@centreon/ui 23.10.84 → 23.10.86

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": "23.10.84",
3
+ "version": "23.10.86",
4
4
  "description": "Centreon UI Components",
5
5
  "scripts": {
6
6
  "eslint": "eslint ./src --ext .js,.jsx,.ts,.tsx --max-warnings 0",
@@ -18,10 +18,9 @@ export const useStyles = makeStyles<MakeStylesProps>()(
18
18
  },
19
19
  items: {
20
20
  display: 'grid',
21
- gridTemplateColumns: 'repeat(auto-fit, minmax(150px, 1fr))',
22
- justifyContent: 'center',
21
+ gridTemplateColumns: 'repeat(auto-fit, minmax(150px, max-content))',
23
22
  marginLeft: theme.spacing(0.5),
24
- maxHeight: limitLegendRows ? theme.spacing(19) : 'unset',
23
+ maxHeight: limitLegendRows ? theme.spacing(14) : 'unset',
25
24
  overflowY: 'auto',
26
25
  width: '100%'
27
26
  },
@@ -40,6 +39,7 @@ export const useStyles = makeStyles<MakeStylesProps>()(
40
39
  display: 'flex',
41
40
  flexDirection: 'row',
42
41
  justifyContent: 'start',
42
+ marginRight: theme.spacing(0.5),
43
43
  overflow: 'hidden',
44
44
  textOverflow: 'ellipsis'
45
45
  },
@@ -1,6 +1,6 @@
1
1
  import { Dispatch, ReactNode, SetStateAction } from 'react';
2
2
 
3
- import { slice } from 'ramda';
3
+ import { prop, slice, sortBy } from 'ramda';
4
4
  import { useAtomValue } from 'jotai';
5
5
 
6
6
  import { Box, alpha, useTheme } from '@mui/material';
@@ -58,9 +58,11 @@ const MainLegend = ({
58
58
  xScale
59
59
  });
60
60
 
61
+ const sortedData = sortBy(prop('metric_id'), lines);
62
+
61
63
  const displayedLines = limitLegendRows
62
- ? slice(0, maxLinesDisplayedLegend, lines)
63
- : lines;
64
+ ? slice(0, maxLinesDisplayedLegend, sortedData)
65
+ : sortedData;
64
66
 
65
67
  const getMetricValue = ({ value, unit }: GetMetricValueProps): string =>
66
68
  formatMetricValue({
@@ -8,10 +8,8 @@ import {
8
8
  isNil,
9
9
  map,
10
10
  pipe,
11
- prop,
12
11
  propEq,
13
- reject,
14
- sortBy
12
+ reject
15
13
  } from 'ramda';
16
14
 
17
15
  import { Line } from '../../common/timeSeries/models';
@@ -49,9 +47,7 @@ const useLegend = ({ lines, setLinesGraph }: Props): LegendActions => {
49
47
  { ...getLineByMetric(metric_id), highlight: true }
50
48
  ];
51
49
 
52
- const sortedData = sortBy(prop('metric_id'), data);
53
-
54
- setLinesGraph(sortedData);
50
+ setLinesGraph(data);
55
51
  };
56
52
 
57
53
  const clearHighlight = (): void => {
@@ -115,6 +115,7 @@ const SelectField = ({
115
115
 
116
116
  return (
117
117
  <MenuItem
118
+ aria-label={name}
118
119
  data-testid={testId}
119
120
  key={key}
120
121
  style={{ backgroundColor: color }}