From 36de05fe366ff73f2caf65988a4e82206faa9f41 Mon Sep 17 00:00:00 2001 From: Maxime Beauchemin Date: Wed, 8 Apr 2026 12:25:54 -0700 Subject: [PATCH] fix(plugin-chart-handlebars): improve CSS sanitization tooltip and hide when not needed (#39180) Co-authored-by: Claude Opus 4.6 --- .../src/plugin/controls/style.tsx | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/superset-frontend/plugins/plugin-chart-handlebars/src/plugin/controls/style.tsx b/superset-frontend/plugins/plugin-chart-handlebars/src/plugin/controls/style.tsx index ce4b6cf48bf..b38635faa6d 100644 --- a/superset-frontend/plugins/plugin-chart-handlebars/src/plugin/controls/style.tsx +++ b/superset-frontend/plugins/plugin-chart-handlebars/src/plugin/controls/style.tsx @@ -30,10 +30,12 @@ import { debounceFunc } from '../../consts'; interface StyleCustomControlProps { value: string; + htmlSanitization: boolean; } const StyleControl = (props: CustomControlConfig) => { const theme = useTheme(); + const htmlSanitization = props.htmlSanitization ?? true; const defaultValue = props?.value ? undefined @@ -48,10 +50,16 @@ const StyleControl = (props: CustomControlConfig) => {
{props.label} - + {htmlSanitization && ( + + )}
({ + mapStateToProps: ({ controls, common }) => ({ value: controls?.handlebars_template?.value, + htmlSanitization: common?.conf?.HTML_SANITIZATION ?? true, }), }, };