From 19151d1e4a6d735f4229a28eae2c6b00e1409227 Mon Sep 17 00:00:00 2001 From: SBIN2010 Date: Tue, 22 Oct 2024 23:07:40 +0300 Subject: [PATCH 1/9] fix: fixed Add Metrics to Tree Chart (#29158) --- .../plugins/plugin-chart-echarts/src/Tree/controlPanel.tsx | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/superset-frontend/plugins/plugin-chart-echarts/src/Tree/controlPanel.tsx b/superset-frontend/plugins/plugin-chart-echarts/src/Tree/controlPanel.tsx index 34d65a27d315..26fafbdc1b7f 100644 --- a/superset-frontend/plugins/plugin-chart-echarts/src/Tree/controlPanel.tsx +++ b/superset-frontend/plugins/plugin-chart-echarts/src/Tree/controlPanel.tsx @@ -89,9 +89,7 @@ const controlPanel: ControlPanelConfig = { { name: 'metric', config: { - ...optionalEntity, - type: 'DndMetricSelect', - label: t('Metric'), + ...sharedControls.metric, description: t('Metric for node values'), }, }, From 35aaeb66bf9d01a4e3f1cb7c9c92989b1503b25e Mon Sep 17 00:00:00 2001 From: SBIN2010 Date: Tue, 22 Oct 2024 23:45:27 +0300 Subject: [PATCH 2/9] fix: clear modal after CSS templates is added --- .../src/features/cssTemplates/CssTemplateModal.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/superset-frontend/src/features/cssTemplates/CssTemplateModal.tsx b/superset-frontend/src/features/cssTemplates/CssTemplateModal.tsx index 16af9e7039d3..74f0491543ea 100644 --- a/superset-frontend/src/features/cssTemplates/CssTemplateModal.tsx +++ b/superset-frontend/src/features/cssTemplates/CssTemplateModal.tsx @@ -131,7 +131,10 @@ const CssTemplateModal: FunctionComponent = ({ if (onCssTemplateAdd) { onCssTemplateAdd(); } - + setCurrentCssTemplate({ + template_name: '', + css: '', + }); hide(); }); } From db3afda17db52cf217af4f20b09a4d1e09848117 Mon Sep 17 00:00:00 2001 From: SBIN2010 Date: Wed, 23 Oct 2024 22:15:52 +0300 Subject: [PATCH 3/9] Revert "fix: clear modal after CSS templates is added" This reverts commit 35aaeb66bf9d01a4e3f1cb7c9c92989b1503b25e. --- .../src/features/cssTemplates/CssTemplateModal.tsx | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/superset-frontend/src/features/cssTemplates/CssTemplateModal.tsx b/superset-frontend/src/features/cssTemplates/CssTemplateModal.tsx index 74f0491543ea..16af9e7039d3 100644 --- a/superset-frontend/src/features/cssTemplates/CssTemplateModal.tsx +++ b/superset-frontend/src/features/cssTemplates/CssTemplateModal.tsx @@ -131,10 +131,7 @@ const CssTemplateModal: FunctionComponent = ({ if (onCssTemplateAdd) { onCssTemplateAdd(); } - setCurrentCssTemplate({ - template_name: '', - css: '', - }); + hide(); }); } From 9eea2e6fd6ac5cf4f41ae91b2941a9bfea82718b Mon Sep 17 00:00:00 2001 From: SBIN2010 Date: Mon, 25 Nov 2024 21:45:32 +0300 Subject: [PATCH 4/9] fix: tree metrics exclude validator --- .../plugins/plugin-chart-echarts/src/Tree/controlPanel.tsx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/superset-frontend/plugins/plugin-chart-echarts/src/Tree/controlPanel.tsx b/superset-frontend/plugins/plugin-chart-echarts/src/Tree/controlPanel.tsx index 26fafbdc1b7f..4d8b0fa978ee 100644 --- a/superset-frontend/plugins/plugin-chart-echarts/src/Tree/controlPanel.tsx +++ b/superset-frontend/plugins/plugin-chart-echarts/src/Tree/controlPanel.tsx @@ -90,6 +90,8 @@ const controlPanel: ControlPanelConfig = { name: 'metric', config: { ...sharedControls.metric, + clearable: true, + validators: [], description: t('Metric for node values'), }, }, From 601dde2bb5fbde32df0a7311559b2ccf7e4773e0 Mon Sep 17 00:00:00 2001 From: SBIN2010 Date: Tue, 25 Mar 2025 15:06:36 +0300 Subject: [PATCH 5/9] fix: revert #30679 --- .../plugins/plugin-chart-echarts/src/Tree/controlPanel.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/superset-frontend/plugins/plugin-chart-echarts/src/Tree/controlPanel.tsx b/superset-frontend/plugins/plugin-chart-echarts/src/Tree/controlPanel.tsx index 4d8b0fa978ee..34d65a27d315 100644 --- a/superset-frontend/plugins/plugin-chart-echarts/src/Tree/controlPanel.tsx +++ b/superset-frontend/plugins/plugin-chart-echarts/src/Tree/controlPanel.tsx @@ -89,9 +89,9 @@ const controlPanel: ControlPanelConfig = { { name: 'metric', config: { - ...sharedControls.metric, - clearable: true, - validators: [], + ...optionalEntity, + type: 'DndMetricSelect', + label: t('Metric'), description: t('Metric for node values'), }, }, From 1bf4fdda7732c9c57c2bddcf001078e3cf9fe68a Mon Sep 17 00:00:00 2001 From: SBIN2010 Date: Sun, 20 Jul 2025 22:04:40 +0300 Subject: [PATCH 6/9] fix --- .../plugins/plugin-chart-echarts/src/Tree/controlPanel.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/superset-frontend/plugins/plugin-chart-echarts/src/Tree/controlPanel.tsx b/superset-frontend/plugins/plugin-chart-echarts/src/Tree/controlPanel.tsx index 34d65a27d315..4d8b0fa978ee 100644 --- a/superset-frontend/plugins/plugin-chart-echarts/src/Tree/controlPanel.tsx +++ b/superset-frontend/plugins/plugin-chart-echarts/src/Tree/controlPanel.tsx @@ -89,9 +89,9 @@ const controlPanel: ControlPanelConfig = { { name: 'metric', config: { - ...optionalEntity, - type: 'DndMetricSelect', - label: t('Metric'), + ...sharedControls.metric, + clearable: true, + validators: [], description: t('Metric for node values'), }, }, From 354dee81c16cd97a5e513823e938db1cc4ba47e4 Mon Sep 17 00:00:00 2001 From: SBIN2010 Date: Tue, 27 Jan 2026 00:06:33 +0300 Subject: [PATCH 7/9] fix: tokenSeparators is overridden by default --- .../packages/superset-ui-chart-controls/src/types.ts | 1 + .../components/controls/ColumnConfigControl/constants.tsx | 1 + 2 files changed, 2 insertions(+) diff --git a/superset-frontend/packages/superset-ui-chart-controls/src/types.ts b/superset-frontend/packages/superset-ui-chart-controls/src/types.ts index 115eb0b65b65..3d009d5ad220 100644 --- a/superset-frontend/packages/superset-ui-chart-controls/src/types.ts +++ b/superset-frontend/packages/superset-ui-chart-controls/src/types.ts @@ -572,6 +572,7 @@ export type ControlFormItemSpec = { creatable?: boolean; minWidth?: number | string; validators?: ControlFormValueValidator[]; + tokenSeparators?: string[]; } : T extends 'RadioButtonControl' ? { diff --git a/superset-frontend/src/explore/components/controls/ColumnConfigControl/constants.tsx b/superset-frontend/src/explore/components/controls/ColumnConfigControl/constants.tsx index 1275242fe7b8..9b450b6b24b6 100644 --- a/superset-frontend/src/explore/components/controls/ColumnConfigControl/constants.tsx +++ b/superset-frontend/src/explore/components/controls/ColumnConfigControl/constants.tsx @@ -58,6 +58,7 @@ const d3NumberFormat: ControlFormItemSpec<'Select'> = { creatable: true, minWidth: '14em', debounceDelay: 500, + tokenSeparators: ['\r\n', '\n', '\t', ';'], }; const d3TimeFormat: ControlFormItemSpec<'Select'> = { From 5a2d7c64962b50678f1fe90710681e8d3e41fbe2 Mon Sep 17 00:00:00 2001 From: SBIN2010 Date: Tue, 27 Jan 2026 00:31:19 +0300 Subject: [PATCH 8/9] fix: add docs for tokenSeparators and default path --- .../components/controls/ColumnConfigControl/constants.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/superset-frontend/src/explore/components/controls/ColumnConfigControl/constants.tsx b/superset-frontend/src/explore/components/controls/ColumnConfigControl/constants.tsx index 9b450b6b24b6..19cc7a2e5b9e 100644 --- a/superset-frontend/src/explore/components/controls/ColumnConfigControl/constants.tsx +++ b/superset-frontend/src/explore/components/controls/ColumnConfigControl/constants.tsx @@ -58,6 +58,7 @@ const d3NumberFormat: ControlFormItemSpec<'Select'> = { creatable: true, minWidth: '14em', debounceDelay: 500, + // default value tokenSeparators in superset-frontend/packages/superset-ui-core/src/components/Select/constants.ts tokenSeparators: ['\r\n', '\n', '\t', ';'], }; From 4b90d9ebda6f4e6eabaed0b4cfcf7968e0ea3135 Mon Sep 17 00:00:00 2001 From: SBIN2010 Date: Tue, 27 Jan 2026 14:12:19 +0300 Subject: [PATCH 9/9] fix: add test --- .../ColumnConfigConstants.test.tsx | 33 +++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 superset-frontend/src/explore/components/controls/ColumnConfigControl/ColumnConfigConstants.test.tsx diff --git a/superset-frontend/src/explore/components/controls/ColumnConfigControl/ColumnConfigConstants.test.tsx b/superset-frontend/src/explore/components/controls/ColumnConfigControl/ColumnConfigConstants.test.tsx new file mode 100644 index 000000000000..8d09344a15df --- /dev/null +++ b/superset-frontend/src/explore/components/controls/ColumnConfigControl/ColumnConfigConstants.test.tsx @@ -0,0 +1,33 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +import { SHARED_COLUMN_CONFIG_PROPS } from './constants'; + +const tokenSeparators = + SHARED_COLUMN_CONFIG_PROPS.d3NumberFormat.tokenSeparators; + +test('should allow commas in D3 format inputs', () => { + expect(tokenSeparators).toBeDefined(); + expect(tokenSeparators).not.toContain(','); +}); + +test('should have correct default token separators', () => { + const expectedSeparators = ['\r\n', '\n', '\t', ';']; + expect(tokenSeparators).toEqual(expectedSeparators); +});