Skip to content

Conversation

@nvazquez
Copy link
Contributor

@nvazquez nvazquez commented May 30, 2025

Description

This PR adds a new setting on the config.json file:

  • displayProjectFieldOnLogin - false by default to preserve the current behavior.
  • When set to true: the project option is displayed on the login page. The user is logged in to the project view directly instead of the Default View

Documentation PR: apache/cloudstack-documentation#515

Screenshot 2025-05-30 at 14 36 02

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

Bug Severity

  • BLOCKER
  • Critical
  • Major
  • Minor
  • Trivial

Screenshots (if appropriate):

How Has This Been Tested?

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

  • Create project
  • Login setting the project field on the login page:
Screenshot 2025-05-30 at 12 42 37
  • Observe the page view is correctly set on login:
Screenshot 2025-05-30 at 12 43 52

@codecov
Copy link

codecov bot commented May 30, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 16.60%. Comparing base (bce17b6) to head (f1b5f63).
Report is 20 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##               main   #10935   +/-   ##
=========================================
  Coverage     16.60%   16.60%           
+ Complexity    13925    13924    -1     
=========================================
  Files          5729     5729           
  Lines        508070   508083   +13     
  Branches      61769    61771    +2     
=========================================
+ Hits          84370    84373    +3     
- Misses       414271   414282   +11     
+ Partials       9429     9428    -1     
Flag Coverage Δ
uitests 3.93% <ø> (-0.01%) ⬇️
unittests 17.49% <ø> (+<0.01%) ⬆️

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.

@nvazquez
Copy link
Contributor Author

@blueorangutan ui

@blueorangutan
Copy link

@nvazquez 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/10935 (QA-JID-633)

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

@rohityadavcloud
Copy link
Member

Probably not a good idea? Instead this could be an account level setting, why do we want this?

@DaanHoogland
Copy link
Contributor

Probably not a good idea? Instead this could be an account level setting, why do we want this?

I don’t understand you remark @rohityadavcloud , an account can participate in tons of projects and may want to log into a specific one from the start. Admitted it is a bit of candy, but why not a good idea?

@nvazquez
Copy link
Contributor Author

nvazquez commented Jun 3, 2025

Sorry @rohityadavcloud why is it not good idea? In my point of view it improves usability on the UI but not seeing the downside

@rohityadavcloud
Copy link
Member

I don't think this is a good UX/design - most users won't remember their project names. At least most shouldn't want to see this by default, could we wrap in some UI config i.e. disabled by default? Also check the 2FA UI, this could potentially break when 2FA is enabled.

@nvazquez
Copy link
Contributor Author

nvazquez commented Jun 3, 2025

Thanks @rohityadavcloud - I have refactored the PR to be optional and disabled by default. Admins have to toggle a key on the config.json file to display the project field on login

@nvazquez nvazquez changed the title UI: Login to a specific Project view UI: Add option to Login to a specific Project view via setting on config.json Jun 3, 2025
Copy link
Contributor

@Pearl1594 Pearl1594 left a comment

Choose a reason for hiding this comment

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

code lgtm

@nvazquez
Copy link
Contributor Author

nvazquez commented Jun 3, 2025

@blueorangutan ui

@blueorangutan
Copy link

@nvazquez 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/10935 (QA-JID-635)

@github-actions
Copy link

This pull request has merge conflicts. Dear author, please fix the conflicts and sync your branch with the base branch.

@nvazquez
Copy link
Contributor Author

@blueorangutan ui

@blueorangutan
Copy link

@nvazquez 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/10935 (QA-JID-642)

@nvazquez
Copy link
Contributor Author

@blueorangutan package

@blueorangutan
Copy link

@nvazquez a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.

@blueorangutan
Copy link

Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 13693

Copy link
Member

@rohityadavcloud rohityadavcloud left a comment

Choose a reason for hiding this comment

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

Sorry @nvazquez

-1 this is just really bad UX. In most environments, this isn't possible as people need to remember the project name/details. This shouldn't be on the login screen.

That said, +0 as you've made it configurable via config.json so this isn't the default and someone needs to explicitly enable this.

Copy link
Contributor

@kiranchavala kiranchavala left a comment

Choose a reason for hiding this comment

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

LGTM, Tested manually

  1. Enabled "displayProjectFieldOnLogin" in /etc/cloudstack/management/config.json

  2. Check the login screen and the project box is displayed

Screenshot 2025-07-16 at 5 21 11 PM
  1. Login as admin user and create some projects

  2. Add account to the project

  3. Login by providing the project details

Screenshot 2025-07-16 at 5 39 35 PM

Copy link
Contributor

@kiranchavala kiranchavala left a comment

Choose a reason for hiding this comment

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

LGTM

@nvazquez nvazquez merged commit 11455f6 into apache:main Jul 24, 2025
22 of 26 checks passed
@github-project-automation github-project-automation bot moved this from In Progress to Done in Apache CloudStack 4.21.0 Jul 24, 2025
@nvazquez nvazquez deleted the 421-login-project branch July 24, 2025 14:42
dhslove pushed a commit to ablecloud-team/ablestack-cloud that referenced this pull request Aug 1, 2025
…fig.json (apache#10935)

* UI: Login to a specific Project view

* Fix project icon

* Add the option to display project on login on the config.json file

---------

Co-authored-by: Pearl Dsilva <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

No open projects
Status: Done

Development

Successfully merging this pull request may close these issues.

6 participants