Skip to content
This repository was archived by the owner on Dec 10, 2021. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,10 @@
},
"eslint": {
"rules": {
"arrow-parens": ["warn", "as-needed"]
"arrow-parens": [
"warn",
"as-needed"
]
},
"overrides": [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
1 change: 1 addition & 0 deletions packages/superset-ui-demo/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"extends": "../../tsconfig.json",
"compilerOptions": {
"jsx": "react",
"outDir": "../../build/lib",
"rootDir": "../../",
"emitDeclarationOnly": false,
Expand Down
4 changes: 3 additions & 1 deletion plugins/table/src/ReactDataTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 (
<td
key={key}
Expand All @@ -244,7 +246,7 @@ export default function ReactDataTable(props: DataTableProps) {
data-sort={val}
className={keyIsMetric ? 'text-right' : ''}
style={{
backgroundImage: keyIsMetric ? cellBar(key, val as number) : undefined,
backgroundImage: showCellBar ? cellBar(key, val as number) : undefined,
}}
title={keyIsMetric || percentMetricsSet.has(key) ? String(val) : ''}
>
Expand Down
4 changes: 4 additions & 0 deletions plugins/table/src/transformProps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ export interface DataTableProps {
alignPositiveNegative: boolean;
colorPositiveNegative: boolean;
columns: DataColumnMeta[];
showCellBars: boolean;
metrics: string[];
percentMetrics: string[];
includeSearch: boolean;
Expand All @@ -55,6 +56,7 @@ export interface DataTableProps {
export interface TableChartFormData {
alignPn?: boolean;
colorPn?: boolean;
showCellBars?: boolean;
includeSearch?: boolean;
orderDesc?: boolean;
pageLength?: string;
Expand All @@ -80,6 +82,7 @@ export default function transformProps(chartProps: ChartProps): DataTableProps {
const {
alignPn = true,
colorPn = true,
showCellBars = true,
includeSearch = false,
orderDesc = false,
pageLength = 0,
Expand Down Expand Up @@ -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,
Expand Down
1 change: 1 addition & 0 deletions plugins/table/test/testData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import { ChartProps } from '@superset-ui/chart';
const basicFormData = {
alignPn: false,
colorPn: false,
showCellBars: true,
includeSearch: false,
orderDesc: true,
pageLength: 0,
Expand Down