From 640f5aca82dcca82cd7e0630c833e02daafc2873 Mon Sep 17 00:00:00 2001 From: Ville Brofeldt Date: Thu, 18 Mar 2021 15:38:23 +0200 Subject: [PATCH] fix(cross-filters): add a control panel to range filter --- .../filters/components/Range/controlPanel.ts | 30 ++++++++++++++++--- 1 file changed, 26 insertions(+), 4 deletions(-) diff --git a/superset-frontend/src/filters/components/Range/controlPanel.ts b/superset-frontend/src/filters/components/Range/controlPanel.ts index e7f31e3dc0bd4..8f9501d7a5077 100644 --- a/superset-frontend/src/filters/components/Range/controlPanel.ts +++ b/superset-frontend/src/filters/components/Range/controlPanel.ts @@ -16,12 +16,34 @@ * specific language governing permissions and limitations * under the License. */ -import { ControlPanelConfig, sections } from '@superset-ui/chart-controls'; +import { t } from '@superset-ui/core'; +import { + ControlPanelConfig, + sections, + sharedControls, +} from '@superset-ui/chart-controls'; const config: ControlPanelConfig = { - // @ts-ignore - controlPanelSections: [sections.legacyRegularTime], - // TODO: here to add the relevant controls + controlPanelSections: [ + sections.legacyRegularTime, + { + label: t('Query'), + expanded: true, + controlSetRows: [ + [ + { + name: 'groupby', + config: { + ...sharedControls.groupby, + label: 'Column', + description: + 'The numeric column based on which to calculate the range', + }, + }, + ], + ], + }, + ], }; export default config;