From fab2a93775ff8bb3e8b7c1be73cbbeecef86c1da Mon Sep 17 00:00:00 2001 From: davidjumani Date: Mon, 28 Sep 2020 12:45:14 +0530 Subject: [PATCH] adduser: Read domainid from querystring Signed-off-by: Rohit Yadav --- ui/src/views/iam/AddUser.vue | 31 ++++++++++++++++++++----------- 1 file changed, 20 insertions(+), 11 deletions(-) diff --git a/ui/src/views/iam/AddUser.vue b/ui/src/views/iam/AddUser.vue index 8d227615d9b..d7121ea9cbb 100644 --- a/ui/src/views/iam/AddUser.vue +++ b/ui/src/views/iam/AddUser.vue @@ -112,7 +112,7 @@ - + {{ $t('label.domain') }} @@ -121,9 +121,7 @@ {{ domain.name }} @@ -215,7 +213,8 @@ export default { selectedIdp: '', loadingAccount: false, accountList: [], - account: null + account: null, + domainid: null } }, beforeCreate () { @@ -236,11 +235,14 @@ export default { methods: { fetchData () { this.account = this.$route.query && this.$route.query.account ? this.$route.query.account : null - this.fetchDomains() - this.fetchTimeZone() + this.domainid = this.$route.query && this.$route.query.domainid ? this.$route.query.domainid : null + if (!this.domianid) { + this.fetchDomains() + } if (!this.account) { this.fetchAccount() } + this.fetchTimeZone() if ('listIdps' in this.$store.getters.apis) { this.fetchIdps() } @@ -313,14 +315,21 @@ export default { email: values.email, firstname: values.firstname, lastname: values.lastname, - domainid: values.domainid, accounttype: 0 } - if (!this.account) { - params.account = this.accountList[values.account].name - } else { + + if (this.account) { params.account = this.account + } else if (values.account) { + params.account = this.accountList[values.account].name } + + if (this.domainid) { + params.domainid = this.domainid + } else if (values.domainid) { + params.domainid = values.domainid + } + if (this.isValidValueForKey(values, 'timezone') && values.timezone.length > 0) { params.timezone = values.timezone }