Skip to content

Commit 937def5

Browse files
authored
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>
1 parent b258232 commit 937def5

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

ui/src/views/iam/AddUser.vue

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,9 @@
137137
</a-tooltip>
138138
</span>
139139
<a-select
140-
v-decorator="['account']"
140+
v-decorator="['account', {
141+
rules: [{ required: true, message: $t('message.error.required.input') }]
142+
}]"
141143
:loading="loadingAccount"
142144
:placeholder="apiParams.account.description">
143145
<a-select-option v-for="(item, idx) in accountList" :key="idx">
@@ -225,7 +227,7 @@ export default {
225227
this.apiConfig.params.forEach(param => {
226228
this.apiParams[param.name] = param
227229
})
228-
this.apiConfig = this.$store.getters.apis.authorizeSamlSso || {}
230+
this.apiConfig = this.$store.getters.apis.authorizeSamlSso || { params: [] }
229231
this.apiConfig.params.forEach(param => {
230232
this.apiParams[param.name] = param
231233
})
@@ -319,7 +321,7 @@ export default {
319321
320322
if (this.account) {
321323
params.account = this.account
322-
} else if (values.account) {
324+
} else if (this.accountList[values.account]) {
323325
params.account = this.accountList[values.account].name
324326
}
325327

0 commit comments

Comments
 (0)