@centreon/ui 26.12.13 → 26.12.14

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": "26.12.13",
3
+ "version": "26.12.14",
4
4
  "description": "Centreon UI Components",
5
5
  "scripts": {
6
6
  "update:deps": "pnpx npm-check-updates -i --format group",
@@ -16,6 +16,8 @@ import { useStyles } from './ActionsList.styles';
16
16
  import type { ActionVariants } from './models';
17
17
 
18
18
  interface ActionsType {
19
+ // A stable id for analytics and tests; the label stays the fallback.
20
+ dataTestId?: string;
19
21
  Icon?: OverridableComponent<SvgIconTypeMap<object, 'svg'>> & {
20
22
  muiName: string;
21
23
  };
@@ -52,16 +54,16 @@ const ActionsList = ({
52
54
  return <Divider key={`divider_${idx}`} />;
53
55
  }
54
56
 
55
- const { label, Icon, onClick, variant, secondaryLabel } =
57
+ const { dataTestId, label, Icon, onClick, variant, secondaryLabel } =
56
58
  action as ActionsType;
57
59
 
58
60
  return (
59
61
  <MenuItem
60
62
  aria-label={label}
61
63
  className={classes.item}
62
- data-testid={label}
64
+ data-testid={dataTestId ?? label}
63
65
  data-variant={variant}
64
- id={label}
66
+ id={dataTestId ?? label}
65
67
  key={label}
66
68
  onClick={onClick}
67
69
  >