You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@superset.apache.org by yj...@apache.org on 2020/08/07 09:26:10 UTC

[incubator-superset] branch master updated: bugfix: table chart query mode initial value (#10544)

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

yjc 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 ea0db0d  bugfix: table chart query mode initial value (#10544)
ea0db0d is described below

commit ea0db0d1951039757a69d321ea920e0b6fdada67
Author: Jesse Yang <je...@airbnb.com>
AuthorDate: Fri Aug 7 02:25:48 2020 -0700

    bugfix: table chart query mode initial value (#10544)
---
 .../cypress/integration/explore/visualizations/table.test.ts           | 3 ++-
 superset-frontend/src/explore/controlUtils.js                          | 2 +-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/superset-frontend/cypress-base/cypress/integration/explore/visualizations/table.test.ts b/superset-frontend/cypress-base/cypress/integration/explore/visualizations/table.test.ts
index f01e1c7..8fa3041 100644
--- a/superset-frontend/cypress-base/cypress/integration/explore/visualizations/table.test.ts
+++ b/superset-frontend/cypress-base/cypress/integration/explore/visualizations/table.test.ts
@@ -165,8 +165,9 @@ describe('Visualization > Table', () => {
       metrics: [],
       row_limit: 10,
     };
-
     cy.visitChartByParams(JSON.stringify(formData));
+
+    cy.get('div[data-test="query_mode"] .btn.active').contains('Raw Records');
     cy.verifySliceSuccess({ waitAlias: '@getJson', chartSelector: 'table' });
   });
 
diff --git a/superset-frontend/src/explore/controlUtils.js b/superset-frontend/src/explore/controlUtils.js
index 3ad0561..aac8d45 100644
--- a/superset-frontend/src/explore/controlUtils.js
+++ b/superset-frontend/src/explore/controlUtils.js
@@ -110,7 +110,6 @@ function handleMissingChoice(control) {
 
 export function applyMapStateToPropsToControl(controlState, controlPanelState) {
   const { mapStateToProps } = controlState;
-  let { value } = controlState;
   let state = { ...controlState };
   if (mapStateToProps && controlPanelState) {
     state = {
@@ -126,6 +125,7 @@ export function applyMapStateToPropsToControl(controlState, controlPanelState) {
       delete state.default;
     }
   }
+  let { value } = state;
   // If no current value, set it as default
   if (state.default && value === undefined) {
     value = state.default;