diff --git a/lib/shared/addon/components/cluster-driver/driver-rke/component.js b/lib/shared/addon/components/cluster-driver/driver-rke/component.js index d8e07976d..b7c5b6454 100644 --- a/lib/shared/addon/components/cluster-driver/driver-rke/component.js +++ b/lib/shared/addon/components/cluster-driver/driver-rke/component.js @@ -548,10 +548,8 @@ export default InputTextFile.extend(ManageLabels, ClusterDriver, { return remapped; }), - canSave: computed('allErrors.[]', function() { - let { clusterOptErrors, } = this; - - return (clusterOptErrors || []).length > 0; + canEditForm: computed('clusterOptErrors.[]', function() { + return (this.clusterOptErrors || []).length === 0; }), kubeApiPodSecurityPolicy: computed('config.services.kubeApi.podSecurityPolicy', { @@ -826,11 +824,9 @@ export default InputTextFile.extend(ManageLabels, ClusterDriver, { }, set(key, value) { - if (this.clusterOptErrors && this.clusterOptErrors.length > 0) { - next(() => { - set(this, 'clusterOptErrors', this.checkYamlForRkeConfig(value)); - }); - } + next(() => { + set(this, 'clusterOptErrors', this.checkYamlForRkeConfig(value)); + }); return value; } @@ -881,7 +877,7 @@ export default InputTextFile.extend(ManageLabels, ClusterDriver, { let decamledYaml = this.parseOptsFromYaml(yamlValue); if (decamledYaml && isEmpty(decamledYaml.rancherKubernetesEngineConfig)) { - set(this, 'clusterOptErrors', [`Cluster Options Parse Error: Missing Rancher Kubernetes Engine Config`]); + set(this, 'clusterOptErrors', [`Cluster Options Parse Error: Missing rancher_kubernetes_engine_config key`]); return; } @@ -931,10 +927,6 @@ export default InputTextFile.extend(ManageLabels, ClusterDriver, { if (this.updateFromYaml) { this.updateFromYaml(newOpts); } - } else { - ok = false; - - return ok; } } @@ -1035,11 +1027,9 @@ export default InputTextFile.extend(ManageLabels, ClusterDriver, { errors = this.validateAuthorizedClusterEndpoint(errors); } - const clusterOptErrors = get(this, 'clusterOptErrors') || []; - set(this, 'errors', errors); - return errors.length === 0 && clusterOptErrors.length === 0; + return errors.length === 0; }, validateAuthorizedClusterEndpoint(errors) { diff --git a/lib/shared/addon/components/cluster-driver/driver-rke/template.hbs b/lib/shared/addon/components/cluster-driver/driver-rke/template.hbs index 61b6c9ac8..cd028ce20 100644 --- a/lib/shared/addon/components/cluster-driver/driver-rke/template.hbs +++ b/lib/shared/addon/components/cluster-driver/driver-rke/template.hbs @@ -16,23 +16,13 @@
{{#if (or (not applyClusterTemplate) (and (eq step 1) (not applyClusterTemplate)))}} {{#if pasteOrUpload}} - {{#if clusterOptErrors.length}} - - {{else}} - - {{/if}} + {{else}}
{{top-errors errors=clusterOptErrors}} -
- {{input-yaml - showDownload=false - canChangeName=false - autoResize=true - value=yamlValue - fileChosen=(action "fileUploaded") - readOnly=(eq mode "view") - showUpload=(not-eq mode "view") - valueUpdated=(action "yamlValUpdated") - }} -
- {{copy-to-clipboard - tooltipText="" - buttonText="copyToClipboard.tooltip" - clipboardText=yamlValue - class="with-clip" + + {{input-yaml + showCopy=true + showDownload=false + canChangeName=false + autoResize=true + value=yamlValue + fileChosen=(action "fileUploaded") + readOnly=(eq mode "view") + showUpload=(not-eq mode "view") + valueUpdated=(action "yamlValUpdated") }}
@@ -1266,9 +1250,7 @@ {{/if}} {{/if}} - {{#unless (and pasteOrUpload clusterOptErrors)}} - {{top-errors errors=allErrors}} - {{/unless}} + {{top-errors errors=allErrors}} {{#if (or (and notView (eq step 1)) (and isEdit (eq step 2)))}} {{save-cancel @@ -1276,7 +1258,6 @@ editing=isEdit save=(action "driverSave") cancel=(action "close") - saveDisabled=canSave }} {{else}}