mirror of
https://github.com/apache/superset.git
synced 2026-04-19 08:04:53 +00:00
feat: Add controlGroups to formData (#9740)
This commit is contained in:
@@ -23,7 +23,9 @@ import { t } from '@superset-ui/translation';
|
||||
import {
|
||||
getControlConfig,
|
||||
getControlState,
|
||||
getFormDataFromControls,
|
||||
applyMapStateToPropsToControl,
|
||||
getAllControlsState,
|
||||
} from '../../../src/explore/controlUtils';
|
||||
import ColumnOption from '../../../src/components/ColumnOption';
|
||||
|
||||
@@ -107,6 +109,7 @@ describe('controlUtils', () => {
|
||||
name: 'all_columns',
|
||||
config: {
|
||||
type: 'SelectControl',
|
||||
controlGroup: 'columns',
|
||||
multi: true,
|
||||
label: t('Columns'),
|
||||
default: [],
|
||||
@@ -246,4 +249,12 @@ describe('controlUtils', () => {
|
||||
expect(control.validationErrors).toEqual(['cannot be empty']);
|
||||
});
|
||||
});
|
||||
|
||||
describe('controlGroup', () => {
|
||||
it('in formData', () => {
|
||||
const controlsState = getAllControlsState('table', 'table', {}, {});
|
||||
const formData = getFormDataFromControls(controlsState);
|
||||
expect(formData.controlGroups).toEqual({ all_columns: 'columns' });
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user