@@ -5166,45 +5166,45 @@ a.toggle.roles = !a.toggle.roles, a.toggle.roles ? a.filteredRoles = t : (a.filt
5166
5166
});
5167
5167
});
5168
5168
}));
5169
- } ]), angular.module("openshiftConsole").controller("BuildsController", [ "$routeParams ", "$scope ", "DataService ", "$filter ", "LabelFilter ", "Logger ", "$location ", "BuildsService ", "ProjectsService", function(e, t, n, a, r, o, i, s, c) {
5170
- t .projectName = e .project, t .builds = {}, t .unfilteredBuildConfigs = {}, t .buildConfigs = void 0, t .labelSuggestions = {}, t .alerts = t .alerts || {}, t .emptyMessage = "Loading...", t .latestByConfig = {};
5171
- var l = a ("buildConfigForBuild"), u = [];
5172
- c .get(e .project).then(_.spread(function(e, i ) {
5173
- function c (e) {
5174
- var n = r .getLabelSelector();
5175
- if (n .isEmpty()) return !0;
5176
- var a = l (e) || "";
5177
- return a && t .unfilteredBuildConfigs[a ] ? !!t .buildConfigs[a ] : n .matches(e);
5169
+ } ]), angular.module("openshiftConsole").controller("BuildsController", [ "$filter ", "$location ", "$routeParams ", "$scope ", "APIService ", "BuildsService ", "DataService ", "LabelFilter ", "Logger", " ProjectsService", function(e, t, n, a, r, o, i, s, c, l ) {
5170
+ a .projectName = n .project, a .builds = {}, a .unfilteredBuildConfigs = {}, a .buildConfigs = void 0, a .labelSuggestions = {}, a .alerts = a .alerts || {}, a .emptyMessage = "Loading...", a .latestByConfig = {};
5171
+ var u = e ("buildConfigForBuild"), d = r.getPreferredVersion("builds"), p = r.getPreferredVersion("buildconfigs"), m = [];
5172
+ l .get(n .project).then(_.spread(function(t, n ) {
5173
+ function r (e) {
5174
+ var t = s .getLabelSelector();
5175
+ if (t .isEmpty()) return !0;
5176
+ var n = u (e) || "";
5177
+ return n && a .unfilteredBuildConfigs[n ] ? !!a .buildConfigs[n ] : t .matches(e);
5178
5178
}
5179
- function d (e) {
5180
- if (l (e)) return !1;
5181
- var t = r .getLabelSelector();
5179
+ function l (e) {
5180
+ if (u (e)) return !1;
5181
+ var t = s .getLabelSelector();
5182
5182
return !!t.isEmpty() || t.matches(e);
5183
5183
}
5184
- function p () {
5185
- t .latestByConfig = s .latestBuildByConfig(t .builds, c ), t .buildsNoConfig = _.pickBy(t .builds, d ), angular.forEach(t .buildConfigs, function(e, n ) {
5186
- t .latestByConfig[n ] = t .latestByConfig[n ] || null;
5184
+ function f () {
5185
+ a .latestByConfig = o .latestBuildByConfig(a .builds, r ), a .buildsNoConfig = _.pickBy(a .builds, l ), angular.forEach(a .buildConfigs, function(e, t ) {
5186
+ a .latestByConfig[t ] = a .latestByConfig[t ] || null;
5187
5187
});
5188
5188
}
5189
- function m () {
5190
- var e = _.omitBy(t .latestByConfig, _.isNull);
5191
- !r .getLabelSelector().isEmpty() && _.isEmpty(t .buildConfigs) && _.isEmpty(e) ? t .alerts.builds = {
5189
+ function g () {
5190
+ var e = _.omitBy(a .latestByConfig, _.isNull);
5191
+ !s .getLabelSelector().isEmpty() && _.isEmpty(a .buildConfigs) && _.isEmpty(e) ? a .alerts.builds = {
5192
5192
type: "warning",
5193
5193
details: "The active filters are hiding all builds."
5194
- } : delete t .alerts.builds;
5195
- }
5196
- t .project = e ;
5197
- var f = a ("isJenkinsPipelineStrategy");
5198
- u .push(n .watch("builds", i , function(e) {
5199
- 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);
5200
- })), u .push(n .watch("buildconfigs", i , function(e) {
5201
- 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);
5202
- })), r .onActiveFiltersChanged(function(e) {
5203
- t .$apply(function() {
5204
- t .buildConfigs = e.select(t .unfilteredBuildConfigs), p (), m ();
5194
+ } : delete a .alerts.builds;
5195
+ }
5196
+ a .project = t ;
5197
+ var h = e ("isJenkinsPipelineStrategy");
5198
+ m .push(i .watch(d, n , function(e) {
5199
+ a .builds = _.omitBy(e.by("metadata.name"), h ), a .emptyMessage = "No builds to show", f (), s .addLabelSuggestionsFromResources(a .builds, a .labelSuggestions), c .log("builds (subscribe)", a .builds);
5200
+ })), m .push(i .watch(p, n , function(e) {
5201
+ a .unfilteredBuildConfigs = _.omitBy(e.by("metadata.name"), h ), s .addLabelSuggestionsFromResources(a .unfilteredBuildConfigs, a .labelSuggestions), s .setLabelSuggestions(a .labelSuggestions), a .buildConfigs = s .getLabelSelector().select(a .unfilteredBuildConfigs), f (), g (), c .log("buildconfigs (subscribe)", a .buildConfigs);
5202
+ })), s .onActiveFiltersChanged(function(e) {
5203
+ a .$apply(function() {
5204
+ a .buildConfigs = e.select(a .unfilteredBuildConfigs), f (), g ();
5205
5205
});
5206
- }), t .$on("$destroy", function() {
5207
- n .unwatchAll(u );
5206
+ }), a .$on("$destroy", function() {
5207
+ i .unwatchAll(m );
5208
5208
});
5209
5209
}));
5210
5210
} ]), 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