superset-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ccwilli...@apache.org
Subject [incubator-superset] branch dashboard-builder updated: [dashboard v2] lint javascript
Date Fri, 22 Jun 2018 01:36:28 GMT
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/dashboard-builder by this push:
     new fe5d9ca  [dashboard v2] lint javascript
fe5d9ca is described below

commit fe5d9cad50839b2e460df07e01c9da63d0d308fa
Author: Chris Williams <chris.williams@airbnb.com>
AuthorDate: Thu Jun 21 18:36:00 2018 -0700

    [dashboard v2] lint javascript
---
 superset/assets/src/dashboard/components/Dashboard.jsx          | 1 +
 superset/assets/src/dashboard/containers/Chart.jsx              | 5 ++++-
 superset/assets/src/dashboard/containers/Dashboard.jsx          | 5 ++++-
 superset/assets/src/dashboard/containers/DashboardBuilder.jsx   | 5 ++++-
 superset/assets/src/dashboard/containers/DashboardComponent.jsx | 5 ++++-
 superset/assets/src/dashboard/containers/DashboardGrid.jsx      | 5 ++++-
 superset/assets/src/dashboard/containers/DashboardHeader.jsx    | 5 ++++-
 superset/assets/src/dashboard/containers/SliceAdder.jsx         | 5 ++++-
 superset/assets/src/dashboard/index.jsx                         | 5 ++++-
 superset/assets/src/dashboard/util/dashboardLayoutConverter.js  | 2 +-
 superset/assets/src/visualizations/deckgl/layers/scatter.jsx    | 4 ++--
 superset/assets/src/visualizations/deckgl/layers/screengrid.jsx | 4 ++--
 superset/assets/src/visualizations/time_table.jsx               | 4 +++-
 13 files changed, 41 insertions(+), 14 deletions(-)

diff --git a/superset/assets/src/dashboard/components/Dashboard.jsx b/superset/assets/src/dashboard/components/Dashboard.jsx
index f069cd1..5f5479e 100644
--- a/superset/assets/src/dashboard/components/Dashboard.jsx
+++ b/superset/assets/src/dashboard/components/Dashboard.jsx
@@ -53,6 +53,7 @@ const defaultProps = {
 };
 
 class Dashboard extends React.PureComponent {
+  // eslint-disable-next-line react/sort-comp
   static onBeforeUnload(hasChanged) {
     if (hasChanged) {
       window.addEventListener('beforeunload', Dashboard.unload);
diff --git a/superset/assets/src/dashboard/containers/Chart.jsx b/superset/assets/src/dashboard/containers/Chart.jsx
index c046c02..b2f0795 100644
--- a/superset/assets/src/dashboard/containers/Chart.jsx
+++ b/superset/assets/src/dashboard/containers/Chart.jsx
@@ -58,4 +58,7 @@ function mapDispatchToProps(dispatch) {
   );
 }
 
-export default connect(mapStateToProps, mapDispatchToProps)(Chart);
+export default connect(
+  mapStateToProps,
+  mapDispatchToProps,
+)(Chart);
diff --git a/superset/assets/src/dashboard/containers/Dashboard.jsx b/superset/assets/src/dashboard/containers/Dashboard.jsx
index 3252af3..d43e448 100644
--- a/superset/assets/src/dashboard/containers/Dashboard.jsx
+++ b/superset/assets/src/dashboard/containers/Dashboard.jsx
@@ -50,4 +50,7 @@ function mapDispatchToProps(dispatch) {
   };
 }
 
-export default connect(mapStateToProps, mapDispatchToProps)(Dashboard);
+export default connect(
+  mapStateToProps,
+  mapDispatchToProps,
+)(Dashboard);
diff --git a/superset/assets/src/dashboard/containers/DashboardBuilder.jsx b/superset/assets/src/dashboard/containers/DashboardBuilder.jsx
index fde1e76..fb82b2a 100644
--- a/superset/assets/src/dashboard/containers/DashboardBuilder.jsx
+++ b/superset/assets/src/dashboard/containers/DashboardBuilder.jsx
@@ -27,4 +27,7 @@ function mapDispatchToProps(dispatch) {
   );
 }
 
-export default connect(mapStateToProps, mapDispatchToProps)(DashboardBuilder);
+export default connect(
+  mapStateToProps,
+  mapDispatchToProps,
+)(DashboardBuilder);
diff --git a/superset/assets/src/dashboard/containers/DashboardComponent.jsx b/superset/assets/src/dashboard/containers/DashboardComponent.jsx
index 6f5b2e0..c138f88 100644
--- a/superset/assets/src/dashboard/containers/DashboardComponent.jsx
+++ b/superset/assets/src/dashboard/containers/DashboardComponent.jsx
@@ -75,4 +75,7 @@ class DashboardComponent extends React.PureComponent {
 
 DashboardComponent.propTypes = propTypes;
 
-export default connect(mapStateToProps, mapDispatchToProps)(DashboardComponent);
+export default connect(
+  mapStateToProps,
+  mapDispatchToProps,
+)(DashboardComponent);
diff --git a/superset/assets/src/dashboard/containers/DashboardGrid.jsx b/superset/assets/src/dashboard/containers/DashboardGrid.jsx
index 718b543..d4ddd5e 100644
--- a/superset/assets/src/dashboard/containers/DashboardGrid.jsx
+++ b/superset/assets/src/dashboard/containers/DashboardGrid.jsx
@@ -23,4 +23,7 @@ function mapDispatchToProps(dispatch) {
   );
 }
 
