Skip to content

Conversation

@Pearl1594
Copy link
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
Copy link

codecov bot commented Dec 5, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 17.44%. Comparing base (b0d74fe) to head (8198cbe).
⚠️ Report is 3 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     
Flag Coverage Δ
uitests 3.58% <ø> (-0.01%) ⬇️
unittests 18.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
Contributor

@blueorangutan ui

@blueorangutan
Copy link

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

@blueorangutan
Copy link

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

Copy link
Contributor

@DaanHoogland DaanHoogland left a comment

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

Copy link
Contributor

@shwstppr shwstppr left a comment

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
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
Contributor Author

@blueorangutan ui

@blueorangutan
Copy link

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

@blueorangutan
Copy link

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

@sonarqubecloud
Copy link

sonarqubecloud bot commented Dec 8, 2025

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants