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

winterhazel pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/cloudstack.git


The following commit(s) were added to refs/heads/main by this push:
     new be519481461 Stop role from auto-changing if user manually selected a 
role during account creation (#13320)
be519481461 is described below

commit be5194814616ec8d3bf9410ed6bc533186bd0eed
Author: Gabriel Pordeus Santos <[email protected]>
AuthorDate: Wed Jun 3 15:06:06 2026 -0300

    Stop role from auto-changing if user manually selected a role during 
account creation (#13320)
---
 ui/src/views/iam/AddAccount.vue | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/ui/src/views/iam/AddAccount.vue b/ui/src/views/iam/AddAccount.vue
index 25b45cded4e..a211fd2d8c3 100644
--- a/ui/src/views/iam/AddAccount.vue
+++ b/ui/src/views/iam/AddAccount.vue
@@ -36,6 +36,7 @@
             v-focus="true"
             showSearch
             optionFilterProp="label"
+            @change="onRoleChange"
             :filterOption="(input, option) => {
               return option.label.toLowerCase().indexOf(input.toLowerCase()) 
>= 0
             }">
@@ -211,6 +212,7 @@ export default {
       domain: { id: null, loading: false },
       domainsList: [],
       dom: null,
+      roleManuallySelected: false,
       roleLoading: false,
       roles: [],
       timeZoneLoading: false,
@@ -299,8 +301,13 @@ export default {
         })
       }
     },
+    onRoleChange (newRoleId) {
+      if (newRoleId) {
+        this.roleManuallySelected = true
+      }
+    },
     setDefaultRole () {
-      if (this.roles.length === 0) return
+      if (this.roles.length === 0 || this.roleManuallySelected) return
 
       let targetRoleType = null
 

Reply via email to