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 @@
-
+
-