Skip to content

Commit a24b0b1

Browse files
committed
Migrate Vega import
1 parent b107462 commit a24b0b1

6 files changed

Lines changed: 31 additions & 18 deletions

File tree

ui/src/components/DashboardGlobalHealth.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import {
1515
import {
1616
Alert,
1717
GlobalHealthBar as GlobalHealthBarRecharts,
18-
} from '@scality/core-ui/dist/components/globalhealthbar/GlobalHealthBarRecharts.component';
18+
} from '@scality/core-ui/dist/next';
1919
import {
2020
highestAlertToStatus,
2121
useAlertLibrary,

ui/src/components/NonSymmetricalQuantileChart.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { ChartLegendWrapper } from '@scality/core-ui/dist/components/chartlegend/ChartLegendWrapper';
1+
import { ChartLegendWrapper } from '@scality/core-ui/dist/next';
22
import {
33
ChartLegend,
44
LineTimeSerieChart,

ui/src/components/SymmetricalQuantileChart.tsx

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
import { ChartLegendWrapper } from '@scality/core-ui/dist/components/chartlegend/ChartLegendWrapper';
2-
import { UNIT_RANGE_BS } from '@scality/core-ui/dist/components/linetemporalchart/LineTemporalChart.component';
1+
import { ChartLegendWrapper } from '@scality/core-ui/dist/next';
32
import {
43
ChartLegend,
54
LineTimeSerieChart,
@@ -25,6 +24,29 @@ import {
2524
} from '../services/graphUtils';
2625
import { SymmetricalQuantileTooltip } from './SymmetricalQuantileTooltip';
2726

27+
const UNIT_RANGE_BS = [
28+
{
29+
threshold: 1,
30+
label: 'B/s',
31+
},
32+
{
33+
threshold: 1024,
34+
label: 'KiB/s',
35+
},
36+
{
37+
threshold: 1024 * 1024,
38+
label: 'MiB/s',
39+
},
40+
{
41+
threshold: 1024 * 1024 * 1024,
42+
label: 'GiB/s',
43+
},
44+
{
45+
threshold: 1024 * 1024 * 1024 * 1024,
46+
label: 'TiB/s',
47+
},
48+
];
49+
2850
const SymmetricalQuantileChart = ({
2951
getAboveQuantileQuery,
3052
getBelowQuantileQuery,

ui/src/components/shared/QuantileTooltipShared.tsx

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
1-
import {
2-
chartColors,
3-
fontSize,
4-
fontWeight,
5-
} from '@scality/core-ui/dist/style/theme';
1+
import { fontSize, fontWeight } from '@scality/core-ui/dist/style/theme';
62
import React from 'react';
73
import {
84
Stack,
@@ -12,7 +8,7 @@ import {
128
FormattedDateTime,
139
} from '@scality/core-ui/dist/index';
1410
import styled from 'styled-components';
15-
import { LegendShape } from '@scality/core-ui/dist/components/chartlegend/ChartLegend';
11+
import { ChartLegend } from '@scality/core-ui/dist/next';
1612
import {
1713
SmallerSecondaryText,
1814
Text,
@@ -366,11 +362,7 @@ export const TooltipEntry = ({
366362
<Stack direction="vertical" gap={'r4'} key={index}>
367363
<Wrap>
368364
<Stack direction="horizontal" gap={'r10'}>
369-
<LegendShape
370-
color={serieData.color}
371-
shape="line"
372-
chartColors={chartColors}
373-
/>
365+
<ChartLegend shape="line" />
374366
<SmallerText>{serieData.name}</SmallerText>
375367
</Stack>
376368

ui/src/hooks/useChartLegendRegistration.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import { useEffect } from 'react';
2-
import { useChartLegend } from '@scality/core-ui/dist/components/chartlegend/ChartLegendWrapper';
3-
import { Serie } from '@scality/core-ui/dist/components/linetimeseriechart/linetimeseriechart.component';
2+
import { useChartLegend, Serie } from '@scality/core-ui/dist/next';
43

54
type SymmetricalSeries = {
65
above: Serie[];

ui/src/services/platformlibrary/metrics.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import {
66
import { queryPromtheusMetrics } from '../prometheus/fetchMetrics';
77
import type { NodesState } from '../../ducks/app/nodes';
88
import { queryPrometheus, queryPrometheusRange } from '../prometheus/api';
9-
import { addMissingDataPoint } from '@scality/core-ui/dist/components/linetemporalchart/ChartUtil';
9+
import { addMissingDataPoint } from '@scality/core-ui/dist/components/charts/index';
1010
import { generateSelectWithKey, getNaNSegments, getSegments } from '../utils';
1111
import { getFormattedLokiAlert } from '../loki/api';
1212
import { NAN_STRING } from '@scality/core-ui/dist/components/constants';

0 commit comments

Comments
 (0)