Merge pull request #3260 from vincent99/master

Don't submit if there are errors
This commit is contained in:
Vincent Fiduccia 2019-08-15 17:41:07 -07:00 committed by GitHub
commit 02226c4149
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 13 deletions

View File

@ -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')) {

View File

@ -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