Skip to content

Commit 67285dc

Browse files
committed
Collapse pending pipelines on overview
Don't show the expanded view (with stages) for pipelines that haven't started. Since we now have run policy for build configs, it's possible to queue up several pipeline builds. They take up a lot of space on the overview when expanded and don't have any stage details until they actually start running.
1 parent 05093f6 commit 67285dc

File tree

6 files changed

+38
-44
lines changed

6 files changed

+38
-44
lines changed

app/scripts/controllers/overview.js

-6
Original file line numberDiff line numberDiff line change
@@ -401,7 +401,6 @@ angular.module('openshiftConsole')
401401
};
402402

403403
var buildConfigForBuild = $filter('buildConfigForBuild');
404-
var isIncompleteBuild = $filter('isIncompleteBuild');
405404
var groupPipelineByDC = function(build) {
406405
if (!buildConfigs) {
407406
return;
@@ -418,10 +417,6 @@ angular.module('openshiftConsole')
418417
_.each(dcNames, function(dcName) {
419418
$scope.recentPipelinesByDC[dcName] = $scope.recentPipelinesByDC[dcName] || [];
420419
$scope.recentPipelinesByDC[dcName].push(build);
421-
if (isIncompleteBuild(build)) {
422-
$scope.incompletePipelinesByDC[dcName] = $scope.incompletePipelinesByDC[dcName] || [];
423-
$scope.incompletePipelinesByDC[dcName].push(build);
424-
}
425420
});
426421
};
427422

@@ -431,7 +426,6 @@ angular.module('openshiftConsole')
431426
}
432427
// reset these maps
433428
$scope.recentPipelinesByDC = {};
434-
$scope.incompletePipelinesByDC = {};
435429
$scope.recentBuildsByOutputImage = {};
436430
_.each(
437431
BuildsService.interestingBuilds(builds),

app/scripts/directives/buildPipeline.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ angular.module('openshiftConsole')
66
restrict: 'E',
77
scope: {
88
build: '=',
9-
collapseStagesOnCompletion: '=?',
9+
expandOnlyRunning: '=?',
1010
buildConfigNameOnExpanded: '=?'
1111
},
1212
// To fill height as flexbox item.
+4-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<div>
2-
<div ng-if="collapseStagesOnCompletion">
3-
<div class="animate-if" ng-if="build | isIncompleteBuild" ng-include="'views/directives/_build-pipeline-expanded.html'"></div>
4-
<div class="animate-if" ng-if="!(build | isIncompleteBuild)" ng-include="'views/directives/_build-pipeline-collapsed.html'"></div>
2+
<div ng-if="expandOnlyRunning">
3+
<div class="animate-if" ng-if="build.status.phase === 'Running'" ng-include="'views/directives/_build-pipeline-expanded.html'"></div>
4+
<div class="animate-if" ng-if="build.status.phase !== 'Running'" ng-include="'views/directives/_build-pipeline-collapsed.html'"></div>
55
</div>
6-
<div ng-if="!collapseStagesOnCompletion" ng-include="'views/directives/_build-pipeline-expanded.html'"></div>
6+
<div ng-if="!expandOnlyRunning" ng-include="'views/directives/_build-pipeline-expanded.html'"></div>
77
</div>

app/views/overview/_service-group.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ <h3 class="route-title truncate">
3939
<div ng-repeat="dc in allDeploymentConfigsInGroup">
4040
<div row ng-repeat="pipeline in recentPipelinesByDC[dc.metadata.name] | orderObjectsByDate : true track by (pipeline | uid)"
4141
class="build-pipeline-wrapper animate-repeat animate-slide">
42-
<build-pipeline flex build="pipeline" collapse-stages-on-completion="true" build-config-name-on-expanded="true"></build-pipeline>
42+
<build-pipeline flex build="pipeline" expand-only-running="true" build-config-name-on-expanded="true"></build-pipeline>
4343
</div>
4444
<div>
4545
<triggers triggers="dc.spec.triggers" builds-by-output-image="recentBuildsByOutputImage" namespace="dc.metadata.namespace"></triggers>

dist/scripts/scripts.js

+27-27
Original file line numberDiff line numberDiff line change
@@ -4595,28 +4595,28 @@ _.set(c, [ "routeWarningsByService", a.metadata.name, b.metadata.name ], d);
45954595
}, ia = function(a) {
45964596
var b = H(_.get(a, "spec.output.to"), a.metadata.namespace);
45974597
c.recentBuildsByOutputImage[b] = c.recentBuildsByOutputImage[b] || [], c.recentBuildsByOutputImage[b].push(a);
4598-
}, ja = a("buildConfigForBuild"), ka = a("isIncompleteBuild"), la = function(a) {
4598+
}, ja = a("buildConfigForBuild"), ka = function(a) {
45994599
if (z) {
46004600
var b = ja(a), d = z[b];
46014601
if (d) {
46024602
var f = e.usesDeploymentConfigs(d);
46034603
_.each(f, function(b) {
4604-
c.recentPipelinesByDC[b] = c.recentPipelinesByDC[b] || [], c.recentPipelinesByDC[b].push(a), ka(a) && (c.incompletePipelinesByDC[b] = c.incompletePipelinesByDC[b] || [], c.incompletePipelinesByDC[b].push(a));
4604+
c.recentPipelinesByDC[b] = c.recentPipelinesByDC[b] || [], c.recentPipelinesByDC[b].push(a);
46054605
});
46064606
}
46074607
}
4608-
}, ma = function() {
4609-
A && (c.recentPipelinesByDC = {}, c.incompletePipelinesByDC = {}, c.recentBuildsByOutputImage = {}, _.each(e.interestingBuilds(A), function(a) {
4610-
return E(a) ? void la(a) :void ia(a);
4608+
}, la = function() {
4609+
A && (c.recentPipelinesByDC = {}, c.recentBuildsByOutputImage = {}, _.each(e.interestingBuilds(A), function(a) {
4610+
return E(a) ? void ka(a) :void ia(a);
46114611
}), c.pipelinesForDC = {}, _.each(z, function(a) {
46124612
_.each(e.usesDeploymentConfigs(a), function(b) {
46134613
c.pipelinesForDC[b] = c.pipelinesForDC[b] || [], c.pipelinesForDC[b].push(a);
46144614
});
46154615
}));
4616-
}, na = function() {
4616+
}, ma = function() {
46174617
var a = _.isEmpty(r) && _.isEmpty(t) && _.isEmpty(c.monopodsByService) && _.isEmpty(u) && _.isEmpty(w) && _.isEmpty(x), b = r && y && u && w && x;
46184618
c.renderOptions.showGetStarted = b && a, c.renderOptions.showLoading = !b && a;
4619-
}, oa = function() {
4619+
}, na = function() {
46204620
var a = d.isAlertPermanentlyHidden("overview-quota-limit-reached", c.projectName);
46214621
if (!a && p.isAnyQuotaExceeded(c.quotas, c.clusterQuotas)) {
46224622
if (c.alerts.quotaExceeded) return;
@@ -4655,11 +4655,11 @@ var b = _.get(c, [ a, "" ], {});
46554655
return !_.isEmpty(b);
46564656
});
46574657
};
4658-
var pa = [];
4658+
var oa = [];
46594659
c.getHPA = function(a) {
46604660
if (!B) return null;
46614661
var b = _.get(a, "kind"), c = _.get(a, "metadata.name");
4662-
return _.get(C, [ b, c ], pa);
4662+
return _.get(C, [ b, c ], oa);
46634663
}, window.OPENSHIFT_CONSTANTS.DISABLE_OVERVIEW_METRICS || (o.isAvailable(!0).then(function(a) {
46644664
c.showMetrics = a;
46654665
}), c.$on("metrics-connection-failed", function(a, b) {
@@ -4680,64 +4680,64 @@ return d.permanentlyHideAlert("metrics-connection-failed"), !0;
46804680
} ]
46814681
});
46824682
}));
4683-
var qa = a("isIE")() || a("isEdge")();
4683+
var pa = a("isIE")() || a("isEdge")();
46844684
k.get(b.project).then(_.spread(function(a, b) {
46854685
c.project = a, c.projectContext = b, D.push(f.watch("pods", b, function(a) {
4686-
y = a.by("metadata.name"), aa(), na(), i.log("pods", y);
4686+
y = a.by("metadata.name"), aa(), ma(), i.log("pods", y);
46874687
})), D.push(f.watch("services", b, function(a) {
4688-
c.services = r = a.by("metadata.name"), ga(), aa(), P(), U(), T(), V(), Y(), ha(), na(), i.log("services (subscribe)", r);
4688+
c.services = r = a.by("metadata.name"), ga(), aa(), P(), U(), T(), V(), Y(), ha(), ma(), i.log("services (subscribe)", r);
46894689
}, {
4690-
poll:qa,
4690+
poll:pa,
46914691
pollInterval:6e4
46924692
})), D.push(f.watch("builds", b, function(a) {
4693-
A = a.by("metadata.name"), ma(), na(), i.log("builds (subscribe)", A);
4693+
A = a.by("metadata.name"), la(), ma(), i.log("builds (subscribe)", A);
46944694
})), D.push(f.watch("buildConfigs", b, function(a) {
4695-
z = a.by("metadata.name"), ma(), i.log("builds (subscribe)", A);
4695+
z = a.by("metadata.name"), la(), i.log("builds (subscribe)", A);
46964696
}, {
4697-
poll:qa,
4697+
poll:pa,
46984698
pollInterval:6e4
46994699
})), D.push(f.watch("routes", b, function(a) {
47004700
q = a.by("metadata.name"), O(), ga(), ha(), i.log("routes (subscribe)", c.routesByService);
47014701
}, {
4702-
poll:qa,
4702+
poll:pa,
47034703
pollInterval:6e4
47044704
})), D.push(f.watch("replicationcontrollers", b, function(a) {
4705-
c.replicationControllersByName = u = a.by("metadata.name"), U(), T(), aa(), ma(), na(), i.log("replicationcontrollers (subscribe)", u);
4705+
c.replicationControllersByName = u = a.by("metadata.name"), U(), T(), aa(), la(), ma(), i.log("replicationcontrollers (subscribe)", u);
47064706
})), D.push(f.watch("deploymentconfigs", b, function(a) {
4707-
t = a.by("metadata.name"), P(), T(), na(), i.log("deploymentconfigs (subscribe)", t);
4707+
t = a.by("metadata.name"), P(), T(), ma(), i.log("deploymentconfigs (subscribe)", t);
47084708
})), D.push(f.watch({
47094709
group:"extensions",
47104710
resource:"replicasets"
47114711
}, b, function(a) {
4712-
w = a.by("metadata.name"), aa(), V(), X(), na(), i.log("replicasets (subscribe)", w);
4712+
w = a.by("metadata.name"), aa(), V(), X(), ma(), i.log("replicasets (subscribe)", w);
47134713
})), D.push(f.watch({
47144714
group:"apps",
47154715
resource:"statefulsets"
47164716
}, b, function(a) {
4717-
x = a.by("metadata.name"), aa(), Y(), na(), i.log("statefulsets (subscribe)", x);
4717+
x = a.by("metadata.name"), aa(), Y(), ma(), i.log("statefulsets (subscribe)", x);
47184718
}, {
4719-
poll:qa,
4719+
poll:pa,
47204720
pollInterval:6e4
47214721
})), D.push(f.watch({
47224722
group:"extensions",
47234723
resource:"deployments"
47244724
}, b, function(a) {
4725-
s = a.by("metadata.name"), Q(), X(), na(), i.log("deployments (subscribe)", s);
4725+
s = a.by("metadata.name"), Q(), X(), ma(), i.log("deployments (subscribe)", s);
47264726
})), D.push(f.watch({
47274727
group:"extensions",
47284728
resource:"horizontalpodautoscalers"
47294729
}, b, function(a) {
47304730
B = a.by("metadata.name"), Z();
47314731
}, {
4732-
poll:qa,
4732+
poll:pa,
47334733
pollInterval:6e4
47344734
})), D.push(f.watch("resourcequotas", b, function(a) {
4735-
c.quotas = a.by("metadata.name"), oa();
4735+
c.quotas = a.by("metadata.name"), na();
47364736
}, {
47374737
poll:!0,
47384738
pollInterval:6e4
47394739
})), D.push(f.watch("appliedclusterresourcequotas", b, function(a) {
4740-
c.clusterQuotas = a.by("metadata.name"), oa();
4740+
c.clusterQuotas = a.by("metadata.name"), na();
47414741
}, {
47424742
poll:!0,
47434743
pollInterval:6e4
@@ -12565,7 +12565,7 @@ return {
1256512565
restrict:"E",
1256612566
scope:{
1256712567
build:"=",
12568-
collapseStagesOnCompletion:"=?",
12568+
expandOnlyRunning:"=?",
1256912569
buildConfigNameOnExpanded:"=?"
1257012570
},
1257112571
replace:!0,

dist/scripts/templates.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -5819,11 +5819,11 @@ angular.module('openshiftConsoleTemplates', []).run(['$templateCache', function(
58195819

58205820
$templateCache.put('views/directives/build-pipeline.html',
58215821
"<div>\n" +
5822-
"<div ng-if=\"collapseStagesOnCompletion\">\n" +
5823-
"<div class=\"animate-if\" ng-if=\"build | isIncompleteBuild\" ng-include=\"'views/directives/_build-pipeline-expanded.html'\"></div>\n" +
5824-
"<div class=\"animate-if\" ng-if=\"!(build | isIncompleteBuild)\" ng-include=\"'views/directives/_build-pipeline-collapsed.html'\"></div>\n" +
5822+
"<div ng-if=\"expandOnlyRunning\">\n" +
5823+
"<div class=\"animate-if\" ng-if=\"build.status.phase === 'Running'\" ng-include=\"'views/directives/_build-pipeline-expanded.html'\"></div>\n" +
5824+
"<div class=\"animate-if\" ng-if=\"build.status.phase !== 'Running'\" ng-include=\"'views/directives/_build-pipeline-collapsed.html'\"></div>\n" +
58255825
"</div>\n" +
5826-
"<div ng-if=\"!collapseStagesOnCompletion\" ng-include=\"'views/directives/_build-pipeline-expanded.html'\"></div>\n" +
5826+
"<div ng-if=\"!expandOnlyRunning\" ng-include=\"'views/directives/_build-pipeline-expanded.html'\"></div>\n" +
58275827
"</div>"
58285828
);
58295829

@@ -10951,7 +10951,7 @@ angular.module('openshiftConsoleTemplates', []).run(['$templateCache', function(
1095110951
"<div class=\"service-group-triggers\">\n" +
1095210952
"<div ng-repeat=\"dc in allDeploymentConfigsInGroup\">\n" +
1095310953
"<div row ng-repeat=\"pipeline in recentPipelinesByDC[dc.metadata.name] | orderObjectsByDate : true track by (pipeline | uid)\" class=\"build-pipeline-wrapper animate-repeat animate-slide\">\n" +
10954-
"<build-pipeline flex build=\"pipeline\" collapse-stages-on-completion=\"true\" build-config-name-on-expanded=\"true\"></build-pipeline>\n" +
10954+
"<build-pipeline flex build=\"pipeline\" expand-only-running=\"true\" build-config-name-on-expanded=\"true\"></build-pipeline>\n" +
1095510955
"</div>\n" +
1095610956
"<div>\n" +
1095710957
"<triggers triggers=\"dc.spec.triggers\" builds-by-output-image=\"recentBuildsByOutputImage\" namespace=\"dc.metadata.namespace\"></triggers>\n" +

0 commit comments

Comments
 (0)