Bug 341 - input-parameter-xpath complains errors
[osm/UI.git] / skyquake / plugins / launchpad / src / instantiate / instantiateInputParams.jsx
index 6273d8c..6561649 100644 (file)
@@ -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 (
-                <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;
@@ -168,8 +175,8 @@ export default class InstantiateInputParams extends Component {
                             return (
 
                                   <div className="input_group" key={j}>
-                                    <TextInput type="text" onChange={props.nsFn.placementGroupUpdate.bind(self, i, j, 'key')} placeholder="KEY" value={key} />
-                                    <TextInput type="text" onChange={props.nsFn.placementGroupUpdate.bind(self, i, j, 'value')} placeholder="VALUE"  value={value} />
+                                    <TextInput type="text" onChange={props.nsFn.hostAggregateUpdate.bind(self, i, j, 'key')} placeholder="KEY" value={key} />
+                                    <TextInput type="text" onChange={props.nsFn.hostAggregateUpdate.bind(self, i, j, 'value')} placeholder="VALUE"  value={value} />
                                     <span onClick={props.nsFn.removeHostAggregate.bind(self, i, j)} className="removeInput"><img src={imgRemove} />Remove</span>
                                   </div>
                             )