You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@superset.apache.org by di...@apache.org on 2024/08/08 16:21:06 UTC
(superset) 01/01: fix(PivotTable): Pass string only to safeHtmlSpan
This is an automated email from the ASF dual-hosted git repository.
diegopucci pushed a commit to branch geido/fix/table-safehtml
in repository https://gitbox.apache.org/repos/asf/superset.git
commit 037fadac2fbbe668da3106745148915ec529ea5d
Author: Diego Pucci <di...@gmail.com>
AuthorDate: Thu Aug 8 19:20:47 2024 +0300
fix(PivotTable): Pass string only to safeHtmlSpan
---
.../src/react-pivottable/TableRenderers.jsx | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/superset-frontend/plugins/plugin-chart-pivot-table/src/react-pivottable/TableRenderers.jsx b/superset-frontend/plugins/plugin-chart-pivot-table/src/react-pivottable/TableRenderers.jsx
index a9c5a29ff0..06085a42ad 100644
--- a/superset-frontend/plugins/plugin-chart-pivot-table/src/react-pivottable/TableRenderers.jsx
+++ b/superset-frontend/plugins/plugin-chart-pivot-table/src/react-pivottable/TableRenderers.jsx
@@ -44,9 +44,10 @@ function displayHeaderCell(
) {
const name = namesMapping[value] || value;
const parsedLabel = parseLabel(name);
- const labelContent = allowRenderHtml
- ? safeHtmlSpan(parsedLabel)
- : parsedLabel;
+ const labelContent =
+ allowRenderHtml && typeof parsedLabel === 'string'
+ ? safeHtmlSpan(parsedLabel)
+ : parsedLabel;
return needToggle ? (
<span className="toggle-wrapper">
<span