From: Laurence Maultsby Date: Thu, 14 Sep 2017 16:50:58 +0000 (-0400) Subject: Bug 341 - input-parameter-xpath complains errors X-Git-Url: https://osm.etsi.org/gitweb/?a=commitdiff_plain;h=refs%2Fchanges%2F71%2F2171%2F1;p=osm%2FUI.git Bug 341 - input-parameter-xpath complains errors Signed-off-by: Laurence Maultsby --- diff --git a/skyquake/plugins/launchpad/src/instantiate/instantiateInputParams.jsx b/skyquake/plugins/launchpad/src/instantiate/instantiateInputParams.jsx index 5ffb4bc67..6561649b9 100644 --- a/skyquake/plugins/launchpad/src/instantiate/instantiateInputParams.jsx +++ b/skyquake/plugins/launchpad/src/instantiate/instantiateInputParams.jsx @@ -106,16 +106,23 @@ export default class InstantiateInputParams extends Component { inputParametersHTML = (props) => { let inputParameters = props.inputParameters; const handleChange = (i, event) => props.updateInputParam(i, event.target.value); - return inputParameters && inputParameters.map(function(input, i) { - return ( -
-

Input Parameters

-
- -
-
- ) - }) + let nsInputParamsHTML = []; + inputParameters && inputParameters.map(function(input, i) { + nsInputParamsHTML.push( +
+ +
+ ); + }); + var nsinput = ( +
+

NS Input Parameters

+ { + nsInputParamsHTML + } +
+ ); + return nsinput; } nsPlacementGroupsHTML = (props) => { let nsPlacementGroups = props.nsPlacementGroups; diff --git a/skyquake/plugins/launchpad/src/instantiate/instantiateStore.js b/skyquake/plugins/launchpad/src/instantiate/instantiateStore.js index dcf6e9e09..dacf316d2 100644 --- a/skyquake/plugins/launchpad/src/instantiate/instantiateStore.js +++ b/skyquake/plugins/launchpad/src/instantiate/instantiateStore.js @@ -255,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; @@ -720,12 +724,16 @@ class LaunchNetworkServiceStore { } 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;