brooklyn-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject [1/2] brooklyn-ui git commit: Location wizard generates valid YAML for multiline fields
Date Mon, 30 May 2016 15:11:49 GMT
Repository: brooklyn-ui
Updated Branches:
  refs/heads/master b2ec9d10b -> a371dfcc1


Location wizard generates valid YAML for multiline fields


Project: http://git-wip-us.apache.org/repos/asf/brooklyn-ui/repo
Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-ui/commit/f8db0de7
Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-ui/tree/f8db0de7
Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-ui/diff/f8db0de7

Branch: refs/heads/master
Commit: f8db0de7c81dc7718068449c2013a571fab2d8fd
Parents: 6ecfb16
Author: Thomas Bouron <thomas.bouron@cloudsoftcorp.com>
Authored: Wed May 25 11:54:46 2016 +0100
Committer: Thomas Bouron <thomas.bouron@cloudsoftcorp.com>
Committed: Wed May 25 11:54:46 2016 +0100

----------------------------------------------------------------------
 src/main/webapp/assets/js/view/location-wizard.js | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/f8db0de7/src/main/webapp/assets/js/view/location-wizard.js
----------------------------------------------------------------------
diff --git a/src/main/webapp/assets/js/view/location-wizard.js b/src/main/webapp/assets/js/view/location-wizard.js
index 0a317b2..b3454c7 100644
--- a/src/main/webapp/assets/js/view/location-wizard.js
+++ b/src/main/webapp/assets/js/view/location-wizard.js
@@ -170,6 +170,7 @@ define([
                 this.currentView.setProvisioningProperties();
             }
 
+            var linebreak = /\n/g;
             var baseSpacing = '  ';
 
             var content = [].concat(_YAML_HEADER);
@@ -200,7 +201,12 @@ define([
                             content.push(baseSpacing + '  ' + valueKey + ': ' + valueValue);
                         });
                     } else {
-                        content.push(baseSpacing + key + ': ' + value);
+                        var isMultiline = linebreak.test(value);
+                        content.push(baseSpacing + key + ': ' + (isMultiline ? '|' : value));
+                        if (isMultiline) {
+                            var subBaseSpacing = baseSpacing + '  ';
+                            content.push(subBaseSpacing + value.replace(linebreak, "\n" +
subBaseSpacing));
+                        }
                     }
                 });
             }
@@ -410,7 +416,7 @@ define([
                     help: 'The password to use to connect to the machines (if using password
access)'
                 },
                 {
-                    id: 'privateKeyFile',
+                    id: 'privateKeyData',
                     label: 'Private Key Data',
                     type: 'textarea',
                     help: 'The contents of the private key file to use to connect to the
machines (if using key access, where the corresponding public key is in the <code>.authorized_keys</code>
file on the servers)'


Mime
View raw message