ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rz...@apache.org
Subject [21/51] [abbrv] ambari git commit: AMBARI-19852. Workflow name mandatory for save in Coordinator and Bundle (Venkata Sairam via pallavkul)
Date Fri, 17 Feb 2017 22:56:59 GMT
AMBARI-19852. Workflow name mandatory for save in Coordinator and Bundle (Venkata Sairam via
pallavkul)

(cherry picked from commit 6231da4e873d51ba89c3dd933a6c7e03cb47d119)

Change-Id: Ie311019e9eca395a521422abf0a2847f23b5835f


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

Branch: refs/heads/branch-feature-BUG-74026
Commit: d1c34a9ab0cc364f7d97a948ab5145ca7edd3412
Parents: 02984ff
Author: pallavkul <pallav.kul@gmail.com>
Authored: Thu Feb 2 23:07:05 2017 +0530
Committer: Zuul <releng@hortonworks.com>
Committed: Tue Feb 7 01:54:00 2017 -0800

----------------------------------------------------------------------
 .../resources/ui/app/components/bundle-config.js   |  5 ++++-
 .../resources/ui/app/components/coord-config.js    | 17 ++++++++++-------
 .../resources/ui/app/components/flow-designer.js   |  5 +++++
 3 files changed, 19 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/d1c34a9a/contrib/views/wfmanager/src/main/resources/ui/app/components/bundle-config.js
----------------------------------------------------------------------
diff --git a/contrib/views/wfmanager/src/main/resources/ui/app/components/bundle-config.js
b/contrib/views/wfmanager/src/main/resources/ui/app/components/bundle-config.js
index 7b24d34..445b86e 100644
--- a/contrib/views/wfmanager/src/main/resources/ui/app/components/bundle-config.js
+++ b/contrib/views/wfmanager/src/main/resources/ui/app/components/bundle-config.js
@@ -390,9 +390,12 @@ export default Ember.Component.extend(Ember.Evented, Validations, {
       this.set('showVersionSettings', value);
     },
     save(){
+      if (Ember.isBlank(this.$('[name=bundle_title]').val())) {
+        return;
+      }
       var isDraft = false, bundleXml;
       if(this.get('validations.isInvalid')) {
-       isDraft = true;
+        isDraft = true;
       }else{
         var bundleGenerator = BundleGenerator.create({bundle:this.get("bundle")});
         bundleXml = bundleGenerator.process();

http://git-wip-us.apache.org/repos/asf/ambari/blob/d1c34a9a/contrib/views/wfmanager/src/main/resources/ui/app/components/coord-config.js
----------------------------------------------------------------------
diff --git a/contrib/views/wfmanager/src/main/resources/ui/app/components/coord-config.js
b/contrib/views/wfmanager/src/main/resources/ui/app/components/coord-config.js
index 57dbeb0..b045798 100644
--- a/contrib/views/wfmanager/src/main/resources/ui/app/components/coord-config.js
+++ b/contrib/views/wfmanager/src/main/resources/ui/app/components/coord-config.js
@@ -147,7 +147,7 @@ export default Ember.Component.extend(Validations, Ember.Evented, {
     if(Ember.isBlank(this.get('coordinator.name'))){
       this.set('coordinator.name', Ember.copy(this.get('tabInfo.name')));
     }
-    this.schedulePersistWorkInProgress();    
+    this.schedulePersistWorkInProgress();
   },
   coordinatorFilePath : Ember.computed('tabInfo.filePath', function(){
     return this.get('tabInfo.filePath');
@@ -344,12 +344,12 @@ export default Ember.Component.extend(Validations, Ember.Evented, {
       this.set('inputLogicEnabled', true);
     }
   },
-  validateChildComponents(){
+  validateChildComponents(showErrorMessage){
     var isChildComponentsValid = true;
     this.get('childComponents').forEach((context)=>{
       if(context.get('validations') && context.get('validations.isInvalid')){
         isChildComponentsValid =  false;
-        context.set('showErrorMessage', true);
+        context.set('showErrorMessage', showErrorMessage);
       }
     }.bind(this));
     return isChildComponentsValid;
@@ -457,7 +457,7 @@ export default Ember.Component.extend(Validations, Ember.Evented, {
       this.send('submit');
     },
     submit(){
-      var isChildComponentsValid = this.validateChildComponents();
+      var isChildComponentsValid = this.validateChildComponents(true);
       if(this.get('validations.isInvalid') || !isChildComponentsValid) {
         this.set('showErrorMessage', true);
         return;
@@ -539,7 +539,7 @@ export default Ember.Component.extend(Validations, Ember.Evented, {
       this.set('inputLogicExists', false);
     },
     preview(){
-      var isChildComponentsValid = this.validateChildComponents();
+      var isChildComponentsValid = this.validateChildComponents(true);
       if(this.get('validations.isInvalid') || !isChildComponentsValid) {
         this.set('showErrorMessage', true);
         return;
@@ -637,10 +637,13 @@ export default Ember.Component.extend(Validations, Ember.Evented, {
       this.set('showVersionSettings', value);
     },
     save(){
+      if (Ember.isBlank(this.$('[name=coord_title]').val())) {
+        return;
+      }
       var isDraft = false, coordinatorXml;
-      var isChildComponentsValid = this.validateChildComponents();
+      var isChildComponentsValid = this.validateChildComponents(false);
       if(this.get('validations.isInvalid') || !isChildComponentsValid) {
-       isDraft = true;
+        isDraft = true;
       }else{
         var coordGenerator = CoordinatorGenerator.create({coordinator:this.get("coordinator")});
         coordinatorXml = coordGenerator.process();

http://git-wip-us.apache.org/repos/asf/ambari/blob/d1c34a9a/contrib/views/wfmanager/src/main/resources/ui/app/components/flow-designer.js
----------------------------------------------------------------------
diff --git a/contrib/views/wfmanager/src/main/resources/ui/app/components/flow-designer.js
b/contrib/views/wfmanager/src/main/resources/ui/app/components/flow-designer.js
index 4618ab6..90fba0d 100644
--- a/contrib/views/wfmanager/src/main/resources/ui/app/components/flow-designer.js
+++ b/contrib/views/wfmanager/src/main/resources/ui/app/components/flow-designer.js
@@ -695,9 +695,14 @@ export default Ember.Component.extend(FindNodeMixin, Validations, {
     }, 1000);
   },
   openSaveWorkflow() {
+    if(Ember.isBlank(this.$('[name=wf_title]').val())) {
+      this.set('errors',[{"message":"Workflow name is mandatory"}]);
+      return;
+    }
     var workflowGenerator = WorkflowGenerator.create({workflow:this.get("workflow"), workflowContext:this.get('workflowContext')});
     var workflowXml = workflowGenerator.process();
     var workflowJson = this.getWorkflowAsJson();
+    this.set('errors', []);
     var isDraft = this.get('workflowContext').hasErrors()? true: false;
     this.set("configForSave", {json : workflowJson, xml : workflowXml,isDraft : isDraft});
     this.set("showingSaveWorkflow",true);


Mime
View raw message