Skip to content

UI: Create Account form to set proper domain and role based on route - #12200

Merged
DaanHoogland merged 2 commits into
mainfrom
enh-role-domain-mapping-acc-form
Dec 9, 2025
Merged

UI: Create Account form to set proper domain and role based on route#12200
DaanHoogland merged 2 commits into
mainfrom
enh-role-domain-mapping-acc-form

Conversation

@Pearl1594

Copy link
Copy Markdown
Contributor

Description

This PR adds an enhancement, where in when we log in as root admin, create a domain and then go to accounts from that domain - while creating the account for the domain, it should correctly select the right domain and role in the create account form.
It also takes care of setting the right role type when changing the domain
As Root Admin:
If domain selected isn't the root domain, then the Role type selected by default will be Domain Admin
If the domain is then changed to root domain, the role type on the form will automatically change to Root Admin.

Types of changes

  • Breaking change (fix or feature that would cause existing functionality to change)
  • New feature (non-breaking change which adds functionality)
  • Bug fix (non-breaking change which fixes an issue)
  • Enhancement (improves an existing feature and functionality)
  • Cleanup (Code refactoring and cleanup, that may add test cases)
  • Build/CI
  • Test (unit or integration test code)

Feature/Enhancement Scale or Bug Severity

Feature/Enhancement Scale

  • Major
  • Minor

Screenshots (if appropriate):

How Has This Been Tested?

How did you try to break this feature and the system with this change?

@codecov

codecovBot commented Dec 5, 2025

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 17.44%. Comparing base (b0d74fe) to head (8198cbe).
⚠️ Report is 4 commits behind head on main.

Additional details and impacted files
@@ Coverage Diff @@## main #12200 +/- ##
============================================
- Coverage 17.57% 17.44% -0.13% - Complexity 15550 15595 +45 
============================================
Files 5913 5913 Lines 529428 534975 +5547 Branches 64677 66646 +1969 ============================================
+ Hits 93022 93337 +315 - Misses 425944 431171 +5227 - Partials 10462 10467 +5 
FlagCoverage Δ
uitests3.58% <ø> (-0.01%)⬇️
unittests18.49% <ø> (-0.15%)⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@DaanHoogland

Copy link
Copy Markdown
Contributor

@blueorangutan ui

@blueorangutan

Copy link
Copy Markdown

@DaanHoogland a Jenkins job has been kicked to build UI QA env. I'll keep you posted as I make progress.

@blueorangutan

Copy link
Copy Markdown

UI build: ✔️
Live QA URL: https://qa.cloudstack.cloud/simulator/pr/12200 (QA-JID-820)

@DaanHooglandDaanHoogland left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clgtm, tested in qa and works as described

@shwstpprshwstppr left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Idea lgtm, changes can be simplified

Comment on lines +303 to +317
if (this.isAdmin()) {
if (this.isNonRootDomain) {
const domainAdminRole = this.roles.find(role => role.type === 'DomainAdmin')
if (domainAdminRole) {
this.form.roleid = domainAdminRole.id
return
}
} else {
const rootAdminRole = this.roles.find(role => role.type === 'Admin')
if (rootAdminRole) {
this.form.roleid = rootAdminRole.id
return
}
}
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about filtering Admin role when it is not the ROOT domain?

@Pearl1594

Copy link
Copy Markdown
ContributorAuthor

@blueorangutan ui

@blueorangutan

Copy link
Copy Markdown

@Pearl1594 a Jenkins job has been kicked to build UI QA env. I'll keep you posted as I make progress.

@blueorangutan

Copy link
Copy Markdown

UI build: ✔️
Live QA URL: https://qa.cloudstack.cloud/simulator/pr/12200 (QA-JID-824)

@sonarqubecloud

Copy link
Copy Markdown

@shwstpprshwstppr left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@DaanHoogland
DaanHoogland merged commit 3c64847 into mainDec 9, 2025
51 of 52 checks passed
@DaanHoogland
DaanHoogland deleted the enh-role-domain-mapping-acc-form branch December 9, 2025 09:56
dhslove pushed a commit to ablecloud-team/ablestack-cloud that referenced this pull request Dec 11, 2025
owsferraro pushed a commit to owsferraro/cloudstack that referenced this pull request Mar 25, 2026
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@Pearl1594@DaanHoogland@blueorangutan@shwstppr