@@ -5370,7 +5370,7 @@ c.showJenkinsfileExamples();
5370
5370
i.unwatchAll(g);
5371
5371
});
5372
5372
}));
5373
- } ]), angular.module("openshiftConsole").controller("BuildController", [ "$scope", "$filter", "$routeParams", "BuildsService", "DataService", "ModalsService", "Navigate", "ProjectsService", function(e, t, n, a, r, o, i, s) {
5373
+ } ]), angular.module("openshiftConsole").controller("BuildController", [ "$scope", "$filter", "$routeParams", "APIService", " BuildsService", "DataService", "ModalsService", "Navigate", "ProjectsService", function(e, t, n, a, r, o, i, s, c ) {
5374
5374
e.projectName = n.project, e.build = null, e.buildConfig = null, e.buildConfigName = n.buildconfig, e.builds = {}, e.alerts = {}, e.showSecret = !1, e.renderOptions = {
5375
5375
hideFilterWidget: !0
5376
5376
}, e.breadcrumbs = [], n.isPipeline ? (e.breadcrumbs.push({
@@ -5387,39 +5387,39 @@ title: n.buildconfig,
5387
5387
link: "project/" + n.project + "/browse/builds/" + n.buildconfig
5388
5388
})), e.breadcrumbs.push({
5389
5389
title: n.build
5390
- });
5391
- var c, l = t("annotation"), u = [], d = function(t) {
5390
+ }), e.buildsVersion = a.getPreferredVersion("builds"), e.buildConfigsVersion = a.getPreferredVersion("buildconfigs"), e.podsVersion = a.getPreferredVersion("pods") ;
5391
+ var l, u = t("annotation"), d = [], p = function(t) {
5392
5392
e.logCanRun = !_.includes([ "New", "Pending", "Error" ], t.status.phase);
5393
- }, p = function() {
5394
- e.buildConfig ? e.canBuild = a .canBuild(e.buildConfig) : e.canBuild = !1;
5393
+ }, m = function() {
5394
+ e.buildConfig ? e.canBuild = r .canBuild(e.buildConfig) : e.canBuild = !1;
5395
5395
};
5396
- s .get(n.project).then(_.spread(function(i , s) {
5397
- e.project = i , e.projectContext = s, e.logOptions = {};
5398
- var m = function() {
5399
- e.eventObjects = c ? [ e.build, c ] : [ e.build ];
5396
+ c .get(n.project).then(_.spread(function(a , s) {
5397
+ e.project = a , e.projectContext = s, e.logOptions = {};
5398
+ var c = function() {
5399
+ e.eventObjects = l ? [ e.build, l ] : [ e.build ];
5400
5400
}, f = function(t, n) {
5401
- e.loaded = !0, e.build = t, d (t), m ();
5402
- var a = l (t, "buildNumber");
5401
+ e.loaded = !0, e.build = t, p (t), c ();
5402
+ var a = u (t, "buildNumber");
5403
5403
a && (e.breadcrumbs[2].title = "#" + a), "DELETED" === n && (e.alerts.deleted = {
5404
5404
type: "warning",
5405
5405
message: "This build has been deleted."
5406
5406
});
5407
- var o ;
5408
- c || (o = l (t, "buildPod")) && r .get("pods", o , s, {
5407
+ var r ;
5408
+ l || (r = u (t, "buildPod")) && o .get(e.podsVersion, r , s, {
5409
5409
errorNotification: !1
5410
5410
}).then(function(e) {
5411
- c = e, m ();
5411
+ l = e, c ();
5412
5412
});
5413
5413
}, g = function(t, n) {
5414
5414
"DELETED" === n && (e.alerts.deleted = {
5415
5415
type: "warning",
5416
5416
message: "Build configuration " + e.buildConfigName + " has been deleted."
5417
- }, e.buildConfigDeleted = !0), e.buildConfig = t, e.buildConfigPaused = a .isPaused(e.buildConfig), p ();
5417
+ }, e.buildConfigDeleted = !0), e.buildConfig = t, e.buildConfigPaused = r .isPaused(e.buildConfig), m ();
5418
5418
};
5419
- r .get("builds" , n.build, s, {
5419
+ o .get(e.buildsVersion , n.build, s, {
5420
5420
errorNotification: !1
5421
- }).then(function(e ) {
5422
- f(e ), u .push(r .watchObject("builds" , n.build, s, f)), u .push(r .watchObject("buildconfigs" , n.buildconfig, s, g));
5421
+ }).then(function(t ) {
5422
+ f(t ), d .push(o .watchObject(e.buildsVersion , n.build, s, f)), d .push(o .watchObject(e.buildConfigsVersion , n.buildconfig, s, g));
5423
5423
}, function(n) {
5424
5424
e.loaded = !0, e.alerts.load = {
5425
5425
type: "error",
@@ -5429,13 +5429,13 @@ details: t("getErrorDetails")(n)
5429
5429
}), e.toggleSecret = function() {
5430
5430
e.showSecret = !0;
5431
5431
}, e.cancelBuild = function() {
5432
- a .cancelBuild(e.build, e.buildConfigName);
5432
+ r .cancelBuild(e.build, e.buildConfigName);
5433
5433
}, e.cloneBuild = function() {
5434
- e.build && e.canBuild && a .cloneBuild(e.build, e.buildConfigName);
5434
+ e.build && e.canBuild && r .cloneBuild(e.build, e.buildConfigName);
5435
5435
}, e.showJenkinsfileExamples = function() {
5436
- o .showJenkinsfileExamples();
5436
+ i .showJenkinsfileExamples();
5437
5437
}, e.$on("$destroy", function() {
5438
- r .unwatchAll(u );
5438
+ o .unwatchAll(d );
5439
5439
});
5440
5440
}));
5441
5441
} ]), angular.module("openshiftConsole").controller("ImageController", [ "$scope", "$routeParams", "DataService", "ProjectsService", "$filter", "ImageStreamsService", "imageLayers", function(e, t, n, a, r, o, i) {
0 commit comments