@centreon/ui 24.10.23 → 24.10.25
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/Graph/BarChart/BarChart.cypress.spec.tsx +1 -1
- package/src/Graph/Chart/Chart.cypress.spec.tsx +1 -1
- package/src/Graph/common/timeSeries/index.test.ts +4 -4
- package/src/Graph/common/timeSeries/index.ts +4 -2
- package/src/TimePeriods/DateTimePickerInput.tsx +3 -1
- package/src/TimePeriods/helpers/index.ts +3 -0
package/package.json
CHANGED
|
@@ -191,7 +191,7 @@ describe('Bar chart', () => {
|
|
|
191
191
|
cy.contains('Centreon-Server: Round-Trip Maximum Time').should(
|
|
192
192
|
'be.visible'
|
|
193
193
|
);
|
|
194
|
-
cy.contains('7.47
|
|
194
|
+
cy.contains('7.47 KiB').should('be.visible');
|
|
195
195
|
|
|
196
196
|
cy.makeSnapshot();
|
|
197
197
|
});
|
|
@@ -676,7 +676,7 @@ describe('Lines and bars', () => {
|
|
|
676
676
|
cy.findByLabelText('B').click();
|
|
677
677
|
|
|
678
678
|
cy.findAllByTestId('unit-selector').eq(0).should('have.value', 'B');
|
|
679
|
-
cy.contains('8.79
|
|
679
|
+
cy.contains('8.79 KiB').should('be.visible');
|
|
680
680
|
|
|
681
681
|
cy.findAllByTestId('unit-selector').eq(1).parent().click();
|
|
682
682
|
cy.findByLabelText('%').click();
|
|
@@ -362,10 +362,10 @@ describe('timeSeries', () => {
|
|
|
362
362
|
describe(formatMetricValue, () => {
|
|
363
363
|
const cases: Array<TestCase> = [
|
|
364
364
|
[218857269, '', 1000, '218.86m'],
|
|
365
|
-
[218857269, '', 1024, '208.72
|
|
365
|
+
[218857269, '', 1024, '208.72 Mi'],
|
|
366
366
|
[0.12232323445, '', 1000, '0.12'],
|
|
367
|
-
[1024, 'B', 1000, '1
|
|
368
|
-
[1024, 'B', 1024, '1
|
|
367
|
+
[1024, 'B', 1000, '1 KiB'],
|
|
368
|
+
[1024, 'B', 1024, '1 KiB'],
|
|
369
369
|
[null, 'B', 1024, null]
|
|
370
370
|
];
|
|
371
371
|
|
|
@@ -553,7 +553,7 @@ describe('Format value with unit', () => {
|
|
|
553
553
|
return '324.23m';
|
|
554
554
|
}
|
|
555
555
|
|
|
556
|
-
return `309.21
|
|
556
|
+
return `309.21 Mi${unit}`;
|
|
557
557
|
};
|
|
558
558
|
|
|
559
559
|
const humanReadableTestCases = units.map((unit) => {
|
|
@@ -135,7 +135,9 @@ const toLine = ({
|
|
|
135
135
|
...defaultDsData,
|
|
136
136
|
...(ds_data || {}),
|
|
137
137
|
ds_color_area:
|
|
138
|
-
ds_data?.ds_color_area ??
|
|
138
|
+
ds_data?.ds_color_area ??
|
|
139
|
+
ds_data?.ds_color_line ??
|
|
140
|
+
defaultDsData.ds_color_line
|
|
139
141
|
};
|
|
140
142
|
|
|
141
143
|
return {
|
|
@@ -628,7 +630,7 @@ const formatMetricValue = ({
|
|
|
628
630
|
|
|
629
631
|
const formattedMetricValue = numeral(Math.abs(value))
|
|
630
632
|
.format(`0.[00]${formatSuffix}`)
|
|
631
|
-
.replace(/
|
|
633
|
+
.replace(/B/, unit);
|
|
632
634
|
|
|
633
635
|
if (lt(value, 0)) {
|
|
634
636
|
return `-${formattedMetricValue}`;
|
|
@@ -80,7 +80,9 @@ const DateTimePickerInput = ({
|
|
|
80
80
|
>
|
|
81
81
|
<DateTimePicker<dayjs.Dayjs>
|
|
82
82
|
dayOfWeekFormatter={(dayOfWeek) =>
|
|
83
|
-
dayOfWeek
|
|
83
|
+
typeof dayOfWeek === 'string'
|
|
84
|
+
? dayOfWeek.toLocaleUpperCase()
|
|
85
|
+
: dayOfWeek.format('dd').toLocaleUpperCase()
|
|
84
86
|
}
|
|
85
87
|
desktopModeMediaQuery={desktopMediaQuery ?? desktopPickerMediaQuery}
|
|
86
88
|
disabled={disabled}
|