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 17:01:25 UTC

(superset) branch master updated: fix(PivotTable): Pass string only to safeHtmlSpan (#29895)

This is an automated email from the ASF dual-hosted git repository.

diegopucci pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/superset.git


The following commit(s) were added to refs/heads/master by this push:
     new fb6efb9e9a fix(PivotTable): Pass string only to safeHtmlSpan (#29895)
fb6efb9e9a is described below

commit fb6efb9e9a049ecd7985a50a902810484b0fc37a
Author: Geido <60...@users.noreply.github.com>
AuthorDate: Thu Aug 8 20:01:18 2024 +0300

    fix(PivotTable): Pass string only to safeHtmlSpan (#29895)
---
 .../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