@@ -5139,45 +5139,47 @@ a.toggle.roles = !a.toggle.roles, a.toggle.roles ? a.filteredRoles = t : (a.filt
5139
5139
});
5140
5140
});
5141
5141
}));
5142
- } ]), angular.module("openshiftConsole").controller("BuildsController", [ "$routeParams", "$scope", "DataService", "$filter", "LabelFilter", "Logger", "$location", "BuildsService", "ProjectsService", function(e, t, n, a, r, o, i, s, c) {
5142
+ } ]), angular.module("openshiftConsole").controller("BuildsController", [ "$routeParams", "$scope", "APIService", " DataService", "$filter", "LabelFilter", "Logger", "$location", "BuildsService", "ProjectsService", function(e, t, n, a, r, o, i, s, c, l ) {
5143
5143
t.projectName = e.project, t.builds = {}, t.unfilteredBuildConfigs = {}, t.buildConfigs = void 0, t.labelSuggestions = {}, t.alerts = t.alerts || {}, t.emptyMessage = "Loading...", t.latestByConfig = {};
5144
- var l = a("buildConfigForBuild"), u = [];
5145
- c.get(e.project).then(_.spread(function(e, i) {
5146
- function c(e) {
5147
- var n = r.getLabelSelector();
5144
+ var u = r("buildConfigForBuild");
5145
+ t.buildsVersion = n.getPreferredVersion("builds"), t.buildConfigsVersion = n.getPreferredVersion("buildconfigs");
5146
+ var d = [];
5147
+ l.get(e.project).then(_.spread(function(e, n) {
5148
+ function s(e) {
5149
+ var n = o.getLabelSelector();
5148
5150
if (n.isEmpty()) return !0;
5149
- var a = l (e) || "";
5151
+ var a = u (e) || "";
5150
5152
return a && t.unfilteredBuildConfigs[a] ? !!t.buildConfigs[a] : n.matches(e);
5151
5153
}
5152
- function d (e) {
5153
- if (l (e)) return !1;
5154
- var t = r .getLabelSelector();
5154
+ function l (e) {
5155
+ if (u (e)) return !1;
5156
+ var t = o .getLabelSelector();
5155
5157
return !!t.isEmpty() || t.matches(e);
5156
5158
}
5157
5159
function p() {
5158
- t.latestByConfig = s .latestBuildByConfig(t.builds, c ), t.buildsNoConfig = _.pickBy(t.builds, d ), angular.forEach(t.buildConfigs, function(e, n) {
5160
+ t.latestByConfig = c .latestBuildByConfig(t.builds, s ), t.buildsNoConfig = _.pickBy(t.builds, l ), angular.forEach(t.buildConfigs, function(e, n) {
5159
5161
t.latestByConfig[n] = t.latestByConfig[n] || null;
5160
5162
});
5161
5163
}
5162
5164
function m() {
5163
5165
var e = _.omitBy(t.latestByConfig, _.isNull);
5164
- !r .getLabelSelector().isEmpty() && _.isEmpty(t.buildConfigs) && _.isEmpty(e) ? t.alerts.builds = {
5166
+ !o .getLabelSelector().isEmpty() && _.isEmpty(t.buildConfigs) && _.isEmpty(e) ? t.alerts.builds = {
5165
5167
type: "warning",
5166
5168
details: "The active filters are hiding all builds."
5167
5169
} : delete t.alerts.builds;
5168
5170
}
5169
5171
t.project = e;
5170
- var f = a ("isJenkinsPipelineStrategy");
5171
- u .push(n .watch("builds", i , function(e) {
5172
- t.builds = _.omitBy(e.by("metadata.name"), f), t.emptyMessage = "No builds to show", p(), r .addLabelSuggestionsFromResources(t.builds, t.labelSuggestions), o .log("builds (subscribe)", t.builds);
5173
- })), u .push(n .watch("buildconfigs", i , function(e) {
5174
- t.unfilteredBuildConfigs = _.omitBy(e.by("metadata.name"), f), r .addLabelSuggestionsFromResources(t.unfilteredBuildConfigs, t.labelSuggestions), r .setLabelSuggestions(t.labelSuggestions), t.buildConfigs = r .getLabelSelector().select(t.unfilteredBuildConfigs), p(), m(), o .log("buildconfigs (subscribe)", t.buildConfigs);
5175
- })), r .onActiveFiltersChanged(function(e) {
5172
+ var f = r ("isJenkinsPipelineStrategy");
5173
+ d .push(a .watch(t.buildsVersion, n , function(e) {
5174
+ t.builds = _.omitBy(e.by("metadata.name"), f), t.emptyMessage = "No builds to show", p(), o .addLabelSuggestionsFromResources(t.builds, t.labelSuggestions), i .log("builds (subscribe)", t.builds);
5175
+ })), d .push(a .watch(t.buildConfigsVersion, n , function(e) {
5176
+ t.unfilteredBuildConfigs = _.omitBy(e.by("metadata.name"), f), o .addLabelSuggestionsFromResources(t.unfilteredBuildConfigs, t.labelSuggestions), o .setLabelSuggestions(t.labelSuggestions), t.buildConfigs = o .getLabelSelector().select(t.unfilteredBuildConfigs), p(), m(), i .log("buildconfigs (subscribe)", t.buildConfigs);
5177
+ })), o .onActiveFiltersChanged(function(e) {
5176
5178
t.$apply(function() {
5177
5179
t.buildConfigs = e.select(t.unfilteredBuildConfigs), p(), m();
5178
5180
});
5179
5181
}), t.$on("$destroy", function() {
5180
- n .unwatchAll(u );
5182
+ a .unwatchAll(d );
5181
5183
});
5182
5184
}));
5183
5185
} ]), angular.module("openshiftConsole").controller("PipelinesController", [ "$filter", "$routeParams", "$scope", "Constants", "Navigate", "BuildsService", "DataService", "Logger", "ProjectsService", function(e, t, n, a, r, o, i, s, c) {
0 commit comments