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:45 UTC

[46/71] [abbrv] brooklyn-ui git commit: address code review comments

address code review comments

* add js-yaml to license
* ensure None location works (see below)
* fix iconUr mis-spelling

with the None location it was odd but the old pruneLocation / set("location", []) caused the same yaml parse errors Undefined. however unsetting it works fine.


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

Branch: refs/heads/0.7.0-incubating
Commit: dd37fee621609025c1860077fe9bda68acbd8cde
Parents: 53e42a1
Author: Alex Heneveld <al...@cloudsoftcorp.com>
Authored: Mon Apr 6 11:49:58 2015 +0100
Committer: Alex Heneveld <al...@cloudsoftcorp.com>
Committed: Mon Apr 6 11:51:19 2015 +0100

----------------------------------------------------------------------
 LICENSE                                                  | 11 ++++++++---
 .../jsgui/src/main/webapp/assets/js/model/application.js |  4 +++-
 .../main/webapp/assets/js/view/application-add-wizard.js |  4 +++-
 3 files changed, 14 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/dd37fee6/LICENSE
----------------------------------------------------------------------
diff --git a/LICENSE b/LICENSE
index 3adafea..c13cc54 100644
--- a/LICENSE
+++ b/LICENSE
@@ -230,9 +230,8 @@ ZeroClipboard.js
 Copyright (c) Jon Rohan, James M. Greene (2014).
 Licensed under the MIT license (see below).
 
-
-This product includes software developed at SpryMedia Ltd  (http://sprymedia.co.uk/):
-jquery.dataTables.js, dataTables.extensions.js.
+This product includes software developed at SpryMedia Ltd (http://sprymedia.co.uk/):
+jquery.dataTables.js, dataTables.extensions.js
 Copyright (c) Allan Jardine (2008-2012).
 Licensed under the New BSD license (see below).
 
@@ -241,6 +240,12 @@ URI.js.
 Copyright (c) js-uri contributors (2013).
 Licensed under the New BSD license (see below).
 
+This product includes software developed by Vitaly Puzrin (https://github.com/nodeca/):
+js-yaml.js
+Copyright (c) Vitaly Puzrin (2011-2015).
+Licensed under the MIT license (see below).
+
+
 
 The MIT License ("MIT")
 

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/dd37fee6/usage/jsgui/src/main/webapp/assets/js/model/application.js
----------------------------------------------------------------------
diff --git a/usage/jsgui/src/main/webapp/assets/js/model/application.js b/usage/jsgui/src/main/webapp/assets/js/model/application.js
index 5c3a3ea..589ea40 100644
--- a/usage/jsgui/src/main/webapp/assets/js/model/application.js
+++ b/usage/jsgui/src/main/webapp/assets/js/model/application.js
@@ -65,7 +65,9 @@ define([
         },
         /* Drops falsy locations */
         pruneLocations: function() {
-            this.set('locations', _.compact(this.get('locations')));
+            var newLocations = _.compact(this.get('locations'));
+            if (newLocations && _.size(newLocations)) this.set('locations', newLocations);
+            else this.unset("locations");
         },
         setLocationAtIndex:function (locationNumber, val) {
             var newLocations = [],

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/dd37fee6/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 17c0f22..5c8ffc8 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
@@ -283,6 +283,8 @@ define([
                 this.currentStep = 0;
                 var that = this;
                 this.renderCurrentStep(function callback(view) {
+                    // Drop any "None" locations.
+                    that.model.spec.pruneLocations();
                     $("textarea#yaml_code").val(JsYaml.safeDump(oldSpecToCamp(that.model.spec.toJSON())));
                     $("ul#app-add-wizard-create-tab").find("a[href='#yamlTab']").tab('show');
                     $("#yaml_code").focus();
@@ -429,7 +431,7 @@ define([
                 name: item.name || item.id,
                 description: item.description,
                 planYaml:  item.planYaml,
-                iconUrl: item.iconUr
+                iconUrl: item.iconUrl
             })
             $("#create-step-template-entries", that.$el).append($tempel)
         },