You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by pa...@apache.org on 2017/02/28 12:58:41 UTC

ambari git commit: AMBARI-20227. Clicking save button keeps the dialog window open, When job is submitted, the dialog stays open (Venkata Sairam via pallavkul)

Repository: ambari
Updated Branches:
  refs/heads/trunk a23467bf0 -> 5cf5e31d9


AMBARI-20227. Clicking save button keeps the dialog window open, When job is submitted, the dialog stays open (Venkata Sairam via pallavkul)


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

Branch: refs/heads/trunk
Commit: 5cf5e31d9e3409d1ed8b71e5573a520ece816cdb
Parents: a23467b
Author: pallavkul <pa...@gmail.com>
Authored: Tue Feb 28 18:27:28 2017 +0530
Committer: pallavkul <pa...@gmail.com>
Committed: Tue Feb 28 18:27:28 2017 +0530

----------------------------------------------------------------------
 .../resources/ui/app/components/bundle-config.js   | 17 +++++++++++++++++
 .../resources/ui/app/components/coord-config.js    | 17 +++++++++++++++++
 .../resources/ui/app/components/flow-designer.js   | 13 +++++++++++++
 .../main/resources/ui/app/components/job-config.js |  2 ++
 .../main/resources/ui/app/components/save-wf.js    |  2 ++
 .../ui/app/templates/components/bundle-config.hbs  | 11 +++++++++--
 .../ui/app/templates/components/coord-config.hbs   | 11 +++++++++--
 .../ui/app/templates/components/flow-designer.hbs  | 15 +++++++++++----
 8 files changed, 80 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/5cf5e31d/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 e94d51a..59ffbb8 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
