Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #14225 +/- ##
=========================================
Coverage 19.91% 19.91%
- Complexity 20200 20203 +3
=========================================
Files 6373 6373
Lines 577230 577259 +29
Branches 70696 70702 +6
=========================================
+ Hits 114974 114988 +14
- Misses 449690 449707 +17
+ Partials 12566 12564 -2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Warning
Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.
Copilot review overview
Review effort: Lite
Findings: 4
Open (4)
The PR description/table lists the setting name asdisable.account.view, but the implementation… · New WhendefaultOptionisnull,this.defaultOption?.idevaluates toundefined, so… · New This introduces an additionallistProjectscall on component creation and every… · NewautoSelectFirstOptionIfNeeded()previously emitted selection events directly, but now routes… · New
What changed in this PR
Adds an account-scoped configuration to disable the “Default View” in the UI so users are constrained to project views when they have projects available.
Changes:
- Introduces an account-level global setting
disable.default.viewand exposes it vialistCapabilities. - Updates the Project menu to hide “Default View” when disabled and auto-select a project when available.
- Enhances
InfiniteScrollSelectto react todefaultOptionchanges and emitupdate:value.
| File | Description |
|---|---|
| ui/src/components/widgets/InfiniteScrollSelect.vue | Reacts to defaultOption changes, tweaks auto-selection, and emits update:value. |
| ui/src/components/header/ProjectMenu.vue | Hides Default View based on a feature flag + available projects; fetches user projects to decide behavior. |
| server/src/main/java/com/cloud/user/AccountManagerImpl.java | Registers the new account-scoped config key in the account manager config list. |
| server/src/main/java/com/cloud/user/AccountManager.java | Defines the new disable.default.view account configuration key. |
| server/src/main/java/com/cloud/server/ManagementServerImpl.java | Adds disabledefaultview to capabilities output for the caller’s account. |
| api/src/main/java/org/apache/cloudstack/api/response/CapabilitiesResponse.java | Adds the disabledefaultview field to capabilities response. |
| api/src/main/java/org/apache/cloudstack/api/command/user/config/ListCapabilitiesCmd.java | Maps the new capability into the response object. |
| api/src/main/java/org/apache/cloudstack/api/ApiConstants.java | Introduces DISABLE_DEFAULT_VIEW API constant. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| created () { | ||
| this.selectedProjectId = this.$store.getters?.project?.id || this.defaultOption.id | ||
| this.listUserAvailableProjects() | ||
| this.selectedProjectId = this.$store.getters?.project?.id || this.defaultOption?.id |
| listUserAvailableProjects () { | ||
| getAPI('listProjects', { details: 'min', listall: true }) | ||
| .then((response) => { | ||
| this.availableProjects = response.listprojectsresponse?.project || [] | ||
| if (this.shouldHideDefaultView && !this.$store.getters.project?.id) { | ||
| this.selectedProjectId = null | ||
| } | ||
| }) |
| if (firstOption) { | ||
| const firstValue = firstOption[this.optionValueKey] | ||
| this.hasAutoSelectedFirst = true | ||
| this.$emit('change-option-value', firstValue) | ||
| this.$emit('change-option', firstOption) | ||
| this.onChange(firstValue) | ||
| } |

Description
By default, authenticated users can browse through the interface using either the default view, or the view of a project that they belong to. In some cases, it can be interesting to disable the account view, allowing users to view only the resources of their projects. Thus, this was implemented with the creation of the
disable.default.viewaccount configuration.disable.default.viewTypes of changes
Feature/Enhancement Scale or Bug Severity
Feature/Enhancement Scale
Screenshots (if appropriate):
How Has This Been Tested?
In an environment with two account:
admin cloud(the default one) anduser, I create a project foruser. Then, as the Admin, I enabled the configurationdisable.default.viewfor theuseraccount.After authenticating as
user, I validated that the created project was automatically selected for the view, and theDefault Viewoption was not available. I also logged out, and removed the project from the environment. After logging in again, theDefault Viewwas available again (because the user is not associated to any project).I also verified that when an user with
disable.default.viewenabled has no projects, and he creates a new project, the project menu automatically selects the new project as a view and hidesDefault View.