Longhorn storage class params are not editable

rancher/rancher#26617
This commit is contained in:
Westly Wright 2020-04-16 11:27:52 -07:00
parent 0169ef2a50
commit 3e61dabb9f
No known key found for this signature in database
GPG Key ID: 4FAB3D8673DC54A3
3 changed files with 15 additions and 17 deletions

View File

@ -54,11 +54,16 @@
<label class="acc-label">
{{t "cruStorageClass.provisioner.label"}}
</label>
{{searchable-select
allowCustom=true
content=supportedProvisionerChoices
value=primaryResource.provisioner
{{#input-or-display
editable=isNew
value=primaryResource.provisioner
}}
{{searchable-select
allowCustom=true
content=supportedProvisionerChoices
value=primaryResource.provisioner
}}
{{/input-or-display}}
</div>
</div>
{{/if}}
@ -86,6 +91,7 @@
parameters=primaryResource.parameters
editing=notView
registerHook=(action "registerHook")
mode=mode
}}
{{/accordion-list-item}}
@ -100,7 +106,7 @@
<label class="acc-label">
{{t "cruStorageClass.reclaimPolicy.label"}}
</label>
{{#if isView}}
{{#if (or isView isEdit)}}
<div>
{{t (concat "cruStorageClass.reclaimPolicy." primaryResource.reclaimPolicy)}}
</div>
@ -182,7 +188,7 @@
<label class="acc-label">
{{t "cruStorageClass.volumeBindingMode.label"}}
</label>
{{#if isView}}
{{#if (or isView isEdit)}}
<div>
{{primaryResource.volumeBindingMode}}
</div>

View File

@ -2,7 +2,6 @@ import Component from '@ember/component';
import layout from './template';
import StorageClassProvisioner from 'shared/mixins/storage-class-provisioner';
import { get, setProperties } from '@ember/object';
import { isEmpty } from '@ember/utils';
const DEFAULT_PROVISIONER_CONFIG = {
numberOfReplicas: '3',
@ -18,6 +17,7 @@ export default Component.extend(StorageClassProvisioner, {
layout,
provisioner: 'longhorn',
mode: 'new',
defaultProvisionerConfig: DEFAULT_PROVISIONER_CONFIG,
fields: Object.keys(DEFAULT_PROVISIONER_CONFIG),
@ -36,12 +36,4 @@ export default Component.extend(StorageClassProvisioner, {
setProperties(this, { model: changes });
}
},
actions: {
setParams(k) {
if (!isEmpty(k)) {
setProperties(this, { model: k });
}
},
},
});

View File

@ -3,8 +3,8 @@
<FormKeyValue
@addActionLabel="clusterNew.googlegke.nodeLabels.addAction"
@changed={{action (mut model)}}
@editing=editing
@initialMap={{defaultProvisionerConfig}}
@editing={{not (eq mode "edit")}}
@initialMap={{model}}
/>
</div>
</div>