-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Handle project delete in details view #11197
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: 4.20
Are you sure you want to change the base?
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## 4.20 #11197 +/- ##
=========================================
Coverage 16.15% 16.15%
- Complexity 13269 13272 +3
=========================================
Files 5657 5656 -1
Lines 497772 497724 -48
Branches 60364 60361 -3
=========================================
+ Hits 80414 80420 +6
+ Misses 408408 408353 -55
- Partials 8950 8951 +1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
@blueorangutan package |
@abh1sar 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. |
Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 14204 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR fixes issue #10910 by preventing API calls with deleted project IDs when viewing project details. The main problem was that watchers in the AccountsTab and ProjectRoleTab components were triggering API calls even after a project was deleted, causing errors.
Key changes:
- Removed unnecessary watchers that were triggering API calls on resource changes
- Added null checks before making API calls to prevent calls with invalid project IDs
- Initialized projectRoles list to prevent potential null pointer issues
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
File | Description |
---|---|
ui/src/views/project/iam/ProjectRoleTab.vue | Removed resource watcher and added null check before fetching project roles |
ui/src/views/project/AccountsTab.vue | Removed resource watcher and added null check before fetching project accounts |
api/src/main/java/org/apache/cloudstack/api/command/admin/acl/project/ListProjectRolesCmd.java | Initialized projectRoles list to empty ArrayList to prevent potential null pointer issues |
@@ -192,6 +181,7 @@ export default { | |||
}, | |||
fetchData () { | |||
this.loading = true | |||
if (!this.resource.id) return |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider setting loading to false before returning to maintain consistent loading state when resource.id is null.
if (!this.resource.id) return | |
if (!this.resource.id) { | |
this.loading = false | |
return | |
} |
Copilot uses AI. Check for mistakes.
methods: { | ||
fetchData () { | ||
const params = {} | ||
params.projectId = this.resource.id | ||
params.page = this.page | ||
params.pageSize = this.pageSize | ||
this.updateProjectApi = this.$store.getters.apis.updateProject | ||
if (!this.resource.id) return |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider setting loading to false before returning to maintain consistent loading state when resource.id is null, similar to how it should be handled in ProjectRoleTab.
if (!this.resource.id) return | |
if (!this.resource.id) { | |
this.loading.table = false | |
return | |
} |
Copilot uses AI. Check for mistakes.
@sureshanaparti a Jenkins job has been kicked to build UI QA env. I'll keep you posted as I make progress. |
UI build: ✔️ |
Description
This PR fixes #10910
Types of changes
Feature/Enhancement Scale or Bug Severity
Feature/Enhancement Scale
Bug Severity
Screenshots (if appropriate):
How Has This Been Tested?
How did you try to break this feature and the system with this change?