mirror of https://github.com/rancher/ui.git
Merge pull request #3260 from vincent99/master
Don't submit if there are errors
This commit is contained in:
commit
02226c4149
|
|
@ -455,14 +455,6 @@ export default InputTextFile.extend(ManageLabels, ClusterDriver, {
|
|||
}
|
||||
})),
|
||||
|
||||
allErrors: computed('errors.[]', 'clusterErrors.[]', 'otherErrors.[]', 'clusterOptErrors.[]', function() {
|
||||
let {
|
||||
errors, clusterErrors, clusterOptErrors, otherErrors,
|
||||
} = this;
|
||||
|
||||
return [...(errors || []), ...(clusterErrors || []), ...(clusterOptErrors || []), ...(otherErrors || [])];
|
||||
}),
|
||||
|
||||
filteredClusterTemplates: computed('model.clusterTemplates.@each.{id,state,name,members}', function() {
|
||||
let { model: { clusterTemplates } } = this;
|
||||
|
||||
|
|
@ -988,11 +980,15 @@ export default InputTextFile.extend(ManageLabels, ClusterDriver, {
|
|||
},
|
||||
|
||||
validate() {
|
||||
this._super(...arguments);
|
||||
|
||||
let errors = [];
|
||||
let { config, intl } = this;
|
||||
|
||||
this._super(...arguments);
|
||||
|
||||
let errors = this.errors || [];
|
||||
|
||||
errors.pushObjects(this.clusterErrors || []);
|
||||
errors.pushObjects(this.clusterOptErrors || []);
|
||||
errors.pushObjects(this.otherErrors || []);
|
||||
|
||||
if (this.clusterTemplateCreate) {
|
||||
if (this.model.clusterTemplateRevision) {
|
||||
|
|
@ -1016,7 +1012,7 @@ export default InputTextFile.extend(ManageLabels, ClusterDriver, {
|
|||
|
||||
if ( get(config, 'services.kubeApi.podSecurityPolicy') &&
|
||||
!get(this, 'primaryResource.defaultPodSecurityPolicyTemplateId') ) {
|
||||
errors.push(get(this, 'intl').t('clusterNew.psp.required'));
|
||||
errors.push(intl.t('clusterNew.psp.required'));
|
||||
}
|
||||
|
||||
if (get(this, 'config.services.etcd.snapshot')) {
|
||||
|
|
|
|||
|
|
@ -1250,7 +1250,7 @@
|
|||
{{/if}}
|
||||
{{/if}}
|
||||
|
||||
{{top-errors errors=allErrors}}
|
||||
{{top-errors errors=errors}}
|
||||
|
||||
{{#if (or (and notView (eq step 1)) (and isEdit (eq step 2)))}}
|
||||
{{save-cancel
|
||||
|
|
|
|||
Loading…
Reference in New Issue