From cda77e6a8bad18d94ffd4ba14a767fd4030a19de Mon Sep 17 00:00:00 2001 From: CD Cabrera Date: Mon, 9 Oct 2017 14:48:37 -0400 Subject: [PATCH] Environment From Fix Drag & Order Display Fix for making sure the drag and order handles are hidden within a read only display --- app/scripts/directives/editEnvironmentFrom.js | 15 +++++---------- app/views/directives/edit-environment-from.html | 8 ++++---- dist/scripts/scripts.js | 8 +++++--- dist/scripts/templates.js | 8 ++++---- 4 files changed, 18 insertions(+), 21 deletions(-) diff --git a/app/scripts/directives/editEnvironmentFrom.js b/app/scripts/directives/editEnvironmentFrom.js index 709ca35835..9732b1a603 100644 --- a/app/scripts/directives/editEnvironmentFrom.js +++ b/app/scripts/directives/editEnvironmentFrom.js @@ -50,11 +50,12 @@ ctrl.editEnvironmentFromForm.$setDirty(); }; + ctrl.hasOptions = function() { + return !_.isEmpty(ctrl.envFromSelectorOptions); + }; + ctrl.isEnvFromReadonly = function(entry) { - return ctrl.isReadonlyAny || - entry.isReadonlyValue === true || - ((entry.secretRef || entry.configMapRef) && !entry.selectedEnvFrom) || - _.isEmpty(ctrl.envFromSelectorOptions); + return entry.isReadonlyValue === true || ((entry.secretRef || entry.configMapRef) && !entry.selectedEnvFrom); }; ctrl.groupByKind = function(object) { @@ -143,8 +144,6 @@ }; var findReferenceValueForEntries = function(entries, envFromSelectorOptions) { - ctrl.cannotAdd = (ctrl.isReadonlyAny || _.isEmpty(envFromSelectorOptions)); - if(envFromSelectorOptions) { _.each(envFromSelectorOptions, function(option) { var referenceValue = getReferenceValue(option); @@ -168,10 +167,6 @@ ctrl.cannotSort = true; } - if('isReadonly' in $attrs) { - ctrl.isReadonlyAny = true; - } - if('showHeader' in $attrs) { ctrl.showHeader = true; } diff --git a/app/views/directives/edit-environment-from.html b/app/views/directives/edit-environment-from.html index 2b607be32b..49fe47852a 100644 --- a/app/views/directives/edit-environment-from.html +++ b/app/views/directives/edit-environment-from.html @@ -20,7 +20,7 @@
- No secrets or config maps have been added as Environment From. + No config maps or secrets have been added as Environment From.
Use all keys and values from @@ -29,7 +29,7 @@
-
+
-