Skip to content

Commit ef5746b

Browse files
author
OpenShift Bot
authored
Merge pull request #2168 from spadgett/bc-events
Merged by openshift-bot
2 parents cf9c610 + b6aa5e4 commit ef5746b

File tree

4 files changed

+24
-18
lines changed

4 files changed

+24
-18
lines changed

Diff for: app/scripts/controllers/buildConfig.js

+2-4
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,6 @@ angular.module('openshiftConsole')
6060
var buildStrategy = $filter('buildStrategy');
6161
var watches = [];
6262

63-
var requestContext;
64-
6563
// copy buildConfig and ensure it has env so that we can edit env vars using key-value-editor
6664
var copyBuildConfigAndEnsureEnv = function(buildConfig) {
6765
$scope.updatedBuildConfig = angular.copy(buildConfig);
@@ -94,7 +92,7 @@ angular.module('openshiftConsole')
9492
$scope.envVars = _.filter($scope.envVars, 'name');
9593
buildStrategy($scope.updatedBuildConfig).env = keyValueEditorUtils.compactEntries(angular.copy($scope.envVars));
9694
DataService
97-
.update("buildconfigs", $routeParams.buildconfig, $scope.updatedBuildConfig, requestContext)
95+
.update("buildconfigs", $routeParams.buildconfig, $scope.updatedBuildConfig, $scope.projectContext)
9896
.then(function success() {
9997
NotificationsService.addNotification({
10098
type: "success",
@@ -179,7 +177,7 @@ angular.module('openshiftConsole')
179177
.get($routeParams.project)
180178
.then(_.spread(function(project, context) {
181179
$scope.project = project;
182-
requestContext = context;
180+
$scope.projectContext = context;
183181
DataService
184182
.get($scope.buildConfigsVersion, $routeParams.buildconfig, context, { errorNotification: false })
185183
.then(function(buildConfig) {

Diff for: app/views/browse/build-config.html

+4
Original file line numberDiff line numberDiff line change
@@ -498,6 +498,10 @@ <h3>Environment Variables</h3>
498498
show-header></key-value-editor>
499499
</ng-form>
500500
</uib-tab>
501+
<uib-tab active="selectedTab.events" ng-if="('events' | canI : 'watch')">
502+
<uib-tab-heading>Events</uib-tab-heading>
503+
<events api-objects="[ buildConfig ]" project-context="projectContext" ng-if="selectedTab.events"></events>
504+
</uib-tab>
501505
</uib-tabset>
502506
</div><!-- /col-* -->
503507
</div>

Diff for: dist/scripts/scripts.js

+14-14
Original file line numberDiff line numberDiff line change
@@ -5267,13 +5267,13 @@ title: n.buildconfig
52675267
var t = e.getSession();
52685268
t.setOption("tabSize", 2), t.setOption("useSoftTabs", !0), e.$blockScrolling = 1 / 0;
52695269
};
5270-
var p, m = t("buildConfigForBuild"), f = t("buildStrategy"), g = [], h = function(t) {
5271-
e.updatedBuildConfig = angular.copy(t), e.envVars = f(e.updatedBuildConfig).env || [];
5270+
var p = t("buildConfigForBuild"), m = t("buildStrategy"), f = [], g = function(t) {
5271+
e.updatedBuildConfig = angular.copy(t), e.envVars = m(e.updatedBuildConfig).env || [];
52725272
};
52735273
e.compareTriggers = function(e, t) {
52745274
return _.isNumber(e.value) ? -1 : "ConfigChange" === e.value ? -1 : "ConfigChange" === t.value ? 1 : "ImageChange" === e.value ? -1 : "ImageChange" === t.value ? 1 : e.value.localeCompare(t.value);
52755275
}, e.saveEnvVars = function() {
5276-
l.hideNotification("save-bc-env-error"), e.envVars = _.filter(e.envVars, "name"), f(e.updatedBuildConfig).env = d.compactEntries(angular.copy(e.envVars)), i.update("buildconfigs", n.buildconfig, e.updatedBuildConfig, p).then(function() {
5276+
l.hideNotification("save-bc-env-error"), e.envVars = _.filter(e.envVars, "name"), m(e.updatedBuildConfig).env = d.compactEntries(angular.copy(e.envVars)), i.update("buildconfigs", n.buildconfig, e.updatedBuildConfig, e.projectContext).then(function() {
52775277
l.addNotification({
52785278
type: "success",
52795279
message: "Environment variables for build config " + e.buildConfigName + " were successfully updated."
@@ -5287,25 +5287,25 @@ details: t("getErrorDetails")(n)
52875287
});
52885288
});
52895289
}, e.clearEnvVarUpdates = function() {
5290-
h(e.buildConfig), e.forms.bcEnvVars.$setPristine();
5290+
g(e.buildConfig), e.forms.bcEnvVars.$setPristine();
52915291
};
5292-
var v, y = function(n, s) {
5292+
var h, v = function(n, s) {
52935293
e.loaded = !0, e.buildConfig = n, e.buildConfigPaused = r.isPaused(e.buildConfig), e.buildConfig.spec.source.images && (e.imageSources = e.buildConfig.spec.source.images, e.imageSourcesPaths = [], e.imageSources.forEach(function(n) {
52945294
e.imageSourcesPaths.push(t("destinationSourcePair")(n.paths));
52955295
}));
5296-
var c = _.get(f(n), "from", {}), l = c.kind + "/" + c.name + "/" + (c.namespace || e.projectName);
5297-
v !== l && (_.includes([ "ImageStreamTag", "ImageStreamImage" ], c.kind) ? (v = l, i.get(a.kindToResource(c.kind), c.name, {
5296+
var c = _.get(m(n), "from", {}), l = c.kind + "/" + c.name + "/" + (c.namespace || e.projectName);
5297+
h !== l && (_.includes([ "ImageStreamTag", "ImageStreamImage" ], c.kind) ? (h = l, i.get(a.kindToResource(c.kind), c.name, {
52985298
namespace: c.namespace || e.projectName
52995299
}, {
53005300
errorNotification: !1
53015301
}).then(function(t) {
53025302
e.BCEnvVarsFromImage = o.getEnvironment(t);
53035303
}, function() {
53045304
e.BCEnvVarsFromImage = [];
5305-
})) : e.BCEnvVarsFromImage = []), h(n), "DELETED" === s && (e.alerts.deleted = {
5305+
})) : e.BCEnvVarsFromImage = []), g(n), "DELETED" === s && (e.alerts.deleted = {
53065306
type: "warning",
53075307
message: "This build configuration has been deleted."
5308-
}, e.buildConfigDeleted = !0), !e.forms.bcEnvVars || e.forms.bcEnvVars.$pristine ? h(n) : e.alerts.background_update = {
5308+
}, e.buildConfigDeleted = !0), !e.forms.bcEnvVars || e.forms.bcEnvVars.$pristine ? g(n) : e.alerts.background_update = {
53095309
type: "warning",
53105310
message: "This build configuration has been updated in the background. Saving your changes may create a conflict or cause loss of data.",
53115311
links: [ {
@@ -5323,19 +5323,19 @@ type: "warning",
53235323
details: "The active filters are hiding all builds."
53245324
};
53255325
}
5326-
e.project = a, p = o, i.get(e.buildConfigsVersion, n.buildconfig, o, {
5326+
e.project = a, e.projectContext = o, i.get(e.buildConfigsVersion, n.buildconfig, o, {
53275327
errorNotification: !1
53285328
}).then(function(t) {
5329-
y(t), g.push(i.watchObject(e.buildConfigsVersion, n.buildconfig, o, y));
5329+
v(t), f.push(i.watchObject(e.buildConfigsVersion, n.buildconfig, o, v));
53305330
}, function(n) {
53315331
e.loaded = !0, e.alerts.load = {
53325332
type: "error",
53335333
message: 404 === n.status ? "This build configuration can not be found, it may have been deleted." : "The build configuration details could not be loaded.",
53345334
details: 404 === n.status ? "Any remaining build history for this build will be shown." : t("getErrorDetails")(n)
53355335
};
5336-
}), g.push(i.watch(e.buildsVersion, o, function(t, a, o) {
5336+
}), f.push(i.watch(e.buildsVersion, o, function(t, a, o) {
53375337
if (e.emptyMessage = "No builds to show", a) {
5338-
if (m(o) === n.buildconfig) {
5338+
if (p(o) === n.buildconfig) {
53395339
var i = o.metadata.name;
53405340
switch (a) {
53415341
case "ADDED":
@@ -5367,7 +5367,7 @@ r.startBuild(e.buildConfig);
53675367
}, e.showJenkinsfileExamples = function() {
53685368
c.showJenkinsfileExamples();
53695369
}, e.$on("$destroy", function() {
5370-
i.unwatchAll(g);
5370+
i.unwatchAll(f);
53715371
});
53725372
}));
53735373
} ]), angular.module("openshiftConsole").controller("BuildController", [ "$scope", "$filter", "$routeParams", "APIService", "BuildsService", "DataService", "ModalsService", "Navigate", "ProjectsService", function(e, t, n, a, r, o, i, s, c) {

Diff for: dist/scripts/templates.js

+4
Original file line numberDiff line numberDiff line change
@@ -2036,6 +2036,10 @@ angular.module('openshiftConsoleTemplates', []).run(['$templateCache', function(
20362036
"<key-value-editor ng-if=\"!(buildConfigsVersion | canI : 'update')\" entries=\"envVars\" key-placeholder=\"Name\" value-placeholder=\"Value\" is-readonly cannot-add cannot-sort cannot-delete show-header></key-value-editor>\n" +
20372037
"</ng-form>\n" +
20382038
"</uib-tab>\n" +
2039+
"<uib-tab active=\"selectedTab.events\" ng-if=\"('events' | canI : 'watch')\">\n" +
2040+
"<uib-tab-heading>Events</uib-tab-heading>\n" +
2041+
"<events api-objects=\"[ buildConfig ]\" project-context=\"projectContext\" ng-if=\"selectedTab.events\"></events>\n" +
2042+
"</uib-tab>\n" +
20392043
"</uib-tabset>\n" +
20402044
"</div>\n" +
20412045
"</div>\n" +

0 commit comments

Comments
 (0)