mirror of https://github.com/rancher/dashboard.git
ignore validation for oauth, service acct cred googleoauth
This commit is contained in:
parent
9f62d40f40
commit
9f106198c4
|
|
@ -59,25 +59,6 @@ export default {
|
|||
};
|
||||
}
|
||||
},
|
||||
|
||||
created() {
|
||||
this.registerBeforeHook(this.addCreds, 'willsave');
|
||||
},
|
||||
methods: {
|
||||
// re-add credentials when adding allowed users/groups to model
|
||||
addCreds() {
|
||||
if (this.model.enabled) {
|
||||
const { oauthCredential, serviceAccountCredential } = this.originalValue;
|
||||
|
||||
if (!this.model.oauthCredential) {
|
||||
this.model.oauthCredential = oauthCredential;
|
||||
}
|
||||
if (!this.model.serviceAccountCredential) {
|
||||
this.model.serviceAccountCredential = serviceAccountCredential;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
|
|
|
|||
|
|
@ -157,7 +157,11 @@ export default {
|
|||
addObject(this.model.allowedPrincipalIds, this.me.id);
|
||||
}
|
||||
}
|
||||
await this.model.save();
|
||||
if (wasEnabled && configType === 'oauth') {
|
||||
await this.model.save({ ignoreFields: ['oauthCredential', 'serviceAccountCredential'] });
|
||||
} else {
|
||||
await this.model.save();
|
||||
}
|
||||
await this.reloadModel();
|
||||
this.isEnabling = false;
|
||||
this.editConfig = false;
|
||||
|
|
@ -235,18 +239,6 @@ export default {
|
|||
set(this.model, 'disabledStatusBitmask', 0);
|
||||
}
|
||||
break;
|
||||
case 'oauth':
|
||||
if (this.model.id === 'googleoauth') {
|
||||
const { oauthCredential, serviceAccountCredential } = this.originalValue;
|
||||
|
||||
if (!this.model.oauthCredential) {
|
||||
set(this.model, 'oauthCredential', oauthCredential);
|
||||
}
|
||||
if (!this.model.serviceAccountCredential) {
|
||||
set(this.model, 'serviceAccountCredential', serviceAccountCredential);
|
||||
}
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -817,7 +817,7 @@ export default {
|
|||
delete this.__rehydrate;
|
||||
const forNew = !this.id;
|
||||
|
||||
const errors = await this.validationErrors(this);
|
||||
const errors = await this.validationErrors(this, opt.ignoreFields);
|
||||
|
||||
if (!isEmpty(errors)) {
|
||||
return Promise.reject(errors);
|
||||
|
|
|
|||
Loading…
Reference in New Issue