Skip to content
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

Bug 1410662 - fix duplicate build messages on overview #1092

Merged
merged 1 commit into from
Jan 9, 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
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