diff --git a/superset-frontend/package-lock.json b/superset-frontend/package-lock.json index 0f2a82b9a2a..f567a05b59d 100644 --- a/superset-frontend/package-lock.json +++ b/superset-frontend/package-lock.json @@ -67134,6 +67134,12 @@ "integrity": "sha512-KHW6M86R+FUPYGb3R5XiYjXPq7VzwxZ22buHhAEVG5ztoEcZZMLov530mmccaqA1GghZArjQV46fuc8kUqhhHw==", "license": "BSD-3-Clause" }, + "plugins/plugin-chart-echarts/node_modules/dayjs": { + "version": "1.11.18", + "resolved": "https://registry.npmjs.org/dayjs/-/dayjs-1.11.18.tgz", + "integrity": "sha512-zFBQ7WFRvVRhKcWoUh+ZA1g2HVgUbsZm9sbddh8EC5iv93sui8DVVz1Npvz+r6meo9VKfa8NyLWBsQK1VvIKPA==", + "license": "MIT" + }, "plugins/plugin-chart-handlebars": { "name": "@superset-ui/plugin-chart-handlebars", "version": "0.20.3", diff --git a/superset-frontend/plugins/legacy-preset-chart-deckgl/package.json b/superset-frontend/plugins/legacy-preset-chart-deckgl/package.json index 022a70a0967..5d450279f4e 100644 --- a/superset-frontend/plugins/legacy-preset-chart-deckgl/package.json +++ b/superset-frontend/plugins/legacy-preset-chart-deckgl/package.json @@ -43,7 +43,6 @@ "d3-array": "^1.2.4", "d3-color": "^1.4.1", "d3-scale": "^3.0.0", - "dayjs": "^1.11.18", "handlebars": "^4.7.8", "lodash": "^4.17.21", "mousetrap": "^1.6.5", @@ -60,9 +59,10 @@ "@types/urijs": "^1.19.25" }, "peerDependencies": { + "@apache-superset/core": "*", "@superset-ui/chart-controls": "*", "@superset-ui/core": "*", - "@apache-superset/core": "*", + "dayjs": "^1.11.18", "mapbox-gl": "*", "react": "^17.0.2", "react-dom": "^17.0.2", diff --git a/superset-frontend/plugins/legacy-preset-chart-nvd3/package.json b/superset-frontend/plugins/legacy-preset-chart-nvd3/package.json index 4387a4b29b4..fadb52ba306 100644 --- a/superset-frontend/plugins/legacy-preset-chart-nvd3/package.json +++ b/superset-frontend/plugins/legacy-preset-chart-nvd3/package.json @@ -33,16 +33,16 @@ "d3-tip": "^0.9.1", "fast-safe-stringify": "^2.1.1", "lodash": "^4.17.21", - "dayjs": "^1.11.18", "nvd3-fork": "^2.0.5", "dompurify": "^3.3.0", "prop-types": "^15.8.1", "urijs": "^1.19.11" }, "peerDependencies": { + "@apache-superset/core": "*", "@superset-ui/chart-controls": "*", "@superset-ui/core": "*", - "@apache-superset/core": "*", + "dayjs": "^1.11.18", "react": "^17.0.2" } } diff --git a/superset-frontend/plugins/plugin-chart-echarts/package.json b/superset-frontend/plugins/plugin-chart-echarts/package.json index 3604ff7aa2a..c5312b9b309 100644 --- a/superset-frontend/plugins/plugin-chart-echarts/package.json +++ b/superset-frontend/plugins/plugin-chart-echarts/package.json @@ -26,13 +26,13 @@ "dependencies": { "@types/react-redux": "^7.1.34", "d3-array": "^1.2.0", - "dayjs": "^1.11.18", "lodash": "^4.17.21" }, "peerDependencies": { "@apache-superset/core": "*", "@superset-ui/chart-controls": "*", "@superset-ui/core": "*", + "dayjs": "^1.11.18", "echarts": "*", "memoize-one": "*", "react": "^17.0.2" diff --git a/superset-frontend/plugins/plugin-chart-echarts/src/BigNumber/BigNumberPeriodOverPeriod/transformProps.ts b/superset-frontend/plugins/plugin-chart-echarts/src/BigNumber/BigNumberPeriodOverPeriod/transformProps.ts index b374678d05b..647b6b1aeda 100644 --- a/superset-frontend/plugins/plugin-chart-echarts/src/BigNumber/BigNumberPeriodOverPeriod/transformProps.ts +++ b/superset-frontend/plugins/plugin-chart-echarts/src/BigNumber/BigNumberPeriodOverPeriod/transformProps.ts @@ -16,6 +16,8 @@ * specific language governing permissions and limitations * under the License. */ +// Type augmentation for dayjs plugins +import 'dayjs/plugin/utc'; import { Metric } from '@superset-ui/chart-controls'; import { ChartProps, @@ -26,7 +28,6 @@ import { ensureIsArray, } from '@superset-ui/core'; import { extendedDayjs as dayjs } from '@superset-ui/core/utils/dates'; -import 'dayjs/plugin/utc'; import { getComparisonFontSize, getHeaderFontSize, diff --git a/superset-frontend/plugins/plugin-chart-echarts/src/BigNumber/utils.ts b/superset-frontend/plugins/plugin-chart-echarts/src/BigNumber/utils.ts index ebba6fd2c01..29fd193bbd3 100644 --- a/superset-frontend/plugins/plugin-chart-echarts/src/BigNumber/utils.ts +++ b/superset-frontend/plugins/plugin-chart-echarts/src/BigNumber/utils.ts @@ -17,7 +17,8 @@ * under the License. */ -import utc from 'dayjs/plugin/utc'; +// Type augmentation for dayjs plugins +import 'dayjs/plugin/utc'; import { getTimeFormatter, getTimeFormatterForGranularity, @@ -30,8 +31,6 @@ import { } from '@superset-ui/core'; import { extendedDayjs as dayjs } from '@superset-ui/core/utils/dates'; -dayjs.extend(utc); - export const parseMetricValue = (metricValue: number | string | null) => { if (typeof metricValue === 'string') { const dateObject = dayjs.utc(metricValue, undefined, true); diff --git a/superset-frontend/plugins/plugin-chart-echarts/src/Gantt/transformProps.ts b/superset-frontend/plugins/plugin-chart-echarts/src/Gantt/transformProps.ts index a527649ff7f..5d6522498c1 100644 --- a/superset-frontend/plugins/plugin-chart-echarts/src/Gantt/transformProps.ts +++ b/superset-frontend/plugins/plugin-chart-echarts/src/Gantt/transformProps.ts @@ -16,6 +16,8 @@ * specific language governing permissions and limitations * under the License. */ +// Type augmentation for dayjs plugins +import 'dayjs/plugin/utc'; import { CustomSeriesOption, CustomSeriesRenderItem, diff --git a/superset-frontend/plugins/plugin-chart-handlebars/package.json b/superset-frontend/plugins/plugin-chart-handlebars/package.json index 901b4684473..f2404a1e6c6 100644 --- a/superset-frontend/plugins/plugin-chart-handlebars/package.json +++ b/superset-frontend/plugins/plugin-chart-handlebars/package.json @@ -37,7 +37,7 @@ "ace-builds": "^1.4.14", "handlebars": "^4.7.8", "lodash": "^4.17.11", - "dayjs": "^1.11.13", + "dayjs": "^1.11.18", "react": "^17.0.2", "react-ace": "^10.1.0", "react-dom": "^17.0.2"