@centreon/ui 24.4.1-MON-34494-delete-action.9 → 24.4.1-MON-34407-implement-the-status-chart-widget.0

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.4.1-MON-34494-delete-action.9",
3
+ "version": "24.4.1-MON-34407-implement-the-status-chart-widget.0",
4
4
  "description": "Centreon UI Components",
5
5
  "scripts": {
6
6
  "eslint": "eslint ./src --ext .js,.jsx,.ts,.tsx --max-warnings 0",
@@ -12,7 +12,7 @@ import { Tooltip } from '../../components';
12
12
  import { LegendProps } from '../Legend/models';
13
13
  import { Legend as LegendComponent } from '../Legend';
14
14
  import { getValueByUnit } from '../common/utils';
15
- import { labelNoDataFound } from '../translatedLabels';
15
+ import { labelNoDataFound as defaultlabelNoDataFound } from '../translatedLabels';
16
16
 
17
17
  import { BarStackProps } from './models';
18
18
  import { useBarStackStyles } from './BarStack.styles';
@@ -35,7 +35,8 @@ const BarStack = ({
35
35
  unit = 'number',
36
36
  displayValues,
37
37
  variant = 'vertical',
38
- legendDirection = 'column'
38
+ legendDirection = 'column',
39
+ labelNoDataFound = defaultlabelNoDataFound
39
40
  }: BarStackProps & { height: number; width: number }): JSX.Element => {
40
41
  const { t } = useTranslation();
41
42
  const { classes } = useBarStackStyles();
@@ -90,7 +91,7 @@ const BarStack = ({
90
91
  >
91
92
  {title && (
92
93
  <div className={classes.title} data-testid="Title" ref={titleRef}>
93
- {`${numeral(total).format('0a').toUpperCase()} `} {title}
94
+ {`${numeral(total).format('0a').toUpperCase()} `} {t(title)}
94
95
  </div>
95
96
  )}
96
97
  <div
@@ -146,6 +147,7 @@ const BarStack = ({
146
147
  >
147
148
  <g data-testid={bar.key}>
148
149
  <rect
150
+ cursor="pointer"
149
151
  fill={bar.color}
150
152
  height={
151
153
  isVerticalBar ? bar.height - 1 : bar.height
@@ -10,6 +10,7 @@ export type BarStackProps = {
10
10
  data: Array<BarType>;
11
11
  displayLegend?: boolean;
12
12
  displayValues?: boolean;
13
+ labelNoDataFound?: string;
13
14
  legendDirection?: 'row' | 'column';
14
15
  onSingleBarClick?: (barData) => void;
15
16
  size?: number;
@@ -13,7 +13,7 @@ import { Tooltip } from '../../components';
13
13
  import { Legend as LegendComponent } from '../Legend';
14
14
  import { LegendProps } from '../Legend/models';
15
15
  import { getValueByUnit } from '../common/utils';
16
- import { labelNoDataFound } from '../translatedLabels';
16
+ import { labelNoDataFound as defaultlabelNoDataFound } from '../translatedLabels';
17
17
 
18
18
  import { PieProps } from './models';
19
19
  import { usePieStyles } from './PieChart.styles';
@@ -54,7 +54,8 @@ const ResponsivePie = ({
54
54
  onArcClick,
55
55
  displayValues,
56
56
  TooltipContent,
57
- legendDirection = 'column'
57
+ legendDirection = 'column',
58
+ labelNoDataFound = defaultlabelNoDataFound
58
59
  }: PieProps & { height: number; width: number }): JSX.Element => {
59
60
  const { t } = useTranslation();
60
61
  const theme = useTheme();
@@ -178,6 +179,7 @@ const ResponsivePie = ({
178
179
  >
179
180
  <g data-testid={arc.data.label} onClick={onClick}>
180
181
  <path
182
+ cursor="pointer"
181
183
  d={pie.path(arc) as string}
182
184
  fill={arc.data.color}
183
185
  />
@@ -11,6 +11,7 @@ export interface PieProps {
11
11
  displayLegend?: boolean;
12
12
  displayValues?: boolean;
13
13
  innerRadius?: number;
14
+ labelNoDataFound?: string;
14
15
  legendDirection?: 'row' | 'column';
15
16
  onArcClick?: (ardata) => void;
16
17
  title?: string;