You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by GitBox <gi...@apache.org> on 2018/11/01 16:43:09 UTC

[GitHub] michellethomas closed pull request #6236: Dashboard filter box default

michellethomas closed pull request #6236: Dashboard filter box default
URL: https://github.com/apache/incubator-superset/pull/6236
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/superset/assets/cypress/integration/explore/visualizations/filter_box.js b/superset/assets/cypress/integration/explore/visualizations/filter_box.js
new file mode 100644
index 0000000000..4bba77a90d
--- /dev/null
+++ b/superset/assets/cypress/integration/explore/visualizations/filter_box.js
@@ -0,0 +1,25 @@
+import { FORM_DATA_DEFAULTS } from './shared.helper';
+
+export default () => describe('FilterBox', () => {
+  const VIZ_DEFAULTS = { ...FORM_DATA_DEFAULTS, viz_type: 'filter_box' };
+
+  function verify(formData) {
+    cy.visitChartByParams(JSON.stringify(formData));
+    cy.verifySliceSuccess({ waitAlias: '@getJson' });
+  }
+
+  beforeEach(() => {
+    cy.server();
+    cy.login();
+    cy.route('POST', '/superset/explore_json/**').as('getJson');
+  });
+
+  it('should work with default date filter', () => {
+    verify(VIZ_DEFAULTS);
+    // Filter box should default to having a date filter with no filter selected
+    cy.get('div.filter_box').within(() => {
+      cy.get('span').contains('No filter');
+    });
+  });
+
+});
diff --git a/superset/assets/cypress/integration/explore/visualizations/index.test.js b/superset/assets/cypress/integration/explore/visualizations/index.test.js
index 2f28083209..7e140b1346 100644
--- a/superset/assets/cypress/integration/explore/visualizations/index.test.js
+++ b/superset/assets/cypress/integration/explore/visualizations/index.test.js
@@ -5,6 +5,7 @@ import BubbleTest from './bubble';
 import CompareTest from './compare';
 import DistBarTest from './dist_bar';
 import DualLineTest from './dual_line';
+import FilterBox from './filter_box';
 import HistogramTest from './histogram';
 import LineTest from './line';
 import PieTest from './pie';
@@ -23,6 +24,7 @@ describe('All Visualizations', () => {
   CompareTest();
   DistBarTest();
   DualLineTest();
+  FilterBox();
   HistogramTest();
   LineTest();
   PieTest();
diff --git a/superset/assets/src/visualizations/FilterBox/FilterBox.jsx b/superset/assets/src/visualizations/FilterBox/FilterBox.jsx
index 907e802025..cb79bb3a77 100644
--- a/superset/assets/src/visualizations/FilterBox/FilterBox.jsx
+++ b/superset/assets/src/visualizations/FilterBox/FilterBox.jsx
@@ -123,7 +123,7 @@ class FilterBox extends React.Component {
               label={t('Time range')}
               description={t('Select start and end date')}
               onChange={(...args) => { this.changeFilter(TIME_RANGE, ...args); }}
-              value={this.state.selectedValues[TIME_RANGE]}
+              value={this.state.selectedValues[TIME_RANGE] || 'No filter'}
             />
           </div>
         </div>


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org