X-Git-Url: https://osm.etsi.org/gitweb/?p=osm%2FUI.git;a=blobdiff_plain;f=skyquake%2Fplugins%2Flaunchpad%2Fsrc%2Finstantiate%2FinstantiateStore.js;h=59fb00361445943b0f2d91ad36ae7047da0c2fb1;hp=0e91ee38419017665bd772a30d9401fc2cfe2e1d;hb=e6a5e4fdeac339f87e2d4153f6cbba6c46a3e844;hpb=a27b51d71318058e22f9a24364b4b02212738b26 diff --git a/skyquake/plugins/launchpad/src/instantiate/instantiateStore.js b/skyquake/plugins/launchpad/src/instantiate/instantiateStore.js index 0e91ee384..59fb00361 100644 --- a/skyquake/plugins/launchpad/src/instantiate/instantiateStore.js +++ b/skyquake/plugins/launchpad/src/instantiate/instantiateStore.js @@ -140,7 +140,7 @@ class LaunchNetworkServiceStore { Alt.actions.global.showNotification.defer({type: 'warning', msg: 'One or more VIM accounts have failed to connect'}); } if(cloudAccounts && cloudAccounts.length > 0) { - newState.selectedCloudAccount = cloudAccounts[0]; + newState.selectedCloudAccount = newState.cloudAccounts[0]; if (cloudAccounts[0]['account-type'] == 'openstack') { newState.displayPlacementGroups = true; } else { @@ -191,6 +191,9 @@ class LaunchNetworkServiceStore { } launchNSRError(data) { var msg = 'Something went wrong while trying to instantiate. Check the error logs for more information'; + if(data) { + msg = data; + } if (data.error) { msg = data.error; } @@ -252,9 +255,13 @@ class LaunchNetworkServiceStore { ipProfiles: NSD['ip-profiles'] }; newState.selectedNSD = data; + newState['input-parameters'] = []; if (NSD['input-parameter-xpath']) { newState.hasConfigureNSD = true; - newState['input-parameters'] = NSD['input-parameter-xpath']; + NSD['input-parameter-xpath'].map(function(p) { + newState.hasConfigureNSD = true; + newState['input-parameters'].push(_cloneDeep(p)); + }) } else { newState.hasConfigureNSD = false; newState['input-parameters'] = null; @@ -707,14 +714,22 @@ class LaunchNetworkServiceStore { if (this.state.ro && this.state.ro['account-type'] == 'openmano') { payload['om-datacenter'] = this.state.dataCenterID; } else { + if(!this.state.selectedCloudAccount) { + Alt.actions.global.showNotification.defer("No VIM Account Selected"); + return; + } payload["cloud-account"] = this.state.selectedCloudAccount.name; } + //Clean Input Parameters if (this.state.hasConfigureNSD) { - let ips = this.state['input-parameters']; + let ips = _cloneDeep(this.state['input-parameters']); + let ipsToSend = ips.filter(function(ip) { if (ip.value && ip.value != "") { - ip.uuid = GUID(); + delete ip.label; delete ip.name; + delete ip['default-value']; + return true; } return false;