feat(viz): add query mode switch to table chart (#10113)

1, Replace table chart rendering from jquery.DataTables to react-table: apache-superset/superset-ui#623
2. Rearrange the control panel, replace GROUP BY and NOT GROUP BY with a "Query Mode" switch: apache-superset/superset-ui#609
This commit is contained in:
Jesse Yang
2020-06-28 21:37:04 -07:00
committed by GitHub
parent 3414f35792
commit 9bdfa055ac
34 changed files with 5549 additions and 9234 deletions

View File

@@ -105,6 +105,8 @@ describe('controlUtils', () => {
expanded: true,
controlSetRows: [
[
'metric',
'metrics',
{
name: 'all_columns',
config: {
@@ -213,7 +215,12 @@ describe('controlUtils', () => {
expect(control.value).toBe('stack');
control = getControlState('stacked_style', 'test-chart', state, 'FOO');
expect(control.value).toBe(null);
expect(control.value).toBeNull();
});
it('returns null for non-existent field', () => {
const control = getControlState('NON_EXISTENT', 'table', state);
expect(control).toBeNull();
});
it('applies the default function for metrics', () => {
@@ -254,7 +261,11 @@ describe('controlUtils', () => {
it('in formData', () => {
const controlsState = getAllControlsState('table', 'table', {}, {});
const formData = getFormDataFromControls(controlsState);
expect(formData.queryFields).toEqual({ all_columns: 'columns' });
expect(formData.queryFields).toEqual({
all_columns: 'columns',
metric: 'metrics',
metrics: 'metrics',
});
});
});
});