Skip to content

Commit 556f9da

Browse files
authored
ui: Network offerings not listed if listVPCs not available in the account Role (#6354)
1 parent efb1f2b commit 556f9da

File tree

2 files changed

+26
-18
lines changed

2 files changed

+26
-18
lines changed

ui/src/views/network/CreateIsolatedNetworkForm.vue

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -328,15 +328,19 @@ export default {
328328
} else { // from guest network section
329329
var params = {}
330330
this.networkOfferingLoading = true
331-
api('listVPCs', params).then(json => {
332-
const listVPCs = json.listvpcsresponse.vpc
333-
var vpcAvailable = this.arrayHasItems(listVPCs)
334-
if (vpcAvailable === false) {
335-
this.fetchNetworkOfferingData(false)
336-
} else {
337-
this.fetchNetworkOfferingData()
338-
}
339-
})
331+
if ('listVPCs' in this.$store.getters.apis) {
332+
api('listVPCs', params).then(json => {
333+
const listVPCs = json.listvpcsresponse.vpc
334+
var vpcAvailable = this.arrayHasItems(listVPCs)
335+
if (vpcAvailable === false) {
336+
this.fetchNetworkOfferingData(false)
337+
} else {
338+
this.fetchNetworkOfferingData()
339+
}
340+
})
341+
} else {
342+
this.fetchNetworkOfferingData(false)
343+
}
340344
}
341345
},
342346
fetchNetworkOfferingData (forVpc) {

ui/src/views/network/CreateL2NetworkForm.vue

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -317,15 +317,19 @@ export default {
317317
} else { // from guest network section
318318
var params = {}
319319
this.networkOfferingLoading = true
320-
api('listVPCs', params).then(json => {
321-
const listVPCs = json.listvpcsresponse.vpc
322-
var vpcAvailable = this.arrayHasItems(listVPCs)
323-
if (vpcAvailable === false) {
324-
this.fetchNetworkOfferingData(false)
325-
} else {
326-
this.fetchNetworkOfferingData()
327-
}
328-
})
320+
if ('listVPCs' in this.$store.getters.apis) {
321+
api('listVPCs', params).then(json => {
322+
const listVPCs = json.listvpcsresponse.vpc
323+
var vpcAvailable = this.arrayHasItems(listVPCs)
324+
if (vpcAvailable === false) {
325+
this.fetchNetworkOfferingData(false)
326+
} else {
327+
this.fetchNetworkOfferingData()
328+
}
329+
})
330+
} else {
331+
this.fetchNetworkOfferingData(false)
332+
}
329333
}
330334
},
331335
fetchNetworkOfferingData (forVpc) {

0 commit comments

Comments
 (0)