Skip to content

Commit

Permalink
EnvFrom Issue Updates
Browse files Browse the repository at this point in the history
EnvFrom issue fixes for CSS, copy, and UX
  • Loading branch information
cdcabrera committed Oct 2, 2017
1 parent 752a6ae commit 77d5889
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 9 deletions.
6 changes: 5 additions & 1 deletion app/scripts/directives/editEnvironmentFrom.js
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,11 @@
return referenceValue;
};

ctrl.checkEntries = function(option) {
ctrl.checkEntries = function(option, entrySelectedEnvFrom) {
if(_.isEqual(option, entrySelectedEnvFrom)) {
return false;
}

return !!(getReferenceValue(option));
};

Expand Down
4 changes: 2 additions & 2 deletions app/views/directives/edit-environment-from.html
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
</span>
</ui-select-match>
<ui-select-choices
ui-disable-choice="$ctrl.checkEntries(source)"
ui-disable-choice="$ctrl.checkEntries(source, entry.selectedEnvFrom)"
repeat="source in $ctrl.envFromSelectorOptions | filter : { metadata: { name: $select.search } } track by (source | uid)"
group-by="$ctrl.groupByKind">
<span ng-bind-html="source.metadata.name | highlight : $select.search"></span>
Expand All @@ -54,7 +54,7 @@

<div ng-if="!$ctrl.isEnvFromReadonly(entry)" class="environment-from-editor-button">
<span
ng-if="!$ctrl.cannotSort"
ng-if="!$ctrl.cannotSort && $ctrl.entries.length > 1"
class="fa fa-bars sort-row"
role="button"
aria-label="Move row"
Expand Down
2 changes: 1 addition & 1 deletion app/views/directives/edit-environment-variables.html
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ <h4 class="section-label">
entries="container.envFrom"
selector-placeholder="Secret/Config Map"
env-from-selector-options="$ctrl.valueFromObjects"
add-row-link="Add ALL Values from a Resource"
add-row-link="Add ALL Values from Secret or Config Map"
show-header>
</edit-environment-from>
</div>
Expand Down
4 changes: 2 additions & 2 deletions dist/scripts/scripts.js
Original file line number Diff line number Diff line change
Expand Up @@ -9158,8 +9158,8 @@ name: e.metadata.name
}
return t;
};
a.checkEntries = function(e) {
return !!l(e);
a.checkEntries = function(e, t) {
return !_.isEqual(e, t) && !!l(e);
};
var u = function(e, t) {
a.cannotAdd = a.isReadonlyAny || _.isEmpty(t), t && _.each(t, function(e) {
Expand Down
6 changes: 3 additions & 3 deletions dist/scripts/templates.js
Original file line number Diff line number Diff line change
Expand Up @@ -6674,15 +6674,15 @@ angular.module('openshiftConsoleTemplates', []).run(['$templateCache', function(
"<small class=\"text-muted\">&ndash; {{$select.selected.kind | humanizeKind : true}}</small>\n" +
"</span>\n" +
"</ui-select-match>\n" +
"<ui-select-choices ui-disable-choice=\"$ctrl.checkEntries(source)\" repeat=\"source in $ctrl.envFromSelectorOptions | filter : { metadata: { name: $select.search } } track by (source | uid)\" group-by=\"$ctrl.groupByKind\">\n" +
"<ui-select-choices ui-disable-choice=\"$ctrl.checkEntries(source, entry.selectedEnvFrom)\" repeat=\"source in $ctrl.envFromSelectorOptions | filter : { metadata: { name: $select.search } } track by (source | uid)\" group-by=\"$ctrl.groupByKind\">\n" +
"<span ng-bind-html=\"source.metadata.name | highlight : $select.search\"></span>\n" +
"</ui-select-choices>\n" +
"</ui-select>\n" +
"</div>\n" +
"</div>\n" +
"</div>\n" +
"<div ng-if=\"!$ctrl.isEnvFromReadonly(entry)\" class=\"environment-from-editor-button\">\n" +
"<span ng-if=\"!$ctrl.cannotSort\" class=\"fa fa-bars sort-row\" role=\"button\" aria-label=\"Move row\" aria-grabbed=\"false\" as-sortable-item-handle></span>\n" +
"<span ng-if=\"!$ctrl.cannotSort && $ctrl.entries.length > 1\" class=\"fa fa-bars sort-row\" role=\"button\" aria-label=\"Move row\" aria-grabbed=\"false\" as-sortable-item-handle></span>\n" +
"<a ng-if=\"!$ctrl.cannotDeleteAny\" href=\"\" class=\"pficon pficon-close delete-row as-sortable-item-delete\" role=\"button\" aria-label=\"Delete row\" ng-click=\"$ctrl.deleteEntry($index, 1)\"></a>\n" +
"</div>\n" +
"</div>\n" +
Expand Down Expand Up @@ -6713,7 +6713,7 @@ angular.module('openshiftConsoleTemplates', []).run(['$templateCache', function(
"Environment From\n" +
"<span class=\"pficon pficon-help\" aria-hidden=\"true\" data-toggle=\"tooltip\" data-original-title=\"Environment From lets you add all key-value pairs from a config map or secret as environment variables.\"></span>\n" +
"</h4>\n" +
"<edit-environment-from entries=\"container.envFrom\" selector-placeholder=\"Secret/Config Map\" env-from-selector-options=\"$ctrl.valueFromObjects\" add-row-link=\"Add ALL Values from a Resource\" show-header>\n" +
"<edit-environment-from entries=\"container.envFrom\" selector-placeholder=\"Secret/Config Map\" env-from-selector-options=\"$ctrl.valueFromObjects\" add-row-link=\"Add ALL Values from Secret or Config Map\" show-header>\n" +
"</edit-environment-from>\n" +
"</div>\n" +
"<button class=\"btn btn-default\" ng-if=\"$ctrl.canIUpdate && !$ctrl.ngReadonly\" ng-click=\"$ctrl.save()\" ng-disabled=\"$ctrl.form.$pristine || $ctrl.form.$invalid\">Save</button>\n" +
Expand Down

0 comments on commit 77d5889

Please sign in to comment.