You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by ni...@apache.org on 2017/02/09 09:43:06 UTC

ambari git commit: AMBARI-19918 : Reset Workflow on newly created workflow blocks UI(Venkata Sairam via nitirajrathore)

Repository: ambari
Updated Branches:
  refs/heads/trunk f14168330 -> 170497e92


AMBARI-19918 : Reset Workflow on newly created workflow blocks UI(Venkata Sairam via nitirajrathore)


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

Branch: refs/heads/trunk
Commit: 170497e92ff558f3505314153acf76954ba9ca3b
Parents: f141683
Author: Nitiraj Singh Rathore <ni...@gmail.com>
Authored: Thu Feb 9 15:11:37 2017 +0530
Committer: Nitiraj Singh Rathore <ni...@gmail.com>
Committed: Thu Feb 9 15:12:34 2017 +0530

----------------------------------------------------------------------
 .../ui/app/components/bundle-config.js          |  1 +
 .../resources/ui/app/components/coord-config.js |  1 +
 .../ui/app/components/designer-workspace.js     | 37 ++++++-----
 .../resources/ui/app/components/drafts-wf.js    |  2 +-
 .../ui/app/components/flow-designer.js          |  2 +
 .../src/main/resources/ui/app/routes/design.js  |  7 ---
 .../templates/components/designer-workspace.hbs | 66 +++++++++++---------
 7 files changed, 64 insertions(+), 52 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/170497e9/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 445b86e..658cbc0 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
