diff --git a/superset-frontend/package-lock.json b/superset-frontend/package-lock.json index cbf29c66c40c..abf040df8a52 100644 --- a/superset-frontend/package-lock.json +++ b/superset-frontend/package-lock.json @@ -79,7 +79,7 @@ "geostyler-openlayers-parser": "^4.3.0", "geostyler-style": "7.5.0", "geostyler-wfs-parser": "^2.0.3", - "googleapis": "^170.1.0", + "googleapis": "^171.0.0", "immer": "^11.1.3", "interweave": "^13.1.1", "jquery": "^4.0.0", @@ -34539,9 +34539,9 @@ } }, "node_modules/googleapis": { - "version": "170.1.0", - "resolved": "https://registry.npmjs.org/googleapis/-/googleapis-170.1.0.tgz", - "integrity": "sha512-RLbc7yG6qzZqvAmGcgjvNIoZ7wpcCFxtc+HN+46etxDrlO4a8l5Cb7NxNQGhV91oRmL7mt56VoRoypAtEQEIKg==", + "version": "171.0.0", + "resolved": "https://registry.npmjs.org/googleapis/-/googleapis-171.0.0.tgz", + "integrity": "sha512-z+wpYZ9wfO/v58b/7fM0JqwDR6dx6yE3UdQZ9vWrzmzNVHFd85Uud8QewFfm8ht/3Hx2ISLbCs8RfnbrqR8X4A==", "license": "Apache-2.0", "dependencies": { "google-auth-library": "^10.2.0", diff --git a/superset-frontend/package.json b/superset-frontend/package.json index 85002f28dd73..dff5390cb384 100644 --- a/superset-frontend/package.json +++ b/superset-frontend/package.json @@ -161,7 +161,7 @@ "geostyler-openlayers-parser": "^4.3.0", "geostyler-style": "7.5.0", "geostyler-wfs-parser": "^2.0.3", - "googleapis": "^170.1.0", + "googleapis": "^171.0.0", "immer": "^11.1.3", "interweave": "^13.1.1", "jquery": "^4.0.0", diff --git a/superset-frontend/plugins/plugin-chart-echarts/src/BigNumber/BigNumberViz.tsx b/superset-frontend/plugins/plugin-chart-echarts/src/BigNumber/BigNumberViz.tsx index 01402741137e..df201008b1f9 100644 --- a/superset-frontend/plugins/plugin-chart-echarts/src/BigNumber/BigNumberViz.tsx +++ b/superset-frontend/plugins/plugin-chart-echarts/src/BigNumber/BigNumberViz.tsx @@ -25,6 +25,7 @@ import { computeMaxFontSize, BRAND_COLOR, BinaryQueryObjectFilterClause, + DTTM_ALIAS, } from '@superset-ui/core'; import { styled, useTheme } from '@apache-superset/core/ui'; import Echart from '../components/Echart'; @@ -357,7 +358,10 @@ function BigNumberVis({ const pointerEvent = eventParams.event.event; const drillToDetailFilters: BinaryQueryObjectFilterClause[] = []; drillToDetailFilters.push({ - col: formData?.granularitySqla, + col: + formData?.xAxis === DTTM_ALIAS + ? formData?.granularitySqla + : formData?.xAxis, grain: formData?.timeGrainSqla, op: '==', val: data[0], diff --git a/superset-frontend/plugins/plugin-chart-echarts/src/BigNumber/BigNumberWithTrendline/transformProps.test.ts b/superset-frontend/plugins/plugin-chart-echarts/src/BigNumber/BigNumberWithTrendline/transformProps.test.ts index f6f6b4cca113..b4be8637bd6b 100644 --- a/superset-frontend/plugins/plugin-chart-echarts/src/BigNumber/BigNumberWithTrendline/transformProps.test.ts +++ b/superset-frontend/plugins/plugin-chart-echarts/src/BigNumber/BigNumberWithTrendline/transformProps.test.ts @@ -106,6 +106,7 @@ describe('BigNumberWithTrendline transformProps', () => { subtitleFontSize: 14, forceTimestampFormatting: false, timeFormat: 'YYYY-MM-DD', + xAxis: '__timestamp', yAxisFormat: 'SMART_NUMBER', compareLag: 1, compareSuffix: 'WoW', diff --git a/superset-frontend/plugins/plugin-chart-echarts/src/BigNumber/types.ts b/superset-frontend/plugins/plugin-chart-echarts/src/BigNumber/types.ts index e1f115c28b86..8f6bde4d2b8f 100644 --- a/superset-frontend/plugins/plugin-chart-echarts/src/BigNumber/types.ts +++ b/superset-frontend/plugins/plugin-chart-echarts/src/BigNumber/types.ts @@ -47,6 +47,7 @@ export type BigNumberWithTrendlineFormData = BigNumberTotalFormData & { b: number; }; compareLag?: string | number; + xAxis: string; showXAxis?: boolean; showXAxisMinMaxLabels?: boolean; showYAxis?: boolean; diff --git a/superset-frontend/plugins/plugin-chart-echarts/test/BigNumber/transformProps.test.ts b/superset-frontend/plugins/plugin-chart-echarts/test/BigNumber/transformProps.test.ts index cd1b00100ebd..0c0d5c3b87f2 100644 --- a/superset-frontend/plugins/plugin-chart-echarts/test/BigNumber/transformProps.test.ts +++ b/superset-frontend/plugins/plugin-chart-echarts/test/BigNumber/transformProps.test.ts @@ -35,6 +35,7 @@ const formData = { a: 1, }, compareLag: 1, + xAxis: '__timestamp', timeGrainSqla: TimeGranularity.QUARTER, granularitySqla: 'ds', compareSuffix: 'over last quarter', @@ -54,11 +55,13 @@ const rawFormData: BigNumberWithTrendlineFormData = { a: 1, }, compare_lag: 1, + x_axis: '__timestamp', time_grain_sqla: TimeGranularity.QUARTER, granularity_sqla: 'ds', compare_suffix: 'over last quarter', viz_type: VizType.BigNumber, y_axis_format: '.3s', + xAxis: '__timestamp', }; function generateProps(