From 95a277843519a026ca207140f3bfd2624e0f454b Mon Sep 17 00:00:00 2001 From: Samuel Padgett Date: Mon, 27 Feb 2017 09:35:11 -0500 Subject: [PATCH] Bug 1421097 - Fix problems with secret links on build config page * Fix missing "Create Secret" link if the page is accessed directly by URL * Fix runtime error in `canAddSourceSecret` https://bugzilla.redhat.com/show_bug.cgi?id=1421097 --- app/scripts/directives/oscSourceSecrets.js | 4 +-- app/views/edit/build-config.html | 32 ++++++++++++---------- dist/scripts/scripts.js | 4 +-- dist/scripts/templates.js | 6 +++- 4 files changed, 27 insertions(+), 19 deletions(-) diff --git a/app/scripts/directives/oscSourceSecrets.js b/app/scripts/directives/oscSourceSecrets.js index 60b3b63cfe..f707748104 100644 --- a/app/scripts/directives/oscSourceSecrets.js +++ b/app/scripts/directives/oscSourceSecrets.js @@ -21,9 +21,9 @@ angular.module("openshiftConsole") var lastSecret = _.last($scope.pickedSecrets); switch ($scope.strategyType) { case 'Custom': - return lastSecret.secretSource.name; + return _.get(lastSecret, 'secretSource.name'); default: - return lastSecret.secret.name; + return _.get(lastSecret, 'secret.name'); } }; diff --git a/app/views/edit/build-config.html b/app/views/edit/build-config.html index 51e5f2f944..8833db3f64 100644 --- a/app/views/edit/build-config.html +++ b/app/views/edit/build-config.html @@ -347,8 +347,10 @@

Image Configuration

-
- + +
+
Image Configuration
- -
- - + +
+ +
+ + +
-
diff --git a/dist/scripts/scripts.js b/dist/scripts/scripts.js index e1d4f89047..c73c88549f 100644 --- a/dist/scripts/scripts.js +++ b/dist/scripts/scripts.js @@ -10783,10 +10783,10 @@ b.canAddSourceSecret = function() { var a = _.last(b.pickedSecrets); switch (b.strategyType) { case "Custom": -return a.secretSource.name; +return _.get(a, "secretSource.name"); default: -return a.secret.name; +return _.get(a, "secret.name"); } }, b.setLastSecretsName = function(a) { var c = _.last(b.pickedSecrets); diff --git a/dist/scripts/templates.js b/dist/scripts/templates.js index 2aa9798f54..043626f012 100644 --- a/dist/scripts/templates.js +++ b/dist/scripts/templates.js @@ -9271,7 +9271,8 @@ angular.module('openshiftConsoleTemplates', []).run(['$templateCache', function( "\n" + "\n" + "\n" + - "
\n" + + "\n" + + "
\n" + "\n" + "
\n" + "\n" + @@ -9306,11 +9307,14 @@ angular.module('openshiftConsoleTemplates', []).run(['$templateCache', function( "
\n" + "
\n" + "\n" + + "
\n" + + "\n" + "
\n" + "\n" + "\n" + "
\n" + "
\n" + + "
\n" + "\n" + "\n" + "
\n" +