diff --git a/package.json b/package.json index fc7c41884c..fdcb363214 100644 --- a/package.json +++ b/package.json @@ -134,7 +134,10 @@ }, "eslint": { "rules": { - "arrow-parens": ["warn", "as-needed"] + "arrow-parens": [ + "warn", + "as-needed" + ] }, "overrides": [ { diff --git a/packages/superset-ui-demo/storybook/stories/plugins/table/TableStories.tsx b/packages/superset-ui-demo/storybook/stories/plugins/table/TableStories.tsx index c56baff203..aa38524627 100644 --- a/packages/superset-ui-demo/storybook/stories/plugins/table/TableStories.tsx +++ b/packages/superset-ui-demo/storybook/stories/plugins/table/TableStories.tsx @@ -89,6 +89,7 @@ export const basic = () => ( orderDesc: true, pageLength: 0, percentMetrics: null, + showCellBars: true, tableFilter: false, tableTimestampFormat: '%Y-%m-%d %H:%M:%S', timeseriesLimitMetric: null, diff --git a/packages/superset-ui-demo/tsconfig.json b/packages/superset-ui-demo/tsconfig.json index 385c5ba1a9..4b0dc7536b 100644 --- a/packages/superset-ui-demo/tsconfig.json +++ b/packages/superset-ui-demo/tsconfig.json @@ -1,6 +1,7 @@ { "extends": "../../tsconfig.json", "compilerOptions": { + "jsx": "react", "outDir": "../../build/lib", "rootDir": "../../", "emitDeclarationOnly": false, diff --git a/plugins/table/src/ReactDataTable.tsx b/plugins/table/src/ReactDataTable.tsx index 3481c5ac1f..22f6c52376 100644 --- a/plugins/table/src/ReactDataTable.tsx +++ b/plugins/table/src/ReactDataTable.tsx @@ -52,6 +52,7 @@ export default function ReactDataTable(props: DataTableProps) { metrics: aggMetrics, pageLength, percentMetrics, + showCellBars = true, tableTimestampFormat, // orderDesc, // TODO: add back the broken dashboard filters feature @@ -236,6 +237,7 @@ export default function ReactDataTable(props: DataTableProps) { const keyIsMetric = metricsSet.has(key); const text = cellText(key, format, val); const isHtml = !keyIsMetric && isProbablyHTML(text); + const showCellBar = keyIsMetric && showCellBars; return ( diff --git a/plugins/table/src/transformProps.ts b/plugins/table/src/transformProps.ts index 38a3a6f628..cbadf5d3e9 100644 --- a/plugins/table/src/transformProps.ts +++ b/plugins/table/src/transformProps.ts @@ -38,6 +38,7 @@ export interface DataTableProps { alignPositiveNegative: boolean; colorPositiveNegative: boolean; columns: DataColumnMeta[]; + showCellBars: boolean; metrics: string[]; percentMetrics: string[]; includeSearch: boolean; @@ -55,6 +56,7 @@ export interface DataTableProps { export interface TableChartFormData { alignPn?: boolean; colorPn?: boolean; + showCellBars?: boolean; includeSearch?: boolean; orderDesc?: boolean; pageLength?: string; @@ -80,6 +82,7 @@ export default function transformProps(chartProps: ChartProps): DataTableProps { const { alignPn = true, colorPn = true, + showCellBars = true, includeSearch = false, orderDesc = false, pageLength = 0, @@ -118,6 +121,7 @@ export default function transformProps(chartProps: ChartProps): DataTableProps { percentMetrics, alignPositiveNegative: alignPn, colorPositiveNegative: colorPn, + showCellBars, includeSearch, orderDesc, pageLength: pageLength ? parseInt(pageLength, 10) : 0, diff --git a/plugins/table/test/testData.ts b/plugins/table/test/testData.ts index 35c963e908..88405c8b5e 100644 --- a/plugins/table/test/testData.ts +++ b/plugins/table/test/testData.ts @@ -21,6 +21,7 @@ import { ChartProps } from '@superset-ui/chart'; const basicFormData = { alignPn: false, colorPn: false, + showCellBars: true, includeSearch: false, orderDesc: true, pageLength: 0,