mirror of
https://github.com/apache/superset.git
synced 2026-04-19 16:14:52 +00:00
feat: make data tables support html (#24368)
This commit is contained in:
committed by
GitHub
parent
19a94009b0
commit
d2b0b8eac5
@@ -21,6 +21,7 @@ import {
|
||||
css,
|
||||
GenericDataType,
|
||||
getTimeFormatter,
|
||||
safeHtmlSpan,
|
||||
styled,
|
||||
t,
|
||||
TimeFormats,
|
||||
@@ -263,6 +264,7 @@ export const useTableColumns = (
|
||||
datasourceId?: string,
|
||||
isVisible?: boolean,
|
||||
moreConfigs?: { [key: string]: Partial<Column> },
|
||||
allowHTML?: boolean,
|
||||
) => {
|
||||
const [originalFormattedTimeColumns, setOriginalFormattedTimeColumns] =
|
||||
useState<string[]>(getTimeColumns(datasourceId));
|
||||
@@ -346,6 +348,9 @@ export const useTableColumns = (
|
||||
) {
|
||||
return timeFormatter(value);
|
||||
}
|
||||
if (typeof value === 'string' && allowHTML) {
|
||||
return safeHtmlSpan(value);
|
||||
}
|
||||
return String(value);
|
||||
},
|
||||
...moreConfigs?.[key],
|
||||
|
||||
Reference in New Issue
Block a user