diff --git a/app/authenticated/project/config-maps/index/template.hbs b/app/authenticated/project/config-maps/index/template.hbs index 95f0073b4..c0d0e58d5 100644 --- a/app/authenticated/project/config-maps/index/template.hbs +++ b/app/authenticated/project/config-maps/index/template.hbs @@ -9,6 +9,9 @@ {{#link-to (query-params group="namespace") classNames="btn btn-sm bg-default"}}{{/link-to}} {{/tooltip-element}} + + + {{#link-to "authenticated.project.config-maps.new" classNames="btn btn-sm bg-primary" disabled=(rbac-prevents resource=resource scope="project" permission="create")}}{{t 'configMapsPage.index.linkTo'}}{{/link-to}} diff --git a/app/components/cru-config-map/template.hbs b/app/components/cru-config-map/template.hbs index 453802785..987659ccd 100644 --- a/app/components/cru-config-map/template.hbs +++ b/app/components/cru-config-map/template.hbs @@ -38,10 +38,11 @@
- {{form-key-value initialMap=primaryResource.data allowEmptyValue=true + header=(t 'newConfigMap.values.label') + allowUpload=true addActionLabel="newConfigMap.addActionLabel" addInitialEmptyRow=true editing=notView diff --git a/lib/shared/addon/components/form-key-value/component.js b/lib/shared/addon/components/form-key-value/component.js index 57e96bb92..290d68192 100644 --- a/lib/shared/addon/components/form-key-value/component.js +++ b/lib/shared/addon/components/form-key-value/component.js @@ -1,7 +1,8 @@ import { on } from '@ember/object/evented'; import { next, debounce } from '@ember/runloop'; import Component from '@ember/component'; -import { get, set, observer } from '@ember/object'; +import { get, set, observer } from '@ember/object' +import Upload from 'shared/mixins/upload'; import layout from './template'; function applyLinesIntoArray(lines, ary) { @@ -55,7 +56,7 @@ function removeEmptyEntries(ary, allowEmptyValue = false) { ary.removeObjects(toRemove); } -export default Component.extend({ +export default Component.extend(Upload, { layout, // Inputs initialStr: null, @@ -65,6 +66,7 @@ export default Component.extend({ ary: null, allowEmptyValue: false, allowAdd: true, + allowUpload: false, allowRemove: true, allowEditKey: true, addInitialEmptyRow: false, @@ -79,6 +81,8 @@ export default Component.extend({ valueLabel: 'formKeyValue.value.label', keyPlaceholder: 'formKeyValue.key.placeholder', valuePlaceholder: 'formKeyValue.value.placeholder', + uploadAction: 'pastedValues', + init() { this._super(...arguments); diff --git a/lib/shared/addon/components/form-key-value/template.hbs b/lib/shared/addon/components/form-key-value/template.hbs index a2143ecd2..5dd1d2dcc 100644 --- a/lib/shared/addon/components/form-key-value/template.hbs +++ b/lib/shared/addon/components/form-key-value/template.hbs @@ -1,6 +1,14 @@
{{#if header}} - +
+ +
+ {{/if}} + + {{#if (and allowUpload editing)}} +
+ +
{{/if}}
@@ -75,3 +83,4 @@
{{/if}} + \ No newline at end of file diff --git a/lib/shared/addon/components/modal-yaml/template.hbs b/lib/shared/addon/components/modal-yaml/template.hbs index 728b01c10..65f9b782c 100644 --- a/lib/shared/addon/components/modal-yaml/template.hbs +++ b/lib/shared/addon/components/modal-yaml/template.hbs @@ -1,7 +1,7 @@