ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nc...@apache.org
Subject [24/30] ambari git commit: AMBARI-19753. Hive2 View - Switching tabs after executing query loses state (pallavkul)
Date Mon, 30 Jan 2017 15:40:45 GMT
AMBARI-19753. Hive2 View - Switching tabs after executing query loses state (pallavkul)


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

Branch: refs/heads/branch-dev-patch-upgrade
Commit: 589f567e37800ff606f5c40eca99508ce8910899
Parents: 75c126e
Author: pallavkul <pallav.kul@gmail.com>
Authored: Mon Jan 30 15:24:03 2017 +0530
Committer: pallavkul <pallav.kul@gmail.com>
Committed: Mon Jan 30 15:24:03 2017 +0530

----------------------------------------------------------------------
 .../src/main/resources/ui/app/models/worksheet.js       |  3 ++-
 .../src/main/resources/ui/app/routes/queries/query.js   | 12 ++++++------
 .../main/resources/ui/app/templates/queries/query.hbs   |  2 +-
 3 files changed, 9 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/589f567e/contrib/views/hive20/src/main/resources/ui/app/models/worksheet.js
----------------------------------------------------------------------
diff --git a/contrib/views/hive20/src/main/resources/ui/app/models/worksheet.js b/contrib/views/hive20/src/main/resources/ui/app/models/worksheet.js
index 9021e90..6a77633 100644
--- a/contrib/views/hive20/src/main/resources/ui/app/models/worksheet.js
+++ b/contrib/views/hive20/src/main/resources/ui/app/models/worksheet.js
@@ -35,6 +35,7 @@ export default DS.Model.extend({
   selectedMultiDb: DS.attr(),
   queryFile: DS.attr('string', {defaultValue: ""}),
   logFile: DS.attr('string', {defaultValue: ""}),
-  logResults: DS.attr('string', {defaultValue: ""})
+  logResults: DS.attr('string', {defaultValue: ""}),
+  isQueryRunning: DS.attr('boolean', {defaultValue: false})
 
 });

http://git-wip-us.apache.org/repos/asf/ambari/blob/589f567e/contrib/views/hive20/src/main/resources/ui/app/routes/queries/query.js
----------------------------------------------------------------------
diff --git a/contrib/views/hive20/src/main/resources/ui/app/routes/queries/query.js b/contrib/views/hive20/src/main/resources/ui/app/routes/queries/query.js
index 7d387f0..753b7f7 100644
--- a/contrib/views/hive20/src/main/resources/ui/app/routes/queries/query.js
+++ b/contrib/views/hive20/src/main/resources/ui/app/routes/queries/query.js
@@ -75,10 +75,10 @@ export default Ember.Route.extend({
     selectedMultiDb.pushObject(selecteDBName);
 
     controller.set('worksheet', model);
-    controller.set('selectedTablesModels',this.get('controller.model').get('selectedTablesModels')
|| selectedTablesModels );
+    controller.set('selectedTablesModels',model.get('selectedTablesModels') || selectedTablesModels
);
 
-    controller.set('selectedMultiDb', this.get('controller.model').get('selectedMultiDb')
|| selectedMultiDb);
-    controller.set('isQueryRunning', false);
+    controller.set('selectedMultiDb', model.get('selectedMultiDb') || selectedMultiDb);
+    controller.set('isQueryRunning', model.get('isQueryRunning'));
     controller.set('currentQuery', model.get('query'));
     controller.set('queryResult', model.get('queryResult'));
     controller.set('currentJobId', null);
@@ -143,7 +143,7 @@ export default Ember.Route.extend({
       let worksheetTitle = this.get('controller.model').get('title');
 
       self.get('controller.model').set('jobData', []);
-      self.get('controller').set('isQueryRunning', true);
+      self.get('controller.model').set('isQueryRunning', true);
 
       //Making the result set emply every time query runs.
       self.get('controller').set('queryResult', self.get('controller').get('queryResult'));
@@ -247,7 +247,7 @@ export default Ember.Route.extend({
 
         self.get('controller').set('queryResult', data);
         self.get('controller.model').set('queryResult', data);
-        self.get('controller').set('isQueryRunning', false);
+        self.get('controller.model').set('isQueryRunning', false);
 
         let localArr = self.get('controller.model').get("jobData");
         localArr.push(data);
@@ -299,7 +299,7 @@ export default Ember.Route.extend({
           console.log('getJob route', data );
           self.get('controller').set('queryResult', data);
           self.get('controller.model').set('queryResult', data);
-          self.get('controller').set('isQueryRunning', false);
+          self.get('controller.model').set('isQueryRunning', false);
           self.get('controller.model').set('hidePreviousButton', false);
 
           let localArr = self.get('controller.model').get("jobData");

http://git-wip-us.apache.org/repos/asf/ambari/blob/589f567e/contrib/views/hive20/src/main/resources/ui/app/templates/queries/query.hbs
----------------------------------------------------------------------
diff --git a/contrib/views/hive20/src/main/resources/ui/app/templates/queries/query.hbs b/contrib/views/hive20/src/main/resources/ui/app/templates/queries/query.hbs
index 7f91d6c..5cdc9b3 100644
--- a/contrib/views/hive20/src/main/resources/ui/app/templates/queries/query.hbs
+++ b/contrib/views/hive20/src/main/resources/ui/app/templates/queries/query.hbs
@@ -30,7 +30,7 @@
       <div class="row query-editor-controls">
         <button class="btn btn-success" {{action "executeQuery" }}>{{fa-icon "check"}}
Execute</button>
         <button class="btn btn-default" {{action "openWorksheetModal" }}>{{fa-icon
"save"}} Save As</button>
-        {{#if isQueryRunning}}
+        {{#if worksheet.isQueryRunning}}
           {{fa-icon "spinner fa-1-5" spin=true}}
         {{/if}}
       </div>


Mime
View raw message