ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From yus...@apache.org
Subject ambari git commit: AMBARI-12971. Hive view visualization enhancements - error handling. (Pallav Kulshreshtha via yusaku)
Date Fri, 04 Sep 2015 17:17:16 GMT
Repository: ambari
Updated Branches:
  refs/heads/branch-2.1 77f716441 -> 3d72652f7


AMBARI-12971. Hive view visualization enhancements - error handling. (Pallav Kulshreshtha
via yusaku)


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

Branch: refs/heads/branch-2.1
Commit: 3d72652f7269258af0b994a8ad336652f1650b1c
Parents: 77f7164
Author: Yusaku Sako <yusaku@hortonworks.com>
Authored: Fri Sep 4 10:16:06 2015 -0700
Committer: Yusaku Sako <yusaku@hortonworks.com>
Committed: Fri Sep 4 10:17:09 2015 -0700

----------------------------------------------------------------------
 .../ui/hive-web/app/controllers/query-tabs.js   | 10 +++++++
 .../app/controllers/visualization-ui.js         |  7 +++--
 .../ui/hive-web/app/templates/query-tabs.hbs    | 30 ++++++++++++++------
 .../src/main/resources/ui/hive-web/bower.json   |  4 +--
 4 files changed, 39 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/3d72652f/contrib/views/hive/src/main/resources/ui/hive-web/app/controllers/query-tabs.js
