brooklyn-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From henev...@apache.org
Subject [07/11] brooklyn-ui git commit: Removing missed debug logging
Date Mon, 08 Feb 2016 11:12:03 GMT
Removing missed debug logging


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

Branch: refs/heads/master
Commit: 0a08f3bdaec1ef5c1f0c20960464d9ebef5a5da9
Parents: 72e1e28
Author: Mark McKenna <m4rkmckenna@gmail.com>
Authored: Fri Feb 5 10:27:39 2016 +0000
Committer: Mark McKenna <m4rkmckenna@gmail.com>
Committed: Fri Feb 5 10:27:39 2016 +0000

----------------------------------------------------------------------
 .../webapp/assets/js/util/brooklyn-utils.js     |  1 -
 .../assets/js/view/application-add-wizard.js    | 22 ++------------------
 src/main/webapp/assets/js/view/editor.js        | 14 +++++--------
 src/main/webapp/index.html                      |  3 ---
 4 files changed, 7 insertions(+), 33 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/0a08f3bd/src/main/webapp/assets/js/util/brooklyn-utils.js
----------------------------------------------------------------------
diff --git a/src/main/webapp/assets/js/util/brooklyn-utils.js b/src/main/webapp/assets/js/util/brooklyn-utils.js
index d88d937..5f3915c 100644
--- a/src/main/webapp/assets/js/util/brooklyn-utils.js
+++ b/src/main/webapp/assets/js/util/brooklyn-utils.js
@@ -113,7 +113,6 @@ define([
         if ($input.attr("type") === "checkbox") {
             return $input.is(":checked");
         } else {
-            // TODO: get codemirror.getValue() in case this is a textarea ...
             return $input.val();
         }
     };

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/0a08f3bd/src/main/webapp/assets/js/view/application-add-wizard.js
----------------------------------------------------------------------
diff --git a/src/main/webapp/assets/js/view/application-add-wizard.js b/src/main/webapp/assets/js/view/application-add-wizard.js
index ba87602..344d6a0 100644
--- a/src/main/webapp/assets/js/view/application-add-wizard.js
+++ b/src/main/webapp/assets/js/view/application-add-wizard.js
@@ -33,7 +33,7 @@ define([
     "text!tpl/app-add-wizard/deploy-version-option.html",
     "text!tpl/app-add-wizard/deploy-location-row.html",
     "text!tpl/app-add-wizard/deploy-location-option.html",
-    // ↓ not part of the constructor
+    //below not part of constructor
     "codemirror-mode-yaml",
     "codemirror-addon-show-hint",
     "codemirror-addon-anyword-hint",
@@ -114,7 +114,6 @@ define([
             this.model.yaml = "";
             this.model.mode = "template";  // or "yaml" or "other"
             this.currentStep = 0;
-            log("ModalWizard::initialize()");
             this.steps = [
                           {
                               step_id:'what-app',
@@ -163,7 +162,6 @@ define([
             this.updateButtonVisibility();
         },
         updateButtonVisibility:function () {
-            log("::updateButtonVisibility()")
             var currentStepObj = this.steps[this.currentStep]
             
             setVisibility(this.$("#prev_step"), (this.currentStep > 0))
@@ -266,16 +264,12 @@ define([
             this.renderCurrentStep();
         },
         nextStep:function () {
-            log("ModalWizard::nextStep()");
             if (this.currentStep == 0) {
                 if (this.currentView.validate()) {
-                    log("nextStep ... validate");
                     var yaml = (this.currentView && this.currentView.selectedTemplate
&& this.currentView.selectedTemplate.yaml);
-                    log("nextStep ... yaml: " + yaml);
                     if (yaml) {
                         try {
                             yaml = JsYaml.safeLoad(yaml);
-                            log("nextStep ... safeYaml: " + yaml);
                             hasLocation = yaml.location || yaml.locations;
                             if (!hasLocation) {
                               // look for locations defined in locations
@@ -296,7 +290,6 @@ define([
                             yaml = false;
                         }
                     }
-                    log("nextStep ... boolYaml: " + yaml);
                     if (yaml) {
                         // it's a yaml catalog template which includes a location, show the
yaml tab navigate to editor
                         this.currentView.redirectToEditorTab(this.currentView.selectedTemplate.id);
@@ -313,7 +306,6 @@ define([
             }
         },
         previewStep:function () {
-            log("ModalWizard::previewStep()");
             if (this.currentView.validate()) {
                 this.currentStep = 0;
                 var that = this;
@@ -359,7 +351,6 @@ define([
         template:_.template(CreateHtml),
         wizard: null,
         initialize:function () {
-            log("ModalWizard.StepCreate::initialize()");
             var self = this
             self.catalogEntityIds = []
 
@@ -388,7 +379,6 @@ define([
                     if (collection.size() > 0) {
                         self.addTemplateLozenges();
                     } else {
-                        log("collection is empty");
                         $('#catalog-applications-empty').show();
                         self.showYamlTab();
                     }
@@ -411,7 +401,6 @@ define([
             return this;
         },
         onTabChange: function(e) {
-            log("onTabChange()");
             var tabText = $(e.target).text();
             if (tabText=="Catalog") {
                 $("li.text-filter").show()
@@ -431,7 +420,6 @@ define([
                 this.options.wizard.updateButtonVisibility();
         },
         onYamlCodeChange: function() {
-            log("ModalWizard.StepCreate::onYamlCodeChange() ... event");
             if (this.options.wizard)
                 this.options.wizard.updateButtonVisibility();
         },
@@ -471,7 +459,6 @@ define([
             })
         },
         addTemplateLozenge: function(that, item) {
-            log("ModalWizard.StepCreate::addTemplateLozenge() ... planYaml: " + item.get('planYaml'));
             var $tempel = _.template(CreateStepTemplateEntryHtml, {
                 id: item.get('id'),
                 type: item.get('type'),
@@ -483,7 +470,6 @@ define([
             $("#create-step-template-entries", that.$el).append($tempel)
         },
         templateClick: function(event) {
-            log("ModalWizard.StepCreate::templateClick()");
             var $tl = $(event.target).closest(".template-lozenge");
             var wasSelected = $tl.hasClass("selected")
             $(".template-lozenge").removeClass("selected")
@@ -495,7 +481,6 @@ define([
                     name: $tl.data("name"),
                     yaml: $tl.data("yaml"),
                 };
-                log("::templateClick() ... selectedYaml: " + this.selectedTemplate.yaml);
                 if (this.selectedTemplate.yaml) {
                     $("textarea#yaml_code").val(this.selectedTemplate.yaml);
                 } else {
@@ -595,9 +580,7 @@ define([
 
         validate:function () {
             var that = this;
-            // TODO: enforce ';' as javascript conventions
             var tabName = $('#app-add-wizard-create-tab li[class="active"] a').attr('href');
-            log("::validate() ... tabName: "+tabName);
             if (tabName=='#entitiesTab') {
                 delete this.model.spec.attributes["id"]
                 var allokay = true
@@ -827,6 +810,7 @@ define([
                 return candidate.get("id")==loc_id;
             });
             if (!locationValid) {
+                log("invalid location "+loc_id);
                 this.showFailure("Invalid location "+loc_id);
                 this.model.spec.set("locations",[]);
             } else {
@@ -842,8 +826,6 @@ define([
                 this.model.spec.set("name", "");
         },
         validate:function () {
-            log("::validate()");
-            log(this.model.spec);
             this.model.spec.set("config", this.getConfigMap())
             if (this.model.spec.get("locations").length !== 0) {
                 return true;

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/0a08f3bd/src/main/webapp/assets/js/view/editor.js
----------------------------------------------------------------------
diff --git a/src/main/webapp/assets/js/view/editor.js b/src/main/webapp/assets/js/view/editor.js
index 112445e..4746b33 100644
--- a/src/main/webapp/assets/js/view/editor.js
+++ b/src/main/webapp/assets/js/view/editor.js
@@ -77,7 +77,6 @@ define([
                 this.editor = CodeMirror.fromTextArea(this.$("#yaml_code")[0], {
                     lineNumbers: true,
                     extraKeys: {"Ctrl-Space": "autocomplete"},
-                    // TODO: feature request: to allow custom theme: http://codemirror.net/demo/theme.html#base16-light
                     mode: {
                         name: "yaml",
                         globalVars: true
@@ -91,11 +90,9 @@ define([
             var yaml = this.editor.getValue();
             try{
                 jsYaml.safeLoad(yaml);
-                log('valid yaml :: true');
                 return true;
             }catch (e){
                 this.showFailure(e.message);
-                log('valid yaml :: false');
                 return false;
             }
         },
@@ -156,7 +153,6 @@ define([
             return false
         },
         submitCatalog: function () {
-            log("submitCatalog");
             var that = this;
             $.ajax({
                 url:'/v1/catalog',
@@ -165,18 +161,18 @@ define([
                 processData:false,
                 data: that.editor.getValue(),
                 success:function (data) {
-                    that.onSubmissionComplete(true, data, 'catalog')
+                    that.onSubmissionComplete(true, data, 'catalog');
                 },
                 error:function (data) {
-                    that.onSubmissionComplete(false, data, 'catalog')
+                    that.onSubmissionComplete(false, data, 'catalog');
                 }
             });
             return false;
         },
         showFailure: function(text) {
-            if (!text) text = "Failure performing the specified action";
-            log("showing error: "+text);
-            this.$('div.error-message .error-message-text').html(_.escape(text));
+            var _text = text || "Failure performing the specified action";
+            log("showing error: "+_text);
+            this.$('div.error-message .error-message-text').html(_.escape(_text));
             // flash the error, but make sure it goes away (we do not currently have any
other logic for hiding this error message)
             this.$('div.error-message').slideDown(250).delay(10000).slideUp(500);
         }

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/0a08f3bd/src/main/webapp/index.html
----------------------------------------------------------------------
diff --git a/src/main/webapp/index.html b/src/main/webapp/index.html
index c3bba5a..40ffd04 100644
--- a/src/main/webapp/index.html
+++ b/src/main/webapp/index.html
@@ -26,11 +26,8 @@
 
     <title>Brooklyn JS REST client</title>
 
-    <!-- TODO: following CSS to config.js -->
     <link rel="stylesheet" href="/assets/css/codemirror.css">
     <link rel="stylesheet" href="/assets/css/show-hint.css">
-    <!-- link rel="stylesheet" href="/assets/css/complete.css" -->
-
     <link rel="stylesheet" href="/assets/css/styles.css">
     <link rel="stylesheet" href="/assets/css/brooklyn.css">
     <style>


Mime
View raw message