Skip to content

Commit 204990e

Browse files
committed
ui: fix form data double fetch/reset form data by ownership selection
Fixes #10832 Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
1 parent db5b6a5 commit 204990e

File tree

6 files changed

+14
-9
lines changed

6 files changed

+14
-9
lines changed

ui/src/views/compute/DeployVM.vue

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2319,7 +2319,9 @@ export default {
23192319
this.owner.domainid = null
23202320
this.owner.projectid = OwnerOptions.selectedProject
23212321
}
2322-
this.resetData()
2322+
if (OwnerOptions.initialized) {
2323+
this.resetData()
2324+
}
23232325
},
23242326
fetchZones (zoneId, listZoneAllow) {
23252327
this.zones = []

ui/src/views/compute/wizard/OwnershipSelection.vue

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,7 @@ export default {
136136
components: { ResourceIcon },
137137
data () {
138138
return {
139+
initialized: false,
139140
domains: [],
140141
accounts: [],
141142
projects: [],
@@ -214,6 +215,7 @@ export default {
214215
})
215216
.finally(() => {
216217
this.loading = false
218+
this.initialized = true
217219
})
218220
},
219221
fetchProjects () {
@@ -240,6 +242,7 @@ export default {
240242
})
241243
.finally(() => {
242244
this.loading = false
245+
this.initialized = true
243246
})
244247
},
245248
changeDomain () {

ui/src/views/network/CreateIsolatedNetworkForm.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -507,7 +507,7 @@ export default {
507507
this.owner.domainid = null
508508
this.owner.projectid = OwnerOptions.selectedProject
509509
}
510-
if (isAdminOrDomainAdmin()) {
510+
if (OwnerOptions.initialized && isAdminOrDomainAdmin()) {
511511
this.updateVPCCheckAndFetchNetworkOfferingData()
512512
}
513513
},

ui/src/views/network/CreateL2NetworkForm.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,7 @@ export default {
309309
this.owner.domainid = null
310310
this.owner.projectid = OwnerOptions.selectedProject
311311
}
312-
if (isAdminOrDomainAdmin()) {
312+
if (OwnerOptions.initialized && this.isAdminOrDomainAdmin()) {
313313
this.updateVPCCheckAndFetchNetworkOfferingData()
314314
}
315315
},

ui/src/views/storage/CreateSharedFS.vue

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -272,23 +272,21 @@ export default {
272272
},
273273
fetchOwnerOptions (OwnerOptions) {
274274
this.owner = {}
275-
console.log('fetching owner')
276275
if (OwnerOptions.selectedAccountType === 'Account') {
277276
if (!OwnerOptions.selectedAccount) {
278277
return
279278
}
280-
console.log('fetched account')
281279
this.owner.account = OwnerOptions.selectedAccount
282280
this.owner.domainid = OwnerOptions.selectedDomain
283281
} else if (OwnerOptions.selectedAccountType === 'Project') {
284282
if (!OwnerOptions.selectedProject) {
285283
return
286284
}
287-
console.log('fetched project')
288285
this.owner.projectid = OwnerOptions.selectedProject
289286
}
290-
console.log('fetched owner')
291-
this.fetchData()
287+
if (OwnerOptions.initialized) {
288+
this.fetchData()
289+
}
292290
},
293291
fetchData () {
294292
this.minCpu = store.getters.features.sharedfsvmmincpucount

ui/src/views/storage/CreateVolume.vue

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,9 @@ export default {
272272
}
273273
this.owner.projectid = OwnerOptions.selectedProject
274274
}
275-
this.fetchData()
275+
if (OwnerOptions.initialized) {
276+
this.fetchData()
277+
}
276278
},
277279
fetchData () {
278280
if (this.createVolumeFromSnapshot) {

0 commit comments

Comments
 (0)