From d0e05b85abed646b5a4f486bca141d1b4b4fc2f0 Mon Sep 17 00:00:00 2001 From: Arko Date: Thu, 12 Oct 2023 05:33:20 -0700 Subject: [PATCH 1/2] fixed the bug of 'Cell Bars not showing, issue # 24495' --- .gitignore | 1 + package-lock.json | 6 ++++++ superset-frontend/package-lock.json | 2 +- .../plugins/plugin-chart-table/src/TableChart.tsx | 5 ++++- 4 files changed, 12 insertions(+), 2 deletions(-) create mode 100644 package-lock.json diff --git a/.gitignore b/.gitignore index 4e69678246e04..67952649cef51 100644 --- a/.gitignore +++ b/.gitignore @@ -111,3 +111,4 @@ messages.mo docker/requirements-local.txt cache/ +.aider* diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 0000000000000..b332645f1adf6 --- /dev/null +++ b/package-lock.json @@ -0,0 +1,6 @@ +{ + "name": "superset-fork", + "lockfileVersion": 3, + "requires": true, + "packages": {} +} diff --git a/superset-frontend/package-lock.json b/superset-frontend/package-lock.json index 694cfd9193285..4c0fa255e1e00 100644 --- a/superset-frontend/package-lock.json +++ b/superset-frontend/package-lock.json @@ -77984,7 +77984,7 @@ "@mapbox/geojson-extent": "^1.0.1", "@math.gl/web-mercator": "^3.2.2", "@types/d3-array": "^2.0.0", - "@types/mapbox__geojson-extent": "*", + "@types/mapbox__geojson-extent": "^1.0.0", "@types/underscore": "^1.11.6", "@types/urijs": "^1.19.19", "bootstrap-slider": "^10.0.0", diff --git a/superset-frontend/plugins/plugin-chart-table/src/TableChart.tsx b/superset-frontend/plugins/plugin-chart-table/src/TableChart.tsx index 72bcb71d290fa..ef5107698ba11 100644 --- a/superset-frontend/plugins/plugin-chart-table/src/TableChart.tsx +++ b/superset-frontend/plugins/plugin-chart-table/src/TableChart.tsx @@ -233,6 +233,7 @@ export default function TableChart( onContextMenu, emitCrossFilters, } = props; + const timestampFormatter = useCallback( value => getTimeFormatterForGranularity(timeGrain)(value), [timeGrain], @@ -410,6 +411,7 @@ export default function TableChart( const getColumnConfigs = useCallback( (column: DataColumnMeta, i: number): ColumnWithLooseAccessor => { const { key, label, isNumeric, dataType, isMetric, config = {} } = column; + const columnWidth = Number.isNaN(Number(config.columnWidth)) ? config.columnWidth : Number(config.columnWidth); @@ -438,7 +440,7 @@ export default function TableChart( (config.showCellBars === undefined ? showCellBars : config.showCellBars) && - (isMetric || isRawRecords) && + (isMetric || isRawRecords || key[0] == '%') && getValueRange(key, alignPositiveNegative); let className = ''; @@ -550,6 +552,7 @@ export default function TableChart( } // If cellProps renders textContent already, then we don't have to // render `Cell`. This saves some time for large tables. + return ( {valueRange && ( From 3115b7ad6c35b744690ab71aa231b6554bcd2682 Mon Sep 17 00:00:00 2001 From: Arko Date: Fri, 13 Oct 2023 03:56:47 -0700 Subject: [PATCH 2/2] fixed lint error --- superset-frontend/package-lock.json | 18 +++++++++--------- superset-frontend/package.json | 2 +- .../plugin-chart-table/src/TableChart.tsx | 2 +- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/superset-frontend/package-lock.json b/superset-frontend/package-lock.json index b8780a78a0c7a..1cc2641fa3196 100644 --- a/superset-frontend/package-lock.json +++ b/superset-frontend/package-lock.json @@ -191,7 +191,7 @@ "@types/jquery": "^3.5.8", "@types/js-levenshtein": "^1.1.0", "@types/json-bigint": "^1.0.1", - "@types/mousetrap": "^1.6.11", + "@types/mousetrap": "^1.6.12", "@types/react": "^16.9.43", "@types/react-dom": "^16.9.8", "@types/react-gravatar": "^2.6.8", @@ -284,8 +284,8 @@ "webpack-sources": "^3.2.3" }, "engines": { - "node": "^16.9.1", - "npm": "^7.5.4 || ^8.1.2" + "node": "^16.20.2", + "npm": "^8.19.4" } }, "buildtools/eslint-plugin-theme-colors": { @@ -19516,9 +19516,9 @@ "dev": true }, "node_modules/@types/mousetrap": { - "version": "1.6.11", - "resolved": "https://registry.npmjs.org/@types/mousetrap/-/mousetrap-1.6.11.tgz", - "integrity": "sha512-F0oAily9Q9QQpv9JKxKn0zMKfOo36KHCW7myYsmUyf2t0g+sBTbG3UleTPoguHdE1z3GLFr3p7/wiOio52QFjQ==", + "version": "1.6.12", + "resolved": "https://registry.npmjs.org/@types/mousetrap/-/mousetrap-1.6.12.tgz", + "integrity": "sha512-tzXGzMbvXt815z0Z7FE45wmRVRitMTaPgfVcdGhOS6LtEOWBZBokFJxEdatVA8cj+cQxvdFLmlMC4c12TNqv9A==", "dev": true }, "node_modules/@types/ms": { @@ -79325,9 +79325,9 @@ "dev": true }, "@types/mousetrap": { - "version": "1.6.11", - "resolved": "https://registry.npmjs.org/@types/mousetrap/-/mousetrap-1.6.11.tgz", - "integrity": "sha512-F0oAily9Q9QQpv9JKxKn0zMKfOo36KHCW7myYsmUyf2t0g+sBTbG3UleTPoguHdE1z3GLFr3p7/wiOio52QFjQ==", + "version": "1.6.12", + "resolved": "https://registry.npmjs.org/@types/mousetrap/-/mousetrap-1.6.12.tgz", + "integrity": "sha512-tzXGzMbvXt815z0Z7FE45wmRVRitMTaPgfVcdGhOS6LtEOWBZBokFJxEdatVA8cj+cQxvdFLmlMC4c12TNqv9A==", "dev": true }, "@types/ms": { diff --git a/superset-frontend/package.json b/superset-frontend/package.json index 8cee75833c62b..468850ae79d91 100644 --- a/superset-frontend/package.json +++ b/superset-frontend/package.json @@ -256,7 +256,7 @@ "@types/jquery": "^3.5.8", "@types/js-levenshtein": "^1.1.0", "@types/json-bigint": "^1.0.1", - "@types/mousetrap": "^1.6.11", + "@types/mousetrap": "^1.6.12", "@types/react": "^16.9.43", "@types/react-dom": "^16.9.8", "@types/react-gravatar": "^2.6.8", diff --git a/superset-frontend/plugins/plugin-chart-table/src/TableChart.tsx b/superset-frontend/plugins/plugin-chart-table/src/TableChart.tsx index ef5107698ba11..2bf754d2001a2 100644 --- a/superset-frontend/plugins/plugin-chart-table/src/TableChart.tsx +++ b/superset-frontend/plugins/plugin-chart-table/src/TableChart.tsx @@ -440,7 +440,7 @@ export default function TableChart( (config.showCellBars === undefined ? showCellBars : config.showCellBars) && - (isMetric || isRawRecords || key[0] == '%') && + (isMetric || isRawRecords || key[0] === '%') && getValueRange(key, alignPositiveNegative); let className = '';