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

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

commit 9a7c3929fa5afad97301a3dfbab8685423c0aede
Author: Jesse Yang <jesse.y...@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 ce3022e..122214e 100644
--- a/superset-frontend/src/explore/controlUtils.js
+++ b/superset-frontend/src/explore/controlUtils.js
@@ -111,7 +111,6 @@ function handleMissingChoice(control) {
 
 export function applyMapStateToPropsToControl(controlState, controlPanelState) 
{
   const { mapStateToProps } = controlState;
-  let { value } = controlState;
   let state = { ...controlState };
   if (mapStateToProps && controlPanelState) {
     state = {
@@ -127,6 +126,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;

Reply via email to