apache / cloudstack

Apache CloudStack is an opensource Infrastructure as a Service (IaaS) cloud computing platform
https://cloudstack.apache.org/
Apache License 2.0
2.1k stars 1.11k forks source link

UI: Allow accounts of the `User` type to add other accounts or users to projects through UI #9927

Open bernardodemarco opened 1 week ago

bernardodemarco commented 1 week ago

Description

Currently, to add a user or account to a project through UI, a select input field is rendered, displaying the accounts and users that the caller has access to as options. As a result, users with an account of the User type are unable to add other accounts or users to a project, since they don't have access to other accounts or users and no options are available to be selected in the input field.

This PR modifies the input field to allow users to both select from the available options and manually enter the account name or username they wish to add to the project.


Fixes #9774

Types of changes

Feature/Enhancement Scale or Bug Severity

Feature/Enhancement Scale

Bug Severity

Screenshots (if appropriate):

Adding an account by selecting an option available in the dropdown

image

Adding a user by entering their username in the input field

image

How Has This Been Tested?

  1. I created a domain d1, a domain admin (d1) and two normal users (u1-d1 and u2-d1) belonging to the domain.
  2. I created a project with the d1 account.
  3. I verified that the d1 account can select accounts and users of their domain to add them to the project.
  4. I added the u1-d1 account to the project as an admin.
  5. I logged in with the u1-d1 account, accessed the project and added the user u2-d1 to the project.
bernardodemarco commented 1 week ago

@blueorangutan ui

blueorangutan commented 1 week ago

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

codecov[bot] commented 1 week ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 4.30%. Comparing base (03bdf11) to head (358e77c). Report is 7 commits behind head on 4.19.

:exclamation: There is a different number of reports uploaded between BASE (03bdf11) and HEAD (358e77c). Click for more details.

HEAD has 1 upload less than BASE | Flag | BASE (03bdf11) | HEAD (358e77c) | |------|------|------| |unittests|1|0|
Additional details and impacted files ```diff @@ Coverage Diff @@ ## 4.19 #9927 +/- ## ============================================ - Coverage 15.10% 4.30% -10.81% ============================================ Files 5404 366 -5038 Lines 473460 29550 -443910 Branches 57728 5174 -52554 ============================================ - Hits 71525 1272 -70253 + Misses 393941 28134 -365807 + Partials 7994 144 -7850 ``` | [Flag](https://app.codecov.io/gh/apache/cloudstack/pull/9927/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Δ | | |---|---|---| | [uitests](https://app.codecov.io/gh/apache/cloudstack/pull/9927/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `4.30% <ø> (-0.01%)` | :arrow_down: | | [unittests](https://app.codecov.io/gh/apache/cloudstack/pull/9927/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#carryforward-flags-in-the-pull-request-comment) to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

blueorangutan commented 1 week ago

UI build: :heavy_check_mark: Live QA URL: https://qa.cloudstack.cloud/simulator/pr/9927 (QA-JID-478)