bugfix: table chart query mode initial value (#10544)
This commit is contained in:
parent
363abfa1a5
commit
ea0db0d195
|
|
@ -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' });
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in New Issue