@@ -146,6 +146,7 @@ export default Ember.Component.extend(Ember.Evented, Validations, {
   importBundle (filePath){
     this.set("bundleFilePath", filePath);
     this.set("isImporting", true);
+    this.hideSuccessMsg();
     filePath = this.appendFileName(filePath, 'bundle');
     var deferred = this.getBundleFromHdfs(filePath);
     deferred.promise.then(function(response){
@@ -249,7 +250,22 @@ export default Ember.Component.extend(Ember.Evented, Validations, {
       return filePath;
     }
   },
+  hideSuccessMsg(){
+    this.set('successMessage', '');
+    this.set('isWFSaveSuccess', false);
+  },
   actions : {
+    showSuccessMessage(msg, isHideSuccessMsg) {
+      if(isHideSuccessMsg){
+        this.set("isWFSaveSuccess", false);
+      } else {
+        this.set("isWFSaveSuccess", true);
+      }
+      Ember.run.later(()=>{
+      this.$('#successMsg').fadeOut();
+      }, 3000);
+      this.set("successMessage", msg);
+    },
     closeFileBrowser(){
       this.set("showingFileBrowser", false);
       this.get('fileBrowser').getContext().trigger('fileSelected', this.get('filePath'));
@@ -308,6 +324,7 @@ export default Ember.Component.extend(Ember.Evented, Validations, {
       this.set('showingResetConfirmation', true);
     },
     resetBundle(){
+      this.hideSuccessMsg();
       this.get('errors').clear();
       this.set('showingResetConfirmation', false);
       if(this.get('bundleFilePath')){

http://git-wip-us.apache.org/repos/asf/ambari/blob/5cf5e31d/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 f6e11b6..b5592a6 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
@@ -262,6 +262,7 @@ export default Ember.Component.extend(Validations, Ember.Evented, {
     return deferred;
   },
   importCoordinator (filePath){
+    this.hideSuccessMsg();
     filePath = this.appendFileName(filePath, 'coord');
     this.set("coordinatorFilePath", filePath);
     this.set("isImporting", false);
@@ -367,7 +368,22 @@ export default Ember.Component.extend(Validations, Ember.Evented, {
     }.bind(this));
     return isChildComponentsValid;
   },
+  hideSuccessMsg(){
+    this.set('successMessage', '');
+    this.set('isWFSaveSuccess', false);
+  },
   actions : {
+    showSuccessMessage(msg, isHideSuccessMsg) {
+      if(isHideSuccessMsg){
+        this.set("isWFSaveSuccess", false);
+      } else {
+        this.set("isWFSaveSuccess", true);
+      }
+      Ember.run.later(()=>{
+      this.$('#successMsg').fadeOut();
+      }, 3000);
+      this.set("successMessage", msg);
+    },
     registerChild(key, context){
       this.get('childComponents').set(key, context);
     },
@@ -571,6 +587,7 @@ export default Ember.Component.extend(Validations, Ember.Evented, {
     },
     resetCoordinator(){
       this.get("errors").clear();
+      this.hideSuccessMsg();
       this.set('showingResetConfirmation', false);
       if(this.get('coordinatorFilePath')){
         this.importCoordinator(this.get('coordinatorFilePath'));

http://git-wip-us.apache.org/repos/asf/ambari/blob/5cf5e31d/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 9eb20aa..2d326d1 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
@@ -472,6 +472,8 @@ export default Ember.Component.extend(FindNodeMixin, Validations, {
     this.set('counterMap', {});
     this.set("undoAvailable", false);
     this.set("showingConfirmationNewWorkflow", false);
+    this.set("successMessage", "");
+    this.set("isWFSaveSuccess", false);
     if(this.get('workflow.parameters') !== null){
       this.set('workflow.parameters', {});
     }
@@ -740,6 +742,17 @@ export default Ember.Component.extend(FindNodeMixin, Validations, {
     }
   },
   actions:{
+    showSuccessMessage(msg, isHideSuccessMsg) {
+      if(isHideSuccessMsg){
+        this.set("isWFSaveSuccess", false);
+      } else {
+        this.set("isWFSaveSuccess", true);
+      }
+      Ember.run.later(()=>{
+      this.$('#successMsg').fadeOut();
+      }, 3000);
+      this.set("successMessage", msg);
+    },
     importWorkflowStream(dataStr){
       this.importWorkflowFromFile(dataStr);
     },

http://git-wip-us.apache.org/repos/asf/ambari/blob/5cf5e31d/contrib/views/wfmanager/src/main/resources/ui/app/components/job-config.js
----------------------------------------------------------------------
diff --git a/contrib/views/wfmanager/src/main/resources/ui/app/components/job-config.js b/contrib/views/wfmanager/src/main/resources/ui/app/components/job-config.js
index 15c1fbf..fe6f34c 100644
--- a/contrib/views/wfmanager/src/main/resources/ui/app/components/job-config.js
+++ b/contrib/views/wfmanager/src/main/resources/ui/app/components/job-config.js
@@ -227,6 +227,8 @@ export default Ember.Component.extend(Validations, {
           });
         }
         this.set("savingInProgress",false);
+        this.$("#configureJob").modal("hide");
+        this.sendAction("showSuccessMessage", this.get("displayName")+" have been submitted successfully.");
       }.bind(this),
       error: function(response) {
         console.error(response);

http://git-wip-us.apache.org/repos/asf/ambari/blob/5cf5e31d/contrib/views/wfmanager/src/main/resources/ui/app/components/save-wf.js
----------------------------------------------------------------------
diff --git a/contrib/views/wfmanager/src/main/resources/ui/app/components/save-wf.js b/contrib/views/wfmanager/src/main/resources/ui/app/components/save-wf.js
index 017bc61..cd9424a 100644
--- a/contrib/views/wfmanager/src/main/resources/ui/app/components/save-wf.js
+++ b/contrib/views/wfmanager/src/main/resources/ui/app/components/save-wf.js
@@ -101,6 +101,8 @@ export default Ember.Component.extend(Validations, {
         });
         self.set("savingInProgress",false);
         this.set('jobFilePath', this.get('filePath'));
+        self.$("#configureJob").modal("hide");
+        self.sendAction("showSuccessMessage", this.get("displayName")+" have been saved successfully.");
     }.bind(this)).catch(function(response){
         self.set("savingInProgress",false);
         self.showNotification({

http://git-wip-us.apache.org/repos/asf/ambari/blob/5cf5e31d/contrib/views/wfmanager/src/main/resources/ui/app/templates/components/bundle-config.hbs
----------------------------------------------------------------------
diff --git a/contrib/views/wfmanager/src/main/resources/ui/app/templates/components/bundle-config.hbs b/contrib/views/wfmanager/src/main/resources/ui/app/templates/components/bundle-config.hbs
index 2d374a5..d17a857 100644
--- a/contrib/views/wfmanager/src/main/resources/ui/app/templates/components/bundle-config.hbs
+++ b/contrib/views/wfmanager/src/main/resources/ui/app/templates/components/bundle-config.hbs
@@ -72,6 +72,13 @@
     <div id='loading'>
       {{spin-spinner lines=13 length=20 width=10}}
     </div>
+    {{#if isWFSaveSuccess}}
+      <div id="successMsg">
+          <div id="alert" class="alert alert-info alert-dismissible workflow-error" role="alert">
+            {{successMessage}}
+          </div>
+      </div>
+    {{/if}}
     {{designer-errors errors=errors validationErrors=validationErrors errorMsg=errorMsg data=data}}
     <form class="form-horizontal">
       <div class="col-sm-12 paddingtop10">
@@ -124,7 +131,7 @@
   {{hdfs-browser closeFileBrowser="closeFileBrowser" selectFileCallback=selectFileCallback filePath=filePath}}
 {{/if}}
 {{#if showingJobConfig}}
-  {{job-config type='bundle' closeJobConfigs="closeBundleSubmitConfig" jobFilePath=bundleFilePath openFileBrowser="openFileBrowser" closeFileBrowser="closeFileBrowser" jobConfigs=bundleConfigs containsParameteriedPaths=containsParameteriedPaths}}
+  {{job-config type='bundle' closeJobConfigs="closeBundleSubmitConfig" showSuccessMessage="showSuccessMessage" jobFilePath=bundleFilePath openFileBrowser="openFileBrowser" closeFileBrowser="closeFileBrowser" jobConfigs=bundleConfigs}}
 {{/if}}
 {{#if showingResetConfirmation}}
   {{#confirmation-dialog title="Confirm Bundle Reset"
@@ -138,5 +145,5 @@
   {{bundle-version-settings bundle=bundle showVersionSettings="showVersionSettings" }}
 {{/if}}
 {{#if showingSaveWorkflow}}
-  {{save-wf type='bundle' close="closeSave" jobFilePath=bundleFilePath openFileBrowser="openFileBrowser" closeFileBrowser="closeFileBrowser" jobConfigs=configForSave}}
+  {{save-wf type='bundle' close="closeSave" showSuccessMessage="showSuccessMessage" jobFilePath=bundleFilePath openFileBrowser="openFileBrowser" closeFileBrowser="closeFileBrowser" jobConfigs=configForSave}}
 {{/if}}

http://git-wip-us.apache.org/repos/asf/ambari/blob/5cf5e31d/contrib/views/wfmanager/src/main/resources/ui/app/templates/components/coord-config.hbs
----------------------------------------------------------------------
diff --git a/contrib/views/wfmanager/src/main/resources/ui/app/templates/components/coord-config.hbs b/contrib/views/wfmanager/src/main/resources/ui/app/templates/components/coord-config.hbs
index 0e35d0e..71d0080 100644
--- a/contrib/views/wfmanager/src/main/resources/ui/app/templates/components/coord-config.hbs
+++ b/contrib/views/wfmanager/src/main/resources/ui/app/templates/components/coord-config.hbs
@@ -92,6 +92,13 @@
 <div id='loading'>
   {{spin-spinner lines=13 length=20 width=10}}
 </div>
+{{#if isWFSaveSuccess}}
+  <div id="successMsg">
+      <div id="alert" class="alert alert-info alert-dismissible workflow-error" role="alert">
+        {{successMessage}}
+      </div>
+  </div>
+{{/if}}
 <div class="container-fluid">
   {{designer-errors errors=errors validationErrors=validationErrors errorMsg=errorMsg data=data}}
   <form class="form-horizontal">
@@ -339,7 +346,7 @@
     parameterizedWorkflowPath=parameterizedWorkflowPath
     extractProperties="extractProperties" containsParameteriedPaths=containsParameteriedPaths
     jobFilePath=coordinatorFilePath openFileBrowser="openFileBrowser"
-    closeFileBrowser="closeFileBrowser" jobConfigs=coordinatorConfigs isDryrun=dryrun}}
+    closeFileBrowser="closeFileBrowser" jobConfigs=coordinatorConfigs showSuccessMessage="showSuccessMessage" isDryrun=dryrun}}
 {{/if}}
 {{#if showingResetConfirmation}}
 {{#confirmation-dialog title="Confirm Coordinator Reset"
@@ -381,5 +388,5 @@ okBtnText="Continue" cancelBtnText="Cancel" onOk="resetCoordinator"}}{{/confirma
 </div>
 {{/if}}
 {{#if showingSaveWorkflow}}
-  {{save-wf type='coord' close="closeSave" jobFilePath=coordinatorFilePath openFileBrowser="openFileBrowser" closeFileBrowser="closeFileBrowser" jobConfigs=configForSave}}
+  {{save-wf type='coord' close="closeSave" showSuccessMessage="showSuccessMessage" jobFilePath=coordinatorFilePath openFileBrowser="openFileBrowser" closeFileBrowser="closeFileBrowser" jobConfigs=configForSave}}
 {{/if}}

http://git-wip-us.apache.org/repos/asf/ambari/blob/5cf5e31d/contrib/views/wfmanager/src/main/resources/ui/app/templates/components/flow-designer.hbs
----------------------------------------------------------------------
diff --git a/contrib/views/wfmanager/src/main/resources/ui/app/templates/components/flow-designer.hbs b/contrib/views/wfmanager/src/main/resources/ui/app/templates/components/flow-designer.hbs
index 4ff9d87..d428815 100644
--- a/contrib/views/wfmanager/src/main/resources/ui/app/templates/components/flow-designer.hbs
+++ b/contrib/views/wfmanager/src/main/resources/ui/app/templates/components/flow-designer.hbs
@@ -159,18 +159,25 @@
       {{/if}}
       {{#if isAssetPublishing}}
         <div id="loader">
-            <div id="alert"class="alert alert-info alert-dismissible workflow-error" role="alert">
+            <div id="alert" class="alert alert-info alert-dismissible workflow-error" role="alert">
               Publishing asset. Please wait...
             </div>
         </div>
       {{/if}}
       {{#if isAssetImporting}}
         <div id="loader">
-            <div id="alert"class="alert alert-info alert-dismissible workflow-error" role="alert">
+            <div id="alert" class="alert alert-info alert-dismissible workflow-error" role="alert">
               Importing asset. Please wait...
             </div>
         </div>
       {{/if}}
+      {{#if isWFSaveSuccess}}
+        <div id="successMsg">
+            <div id="alert" class="alert alert-info alert-dismissible workflow-error" role="alert">
+              {{successMessage}}
+            </div>
+        </div>
+      {{/if}}
       <div id="flow-designer">
         {{#each flattenedNodes as |node|}}
         <div class="node-wrapper">
@@ -265,10 +272,10 @@
   {{workflow-action-editor actionType=currentAction closeActionEditor="closeActionEditor" setNodeTransitions="setNodeTransitions" actionModel=currentNode.domain nodeType=currentNode.type currentNode=currentNode killNodes=workflow.killNodes credentials=workflow.credentials}}
 {{/if}}
 {{#if showingSaveWorkflow}}
-  {{save-wf type='wf' close="closeSaveWorkflow" jobFilePath=workflowFilePath openFileBrowser="openFileBrowser" closeFileBrowser="closeFileBrowser" jobConfigs=configForSave}}
+  {{save-wf type='wf' close="closeSaveWorkflow" showSuccessMessage="showSuccessMessage" jobFilePath=workflowFilePath openFileBrowser="openFileBrowser" closeFileBrowser="closeFileBrowser" jobConfigs=configForSave}}
 {{/if}}
 {{#if showingWorkflowConfigProps}}
-  {{job-config type='wf' closeJobConfigs="closeWorkflowSubmitConfigs" jobFilePath=workflowFilePath tabInfo=tabInfo openFileBrowser="openFileBrowser" closeFileBrowser="closeFileBrowser" jobConfigs=workflowSubmitConfigs isDryrun=dryrun}}
+  {{job-config type='wf' closeJobConfigs="closeWorkflowSubmitConfigs" showSuccessMessage="showSuccessMessage" jobFilePath=workflowFilePath tabInfo=tabInfo openFileBrowser="openFileBrowser" closeFileBrowser="closeFileBrowser" jobConfigs=workflowSubmitConfigs isDryrun=dryrun}}
 {{/if}}
 {{#if showGlobalConfig}}
   {{#global-config closeGlobalConfig="closeWorkflowGlobalProps" saveGlobalConfig="saveGlobalConfig" actionModel=globalConfig}}{{/global-config}}