feat: add option to disable rendering of html in sql lab and table chart (#27969)

Co-authored-by: Sonia <sonia.gautam@agoda.com>
This commit is contained in:
soniagtm
2024-04-12 01:46:34 +07:00
committed by GitHub
parent 7e679d56ea
commit 4f363e1180
8 changed files with 44 additions and 2 deletions

View File

@@ -237,6 +237,7 @@ export default function TableChart<D extends DataRecord = DataRecord>(
sticky = true, // whether to use sticky header
columnColorFormatters,
allowRearrangeColumns = false,
allowRenderHtml = true,
onContextMenu,
emitCrossFilters,
} = props;
@@ -469,7 +470,7 @@ export default function TableChart<D extends DataRecord = DataRecord>(
accessor: ((datum: D) => datum[key]) as never,
Cell: ({ value, row }: { value: DataRecordValue; row: Row<D> }) => {
const [isHtml, text] = formatColumnValue(column, value);
const html = isHtml ? { __html: text } : undefined;
const html = isHtml && allowRenderHtml ? { __html: text } : undefined;
let backgroundColor;
if (hasColumnColorFormatters) {