Merge from master
authorBob Gallagher <bob.gallagher@riftio.com>
Mon, 24 Apr 2017 17:57:43 +0000 (13:57 -0400)
committerBob Gallagher <bob.gallagher@riftio.com>
Mon, 24 Apr 2017 17:57:43 +0000 (13:57 -0400)
Change-Id: I8d374af11a10b7ba37d25a8c6c2b89275a49beb6
Signed-off-by: Bob Gallagher <bob.gallagher@riftio.com>
skyquake/plugins/composer/src/src/libraries/model/DescriptorModelMetaFactory.js
skyquake/plugins/launchpad/src/instantiate/instantiateInputParams.jsx
skyquake/plugins/launchpad/src/instantiate/instantiateStore.js

index 1ba8912..69098ec 100644 (file)
@@ -102,15 +102,19 @@ function serialize_leaf_empty(data) {
 function serialize_leaf_list(data) {
        data = data[this.name];
        if (data) {
-               data = data.reduce((result, value) => {
-                       if (value !== '' && value !== null && value !== undefined && typeof value !== 'object') {
-                               result.push(value);
+               commaSeparatedValues = data.reduce((d, v) => {
+                       let leaf = Serializer.leaf.call(this, d);
+                       let value = leaf & leaf[this.name];
+                       if (value && value.length) {
+                               if (v.length) {
+                                       v += ', ';
+                               }
+                               v += value;
                        }
-                       return result;
-               }, []);
-               if (data.length){
+               }, "");
+               if (commaSeparatedValues.length) {
                        let obj = {};
-                       obj[this.name] = data;
+                       obj[this.name] = commaSeparatedValues;
                        return obj;
                }
        }
index 6273d8c..d1e295c 100644 (file)
@@ -105,13 +105,12 @@ 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)} />
+                      <TextInput label={ input.label || input.xpath } type="text" onChange={props.updateInputParam.bind(self, i)} />
                   </div>
                 </div>
         )
index 0e91ee3..3ec2a80 100644 (file)
@@ -189,10 +189,10 @@ class LaunchNetworkServiceStore {
         });
         return window.location.hash = 'launchpad/' + tokenizedHash[2];
     }
-    launchNSRError(data) {
+    launchNSRError(error) {
         var msg = 'Something went wrong while trying to instantiate. Check the error logs for more information';
-        if (data.error) {
-            msg = data.error;
+        if(error) {
+            msg = error;
         }
         Alt.actions.global.showNotification.defer(msg);
         Alt.actions.global.hideScreenLoader.defer();