add application wizard changes - switch to yaml tab on next
Project: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/commit/592f3efc Tree: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/tree/592f3efc Diff: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/diff/592f3efc Branch: refs/heads/master Commit: 592f3efc5448ff733d48bdeac55085f0e03e0afe Parents: 584edcb Author: Galina Grunin <[email protected]> Authored: Thu Mar 26 16:07:26 2015 -0400 Committer: Alex Heneveld <[email protected]> Committed: Sat Mar 28 10:02:49 2015 -0500 ---------------------------------------------------------------------- .../assets/js/model/catalog-item-summary.js | 3 ++- .../assets/js/view/application-add-wizard.js | 23 +++++++++++++------- .../create-step-template-entry.html | 2 +- 3 files changed, 18 insertions(+), 10 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/592f3efc/usage/jsgui/src/main/webapp/assets/js/model/catalog-item-summary.js ---------------------------------------------------------------------- diff --git a/usage/jsgui/src/main/webapp/assets/js/model/catalog-item-summary.js b/usage/jsgui/src/main/webapp/assets/js/model/catalog-item-summary.js index 68039db..8e4d3c4 100644 --- a/usage/jsgui/src/main/webapp/assets/js/model/catalog-item-summary.js +++ b/usage/jsgui/src/main/webapp/assets/js/model/catalog-item-summary.js @@ -29,7 +29,8 @@ define(["underscore", "backbone"], function (_, Backbone) { name:"", type:"", description:"", - iconUrl:"" + iconUrl:"", + planYaml:"" } } }) http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/592f3efc/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 c960f44..a936a0c 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 @@ -78,7 +78,6 @@ define([ "brooklyn.config": entity.config }; } - var ModalWizard = Backbone.View.extend({ tagName:'div', className:'modal hide fade', @@ -249,13 +248,18 @@ define([ this.renderCurrentStep() }, nextStep:function () { + if (this.currentStep < 2) { - if (this.currentView.validate()) { - this.currentStep += 1 - this.renderCurrentStep() - } else { - // call to validate should showFailure - } +// if (this.currentView.validate()) { +// this.currentStep += 1 +// this.renderCurrentStep() +// } else { +// // call to validate should showFailure +// } + $("ul#app-add-wizard-create-tab").find("a[href='#yamlTab']").tab('show') + $("#yaml_code").focus() + + } else { this.finishStep() } @@ -400,8 +404,10 @@ define([ id: item.id, name: item.name, description: item.description, - iconUrl: item.iconUrl + planYaml: item.planYaml, + iconUrl: item.iconUrTeml }) + //alert("yaml:"+item.planYaml) $("#create-step-template-entries", that.$el).append($tempel) }, templateClick: function(event) { @@ -414,6 +420,7 @@ define([ type: $tl.attr('id'), name: $tl.data("name") }; + $("textarea#yaml_code").val($tl.data("yaml")); } else { this.selectedTemplate = null; } http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/592f3efc/usage/jsgui/src/main/webapp/assets/tpl/app-add-wizard/create-step-template-entry.html ---------------------------------------------------------------------- diff --git a/usage/jsgui/src/main/webapp/assets/tpl/app-add-wizard/create-step-template-entry.html b/usage/jsgui/src/main/webapp/assets/tpl/app-add-wizard/create-step-template-entry.html index 973b990..d70fd9b 100644 --- a/usage/jsgui/src/main/webapp/assets/tpl/app-add-wizard/create-step-template-entry.html +++ b/usage/jsgui/src/main/webapp/assets/tpl/app-add-wizard/create-step-template-entry.html @@ -18,7 +18,7 @@ specific language governing permissions and limitations under the License. --> -<div class="template-lozenge frame" id="<%= id %>" data-name="<%= name %>"> +<div class="template-lozenge frame" id="<%= id %>" data-name="<%= name %>" data-yaml="<%= planYaml %>"> <% if (iconUrl) { %> <div class="icon"> <img src="<%= iconUrl %>" alt="(icon)" />
