You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@superset.apache.org by vi...@apache.org on 2020/09/16 06:35:05 UTC
[incubator-superset] 09/28: bugfix: table chart query mode initial
value (#10544)
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 3b4882d836723ce26861d93aa7c0868e3e14ff0a
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 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;