You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by yu...@apache.org on 2015/09/04 19:16:46 UTC
ambari git commit: AMBARI-12971. Hive view visualization enhancements
- error handling. (Pallav Kulshreshtha via yusaku)
Repository: ambari
Updated Branches:
refs/heads/trunk d257b12be -> 98d3f320f
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/98d3f320
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/98d3f320
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/98d3f320
Branch: refs/heads/trunk
Commit: 98d3f320fa2f4f0770645c9cccd9ae8fc8aa109e
Parents: d257b12
Author: Yusaku Sako <yu...@hortonworks.com>
Authored: Fri Sep 4 10:16:06 2015 -0700
Committer: Yusaku Sako <yu...@hortonworks.com>
Committed: Fri Sep 4 10:16:30 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/98d3f320/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/98d3f320/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/98d3f320/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/98d3f320/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"