Skip to content

Commit 6f48eb0

Browse files
author
OpenShift Bot
authored
Merge pull request #1092 from jwforres/duplicate-triggers
Merged by openshift-bot
2 parents abdc020 + 5a80731 commit 6f48eb0

File tree

4 files changed

+26
-16
lines changed

4 files changed

+26
-16
lines changed

app/scripts/directives/overview/serviceGroup.js

+10-2
Original file line numberDiff line numberDiff line change
@@ -179,9 +179,17 @@ angular.module('openshiftConsole')
179179
$scope.childServices = _.get($scope, ['childServicesByParent', $scope.service.metadata.name], []);
180180
});
181181

182-
$scope.$watchGroup(['service', 'childServices', 'alternateServices'], function() {
182+
$scope.$watchGroup(['service', 'childServices', 'alternateServices', 'deploymentConfigsByService'], function() {
183+
if (!$scope.deploymentConfigsByService) {
184+
return;
185+
}
183186
var allSvcs = [$scope.service].concat($scope.alternateServices).concat($scope.childServices);
184-
$scope.allServicesInGroup = _.uniq(allSvcs, "metadata.uid");
187+
allSvcs = _.map(allSvcs, "metadata.name");
188+
var allDCs = {};
189+
_.each(allSvcs, function(svc) {
190+
_.extend(allDCs, $scope.deploymentConfigsByService[svc]);
191+
});
192+
$scope.allDeploymentConfigsInGroup = allDCs;
185193
});
186194
}
187195
};

app/views/overview/_service-group.html

+7-9
Original file line numberDiff line numberDiff line change
@@ -36,15 +36,13 @@ <h3 class="route-title truncate">
3636
</div>
3737
<div>
3838
<div class="service-group-triggers">
39-
<div ng-repeat="svc in allServicesInGroup track by (svc | uid)">
40-
<div ng-repeat="dc in deploymentConfigsByService[svc.metadata.name || '']">
41-
<div row ng-repeat="pipeline in recentPipelinesByDC[dc.metadata.name] | orderObjectsByDate : true track by (pipeline | uid)"
42-
class="build-pipeline-wrapper animate-repeat animate-slide">
43-
<build-pipeline flex build="pipeline" collapse-stages-on-completion="true" build-config-name-on-expanded="true"></build-pipeline>
44-
</div>
45-
<div>
46-
<triggers triggers="dc.spec.triggers" builds-by-output-image="recentBuildsByOutputImage" namespace="dc.metadata.namespace"></triggers>
47-
</div>
39+
<div ng-repeat="dc in allDeploymentConfigsInGroup">
40+
<div row ng-repeat="pipeline in recentPipelinesByDC[dc.metadata.name] | orderObjectsByDate : true track by (pipeline | uid)"
41+
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>
43+
</div>
44+
<div>
45+
<triggers triggers="dc.spec.triggers" builds-by-output-image="recentBuildsByOutputImage" namespace="dc.metadata.namespace"></triggers>
4846
</div>
4947
</div>
5048
</div>

dist/scripts/scripts.js

+8-2
Original file line numberDiff line numberDiff line change
@@ -12843,9 +12843,15 @@ return _.get(e, [ "routesByService", a ]);
1284312843
e.displayRoute = i(a), e.primaryServiceRoutes = a, j();
1284412844
}), e.$watchGroup([ "service", "childServicesByParent" ], function() {
1284512845
e.service && (e.primaryService = e.service, e.childServices = _.get(e, [ "childServicesByParent", e.service.metadata.name ], []));
12846-
}), e.$watchGroup([ "service", "childServices", "alternateServices" ], function() {
12846+
}), e.$watchGroup([ "service", "childServices", "alternateServices", "deploymentConfigsByService" ], function() {
12847+
if (e.deploymentConfigsByService) {
1284712848
var a = [ e.service ].concat(e.alternateServices).concat(e.childServices);
12848-
e.allServicesInGroup = _.uniq(a, "metadata.uid");
12849+
a = _.map(a, "metadata.name");
12850+
var b = {};
12851+
_.each(a, function(a) {
12852+
_.extend(b, e.deploymentConfigsByService[a]);
12853+
}), e.allDeploymentConfigsInGroup = b;
12854+
}
1284912855
});
1285012856
}
1285112857
};

dist/scripts/templates.js

+1-3
Original file line numberDiff line numberDiff line change
@@ -10949,8 +10949,7 @@ angular.module('openshiftConsoleTemplates', []).run(['$templateCache', function(
1094910949
"</div>\n" +
1095010950
"<div>\n" +
1095110951
"<div class=\"service-group-triggers\">\n" +
10952-
"<div ng-repeat=\"svc in allServicesInGroup track by (svc | uid)\">\n" +
10953-
"<div ng-repeat=\"dc in deploymentConfigsByService[svc.metadata.name || '']\">\n" +
10952+
"<div ng-repeat=\"dc in allDeploymentConfigsInGroup\">\n" +
1095410953
"<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" +
1095510954
"<build-pipeline flex build=\"pipeline\" collapse-stages-on-completion=\"true\" build-config-name-on-expanded=\"true\"></build-pipeline>\n" +
1095610955
"</div>\n" +
@@ -10959,7 +10958,6 @@ angular.module('openshiftConsoleTemplates', []).run(['$templateCache', function(
1095910958
"</div>\n" +
1096010959
"</div>\n" +
1096110960
"</div>\n" +
10962-
"</div>\n" +
1096310961
"\n" +
1096410962
"<service-group-notifications ng-if=\"service\"></service-group-notifications>\n" +
1096510963
"<div uib-collapse=\"collapse\" class=\"service-group-body\">\n" +

0 commit comments

Comments
 (0)