@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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@centreon/ui",
3
- "version": "24.10.23",
3
+ "version": "24.10.25",
4
4
  "description": "Centreon UI Components",
5
5
  "scripts": {
6
6
  "update:deps": "pnpx npm-check-updates -i --format group",
@@ -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 KB').should('be.visible');
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 KB').should('be.visible');
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 M'],
365
+ [218857269, '', 1024, '208.72 Mi'],
366
366
  [0.12232323445, '', 1000, '0.12'],
367
- [1024, 'B', 1000, '1 KB'],
368
- [1024, 'B', 1024, '1 KB'],
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 M${unit}`;
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 ?? ds_data?.ds_color_line ?? defaultDsData.ds_color_line
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(/iB/g, unit);
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.format('dd').toLocaleUpperCase()
83
+ typeof dayOfWeek === 'string'
84
+ ? dayOfWeek.toLocaleUpperCase()
85
+ : dayOfWeek.format('dd').toLocaleUpperCase()
84
86
  }
85
87
  desktopModeMediaQuery={desktopMediaQuery ?? desktopPickerMediaQuery}
86
88
  disabled={disabled}
@@ -1,6 +1,9 @@
1
1
  import dayjs from 'dayjs';
2
+ import isSameOrAfter from 'dayjs/plugin/isSameOrAfter';
2
3
  import { find, propEq } from 'ramda';
3
4
 
5
+ dayjs.extend(isSameOrAfter);
6
+
4
7
  import {
5
8
  CustomTimePeriod,
6
9
  TimePeriod,