This is an automated email from the ASF dual-hosted git repository.

maximebeauchemin pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-superset.git


The following commit(s) were added to refs/heads/master by this push:
     new 033ba2c  Improve the chart type of Visualize in sqllab (#3241)
033ba2c is described below

commit 033ba2cb66c4decbbdf6f534a2351c2193196477
Author: eeve <eev...@gmail.com>
AuthorDate: Thu Aug 10 00:12:21 2017 +0800

    Improve the chart type of Visualize in sqllab (#3241)
    
    * Improve the chart type of Visualize in sqllab & Add some css & Fix the 
link address in the navbar
    
    * add vizTypes filter
---
 .../javascripts/SqlLab/components/VisualizeModal.jsx  | 17 +++++++++++------
 .../assets/javascripts/explore/stores/visTypes.js     |  4 ++++
 superset/assets/stylesheets/superset.css              | 19 +++++++++++++++++++
 superset/templates/appbuilder/navbar.html             |  4 ++--
 4 files changed, 36 insertions(+), 8 deletions(-)

diff --git a/superset/assets/javascripts/SqlLab/components/VisualizeModal.jsx 
b/superset/assets/javascripts/SqlLab/components/VisualizeModal.jsx
index dce820c..56a66d3 100644
--- a/superset/assets/javascripts/SqlLab/components/VisualizeModal.jsx
+++ b/superset/assets/javascripts/SqlLab/components/VisualizeModal.jsx
@@ -13,13 +13,18 @@ import { getExploreUrl } from '../../explore/exploreUtils';
 import * as actions from '../actions';
 import { VISUALIZE_VALIDATION_ERRORS } from '../constants';
 import { QUERY_TIMEOUT_THRESHOLD } from '../../constants';
+import visTypes from '../../explore/stores/visTypes';
 
-const CHART_TYPES = [
-  { value: 'dist_bar', label: 'Distribution - Bar Chart', requiresTime: false 
},
-  { value: 'pie', label: 'Pie Chart', requiresTime: false },
-  { value: 'line', label: 'Time Series - Line Chart', requiresTime: true },
-  { value: 'bar', label: 'Time Series - Bar Chart', requiresTime: true },
-];
+const CHART_TYPES = Object.keys(visTypes)
+  .filter(typeName => !!visTypes[typeName].showOnExplore)
+  .map((typeName) => {
+    const vis = visTypes[typeName];
+    return {
+      value: typeName,
+      label: vis.label,
+      requiresTime: !!vis.requiresTime,
+    };
+  });
 
 const propTypes = {
   actions: PropTypes.object.isRequired,
diff --git a/superset/assets/javascripts/explore/stores/visTypes.js 
b/superset/assets/javascripts/explore/stores/visTypes.js
index 1df8e11..e937b03 100644
--- a/superset/assets/javascripts/explore/stores/visTypes.js
+++ b/superset/assets/javascripts/explore/stores/visTypes.js
@@ -78,6 +78,7 @@ export const sections = {
 export const visTypes = {
   dist_bar: {
     label: 'Distribution - Bar Chart',
+    showOnExplore: true,
     controlPanelSections: [
       {
         label: 'Chart Options',
@@ -108,6 +109,7 @@ export const visTypes = {
 
   pie: {
     label: 'Pie Chart',
+    showOnExplore: true,
     controlPanelSections: [
       {
         label: null,
@@ -124,6 +126,7 @@ export const visTypes = {
 
   line: {
     label: 'Time Series - Line Chart',
+    showOnExplore: true,
     requiresTime: true,
     controlPanelSections: [
       sections.NVD3TimeSeries[0],
@@ -194,6 +197,7 @@ export const visTypes = {
 
   bar: {
     label: 'Time Series - Bar Chart',
+    showOnExplore: true,
     requiresTime: true,
     controlPanelSections: [
       sections.NVD3TimeSeries[0],
diff --git a/superset/assets/stylesheets/superset.css 
b/superset/assets/stylesheets/superset.css
index 2004133..aa5678c 100644
--- a/superset/assets/stylesheets/superset.css
+++ b/superset/assets/stylesheets/superset.css
@@ -237,3 +237,22 @@ div.widget .slice_container {
 .Select-menu-outer {
     z-index: 10 !important;
 }
+
+/** not found record **/
+.panel b {
+    display: inline-block;
+    width: 98%;
+    padding: 2rem;
+    margin: 0 1% 20px 1%;
+    background: #f8f8f8;
+}
+
+/** table on both sides of the gap **/
+.panel .table-responsive{
+    margin: 0 1%;
+}
+@media screen and (max-width: 767px) {
+    .panel .table-responsive{
+        width: 98%;
+    }
+}
\ No newline at end of file
diff --git a/superset/templates/appbuilder/navbar.html 
b/superset/templates/appbuilder/navbar.html
index b5c3d0a..0ea2dae 100644
--- a/superset/templates/appbuilder/navbar.html
+++ b/superset/templates/appbuilder/navbar.html
@@ -34,12 +34,12 @@
           </a>
         </li>
         <li>
-          <a href="https://github.com/airbnb/superset"; title="Superset's 
Github">
+          <a href="https://github.com/apache/incubator-superset"; 
title="Superset's Github">
             <i class="fa fa-github"></i> &nbsp;
           </a>
         </li>
         <li>
-          <a href="http://airbnb.io/superset"; title="Documentation">
+          <a href="https://superset.incubator.apache.org"; 
title="Documentation">
             <i class="fa fa-book"></i> &nbsp;
           </a>
         </li>

-- 
To stop receiving notification emails like this one, please contact
['"comm...@superset.apache.org" <comm...@superset.apache.org>'].

Reply via email to