From c0eff8faf6389ced142ad2e2f45768b0f5948544 Mon Sep 17 00:00:00 2001 From: Ville Brofeldt <33317356+villebro@users.noreply.github.com> Date: Thu, 10 Jun 2021 16:56:55 +0300 Subject: [PATCH] fix(native-filters): empty label indicator (#15084) --- .../src/filters/components/Select/SelectFilterPlugin.test.tsx | 4 ++-- .../src/filters/components/Select/SelectFilterPlugin.tsx | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/superset-frontend/src/filters/components/Select/SelectFilterPlugin.test.tsx b/superset-frontend/src/filters/components/Select/SelectFilterPlugin.test.tsx index e2ed21c90..549217619 100644 --- a/superset-frontend/src/filters/components/Select/SelectFilterPlugin.test.tsx +++ b/superset-frontend/src/filters/components/Select/SelectFilterPlugin.test.tsx @@ -150,7 +150,7 @@ describe('SelectFilterPlugin', () => { ], }, filterState: { - label: '', + label: undefined, value: null, }, }); @@ -165,7 +165,7 @@ describe('SelectFilterPlugin', () => { }, extraFormData: {}, filterState: { - label: '', + label: undefined, value: null, }, }); diff --git a/superset-frontend/src/filters/components/Select/SelectFilterPlugin.tsx b/superset-frontend/src/filters/components/Select/SelectFilterPlugin.tsx index 305667c29..3051e3fff 100644 --- a/superset-frontend/src/filters/components/Select/SelectFilterPlugin.tsx +++ b/superset-frontend/src/filters/components/Select/SelectFilterPlugin.tsx @@ -138,7 +138,9 @@ export default function PluginFilterSelect(props: PluginFilterSelectProps) { inverseSelection, ), filterState: { - label: `${(values || []).join(', ')}${suffix}`, + label: values?.length + ? `${(values || []).join(', ')}${suffix}` + : undefined, value: appSection === AppSection.FILTER_CONFIG_MODAL && defaultToFirstItem ? undefined