diff --git a/ui/src/views/iam/AddUser.vue b/ui/src/views/iam/AddUser.vue index f57585c60f7..3275cc65e42 100644 --- a/ui/src/views/iam/AddUser.vue +++ b/ui/src/views/iam/AddUser.vue @@ -93,7 +93,8 @@ optionFilterProp="children" :filterOption="(input, option) => { return option.componentOptions.propsData.label.toLowerCase().indexOf(input.toLowerCase()) >= 0 - }" > + }" + @change="val => this.fetchAccount(val)" > @@ -192,7 +193,6 @@ export default { timeZoneMap: [], domainLoading: false, domainsList: [], - selectedDomain: '', samlEnable: false, idpLoading: false, idps: [], @@ -220,9 +220,6 @@ export default { if (!this.domianid) { this.fetchDomains() } - if (!this.account) { - this.fetchAccount() - } this.fetchTimeZone() if (this.samlAllowed) { this.fetchIdps() @@ -230,26 +227,34 @@ export default { }, fetchDomains () { this.domainLoading = true - api('listDomains', { + var params = { listAll: true, showicon: true, details: 'min' - }).then(response => { + } + api('listDomains', params).then(response => { this.domainsList = response.listdomainsresponse.domain || [] - this.selectedDomain = this.domainsList[0].id || '' }).catch(error => { this.$notification.error({ message: `${this.$t('label.error')} ${error.response.status}`, description: error.response.data.errorresponse.errortext }) }).finally(() => { + const domainid = this.domainsList[0].id || '' + this.form.setFieldsValue({ domainid: domainid }) + this.fetchAccount(domainid) this.domainLoading = false }) }, - fetchAccount () { + fetchAccount (domainid) { this.accountList = [] + this.form.setFieldsValue({ account: null }) this.loadingAccount = true - api('listAccounts', { listAll: true, showicon: true }).then(response => { + var params = { listAll: true, showicon: true } + if (domainid) { + params.domainid = domainid + } + api('listAccounts', params).then(response => { this.accountList = response.listaccountsresponse.account || [] }).catch(error => { this.$notification.error({ diff --git a/ui/src/views/iam/ConfigureSamlSsoAuth.vue b/ui/src/views/iam/ConfigureSamlSsoAuth.vue index 63ba49afedf..182e79bb721 100644 --- a/ui/src/views/iam/ConfigureSamlSsoAuth.vue +++ b/ui/src/views/iam/ConfigureSamlSsoAuth.vue @@ -108,6 +108,7 @@ export default { userid: this.resource.id, entityid: values.samlEntity }).then(response => { + this.$emit('refresh-data') this.$notification.success({ message: values.samlEnable ? this.$t('label.saml.enable') : this.$t('label.saml.disable'), description: values.samlEnable ? `${this.$t('message.success.enable.saml.auth')} ${this.$t('label.for')} ${this.resource.username}`