diff --git a/app/scripts/directives/editEnvironmentFrom.js b/app/scripts/directives/editEnvironmentFrom.js
index 966791f902..be74ab65cb 100644
--- a/app/scripts/directives/editEnvironmentFrom.js
+++ b/app/scripts/directives/editEnvironmentFrom.js
@@ -8,11 +8,9 @@
EditEnvironmentFrom
],
bindings: {
- addRowLink: '@', // creates a link to "add row" and sets its text label
- entries: '=', // an array of objects containing configmaps and secrets
- envFromSelectorOptions: '<', // dropdown selector options, an array of objects
- selectorPlaceholder: '@', // placeholder copy for dropdown selector
- isReadonly: '' // display as read only values
+ entries: '=', // an array of objects containing configmaps and secrets
+ envFromSelectorOptions: '<', // dropdown selector options, an array of objects
+ isReadonly: '' // display as read only values
},
templateUrl: 'views/directives/edit-environment-from.html'
});
@@ -52,7 +50,7 @@
ctrl.envFromEntries.splice(start, deleteCount);
- if(!ctrl.envFromEntries.length && ctrl.addRowLink) {
+ if(!ctrl.envFromEntries.length) {
addEntry(ctrl.envFromEntries);
}
@@ -105,6 +103,10 @@
break;
}
+ if (entry.prefix) {
+ newEnvFrom.prefix = entry.prefix;
+ }
+
_.assign(ctrl.envFromEntries[index], newEnvFrom);
ctrl.updateEntries(ctrl.envFromEntries);
};
@@ -121,7 +123,7 @@
ctrl.envFromEntries = ctrl.entries || [];
- if(!ctrl.envFromEntries.length) {
+ if (!ctrl.envFromEntries.length) {
addEntry(ctrl.envFromEntries);
}
diff --git a/app/styles/_kve.less b/app/styles/_kve.less
index 0da8fc12a8..37e168b314 100644
--- a/app/styles/_kve.less
+++ b/app/styles/_kve.less
@@ -115,18 +115,20 @@
width: (@as-sortable-item-button-width * 2);
}
- .key-value-editor-entry,
.environment-from-entry {
display: table;
margin-bottom: 15px;
- padding-right: (@as-sortable-item-button-width * 2);
+ padding-right: 0;
+ @media(max-width: @screen-xxs-max) {
+ padding-right: (@as-sortable-item-button-width * 2);
+ }
position: relative;
table-layout: fixed;
width: 100%;
- @media(min-width: @screen-md-min) {
+ @media(min-width: @screen-xs-min) {
.environment-from-editor-button {
float: left;
- padding-right: 5px;
+ padding: 0 5px;
position: relative;
width: auto;
}
@@ -136,8 +138,16 @@
margin-bottom: 0;
padding-right: 5px;
width: 100%;
- @media(min-width: @screen-md-min) {
- width: 50%;
+ @media(min-width: @screen-xs-min) {
+ width: calc(~"50% - 26px"); // Adjust env-from width to match kve input, when env-from row doesn't have padding-right;
+ }
+ &.prefix {
+ padding-right: 0;
+ width: calc(~"50% + 26px"); // Adjust prefix width to match kve input, when env-from row doesn't have padding-right;
+ @media(max-width: @screen-xxs-max) {
+ margin-top: 5px;
+ width: 100%;
+ }
}
.faux-input-group,
.ui-select {
@@ -145,8 +155,6 @@
width: 100%;
}
}
- }
- .environment-from-entry {
.environment-from-view-details {
float: left;
line-height: 1;
@@ -154,6 +162,14 @@
}
}
+ .key-value-editor-entry {
+ display: table;
+ margin-bottom: 15px;
+ padding-right: (@as-sortable-item-button-width * 2);
+ position: relative;
+ table-layout: fixed;
+ width: 100%;
+ }
.key-value-editor-input .ui-select {
@media(min-width: @screen-md-min) {
float: left;
@@ -170,7 +186,8 @@
}
.key-value-editor .key-value-editor-input,
-.key-value-editor-header {
+.key-value-editor-header,
+.environment-from-editor-header {
float: left;
margin-bottom: 0;
padding-right: 5px;
diff --git a/app/views/directives/edit-environment-from.html b/app/views/directives/edit-environment-from.html
index 6a3ac4419a..76dbed991e 100644
--- a/app/views/directives/edit-environment-from.html
+++ b/app/views/directives/edit-environment-from.html
@@ -4,10 +4,21 @@
class="environment-from-entry environment-from-editor-entry-header">
+
+
Use all keys and values from
- config map {{entry.configMapRef.name}}
- secret {{entry.secretRef.name}}
+ config map {{entry.configMapRef.name}}.
+ secret {{entry.secretRef.name}}.
+ Names will be prefixed with "{{entry.prefix}}"
@@ -50,27 +62,59 @@
-
-
@@ -79,7 +123,7 @@
href=""
class="add-row-link"
role="button"
- ng-click="$ctrl.onAddRow()">{{$ctrl.addRowLink}}
+ ng-click="$ctrl.onAddRow()">Add ALL Values from Config Map or Secret
diff --git a/app/views/directives/edit-environment-variables.html b/app/views/directives/edit-environment-variables.html
index 2c2fa1ec98..d21923353a 100644
--- a/app/views/directives/edit-environment-variables.html
+++ b/app/views/directives/edit-environment-variables.html
@@ -43,9 +43,7 @@
diff --git a/dist/scripts/scripts.js b/dist/scripts/scripts.js
index c60e3b5a11..87bfb823c2 100644
--- a/dist/scripts/scripts.js
+++ b/dist/scripts/scripts.js
@@ -9232,7 +9232,7 @@ e && e.push(t || {});
a.onAddRow = function() {
s(a.envFromEntries), n.setFocusOn("." + a.setFocusClass);
}, a.deleteEntry = function(e, t) {
-a.envFromEntries && !a.envFromEntries.length || (a.envFromEntries.splice(e, t), !a.envFromEntries.length && a.addRowLink && s(a.envFromEntries), a.updateEntries(a.envFromEntries), a.editEnvironmentFromForm.$setDirty());
+a.envFromEntries && !a.envFromEntries.length || (a.envFromEntries.splice(e, t), a.envFromEntries.length || s(a.envFromEntries), a.updateEntries(a.envFromEntries), a.editEnvironmentFromForm.$setDirty());
}, a.hasOptions = function() {
return !_.isEmpty(a.envFromSelectorOptions);
}, a.hasEntries = function() {
@@ -9264,7 +9264,7 @@ r.configMapRef = {
name: n.metadata.name
}, delete a.envFromEntries[e].secretRef;
}
-_.assign(a.envFromEntries[e], r), a.updateEntries(a.envFromEntries);
+t.prefix && (r.prefix = t.prefix), _.assign(a.envFromEntries[e], r), a.updateEntries(a.envFromEntries);
}, a.updateEntries = function(e) {
a.entries = _.filter(e, function(e) {
return e.secretRef || e.configMapRef;
@@ -9296,10 +9296,8 @@ c(), "cannotDelete" in e && (a.cannotDeleteAny = !0), "cannotSort" in e && (a.ca
};
} ],
bindings: {
-addRowLink: "@",
entries: "=",
envFromSelectorOptions: "<",
-selectorPlaceholder: "@",
isReadonly: ""
},
templateUrl: "views/directives/edit-environment-from.html"
diff --git a/dist/scripts/templates.js b/dist/scripts/templates.js
index 21f29bf424..6b12a87509 100644
--- a/dist/scripts/templates.js
+++ b/dist/scripts/templates.js
@@ -6700,7 +6700,13 @@ angular.module('openshiftConsoleTemplates', []).run(['$templateCache', function(
"\n" +
@@ -6713,8 +6719,9 @@ angular.module('openshiftConsoleTemplates', []).run(['$templateCache', function(
"\n" +
"\n" +
"Use all keys and values from\n" +
- "config map {{entry.configMapRef.name}} \n" +
- "secret {{entry.secretRef.name}} \n" +
+ "config map {{entry.configMapRef.name}}. \n" +
+ "secret {{entry.secretRef.name}}. \n" +
+ "Names will be prefixed with \"{{entry.prefix}}\" \n" +
"
\n" +
"\n" +
"\n" +
@@ -6733,16 +6740,32 @@ angular.module('openshiftConsoleTemplates', []).run(['$templateCache', function(
"
\n" +
"\n" +
"\n" +
+ "\n" +
"\n" +
"\n" +
"\n" +
"\n" +
@@ -6796,7 +6819,7 @@ angular.module('openshiftConsoleTemplates', []).run(['$templateCache', function(
"Environment From\n" +
" \n" +
"\n" +
- "\n" +
+ "\n" +
" \n" +
"\n" +
"Save \n" +
diff --git a/dist/styles/main.css b/dist/styles/main.css
index ae3fee5498..5f591b01fb 100644
--- a/dist/styles/main.css
+++ b/dist/styles/main.css
@@ -404,7 +404,7 @@ dd{margin-left:0}
@media (min-width:415px){.dl-horizontal dt{float:left;width:160px;clear:left;text-align:right;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.dl-horizontal dd{margin-left:180px}
}
-.btn-group-vertical>.btn-group:after,.btn-toolbar:after,.clearfix:after,.container-fluid:after,.container:after,.dl-horizontal dd:after,.dropdown-menu>li>a,.form-horizontal .form-group:after,.list-view-pf .list-group-item:after,.log-view,.modal-footer:after,.modal-header:after,.nav:after,.navbar-collapse:after,.navbar-header:after,.navbar:after,.pager:after,.panel-body:after,.row:after{clear:both}
+.btn-group-vertical>.btn-group:after,.btn-toolbar:after,.clearfix:after,.container-fluid:after,.container:after,.dl-horizontal dd:after,.form-horizontal .form-group:after,.list-view-pf .list-group-item:after,.modal-footer:after,.modal-header:after,.nav:after,.navbar-collapse:after,.navbar-header:after,.navbar:after,.pager:after,.panel-body:after,.row:after{clear:both}
abbr[data-original-title],abbr[title]{cursor:help;border-bottom:1px dotted #9c9c9c}
.initialism{font-size:90%;text-transform:uppercase}
blockquote{padding:10.5px 21px;margin:0 0 21px;font-size:16.25px;border-left:5px solid #f1f1f1}
@@ -829,7 +829,7 @@ tbody.collapse.in{display:table-row-group}
.btn-group>.btn-group:first-child:not(:last-child)>.btn:last-child,.btn-group>.btn-group:first-child:not(:last-child)>.dropdown-toggle,.btn-group>.btn:first-child:not(:last-child):not(.dropdown-toggle){border-bottom-right-radius:0;border-top-right-radius:0}
.btn-group>.btn-group:last-child:not(:first-child)>.btn:first-child,.btn-group>.btn:last-child:not(:first-child),.btn-group>.dropdown-toggle:not(:first-child){border-bottom-left-radius:0;border-top-left-radius:0}
.btn-group-vertical>.btn:not(:first-child):not(:last-child),.btn-group>.btn-group:not(:first-child):not(:last-child)>.btn,.btn-group>.btn:not(:first-child):not(:last-child):not(.dropdown-toggle){border-radius:0}
-.dropdown-menu>li>a{display:block;font-weight:400;color:#363636}
+.dropdown-menu>li>a{display:block;clear:both;font-weight:400;color:#363636}
.dropdown-menu>li>a:focus,.dropdown-menu>li>a:hover{text-decoration:none;color:#4d5258;background-color:#def3ff}
.dropdown-menu>.active>a,.dropdown-menu>.active>a:focus,.dropdown-menu>.active>a:hover{color:#fff;text-decoration:none;outline:0}
.dropdown-menu>.disabled>a,.dropdown-menu>.disabled>a:focus,.dropdown-menu>.disabled>a:hover{color:#9c9c9c}
@@ -5716,7 +5716,7 @@ alerts+.chromeless .log-loading-msg{margin-top:130px}
.log-size-warning{margin:0}
@media (max-width:991px){.log-size-warning{margin-top:20px}
}
-.log-view{margin-bottom:20px;position:relative}
+.log-view{clear:both;margin-bottom:20px;position:relative}
.log-end-msg,.log-view .log-scroll a{font-family:"Open Sans",Helvetica,Arial,sans-serif}
.chromeless .log-view{margin-bottom:0}
.log-view pre,.log-view pre code{background-color:transparent;border:0;margin-bottom:0;overflow:visible;padding:0 10px}
@@ -5901,19 +5901,25 @@ kubernetes-container-terminal .terminal-actions .spinner{top:5px}
.environment-from-editor .faux-input-group,.key-value-editor .faux-input-group{border-collapse:separate;display:table;position:relative}
.environment-from-editor .faux-input-group.faux-input-single-input,.key-value-editor .faux-input-group.faux-input-single-input{width:100%}
.environment-from-editor .environment-from-editor-button,.environment-from-editor .key-value-editor-buttons,.key-value-editor .environment-from-editor-button,.key-value-editor .key-value-editor-buttons{position:absolute;right:0;top:0;width:52px}
-.environment-from-editor .environment-from-entry,.environment-from-editor .key-value-editor-entry,.key-value-editor .environment-from-entry,.key-value-editor .key-value-editor-entry{display:table;margin-bottom:15px;padding-right:52px;position:relative;table-layout:fixed;width:100%}
-@media (min-width:992px){.environment-from-editor .environment-from-entry .environment-from-editor-button,.environment-from-editor .key-value-editor-entry .environment-from-editor-button,.key-value-editor .environment-from-entry .environment-from-editor-button,.key-value-editor .key-value-editor-entry .environment-from-editor-button{float:left;padding-right:5px;position:relative;width:auto}
+.environment-from-editor .environment-from-entry,.key-value-editor .environment-from-entry{display:table;margin-bottom:15px;padding-right:0;position:relative;table-layout:fixed;width:100%}
+@media (max-width:479px){.environment-from-editor .environment-from-entry,.key-value-editor .environment-from-entry{padding-right:52px}
}
-.environment-from-editor .environment-from-entry .environment-from-input,.environment-from-editor .key-value-editor-entry .environment-from-input,.key-value-editor .environment-from-entry .environment-from-input,.key-value-editor .key-value-editor-entry .environment-from-input{float:left;margin-bottom:0;padding-right:5px;width:100%}
-@media (min-width:992px){.environment-from-editor .environment-from-entry .environment-from-input,.environment-from-editor .key-value-editor-entry .environment-from-input,.key-value-editor .environment-from-entry .environment-from-input,.key-value-editor .key-value-editor-entry .environment-from-input{width:50%}
+@media (min-width:480px){.environment-from-editor .environment-from-entry .environment-from-editor-button,.key-value-editor .environment-from-entry .environment-from-editor-button{float:left;padding:0 5px;position:relative;width:auto}
}
-.environment-from-editor .environment-from-entry .environment-from-input .faux-input-group,.environment-from-editor .environment-from-entry .environment-from-input .ui-select,.environment-from-editor .key-value-editor-entry .environment-from-input .faux-input-group,.environment-from-editor .key-value-editor-entry .environment-from-input .ui-select,.key-value-editor .environment-from-entry .environment-from-input .faux-input-group,.key-value-editor .environment-from-entry .environment-from-input .ui-select,.key-value-editor .key-value-editor-entry .environment-from-input .faux-input-group,.key-value-editor .key-value-editor-entry .environment-from-input .ui-select{float:left;width:100%}
+.environment-from-editor .environment-from-entry .environment-from-input,.key-value-editor .environment-from-entry .environment-from-input{float:left;margin-bottom:0;padding-right:5px;width:100%}
+@media (min-width:480px){.environment-from-editor .environment-from-entry .environment-from-input,.key-value-editor .environment-from-entry .environment-from-input{width:calc(50% - 26px)}
+}
+.environment-from-editor .environment-from-entry .environment-from-input.prefix,.key-value-editor .environment-from-entry .environment-from-input.prefix{padding-right:0;width:calc(50% + 26px)}
+@media (max-width:479px){.environment-from-editor .environment-from-entry .environment-from-input.prefix,.key-value-editor .environment-from-entry .environment-from-input.prefix{margin-top:5px;width:100%}
+}
+.environment-from-editor .environment-from-entry .environment-from-input .faux-input-group,.environment-from-editor .environment-from-entry .environment-from-input .ui-select,.key-value-editor .environment-from-entry .environment-from-input .faux-input-group,.key-value-editor .environment-from-entry .environment-from-input .ui-select{float:left;width:100%}
.environment-from-editor .environment-from-entry .environment-from-view-details,.key-value-editor .environment-from-entry .environment-from-view-details{float:left;line-height:1;padding:6px 0 0}
+.environment-from-editor .key-value-editor-entry,.key-value-editor .key-value-editor-entry{display:table;margin-bottom:15px;padding-right:52px;position:relative;table-layout:fixed;width:100%}
.environment-from-editor .key-value-editor-input .ui-select+.ui-select,.key-value-editor .key-value-editor-input .ui-select+.ui-select{padding-top:5px}
@media (min-width:992px){.environment-from-editor .key-value-editor-input .ui-select,.key-value-editor .key-value-editor-input .ui-select{float:left;width:50%}
.environment-from-editor .key-value-editor-input .ui-select+.ui-select,.key-value-editor .key-value-editor-input .ui-select+.ui-select{padding-top:0;padding-left:5px}
}
-.key-value-editor .key-value-editor-input,.key-value-editor-header{float:left;margin-bottom:0;padding-right:5px;width:50%}
+.environment-from-editor-header,.key-value-editor .key-value-editor-input,.key-value-editor-header{float:left;margin-bottom:0;padding-right:5px;width:50%}
.membership .content-pane,.membership .content-pane .col-add-role{width:100%}
.environment-from-editor-entry-header,.key-value-editor-entry-header{padding-right:52px}
.environment-from-editor-header,.key-value-editor-header{margin-bottom:5px}