diff --git a/ui/src/components/VolumeMetricsTab.js b/ui/src/components/VolumeMetricsTab.js index 94484feda4..6fa0027557 100644 --- a/ui/src/components/VolumeMetricsTab.js +++ b/ui/src/components/VolumeMetricsTab.js @@ -14,7 +14,6 @@ import { LAST_SEVEN_DAYS, LAST_TWENTY_FOUR_HOURS, LAST_ONE_HOUR, - queryTimeSpansCodes, GRAFANA_DASHBOARDS, } from '../constants'; import { useIntl } from 'react-intl'; @@ -30,6 +29,7 @@ import { VolumeUsageChart, } from './VolumeCharts'; import { SyncedCursorCharts } from '@scality/core-ui/dist/components/vegachartv2/SyncedCursorCharts'; +import { queryTimeSpansCodes } from '@scality/core-ui/dist/components/constants'; const MetricGraphCardContainer = styled.div` min-height: 270px; diff --git a/ui/src/constants.js b/ui/src/constants.js index 049714c922..d8e130eb47 100644 --- a/ui/src/constants.js +++ b/ui/src/constants.js @@ -54,28 +54,6 @@ export const QUERY_LAST_ONE_HOUR = 'now-1h'; export const PORT_NODE_EXPORTER = '9100'; -// deprecated should retrieve from core-ui -export const queryTimeSpansCodes = [ - { - label: QUERY_LAST_SEVEN_DAYS, - value: LAST_SEVEN_DAYS, - duration: SAMPLE_DURATION_LAST_SEVEN_DAYS, - frequency: SAMPLE_FREQUENCY_LAST_SEVEN_DAYS, - }, - { - label: QUERY_LAST_TWENTY_FOUR_HOURS, - value: LAST_TWENTY_FOUR_HOURS, - duration: SAMPLE_DURATION_LAST_TWENTY_FOUR_HOURS, - frequency: SAMPLE_FREQUENCY_LAST_TWENTY_FOUR_HOURS, - }, - { - label: QUERY_LAST_ONE_HOUR, - value: LAST_ONE_HOUR, - duration: SAMPLE_DURATION_LAST_ONE_HOUR, - frequency: SAMPLE_FREQUENCY_LAST_ONE_HOUR, - }, -]; - // alert export const NODE_FILESYSTEM_SPACE_FILLINGUP = 'NodeFilesystemSpaceFillingUp'; export const NODE_FILESYSTEM_ALMOST_OUTOF_SPACE = diff --git a/ui/src/containers/DashboardPage.js b/ui/src/containers/DashboardPage.js index 3258bfb0be..a569c28c20 100644 --- a/ui/src/containers/DashboardPage.js +++ b/ui/src/containers/DashboardPage.js @@ -12,12 +12,12 @@ import { LAST_SEVEN_DAYS, LAST_TWENTY_FOUR_HOURS, LAST_ONE_HOUR, - queryTimeSpansCodes, } from '../constants'; import { useURLQuery } from '../services/utils'; import { useMetricsTimeSpan } from '@scality/core-ui/dist/next'; import { SyncedCursorCharts } from '@scality/core-ui/dist/components/vegachartv2/SyncedCursorCharts'; +import { queryTimeSpansCodes } from '@scality/core-ui/dist/components/constants'; const DashboardGrid = styled.div` display: grid; diff --git a/ui/src/containers/NodePageRSP.js b/ui/src/containers/NodePageRSP.js index 4a724338bb..f72f5dc759 100644 --- a/ui/src/containers/NodePageRSP.js +++ b/ui/src/containers/NodePageRSP.js @@ -27,12 +27,12 @@ import { NoInstanceSelected, } from '../components/style/CommonLayoutStyle'; import { - queryTimeSpansCodes, NODE_ALERTS_GROUP, PORT_NODE_EXPORTER, } from '../constants'; import { useAlerts } from './AlertProvider'; import { useIntl } from 'react-intl'; +import { queryTimeSpansCodes } from '@scality/core-ui/dist/components/constants'; // fetches the data for all the tabs given the current selected Node // handles the refresh for the metrics tab