@@ -304,6 +304,7 @@ export default Ember.Component.extend(Ember.Evented, Validations, {
     },
     resetBundle(){
       this.get('errors').clear();
+      this.set('showingResetConfirmation', false);
       if(this.get('bundleFilePath')){
         this.importBundle(this.get('bundleFilePath'));
       }else {

http://git-wip-us.apache.org/repos/asf/ambari/blob/170497e9/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 b045798..39b9d11 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
@@ -558,6 +558,7 @@ export default Ember.Component.extend(Validations, Ember.Evented, {
     },
     resetCoordinator(){
       this.get("errors").clear();
+      this.set('showingResetConfirmation', false);
       if(this.get('coordinatorFilePath')){
         this.importCoordinator(this.get('coordinatorFilePath'));
       }else{

http://git-wip-us.apache.org/repos/asf/ambari/blob/170497e9/contrib/views/wfmanager/src/main/resources/ui/app/components/designer-workspace.js
----------------------------------------------------------------------
diff --git a/contrib/views/wfmanager/src/main/resources/ui/app/components/designer-workspace.js b/contrib/views/wfmanager/src/main/resources/ui/app/components/designer-workspace.js
index 0b689b0..aa2e791 100644
--- a/contrib/views/wfmanager/src/main/resources/ui/app/components/designer-workspace.js
+++ b/contrib/views/wfmanager/src/main/resources/ui/app/components/designer-workspace.js
@@ -34,6 +34,7 @@ export default Ember.Component.extend({
   }),
   tabsObserver : Ember.observer('tabs.[]', 'tabs.@each.name', 'tabs.@each.filePath', function(){
     this.get('workspaceManager').saveTabs(this.get('tabs'));
+    this.tabManager();
   }),
   initialize : function(){
     if (Constants.isProjectManagerEnabled) {
@@ -66,20 +67,7 @@ export default Ember.Component.extend({
       });
   }.on('init'),
   elementsInserted : function(){
-    this.$('.nav-tabs a[data-toggle="tab"]').on('shown.bs.tab', function (e) {
-      var id = this.$(e.target).attr('href').slice(1);
-      this.get('workspaceManager').setLastActiveTab(id);
-      var tab = this.get('tabs').findBy('id', id);
-      if(tab.type === 'dashboard'){
-        this.sendAction('showDashboard');
-      } else if (tab.type === 'Projects') {
-        this.createOrShowProjManager();
-      }
-      else{
-        this.sendAction('hideDashboard');
-      }
-    }.bind(this));
-
+    this.tabManager();
     if(this.get('tabs') && this.get('tabs').length > 0){
       var lastActiveTabId = this.get('workspaceManager').getLastActiveTab();
       var activeTab = this.get('tabs').findBy('id', lastActiveTabId);
@@ -98,6 +86,23 @@ export default Ember.Component.extend({
   onDestroy : function(){
     this.get('tabs').clear();
   }.on('willDestroyElement'),
+  tabManager(){
+    Ember.run.later(()=>{
+      this.$('.nav-tabs a[data-toggle="tab"]').on('shown.bs.tab', function (e) {
+      var id = this.$(e.target).attr('href').slice(1);
+      this.get('workspaceManager').setLastActiveTab(id);
+      var tab = this.get('tabs').findBy('id', id);
+      if(tab.type === 'dashboard'){
+        this.sendAction('showDashboard');
+      } else if (tab.type === 'Projects') {
+        this.createOrShowProjManager();
+      }
+      else{
+        this.sendAction('hideDashboard');
+      }
+      }.bind(this));
+    }, 1000);
+  },
   createNewTab : function(type, path){
     var existingTab = this.get('tabs').findBy("filePath", path);
     if(existingTab && path){
@@ -116,6 +121,8 @@ export default Ember.Component.extend({
     this.$('.tab-content .tab-pane').removeClass('active');
     this.get('tabs').pushObject(tab);
     this.set('isNew', true);
+    this.sendAction("hideDashboard");
+    this.tabManager();
   },
   getDisplayName(type){
     if(type === 'wf'){
@@ -227,6 +234,7 @@ export default Ember.Component.extend({
       this.createOrShowProjManager();
     },
     showWarning(index){
+      this.$('#ConfirmDialog').remove();
       var tab = this.get('tabs').objectAt(index);
       this.set('indexToClose', index);
       if(tab && tab.type ==='dashboard'){
@@ -239,6 +247,7 @@ export default Ember.Component.extend({
       });
     },
     closeTab(){
+      this.set('showingWarning', false);
       var index = this.get('indexToClose');
       if(index < this.get('tabs').length - 1){
         var previousTab = this.get('tabs').objectAt(index + 1);

http://git-wip-us.apache.org/repos/asf/ambari/blob/170497e9/contrib/views/wfmanager/src/main/resources/ui/app/components/drafts-wf.js
----------------------------------------------------------------------
diff --git a/contrib/views/wfmanager/src/main/resources/ui/app/components/drafts-wf.js b/contrib/views/wfmanager/src/main/resources/ui/app/components/drafts-wf.js
index 86c8dc9..1d01e9b 100644
--- a/contrib/views/wfmanager/src/main/resources/ui/app/components/drafts-wf.js
+++ b/contrib/views/wfmanager/src/main/resources/ui/app/components/drafts-wf.js
@@ -80,7 +80,7 @@ export default Ember.Component.extend({
 	    this.sendAction("deleteWorkflow", this.get('currentDraft'));
     },
     closeProjects () {
-		  $('.modal-backdrop').remove();
+		  //this.$('.modal-backdrop').remove();
 		  this.$("#projectsList").modal("hide");
     },
     showActions (job) {

http://git-wip-us.apache.org/repos/asf/ambari/blob/170497e9/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 90fba0d..fd7a258 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
@@ -504,6 +504,8 @@ export default Ember.Component.extend(FindNodeMixin, Validations, {
     this.get("workflow").resetWorfklow();
     this.set('globalConfig', {});
     this.set('parameters', {});
+    this.set("undoAvailable", false);
+    this.set("showingConfirmationNewWorkflow", false);
     if(this.get('workflow.parameters') !== null){
       this.set('workflow.parameters', {});
     }

http://git-wip-us.apache.org/repos/asf/ambari/blob/170497e9/contrib/views/wfmanager/src/main/resources/ui/app/routes/design.js
----------------------------------------------------------------------
diff --git a/contrib/views/wfmanager/src/main/resources/ui/app/routes/design.js b/contrib/views/wfmanager/src/main/resources/ui/app/routes/design.js
index 93ce758..25a3266 100644
--- a/contrib/views/wfmanager/src/main/resources/ui/app/routes/design.js
+++ b/contrib/views/wfmanager/src/main/resources/ui/app/routes/design.js
@@ -74,9 +74,6 @@ export default Ember.Route.extend(Ember.Evented, {
     editWorkflow(path, type){
       this.trigger('openNewTab', path, type);
     },
-    deleteWorkflow(job){
-      this.set("currentDraft", job);
-    },
     showDashboard(){
       this.controller.set('dashboardShown', true);
       this.transitionTo('design.dashboardtab');
@@ -91,10 +88,6 @@ export default Ember.Route.extend(Ember.Evented, {
     hideDashboard(){
       this.controller.set('dashboardShown', false);
       this.transitionTo('design');
-    },
-    hideProjManager(){
-      this.controller.set('dashboardShown', false);
-      this.transitionTo('design');
     }
   }
 });
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/170497e9/contrib/views/wfmanager/src/main/resources/ui/app/templates/components/designer-workspace.hbs
----------------------------------------------------------------------
diff --git a/contrib/views/wfmanager/src/main/resources/ui/app/templates/components/designer-workspace.hbs b/contrib/views/wfmanager/src/main/resources/ui/app/templates/components/designer-workspace.hbs
index b29ae21..623f2e0 100644
--- a/contrib/views/wfmanager/src/main/resources/ui/app/templates/components/designer-workspace.hbs
+++ b/contrib/views/wfmanager/src/main/resources/ui/app/templates/components/designer-workspace.hbs
@@ -29,36 +29,8 @@
               <button {{action 'showDashboard'}} class="backto-dashboard btn btn-default" title="Workflow Dashboard">
                 <i class="fa fa-th marginright5"></i>Dashboard
               </button>
-            <div class="dropdown create-wf-menu">
-              <button class="btn btn-default dropdown-toggle borderRightRadiusNone" {{action "showTopRecentList"}} type="button" data-toggle="dropdown">Recent
-                <span class="caret"></span></button>
-                <ul class="dropdown-menu proj-menu">
-                 {{#if projList}}
-                  {{#each projList as |proj index|}}
-                    <li>
-                      <a id="wfs_btn" class="pointer projects-list" title={{proj.workflowDefinitionPath}} {{action "editWorkflow" proj.workflowDefinitionPath proj.type}}>
-                      {{#if (eq proj.type "WORKFLOW")}}
-                          <i class="fa fa-sitemap marginright10"></i><span class="action-link">{{proj.name}}</span>
-                      {{else if  (eq proj.type "COORDINATOR")}}
-                          <i class="fa fa-history marginright10"></i><span class="action-link">{{proj.name}}</span>
-                      {{else}}
-                          <i class="fa fa-cubes marginright10"></i><span class="action-link">{{proj.name}}</span>
-                      {{/if}}
-                      </a>
-                    </li>
-                   {{/each}}
-                  <li>
-                      <a {{action "showProjectManagerList"}} title="My Workflows" class="pointer">
-                      More...
-                      </a>
-                  </li>
-                 {{else}}
-                  <li class="pl10">
-                    No recent workflows.
-                  </li>
-                 {{/if}}
-                </ul>
-             </div>
+            <div class="btn-group">
+            <div class="btn-group">
             <div class="dropdown create-wf-menu">
               <button class="btn btn-default dropdown-toggle borderRightRadiusNone" type="button" data-toggle="dropdown">Create
                 <span class="caret"></span></button>
@@ -95,9 +67,43 @@
                   </li>
                 </ul>
               </div>
+            </div>
+            <div class="btn-group">
+            <div class="dropdown create-wf-menu">
+              <button class="btn btn-default dropdown-toggle borderRightRadiusNone" {{action "showTopRecentList"}} type="button" data-toggle="dropdown">Recent
+                <span class="caret"></span></button>
+                <ul class="dropdown-menu proj-menu">
+                 {{#if projList}}
+                  {{#each projList as |proj index|}}
+                    <li>
+                      <a id="wfs_btn" class="pointer projects-list" title={{proj.workflowDefinitionPath}} {{action "editWorkflow" proj.workflowDefinitionPath proj.type}}>
+                      {{#if (eq proj.type "WORKFLOW")}}
+                          <i class="fa fa-sitemap marginright10"></i><span class="action-link">{{proj.name}}</span>
+                      {{else if  (eq proj.type "COORDINATOR")}}
+                          <i class="fa fa-history marginright10"></i><span class="action-link">{{proj.name}}</span>
+                      {{else}}
+                          <i class="fa fa-cubes marginright10"></i><span class="action-link">{{proj.name}}</span>
+                      {{/if}}
+                      </a>
+                    </li>
+                   {{/each}}
+                  <li>
+                      <a {{action "showProjectManagerList"}} title="My Workflows" class="pointer">
+                      More...
+                      </a>
+                  </li>
+                 {{else}}
+                  <li class="pl10">
+                    No recent workflows.
+                  </li>
+                 {{/if}}
+                </ul>
+             </div>
+             </div>
               <button {{action "showAssetManager" true}} class="btn btn-default" title="Manage Assets">
                   Manage Assets
               </button>
+            </div>
               {{help-icon}}
             </div>
           </div>