brooklyn-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aleds...@apache.org
Subject [1/4] incubator-brooklyn git commit: Jsgui only checks the value of the location select is a location.
Date Wed, 14 Jan 2015 22:32:36 GMT
Repository: incubator-brooklyn
Updated Branches:
  refs/heads/master 869825804 -> 6455a9da2


Jsgui only checks the value of the location select is a location.


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

Branch: refs/heads/master
Commit: a893a22e2eed800ce7f75dca862310b2ac465427
Parents: 97db774
Author: Sam Corbett <sam.corbett@cloudsoftcorp.com>
Authored: Wed Jan 14 13:40:16 2015 +0000
Committer: Sam Corbett <sam.corbett@cloudsoftcorp.com>
Committed: Wed Jan 14 13:40:16 2015 +0000

----------------------------------------------------------------------
 .../webapp/assets/js/view/application-add-wizard.js     | 12 +++++-------
 .../src/main/webapp/assets/js/view/effector-invoke.js   |  2 +-
 .../assets/tpl/app-add-wizard/deploy-location-row.html  |  4 ++--
 .../test/javascript/specs/view/effector-invoke-spec.js  |  2 +-
 4 files changed, 9 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/a893a22e/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 45eb5fb..833a5ff 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
@@ -39,7 +39,7 @@ define([
              ModalHtml, CreateHtml, CreateStepTemplateEntryHtml, CreateEntityEntryHtml,
              RequiredConfigEntryHtml, EditConfigEntryHtml, DeployHtml,
              DeployLocationRowHtml, DeployLocationOptionHtml, PreviewHtml
-        ) {
+) {
 
     function setVisibility(obj, isVisible) {
         if (isVisible) obj.show();
@@ -61,13 +61,11 @@ define([
                 services.push(entityToCAMP(entities[i]));
             }
         }
-
         return {
             name: spec.name,
             locations: spec.locations,
             services: services
         };
-
     }
 
     function entityToCAMP(entity) {
@@ -78,7 +76,6 @@ define([
         };
     }
 
-
     var ModalWizard = Backbone.View.extend({
         tagName:'div',
         className:'modal hide fade',
@@ -533,15 +530,16 @@ define([
 
     ModalWizard.StepDeploy = Backbone.View.extend({
         className:'modal-body',
+
         events:{
             'click #add-selector-container':'addLocation',
             'click #remove-app-location':'removeLocation',
-            'change select':'selection',
-            'change option':'selection',
+            'change .select-location': 'selection',
             'blur #application-name':'updateName',
             'click #remove-config':'removeConfigRow',
             'click #add-config':'addConfigRow'
         },
+
         template:_.template(DeployHtml),
         locationRowTemplate:_.template(DeployLocationRowHtml),
         locationOptionTemplate:_.template(DeployLocationOptionHtml),
@@ -569,7 +567,7 @@ define([
                         rowId: li
                     }))
             }
-            var $locationOptions = container.find('#select-location')
+            var $locationOptions = container.find('.select-location')
             this.locations.each(function(aLocation) {
                     if (!aLocation.id) {
                         log("missing id for location:");

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/a893a22e/usage/jsgui/src/main/webapp/assets/js/view/effector-invoke.js
----------------------------------------------------------------------
diff --git a/usage/jsgui/src/main/webapp/assets/js/view/effector-invoke.js b/usage/jsgui/src/main/webapp/assets/js/view/effector-invoke.js
index bc22775..8d8f714 100644
--- a/usage/jsgui/src/main/webapp/assets/js/view/effector-invoke.js
+++ b/usage/jsgui/src/main/webapp/assets/js/view/effector-invoke.js
@@ -87,7 +87,7 @@ define([
                         initialValue : chosenLocation,
                         rowId : 0
                     }))
-                    var $selectLocations = container.find('#select-location')
+                    var $selectLocations = container.find('.select-location')
                         .append(this.locationOptionTemplate({
                                 id: "",
                                 name: "None"

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/a893a22e/usage/jsgui/src/main/webapp/assets/tpl/app-add-wizard/deploy-location-row.html
----------------------------------------------------------------------
diff --git a/usage/jsgui/src/main/webapp/assets/tpl/app-add-wizard/deploy-location-row.html
b/usage/jsgui/src/main/webapp/assets/tpl/app-add-wizard/deploy-location-row.html
index bd612fd..bb41b44 100644
--- a/usage/jsgui/src/main/webapp/assets/tpl/app-add-wizard/deploy-location-row.html
+++ b/usage/jsgui/src/main/webapp/assets/tpl/app-add-wizard/deploy-location-row.html
@@ -19,8 +19,8 @@ under the License.
 -->
 
 <div id="location-row-<%= rowId %>" rowId="<%= rowId %>" initialValue="<%=
initialValue %>" class="location-selector-row">
-    <select id="select-location" style="margin:4px 0 4px 0; width:80%"></select>
-    <% if (rowId>0) { %>
+    <select class="select-location" style="margin:4px 0 4px 0; width:80%"></select>
+    <% if (rowId > 0) { %>
         <button id="remove-app-location" class="btn btn-info btn-mini" type="button"><i
class="icon-minus-sign"></i></button>
     <% } %>    
 </div>

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/a893a22e/usage/jsgui/src/test/javascript/specs/view/effector-invoke-spec.js
----------------------------------------------------------------------
diff --git a/usage/jsgui/src/test/javascript/specs/view/effector-invoke-spec.js b/usage/jsgui/src/test/javascript/specs/view/effector-invoke-spec.js
index 42055af..dbd7c8e 100644
--- a/usage/jsgui/src/test/javascript/specs/view/effector-invoke-spec.js
+++ b/usage/jsgui/src/test/javascript/specs/view/effector-invoke-spec.js
@@ -46,7 +46,7 @@ define([
 
         // Select the third item in the option list rather than the "None" and
         // horizontal bar placeholders.
-        modalView.$("#select-location option:eq(2)").attr("selected", "selected");
+        modalView.$(".select-location option:eq(2)").attr("selected", "selected");
 
         it("must render a bootstrap modal", function () {
             expect(modalView.$(".modal-header").length).toBe(1)


Mime
View raw message