This is an automated email from the ASF dual-hosted git repository.
sureshanaparti pushed a commit to branch 4.20
in repository https://gitbox.apache.org/repos/asf/cloudstack.git
The following commit(s) were added to refs/heads/4.20 by this push:
new 626f3de69ad Handle project delete in detailsview. (#11197)
626f3de69ad is described below
commit 626f3de69ad332bb89c21b0bc2a220d975a1dcba
Author: Abhisar Sinha <[email protected]>
AuthorDate: Mon Aug 4 16:26:37 2025 +0530
Handle project delete in detailsview. (#11197)
---
.../api/command/admin/acl/project/ListProjectRolesCmd.java | 2 +-
ui/src/views/project/AccountsTab.vue | 12 +-----------
ui/src/views/project/iam/ProjectRoleTab.vue | 12 +-----------
3 files changed, 3 insertions(+), 23 deletions(-)
diff --git
a/api/src/main/java/org/apache/cloudstack/api/command/admin/acl/project/ListProjectRolesCmd.java
b/api/src/main/java/org/apache/cloudstack/api/command/admin/acl/project/ListProjectRolesCmd.java
index e876dbc9b58..dedbb410ea5 100644
---
a/api/src/main/java/org/apache/cloudstack/api/command/admin/acl/project/ListProjectRolesCmd.java
+++
b/api/src/main/java/org/apache/cloudstack/api/command/admin/acl/project/ListProjectRolesCmd.java
@@ -72,7 +72,7 @@ public class ListProjectRolesCmd extends BaseListCmd {
@Override
public void execute() {
- List<ProjectRole> projectRoles;
+ List<ProjectRole> projectRoles = new ArrayList<>();
if (getProjectId() != null && getProjectRoleId() != null) {
projectRoles =
Collections.singletonList(projRoleService.findProjectRole(getProjectRoleId(),
getProjectId()));
} else if (StringUtils.isNotBlank(getRoleName())) {
diff --git a/ui/src/views/project/AccountsTab.vue
b/ui/src/views/project/AccountsTab.vue
index 8c7282b988b..ca56b8977ae 100644
--- a/ui/src/views/project/AccountsTab.vue
+++ b/ui/src/views/project/AccountsTab.vue
@@ -157,17 +157,6 @@ export default {
this.fetchData()
},
inject: ['parentFetchData'],
- watch: {
- resource: {
- deep: true,
- handler (newItem) {
- if (!newItem || !newItem.id) {
- return
- }
- this.fetchData()
- }
- }
- },
methods: {
fetchData () {
const params = {}
@@ -175,6 +164,7 @@ export default {
params.page = this.page
params.pageSize = this.pageSize
this.updateProjectApi = this.$store.getters.apis.updateProject
+ if (!this.resource.id) return
this.fetchUsers()
this.fetchProjectAccounts(params)
if (this.isProjectRolesSupported()) {
diff --git a/ui/src/views/project/iam/ProjectRoleTab.vue
b/ui/src/views/project/iam/ProjectRoleTab.vue
index a0768db3164..98d542f88a2 100644
--- a/ui/src/views/project/iam/ProjectRoleTab.vue
+++ b/ui/src/views/project/iam/ProjectRoleTab.vue
@@ -173,17 +173,6 @@ export default {
mounted () {
this.fetchData()
},
- watch: {
- resource: {
- deep: true,
- handler (newItem) {
- if (!newItem || !newItem.id) {
- return
- }
- this.fetchData()
- }
- }
- },
methods: {
initForm () {
this.formRef = ref()
@@ -192,6 +181,7 @@ export default {
},
fetchData () {
this.loading = true
+ if (!this.resource.id) return
api('listProjectRoles', { projectid: this.resource.id }).then(json => {
const projectRoles = json.listprojectrolesresponse.projectrole
if (!projectRoles || projectRoles.length === 0) {