This is an automated email from the ASF dual-hosted git repository.
dahn pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/cloudstack-primate.git
The following commit(s) were added to refs/heads/master by this push:
new 1905b7c domain: fix error tree domain after deleting the domain.
new 5b95aaf Merge pull request #748 from
utchoang/feature/fix-delete-domain
1905b7c is described below
commit 1905b7c0bdad787123dd074101e102581b6a3cb6
Author: utchoang <[email protected]>
AuthorDate: Thu Sep 24 16:53:06 2020 +0700
domain: fix error tree domain after deleting the domain.
---
src/components/view/TreeView.vue | 1 +
src/config/section/domain.js | 1 -
src/views/iam/DomainActionForm.vue | 7 ++++---
3 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/src/components/view/TreeView.vue b/src/components/view/TreeView.vue
index 9621754..0be5228 100644
--- a/src/components/view/TreeView.vue
+++ b/src/components/view/TreeView.vue
@@ -345,6 +345,7 @@ export default {
reloadTreeData (objData) {
if (objData && objData[0].isDel) {
this.treeVerticalData = this.treeVerticalData.filter(item => item.id
!== objData[0].id)
+ this.treeVerticalData = this.treeVerticalData.filter(item =>
item.parentdomainid !== objData[0].id)
} else {
// data response from action
let jsonResponse = this.getResponseJsonData(objData[0])
diff --git a/src/config/section/domain.js b/src/config/section/domain.js
index a507ab6..7fbd263 100644
--- a/src/config/section/domain.js
+++ b/src/config/section/domain.js
@@ -130,7 +130,6 @@ export default {
listView: true,
dataView: true,
show: (record, store) => {
- console.log(record)
return ['Admin'].includes(store.userInfo.roletype) && record.level !==
0 ||
['DomainAdmin'].includes(store.userInfo.roletype) && record.domainid
!== store.userInfo.domainid
},
diff --git a/src/views/iam/DomainActionForm.vue
b/src/views/iam/DomainActionForm.vue
index 6cfecb7..378b3b7 100644
--- a/src/views/iam/DomainActionForm.vue
+++ b/src/views/iam/DomainActionForm.vue
@@ -157,6 +157,10 @@ export default {
this.$pollJob({
jobId,
successMethod: result => {
+ if (this.action.api === 'deleteDomain') {
+ this.$set(this.resource, 'isDel', true)
+ this.parentUpdActionData(this.resource)
+ }
this.parentFetchData()
if (action.response) {
const description = action.response(result.jobresult)
@@ -250,9 +254,6 @@ export default {
if (!hasJobId) {
this.parentUpdActionData(json)
this.parentFetchData()
- } else {
- this.$set(this.resource, 'isDel', true)
- this.parentUpdActionData(this.resource)
}
this.parentCloseAction()
}).catch(error => {