You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@brooklyn.apache.org by he...@apache.org on 2016/02/01 18:52:46 UTC

[47/71] [abbrv] brooklyn-ui git commit: in js gui, show template yaml also for blueprints with yaml in a service

in js gui, show template yaml also for blueprints with yaml in a service


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

Branch: refs/heads/0.7.0-incubating
Commit: 2a8f40cd43a9dc01f54c243e289508bf33672179
Parents: dd37fee
Author: Alex Heneveld <al...@cloudsoftcorp.com>
Authored: Wed Apr 8 10:10:09 2015 +0100
Committer: Alex Heneveld <al...@cloudsoftcorp.com>
Committed: Wed Apr 8 10:10:47 2015 +0100

----------------------------------------------------------------------
 .../assets/js/view/application-add-wizard.js       | 17 ++++++++++++++++-
 1 file changed, 16 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/2a8f40cd/usage/jsgui/src/main/webapp/assets/js/view/application-add-wizard.js
----------------------------------------------------------------------
diff --git a/usage/jsgui/src/main/webapp/assets/js/view/application-add-wizard.js b/usage/jsgui/src/main/webapp/assets/js/view/application-add-wizard.js
index 5c8ffc8..e9427dd 100644
--- a/usage/jsgui/src/main/webapp/assets/js/view/application-add-wizard.js
+++ b/usage/jsgui/src/main/webapp/assets/js/view/application-add-wizard.js
@@ -257,8 +257,23 @@ define([
                     if (yaml) {
                         try {
                             yaml = JsYaml.safeLoad(yaml);
-                            yaml = (yaml.location || yaml.locations ? true : false);
+                            hasLocation = yaml.location || yaml.locations;
+                            if (!hasLocation) {
+                              // look for locations defined in locations
+                              svcs = yaml.services;
+                              if (svcs) {
+                                for (svcI in svcs) {
+                                  if (svcs[svcI].location || svcs[svcI].locations) {
+                                    hasLocation = true;
+                                    break;
+                                  }
+                                }
+                              }
+                            }
+                            yaml = (hasLocation ? true : false);
                         } catch (e) {
+                            log("Warning: could not parse yaml template")
+                            log(yaml);
                             yaml = false;
                         }
                     }