Skip to content

Upgrade to angular 1.5 and patternfly 3.18.1 #1250

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Feb 21, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ node_modules
.tmp
.sass-cache
.bundle
.idea
bower_components
phantomjsdriver.log
openshift-jvm
Expand Down
4 changes: 2 additions & 2 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ module.exports = function (grunt) {
'.tmp/styles/main.css': '<%= yeoman.app %>/styles/main.less'
},
options: {
paths: ['<%= yeoman.app %>/styles'],
paths: ['<%= yeoman.app %>/styles', 'bower_components/'],
sourceMap: true,
sourceMapFilename: '.tmp/styles/main.css.map',
sourceMapURL: 'main.css.map',
Expand All @@ -276,7 +276,7 @@ module.exports = function (grunt) {
},
options: {
cleancss: true,
paths: ['<%= yeoman.app %>/styles']
paths: ['<%= yeoman.app %>/styles', 'bower_components/']
}
}
},
Expand Down
5 changes: 3 additions & 2 deletions app/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
<meta name="msapplication-TileImage" content="images/mstile-144x144.png">
<!-- build:css(.) styles/vendor.css -->
<!-- bower:css -->
<link rel="stylesheet" href="bower_components/patternfly-bootstrap-combobox/css/bootstrap-combobox.css" />
<link rel="stylesheet" href="bower_components/angular-patternfly/dist/styles/angular-patternfly.css" />
<link rel="stylesheet" href="bower_components/messenger/build/css/messenger-theme-flat.css" />
<link rel="stylesheet" href="bower_components/kubernetes-label-selector/labelFilter.css" />
Expand Down Expand Up @@ -97,7 +98,6 @@ <h1>JavaScript Required</h1>
<script src="bower_components/angular-bootstrap/ui-bootstrap-tpls.js"></script>
<script src="bower_components/lodash/lodash.js"></script>
<script src="bower_components/bootstrap/dist/js/bootstrap.js"></script>
<script src="bower_components/bootstrap-combobox/js/bootstrap-combobox.js"></script>
<script src="bower_components/bootstrap-datepicker/dist/js/bootstrap-datepicker.min.js"></script>
<script src="bower_components/bootstrap-select/dist/js/bootstrap-select.js"></script>
<script src="bower_components/bootstrap-switch/dist/js/bootstrap-switch.js"></script>
Expand All @@ -109,6 +109,7 @@ <h1>JavaScript Required</h1>
<script src="bower_components/datatables-colvis/js/dataTables.colVis.js"></script>
<script src="bower_components/matchHeight/dist/jquery.matchHeight.js"></script>
<script src="bower_components/moment/moment.js"></script>
<script src="bower_components/patternfly-bootstrap-combobox/js/bootstrap-combobox.js"></script>
<script src="bower_components/patternfly-bootstrap-treeview/dist/bootstrap-treeview.min.js"></script>
<script src="bower_components/patternfly/dist/js/patternfly.js"></script>
<script src="bower_components/angular-patternfly/dist/angular-patternfly.js"></script>
Expand All @@ -117,7 +118,7 @@ <h1>JavaScript Required</h1>
<script src="bower_components/uri.js/src/jquery.URI.js"></script>
<script src="bower_components/uri.js/src/URI.fragmentURI.js"></script>
<script src="bower_components/js-logger/src/logger.js"></script>
<script src="bower_components/hawtio-core/hawtio-core.js"></script>
<script src="bower_components/hawtio-core/dist/hawtio-core.js"></script>
<script src="bower_components/hawtio-extension-service/dist/hawtio-extension-service.js"></script>
<script src="bower_components/sifter/sifter.js"></script>
<script src="bower_components/microplugin/src/microplugin.js"></script>
Expand Down
4 changes: 2 additions & 2 deletions app/scripts/controllers/imagestream.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ angular.module('openshiftConsole')
.controller('ImageStreamController', function ($scope, $routeParams, DataService, ProjectsService, $filter, ImageStreamsService) {
$scope.projectName = $routeParams.project;
$scope.imageStream = null;
$scope.tagsByName = {};
$scope.tags = [];
$scope.tagShowOlder = {};
$scope.alerts = {};
$scope.renderOptions = $scope.renderOptions || {};
Expand Down Expand Up @@ -48,7 +48,7 @@ angular.module('openshiftConsole')
};
}
$scope.imageStream = imageStream;
$scope.tagsByName = ImageStreamsService.tagsByName($scope.imageStream);
$scope.tags = _.toArray(ImageStreamsService.tagsByName($scope.imageStream));
}));
},
// failure
Expand Down
9 changes: 5 additions & 4 deletions app/scripts/controllers/quota.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,13 +102,13 @@ angular.module('openshiftConsole')
$scope.project = project;

