ui: fix adduser form (#5063)

AddUser form wrongly shows the account dropdown when adding a user for an account. Account dropdown remains empty in the form.
When an account is not selected prior to opening the form, the account input should be required.

Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
This commit is contained in:
Abhishek Kumar 2021-06-02 13:48:59 +05:30 committed by GitHub
parent b25823213b
commit 937def533a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -137,7 +137,9 @@
</a-tooltip>
</span>
<a-select
v-decorator="['account']"
v-decorator="['account', {
rules: [{ required: true, message: $t('message.error.required.input') }]
}]"
:loading="loadingAccount"
:placeholder="apiParams.account.description">
<a-select-option v-for="(item, idx) in accountList" :key="idx">
@ -225,7 +227,7 @@ export default {
this.apiConfig.params.forEach(param => {
this.apiParams[param.name] = param
})
this.apiConfig = this.$store.getters.apis.authorizeSamlSso || {}
this.apiConfig = this.$store.getters.apis.authorizeSamlSso || { params: [] }
this.apiConfig.params.forEach(param => {
this.apiParams[param.name] = param
})
@ -319,7 +321,7 @@ export default {
if (this.account) {
params.account = this.account
} else if (values.account) {
} else if (this.accountList[values.account]) {
params.account = this.accountList[values.account].name
}