fix function scope

Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
This commit is contained in:
Abhishek Kumar 2020-02-14 17:31:46 +05:30 committed by Rohit Yadav
parent c86f166208
commit 3447c9d0f7
2 changed files with 10 additions and 6 deletions

View File

@ -568,6 +568,7 @@ export default {
})
},
handleForVpcChange (forVpc) {
var self = this
this.forVpc = forVpc
this.supportedServices.forEach(function (svc, index) {
if (svc === 'Connectivity') {
@ -589,7 +590,7 @@ export default {
providers[providerIndex] = provider
})
svc.provider = providers
this.supportedServices[index] = svc
self.supportedServices[index] = svc
}
})
},
@ -631,11 +632,12 @@ export default {
var providers = Object.values(this.selectedServiceProviderMap)
this.isVirtualRouterForAtLeastOneService = false
this.isVpcVirtualRouterForAtLeastOneService = false
var self = this
providers.forEach(function (prvdr, idx) {
if (prvdr === 'VirtualRouter') {
this.isVirtualRouterForAtLeastOneService = true
if (this.serviceOfferings.length === 0) {
this.fetchServiceOfferingData()
self.isVirtualRouterForAtLeastOneService = true
if (self.serviceOfferings.length === 0) {
self.fetchServiceOfferingData()
}
}
if (prvdr === 'VpcVirtualRouter') {
@ -652,11 +654,12 @@ export default {
console.log(values)
var params = {}
var self = this
var selectedServices = null
var keys = Object.keys(values)
var ignoredKeys = ['state', 'status', 'allocationstate', 'forvpc', 'specifyvlan', 'ispublic', 'domainid', 'zoneid', 'egressdefaultpolicy', 'promiscuousmode', 'macaddresschanges', 'forgedtransmits']
keys.forEach(function (key, keyIndex) {
if (this.isSupportedServiceObject(values[key])) {
if (self.isSupportedServiceObject(values[key])) {
if (selectedServices == null) {
selectedServices = {}
}

View File

@ -353,8 +353,9 @@ export default {
}
var selectedServices = null
var keys = Object.keys(values)
var self = this
keys.forEach(function (key, keyIndex) {
if (this.isSupportedServiceObject(values[key])) {
if (self.isSupportedServiceObject(values[key])) {
if (selectedServices == null) {
selectedServices = {}
}