inputParametersHTML = (props) => {
let inputParameters = props.inputParameters;
const handleChange = (i, event) => props.updateInputParam(i, event.target.value);
- return inputParameters && inputParameters.map(function(input, i) {
- return (
- <div className="configure-nsd_section" key={i}>
- <h3 className="launchpadCard_title">Input Parameters</h3>
- <div className="inputControls">
- <TextInput label={ input.label || input.xpath } type="text" onChange={handleChange.bind(this, i)} />
- </div>
- </div>
- )
- })
+ let nsInputParamsHTML = [];
+ inputParameters && inputParameters.map(function(input, i) {
+ nsInputParamsHTML.push(
+ <div className="inputControls" key={i}>
+ <TextInput label={ input.label || input.xpath } value={input.value || input['default-value']} type="text" onChange={handleChange.bind(this, i)} />
+ </div>
+ );
+ });
+ var nsinput = (
+ <div className="configure-nsd_section" >
+ <h3 className="launchpadCard_title">NS Input Parameters</h3>
+ {
+ nsInputParamsHTML
+ }
+ </div>
+ );
+ return nsinput;
}
nsPlacementGroupsHTML = (props) => {
let nsPlacementGroups = props.nsPlacementGroups;
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;
}
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;