----------------------------------------------------------------------
diff --git a/contrib/views/hive/src/main/resources/ui/hive-web/app/controllers/query-tabs.js
b/contrib/views/hive/src/main/resources/ui/hive-web/app/controllers/query-tabs.js
index 12b9110..a636b29 100644
--- a/contrib/views/hive/src/main/resources/ui/hive-web/app/controllers/query-tabs.js
+++ b/contrib/views/hive/src/main/resources/ui/hive-web/app/controllers/query-tabs.js
@@ -20,6 +20,11 @@ import Ember from 'ember';
 import constants from 'hive/utils/constants';
 
 export default Ember.Controller.extend({
+  jobProgressService: Ember.inject.service(constants.namingConventions.jobProgress),
+  openQueries   : Ember.inject.controller(constants.namingConventions.openQueries),
+  notifyService: Ember.inject.service(constants.namingConventions.notify),
+  index: Ember.inject.controller(),
+
   tabClassNames : "fa queries-icon query-context-tab",
 
   tabs: [
@@ -43,6 +48,7 @@ export default Ember.Controller.extend({
     Ember.Object.create({
       iconClass: 'fa-area-chart',
       id: 'visualization-icon',
+      type: 'visualization',
       action: 'toggleOverlay',
       tooltip: Ember.I18n.t('tooltips.visualization'),
       into: 'index',
@@ -155,6 +161,10 @@ export default Ember.Controller.extend({
     }
   },
 
+  showVisulization: function () {
+    return this.get('index.displayJobTabs');
+  }.property('index.content', 'index.jobSaveSucceeded'),
+
   actions: {
     toggleOverlay: function (tab) {
       if (tab !== this.get('default') && tab.get('active')) {

http://git-wip-us.apache.org/repos/asf/ambari/blob/3d72652f/contrib/views/hive/src/main/resources/ui/hive-web/app/controllers/visualization-ui.js
----------------------------------------------------------------------
diff --git a/contrib/views/hive/src/main/resources/ui/hive-web/app/controllers/visualization-ui.js
b/contrib/views/hive/src/main/resources/ui/hive-web/app/controllers/visualization-ui.js
index 3376a03..5ba22e4 100644
--- a/contrib/views/hive/src/main/resources/ui/hive-web/app/controllers/visualization-ui.js
+++ b/contrib/views/hive/src/main/resources/ui/hive-web/app/controllers/visualization-ui.js
@@ -20,7 +20,6 @@ import Ember from 'ember';
 import constants from 'hive/utils/constants';
 
 export default Ember.Controller.extend({
-
   needs: [ constants.namingConventions.index,
             constants.namingConventions.openQueries,
             constants.namingConventions.jobResults
@@ -63,6 +62,10 @@ export default Ember.Controller.extend({
         url += '/' + constants.namingConventions.jobs + '/' + model.get('id') + '/results?&first=true';
         url += '&count='+constants.visualizationRowCount+'&job_id='+model.get('id');
         if (existingJob) {
+          if(existingJob.results[0].rows.length === 0){
+            this.set("error", "Query has insufficient results to visualize the data.");
+            return;
+          }
           this.set("error", null);
           var id = model.get('id');
           this.set("polestarUrl", this.get('polestarPath') + "?url=" + url);
@@ -71,7 +74,7 @@ export default Ember.Controller.extend({
             self.alterIframe();
           });
         } else {
-          this.set("error", "No visualization available. Please execute a query and wait
for the results to visualize data.");
+          this.set("error", "No visualization available. Please execute a query and wait
for the results to visualize the data.");
         }
       }
     }

http://git-wip-us.apache.org/repos/asf/ambari/blob/3d72652f/contrib/views/hive/src/main/resources/ui/hive-web/app/templates/query-tabs.hbs
----------------------------------------------------------------------
diff --git a/contrib/views/hive/src/main/resources/ui/hive-web/app/templates/query-tabs.hbs
b/contrib/views/hive/src/main/resources/ui/hive-web/app/templates/query-tabs.hbs
index bea77ba..6b1f8f5 100644
--- a/contrib/views/hive/src/main/resources/ui/hive-web/app/templates/query-tabs.hbs
+++ b/contrib/views/hive/src/main/resources/ui/hive-web/app/templates/query-tabs.hbs
@@ -17,13 +17,27 @@
 }}
 
 {{#each tab in tabs}}
-    <span {{action tab.action tab}} {{bind-attr class=":query-menu-tab tabClassNames tab.iconClass
tab.active:active tab.flash:flash" title="tab.tooltip" id="tab.id"}}>
-      {{#if tab.badge}}
-        <span class="badge">{{tab.badge}}</span>
-      {{/if}}
+  {{#if tab.type}}
+    {{#if showVisulization}}
+        <span {{action tab.action tab}} {{bind-attr class=":query-menu-tab tabClassNames
tab.iconClass tab.active:active tab.flash:flash" title="tab.tooltip" id="tab.id"}}>
+          {{#if tab.badge}}
+            <span class="badge">{{tab.badge}}</span>
+          {{/if}}
 
-      {{#if tab.text}}
-        {{tab.text}}
-      {{/if}}
-    </span>
+          {{#if tab.text}}
+            {{tab.text}}
+          {{/if}}
+        </span>
+    {{/if}}
+    {{else}}
+      <span {{action tab.action tab}} {{bind-attr class=":query-menu-tab tabClassNames
tab.iconClass tab.active:active tab.flash:flash" title="tab.tooltip" id="tab.id"}}>
+        {{#if tab.badge}}
+          <span class="badge">{{tab.badge}}</span>
+        {{/if}}
+
+        {{#if tab.text}}
+          {{tab.text}}
+        {{/if}}
+      </span>
+  {{/if}}
 {{/each}}

http://git-wip-us.apache.org/repos/asf/ambari/blob/3d72652f/contrib/views/hive/src/main/resources/ui/hive-web/bower.json
----------------------------------------------------------------------
diff --git a/contrib/views/hive/src/main/resources/ui/hive-web/bower.json b/contrib/views/hive/src/main/resources/ui/hive-web/bower.json
index 0b26eba..d43881f 100644
--- a/contrib/views/hive/src/main/resources/ui/hive-web/bower.json
+++ b/contrib/views/hive/src/main/resources/ui/hive-web/bower.json
@@ -18,8 +18,8 @@
     "jquery-ui": "~1.11.2",
     "selectize": "~0.12.0",
     "pretender": "0.1.0",
-    "polestar": "https://github.com/vivekratnavel/polestar.git",
-    "voyager": "https://github.com/vivekratnavel/voyager.git"
+    "polestar": "https://github.com/pallavkul/polestar.git",
+    "voyager": "https://github.com/pallavkul/voyager.git"
   },
   "resolutions": {
     "ember": "1.10.0"


Mime
View raw message