You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by da...@apache.org on 2020/09/28 11:51:38 UTC

[cloudstack-primate] branch master updated: adduser: Read domainid from querystring

This is an automated email from the ASF dual-hosted git repository.

dahn pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/cloudstack-primate.git


The following commit(s) were added to refs/heads/master by this push:
     new 16345cf  adduser: Read domainid from querystring
     new e7ef484  Merge pull request #756 from shapeblue/fix-user-form
16345cf is described below

commit 16345cf4ba627a08c622edf427d66192db4d3029
Author: davidjumani <dj...@gmail.com>
AuthorDate: Mon Sep 28 12:45:14 2020 +0530

    adduser: Read domainid from querystring
---
 src/views/iam/AddUser.vue | 31 ++++++++++++++++++++-----------
 1 file changed, 20 insertions(+), 11 deletions(-)

diff --git a/src/views/iam/AddUser.vue b/src/views/iam/AddUser.vue
index 8d22761..d7121ea 100644
--- a/src/views/iam/AddUser.vue
+++ b/src/views/iam/AddUser.vue
@@ -112,7 +112,7 @@
             </a-form-item>
           </a-col>
         </a-row>
-        <a-form-item v-if="this.isAdminOrDomainAdmin()">
+        <a-form-item v-if="this.isAdminOrDomainAdmin() && !domainid">
           <span slot="label">
             {{ $t('label.domain') }}
             <a-tooltip :title="apiParams.domainid.description">
@@ -121,9 +121,7 @@
           </span>
           <a-select
             :loading="domainLoading"
-            v-decorator="['domainid', {
-              initialValue: selectedDomain,
-              rules: [{ required: true, message: $t('message.error.select') }] }]"
+            v-decorator="['domainid']"
             :placeholder="apiParams.domainid.description">
             <a-select-option v-for="domain in domainsList" :key="domain.id">
               {{ 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
         }