DataService.list("resourcequotas", context, function(quotas) {
$scope.quotas = quotas.by("metadata.name");
$scope.quotas = _.sortBy(quotas.by("metadata.name"), "metadata.name");
$scope.orderedTypesByQuota = orderTypes($scope.quotas);
Logger.log("quotas", $scope.quotas);
});

DataService.list("appliedclusterresourcequotas", context, function(quotas) {
$scope.clusterQuotas = quotas.by("metadata.name");
$scope.clusterQuotas = _.sortBy(quotas.by("metadata.name"), "metadata.name");
$scope.orderedTypesByClusterQuota = orderTypes($scope.clusterQuotas);
$scope.namespaceUsageByClusterQuota = {};
_.each($scope.clusterQuotas, function(quota, quotaName) {
Expand All @@ -121,10 +121,11 @@ angular.module('openshiftConsole')
});

DataService.list("limitranges", context, function(limitRanges) {
$scope.limitRanges = limitRanges.by("metadata.name");
$scope.limitRanges = _.sortBy(limitRanges.by("metadata.name"), "metadata.name");
$scope.emptyMessageLimitRanges = "There are no limit ranges set on this project.";
// Convert to a sane format for a view to a build a table with rows per resource type
angular.forEach($scope.limitRanges, function(limitRange, name){
angular.forEach($scope.limitRanges, function(limitRange){
var name = limitRange.metadata.name;
$scope.limitsByType[name] = {};

angular.forEach(limitRange.spec.limits, function(limit) {
Expand Down
2 changes: 1 addition & 1 deletion app/styles/main.less
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
@bower-components-path: "../../bower_components";
@pf-less-path: "@{bower-components-path}/patternfly/less";
@pf-less-path: "@{bower-components-path}/patternfly/dist/less";

// PatternFly
@import "@{pf-less-path}/patternfly.less";
Expand Down
4 changes: 2 additions & 2 deletions app/views/browse/imagestream.html
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,10 @@ <h1 class="contains-actions">
<th>Pull Spec</th>
</tr>
</thead>
<tbody ng-if="(tagsByName | hashSize) == 0">
<tbody ng-if="!tags.length">
<tr><td colspan="5"><em>{{emptyMessage}}</em></td></tr>
</tbody>
<tbody ng-repeat="tag in tagsByName | orderBy : 'name'">
<tbody ng-repeat="tag in tags">
<tr>
<td data-title="Tag">
<a ng-if="tag.status" ng-href="{{imageStream | navigateResourceURL}}/{{tag.name}}">{{tag.name}}</a>
Expand Down
8 changes: 4 additions & 4 deletions app/views/overview.html
Original file line number Diff line number Diff line change
Expand Up @@ -66,29 +66,29 @@ <h2>Welcome to project {{projectName}}.</h2>
<!-- /unserviced deployment -->

<!-- unserviced RC -->
<div ng-repeat="set in replicationControllersByService[''] | orderBy : 'metadata.name' track by (set | uid)"
<div ng-repeat="set in replicationControllersByService[''] | toArray | orderBy : 'metadata.name' track by (set | uid)"
ng-if="!(set | annotation : 'deploymentConfig') || !deploymentConfigs[(set | annotation : 'deploymentConfig')]"
class="no-service">
<overview-set class="overview-tile-wrapper"></overview-set>
</div>
<!-- /unserviced RC-->

<!-- unserviced RS -->
<div ng-repeat="set in replicaSetsByService[''] | orderBy : 'metadata.name' track by (set | uid)"
<div ng-repeat="set in replicaSetsByService[''] | toArray | orderBy : 'metadata.name' track by (set | uid)"
ng-if="!(set | annotation : 'deployment.kubernetes.io/revision')"
class="no-service">
<overview-set class="overview-tile-wrapper"></overview-set>
</div>
<!-- /unserviced RS-->

<!-- unserviced RS -->
<div ng-repeat="set in statefulSetsByService[''] | orderBy : 'metadata.name' track by (set | uid)" class="no-service">
<div ng-repeat="set in statefulSetsByService[''] | toArray | orderBy : 'metadata.name' track by (set | uid)" class="no-service">
<overview-set class="overview-tile-wrapper"></overview-set>
</div>
<!-- /unserviced RS-->

<!-- unservice monopods -->
<div ng-repeat="pod in monopodsByService[''] | orderBy : 'metadata.name' track by (pod | uid)"
<div ng-repeat="pod in monopodsByService[''] | toArray | orderBy : 'metadata.name' track by (pod | uid)"
class="no-service">
<overview-pod class="overview-tile-wrapper"></overview-pod>
</div>
Expand Down
18 changes: 9 additions & 9 deletions app/views/quota.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,20 @@
<div class="row">
<div class="col-md-12">
<h1>
<span ng-if="clusterQuotas | hashSize">Cluster </span>Quota
<span ng-if="clusterQuotas.length">Cluster </span>Quota
<span class="page-header-link">
<a ng-href="{{'quota' | helpLink}}" target="_blank">
Learn More <i class="fa fa-external-link" aria-hidden="true"></i>
</a>
</span>
</h1>
<div ng-if="!(quotas | hashSize) && !(clusterQuotas | hashSize)" class="mar-top-xl">
<div ng-if="!quotas.length && !clusterQuotas.length" class="mar-top-xl">
<div class="help-block">{{quotaHelp}}</div>
<p><em ng-if="!quotas && !clusterQuotas">Loading...</em><em ng-if="quotas || clusterQuotas">There are no resource quotas set on this project.</em></p>
</div>

<div ng-repeat="quota in clusterQuotas | orderBy: 'metadata.name'" class="gutter-bottom">
<h2 ng-if="(clusterQuotas | hashSize) > 1">{{quota.metadata.name}}</h2>
<h2 ng-if="clusterQuotas.length">{{quota.metadata.name}}</h2>
<div ng-if="$first" class="help-block">Limits resource usage across a set of projects.</div>
<dl ng-if="quota.spec.quota.scopes.length">
<dt>Scopes:</dt>
Expand Down Expand Up @@ -113,9 +113,9 @@ <h3 class="text-center">Memory <small>Limit</small></h3>
</div>
</div>

<h1 ng-if="(clusterQuotas | hashSize) && (quotas | hashSize)">Project Quota</h1>
<h1 ng-if="clusterQuotas.length && quotas.length">Project Quota</h1>
<div ng-repeat="quota in quotas | orderBy: 'metadata.name'" class="gutter-bottom">
<h2 ng-if="(quotas | hashSize) > 1">{{quota.metadata.name}}</h2>
<h2 ng-if="quotas.length">{{quota.metadata.name}}</h2>
<div ng-if="$first" class="help-block mar-bottom-md">{{quotaHelp}}</div>
<dl ng-if="quota.spec.scopes.length">
<dt>Scopes:</dt>
Expand Down Expand Up @@ -202,13 +202,13 @@ <h3 class="text-center">Memory <small>Limit</small></h3>

<div class="limit-ranges-section">
<h1>Limit Range</h1>
<div ng-if="!(limitRanges | hashSize)">
<div ng-if="!limitRanges.length">
<div class="help-block">{{limitRangeHelp}}</div>
<p><em>{{emptyMessageLimitRanges}}</em></p>
</div>

<div ng-repeat="(limitRangeName, limitRange) in limitRanges">
<h2 ng-if="(limitRanges | hashSize) > 1">{{limitRangeName}}</h2>
<div ng-repeat="limitRange in limitRanges">
<h2 ng-if="limitRanges.length">{{limitRange.metadata.name}}</h2>
<div ng-if="$first" class="help-block mar-bottom-md">{{limitRangeHelp}}</div>
<div class="table-responsive">
<table class="table">
Expand Down Expand Up @@ -250,7 +250,7 @@ <h2 ng-if="(limitRanges | hashSize) > 1">{{limitRangeName}}</h2>
</thead>
<tbody>
<tr ng-repeat-start="limit in limitRange.spec.limits"></tr>
<tr ng-repeat="(type, typeLimits) in limitsByType[limitRangeName][limit.type]">
<tr ng-repeat="(type, typeLimits) in limitsByType[limitRange.metadata.name][limit.type]">
<td>{{limit.type}} {{type | computeResourceLabel : true}}</td>
<td>{{(typeLimits.min | usageWithUnits : type) || "&mdash;"}}</td>
<td>{{(typeLimits.max | usageWithUnits : type) || "&mdash;"}}</td>
Expand Down
33 changes: 17 additions & 16 deletions bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,34 +2,35 @@
"name": "origin-web-console",
"version": "1.3.0-alpha",
"dependencies": {
"angular": "1.3.20",
"angular": "1.5.11",
"json3": "3.3.2",
"es5-shim": "3.1.1",
"angular-resource": "1.3.20",
"angular-cookies": "1.3.20",
"angular-sanitize": "1.3.20",
"angular-animate": "1.3.20",
"angular-touch": "1.3.20",
"angular-route": "1.3.20",
"es5-dom-shim": "*",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Concerns me a bit we have to use "*" here :/

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We effectively already were since that is what hawtio-core was asking for before, there is not other option as the es5-dom-shim repo doesn't actually have releases.

We can probably drop this dependency altogether now, I don't think any of the browsers we support now even need this. But I would rather do that independent of this set of changes so we aren't trying to figure out what caused the issue if something ends up breaking.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I'm fine with it, although something we might look at. Maybe we can just exclude (not for this PR)

"angular-resource": "1.5.11",
"angular-cookies": "1.5.11",
"angular-sanitize": "1.5.11",
"angular-animate": "1.5.11",
"angular-touch": "1.5.11",
"angular-route": "1.5.11",
"angular-bootstrap": "0.14.3",
"angular-patternfly": "3.10.0",
"angular-patternfly": "3.18.1",
"uri.js": "1.18.0",
"moment": "2.14.2",
"moment-timezone": "0.5.3",
"patternfly": "3.10.0",
"hawtio-core": "2.0.11",
"patternfly": "3.18.1",
"hawtio-core": "2.0.37",
"hawtio-extension-service": "2.0.2",
"jquery": "2.1.4",
"lodash": "3.10.1",
"sifter": "0.4.1",
"microplugin": "0.0.3",
"selectize": "0.12.1",
"messenger": "1.4.1",
"kubernetes-label-selector": "1.4.1",
"kubernetes-label-selector": "1.4.2",
"kubernetes-topology-graph": "0.0.23",
"kubernetes-container-terminal": "1.0.1",
"kubernetes-container-terminal": "1.0.3",
"registry-image-widgets": "0.0.2",
"openshift-object-describer": "1.1.2",
"openshift-object-describer": "1.1.4",
"layout.attrs": "2.1.1",
"bootstrap-hover-dropdown": "2.1.3",
"angular-ui-ace": "0.2.3",
Expand All @@ -40,16 +41,16 @@
"ng-sortable": "1.3.4",
"ui-select": "angular-ui-select#0.19.4",
"matchHeight": "0.7.0",
"angular-key-value-editor": "2.9.2",
"angular-key-value-editor": "3.0.0",
"angular-inview": "1.5.7",
"js-yaml": "3.6.1",
"angular-moment": "1.0.0",
"angular-utf8-base64": "0.0.5",
"file-saver": "1.3.3"
},
"devDependencies": {
"angular-mocks": "1.3.20",
"angular-scenario": "1.3.20"
"angular-mocks": "1.5.11",
"angular-scenario": "1.5.11"
},
"appPath": "app",
"resolutions": {
Expand Down
11 changes: 6 additions & 5 deletions dist/scripts/scripts.js
Original file line number Diff line number Diff line change
Expand Up @@ -5109,9 +5109,9 @@ b[a.metadata.name] = d;
};
e.get(b.project).then(_.spread(function(a, e) {
c.project = a, d.list("resourcequotas", e, function(a) {
c.quotas = a.by("metadata.name"), c.orderedTypesByQuota = k(c.quotas), f.log("quotas", c.quotas);
c.quotas = _.sortBy(a.by("metadata.name"), "metadata.name"), c.orderedTypesByQuota = k(c.quotas), f.log("quotas", c.quotas);
}), d.list("appliedclusterresourcequotas", e, function(a) {
c.clusterQuotas = a.by("metadata.name"), c.orderedTypesByClusterQuota = k(c.clusterQuotas), c.namespaceUsageByClusterQuota = {}, _.each(c.clusterQuotas, function(a, d) {
c.clusterQuotas = _.sortBy(a.by("metadata.name"), "metadata.name"), c.orderedTypesByClusterQuota = k(c.clusterQuotas), c.namespaceUsageByClusterQuota = {}, _.each(c.clusterQuotas, function(a, d) {
if (a.status) {
var e = _.find(a.status.namespaces, {
namespace:b.project
Expand All @@ -5120,7 +5120,8 @@ c.namespaceUsageByClusterQuota[d] = e.status;
}
}), f.log("cluster quotas", c.clusterQuotas);
}), d.list("limitranges", e, function(a) {
c.limitRanges = a.by("metadata.name"), c.emptyMessageLimitRanges = "There are no limit ranges set on this project.", angular.forEach(c.limitRanges, function(a, b) {
c.limitRanges = _.sortBy(a.by("metadata.name"), "metadata.name"), c.emptyMessageLimitRanges = "There are no limit ranges set on this project.", angular.forEach(c.limitRanges, function(a) {
var b = a.metadata.name;
c.limitsByType[b] = {}, angular.forEach(a.spec.limits, function(a) {
var d = c.limitsByType[b][a.type] = {};
angular.forEach(a.max, function(a, b) {
Expand Down Expand Up @@ -5949,7 +5950,7 @@ d.unwatchAll(i);
});
}));
} ]), angular.module("openshiftConsole").controller("ImageStreamController", [ "$scope", "$routeParams", "DataService", "ProjectsService", "$filter", "ImageStreamsService", function(a, b, c, d, e, f) {
a.projectName = b.project, a.imageStream = null, a.tagsByName = {}, a.tagShowOlder = {}, a.alerts = {}, a.renderOptions = a.renderOptions || {}, a.renderOptions.hideFilterWidget = !0, a.breadcrumbs = [ {
a.projectName = b.project, a.imageStream = null, a.tags = [], a.tagShowOlder = {}, a.alerts = {}, a.renderOptions = a.renderOptions || {}, a.renderOptions.hideFilterWidget = !0, a.breadcrumbs = [ {
title:"Image Streams",
link:"project/" + b.project + "/browse/images"
}, {
Expand All @@ -5962,7 +5963,7 @@ a.loaded = !0, a.imageStream = d, a.emptyMessage = "No tags to show", g.push(c.w
"DELETED" === c && (a.alerts.deleted = {
type:"warning",
message:"This image stream has been deleted."
}), a.imageStream = b, a.tagsByName = f.tagsByName(a.imageStream);
}), a.imageStream = b, a.tags = _.toArray(f.tagsByName(a.imageStream));
}));
}, function(b) {
a.loaded = !0, a.alerts.load = {
Expand Down
Loading