-export default connect(mapStateToProps, mapDispatchToProps)(DashboardGrid);
+export default connect(
+  mapStateToProps,
+  mapDispatchToProps,
+)(DashboardGrid);
diff --git a/superset/assets/src/dashboard/containers/DashboardHeader.jsx b/superset/assets/src/dashboard/containers/DashboardHeader.jsx
index 32eda1a..dec97b7 100644
--- a/superset/assets/src/dashboard/containers/DashboardHeader.jsx
+++ b/superset/assets/src/dashboard/containers/DashboardHeader.jsx
@@ -79,4 +79,7 @@ function mapDispatchToProps(dispatch) {
   );
 }
 
-export default connect(mapStateToProps, mapDispatchToProps)(DashboardHeader);
+export default connect(
+  mapStateToProps,
+  mapDispatchToProps,
+)(DashboardHeader);
diff --git a/superset/assets/src/dashboard/containers/SliceAdder.jsx b/superset/assets/src/dashboard/containers/SliceAdder.jsx
index e3d931d..5e58802 100644
--- a/superset/assets/src/dashboard/containers/SliceAdder.jsx
+++ b/superset/assets/src/dashboard/containers/SliceAdder.jsx
@@ -25,4 +25,7 @@ function mapDispatchToProps(dispatch) {
   );
 }
 
-export default connect(mapStateToProps, mapDispatchToProps)(SliceAdder);
+export default connect(
+  mapStateToProps,
+  mapDispatchToProps,
+)(SliceAdder);
diff --git a/superset/assets/src/dashboard/index.jsx b/superset/assets/src/dashboard/index.jsx
index 846b82d..e0e9830 100644
--- a/superset/assets/src/dashboard/index.jsx
+++ b/superset/assets/src/dashboard/index.jsx
@@ -21,7 +21,10 @@ const initState = getInitialState(bootstrapData);
 const store = createStore(
   rootReducer,
   initState,
-  compose(applyMiddleware(thunk), initEnhancer(false)),
+  compose(
+    applyMiddleware(thunk),
+    initEnhancer(false),
+  ),
 );
 
 ReactDOM.render(
diff --git a/superset/assets/src/dashboard/util/dashboardLayoutConverter.js b/superset/assets/src/dashboard/util/dashboardLayoutConverter.js
index 9b66e41..bd0674b 100644
--- a/superset/assets/src/dashboard/util/dashboardLayoutConverter.js
+++ b/superset/assets/src/dashboard/util/dashboardLayoutConverter.js
@@ -85,7 +85,7 @@ function getChartHolder(item) {
   );
   const height = Math.max(
     GRID_MIN_ROW_UNITS,
-    Math.round(size_y / GRID_RATIO * 100 / ROW_HEIGHT),
+    Math.round(((size_y / GRID_RATIO) * 100) / ROW_HEIGHT),
   );
   if (code !== undefined) {
     let markdownContent = ' '; // white-space markdown
diff --git a/superset/assets/src/visualizations/deckgl/layers/scatter.jsx b/superset/assets/src/visualizations/deckgl/layers/scatter.jsx
index a137423..7689787 100644
--- a/superset/assets/src/visualizations/deckgl/layers/scatter.jsx
+++ b/superset/assets/src/visualizations/deckgl/layers/scatter.jsx
@@ -94,8 +94,8 @@ const propTypes = {
 };
 
 class DeckGLScatter extends React.PureComponent {
-  /* eslint-disable no-unused-vars */
-  static getDerivedStateFromProps(nextProps, prevState) {
+  /* eslint-disable-next-line react/sort-comp */
+  static getDerivedStateFromProps(nextProps) {
     const fd = nextProps.slice.formData;
 
     const timeGrain = fd.time_grain_sqla || fd.granularity || 'PT1M';
diff --git a/superset/assets/src/visualizations/deckgl/layers/screengrid.jsx b/superset/assets/src/visualizations/deckgl/layers/screengrid.jsx
index 974b7c4..cb21153 100644
--- a/superset/assets/src/visualizations/deckgl/layers/screengrid.jsx
+++ b/superset/assets/src/visualizations/deckgl/layers/screengrid.jsx
@@ -59,8 +59,8 @@ const propTypes = {
 };
 
 class DeckGLScreenGrid extends React.PureComponent {
-  /* eslint-disable no-unused-vars */
-  static getDerivedStateFromProps(nextProps, prevState) {
+  /* eslint-disable-next-line react/sort-comp */
+  static getDerivedStateFromProps(nextProps) {
     const fd = nextProps.slice.formData;
 
     const timeGrain = fd.time_grain_sqla || fd.granularity || 'PT1M';
diff --git a/superset/assets/src/visualizations/time_table.jsx b/superset/assets/src/visualizations/time_table.jsx
index a00aa36..900fc5f 100644
--- a/superset/assets/src/visualizations/time_table.jsx
+++ b/superset/assets/src/visualizations/time_table.jsx
@@ -71,7 +71,9 @@ function viz(slice, payload) {
         <MetricOption metric={metricData} url={url} showFormula={false} openInNewWindow
/>
       );
     } else {
-      leftCell = url ? <a href={url} target="_blank">{metricLabel}</a> : metric;
+      leftCell = url
+        ? <a href={url} rel="noopener noreferrer" target="_blank">{metricLabel}</a>
+        : metric;
     }
     const row = { metric: leftCell };
     fd.column_collection.forEach((column) => {


Mime
View raw message