Skip to content

Commit

Permalink
Bug 1410662 - fix duplicate build messages on overview
Browse files Browse the repository at this point in the history
  • Loading branch information
jwforres committed Jan 9, 2017
1 parent 81127a4 commit 5a80731
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 16 deletions.
12 changes: 10 additions & 2 deletions app/scripts/directives/overview/serviceGroup.js
Original file line number Diff line number Diff line change
Expand Up @@ -179,9 +179,17 @@ angular.module('openshiftConsole')
$scope.childServices = _.get($scope, ['childServicesByParent', $scope.service.metadata.name], []);
});

$scope.$watchGroup(['service', 'childServices', 'alternateServices'], function() {
$scope.$watchGroup(['service', 'childServices', 'alternateServices', 'deploymentConfigsByService'], function() {
if (!$scope.deploymentConfigsByService) {
return;
}
var allSvcs = [$scope.service].concat($scope.alternateServices).concat($scope.childServices);
$scope.allServicesInGroup = _.uniq(allSvcs, "metadata.uid");
allSvcs = _.map(allSvcs, "metadata.name");
var allDCs = {};
_.each(allSvcs, function(svc) {
_.extend(allDCs, $scope.deploymentConfigsByService[svc]);
});
$scope.allDeploymentConfigsInGroup = allDCs;
});
}
};
Expand Down
16 changes: 7 additions & 9 deletions app/views/overview/_service-group.html
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,13 @@ <h3 class="route-title truncate">
</div>
<div>
<div class="service-group-triggers">
<div ng-repeat="svc in allServicesInGroup track by (svc | uid)">
<div ng-repeat="dc in deploymentConfigsByService[svc.metadata.name || '']">
<div row ng-repeat="pipeline in recentPipelinesByDC[dc.metadata.name] | orderObjectsByDate : true track by (pipeline | uid)"
class="build-pipeline-wrapper animate-repeat animate-slide">
<build-pipeline flex build="pipeline" collapse-stages-on-completion="true" build-config-name-on-expanded="true"></build-pipeline>
</div>
<div>
<triggers triggers="dc.spec.triggers" builds-by-output-image="recentBuildsByOutputImage" namespace="dc.metadata.namespace"></triggers>
</div>
<div ng-repeat="dc in allDeploymentConfigsInGroup">
<div row ng-repeat="pipeline in recentPipelinesByDC[dc.metadata.name] | orderObjectsByDate : true track by (pipeline | uid)"
class="build-pipeline-wrapper animate-repeat animate-slide">
<build-pipeline flex build="pipeline" collapse-stages-on-completion="true" build-config-name-on-expanded="true"></build-pipeline>
</div>
<div>
<triggers triggers="dc.spec.triggers" builds-by-output-image="recentBuildsByOutputImage" namespace="dc.metadata.namespace"></triggers>
</div>
</div>
</div>
Expand Down
10 changes: 8 additions & 2 deletions dist/scripts/scripts.js
Original file line number Diff line number Diff line change
Expand Up @@ -12845,9 +12845,15 @@ return _.get(e, [ "routesByService", a ]);
e.displayRoute = i(a), e.primaryServiceRoutes = a, j();
}), e.$watchGroup([ "service", "childServicesByParent" ], function() {
e.service && (e.primaryService = e.service, e.childServices = _.get(e, [ "childServicesByParent", e.service.metadata.name ], []));
}), e.$watchGroup([ "service", "childServices", "alternateServices" ], function() {
}), e.$watchGroup([ "service", "childServices", "alternateServices", "deploymentConfigsByService" ], function() {
if (e.deploymentConfigsByService) {
var a = [ e.service ].concat(e.alternateServices).concat(e.childServices);
e.allServicesInGroup = _.uniq(a, "metadata.uid");
a = _.map(a, "metadata.name");
var b = {};
_.each(a, function(a) {
_.extend(b, e.deploymentConfigsByService[a]);
}), e.allDeploymentConfigsInGroup = b;
}
});
}
};
Expand Down
4 changes: 1 addition & 3 deletions dist/scripts/templates.js
Original file line number Diff line number Diff line change
Expand Up @@ -10941,8 +10941,7 @@ angular.module('openshiftConsoleTemplates', []).run(['$templateCache', function(
"</div>\n" +
"<div>\n" +
"<div class=\"service-group-triggers\">\n" +
"<div ng-repeat=\"svc in allServicesInGroup track by (svc | uid)\">\n" +
"<div ng-repeat=\"dc in deploymentConfigsByService[svc.metadata.name || '']\">\n" +
"<div ng-repeat=\"dc in allDeploymentConfigsInGroup\">\n" +
"<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" +
"<build-pipeline flex build=\"pipeline\" collapse-stages-on-completion=\"true\" build-config-name-on-expanded=\"true\"></build-pipeline>\n" +
"</div>\n" +
Expand All @@ -10951,7 +10950,6 @@ angular.module('openshiftConsoleTemplates', []).run(['$templateCache', function(
"</div>\n" +
"</div>\n" +
"</div>\n" +
"</div>\n" +
"\n" +
"<service-group-notifications ng-if=\"service\"></service-group-notifications>\n" +
"<div uib-collapse=\"collapse\" class=\"service-group-body\">\n" +
Expand Down

0 comments on commit 5a80731

Please sign in to comment.