@centreon/ui 23.10.30 → 23.10.31

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.30",
3
+ "version": "23.10.31",
4
4
  "description": "Centreon UI Components",
5
5
  "scripts": {
6
6
  "eslint": "eslint ./src --ext .js,.jsx,.ts,.tsx --max-warnings 0",
@@ -10,6 +10,7 @@ import { Button } from '../../Button';
10
10
  import { useStyles } from './DataTableEmptyState.styles';
11
11
 
12
12
  type ListEmptyStateProps = {
13
+ canCreate?: boolean;
13
14
  labels: {
14
15
  actions: {
15
16
  create: string;
@@ -21,7 +22,8 @@ type ListEmptyStateProps = {
21
22
 
22
23
  const DataTableEmptyState = ({
23
24
  labels,
24
- onCreate
25
+ onCreate,
26
+ canCreate = true
25
27
  }: ListEmptyStateProps): ReactElement => {
26
28
  const { classes } = useStyles();
27
29
  const { t } = useTranslation();
@@ -30,14 +32,16 @@ const DataTableEmptyState = ({
30
32
  <div className={classes.dataTableEmptyState}>
31
33
  <MuiTypography variant="h2">{t(labels.title)}</MuiTypography>
32
34
  <div className={classes.actions}>
33
- <Button
34
- aria-label="create"
35
- icon={<AddIcon />}
36
- iconVariant="start"
37
- onClick={() => onCreate?.()}
38
- >
39
- {t(labels.actions.create)}
40
- </Button>
35
+ {canCreate && (
36
+ <Button
37
+ aria-label="create"
38
+ icon={<AddIcon />}
39
+ iconVariant="start"
40
+ onClick={() => onCreate?.()}
41
+ >
42
+ {t(labels.actions.create)}
43
+ </Button>
44
+ )}
41
45
  </div>
42
46
  </div>
43
47
  );
@@ -46,6 +46,7 @@ const DataTableItem = forwardRef(
46
46
  return (
47
47
  <MuiCard
48
48
  className={classes.dataTableItem}
49
+ data-item-title={title}
49
50
  ref={ref as RefObject<HTMLDivElement>}
50
51
  variant="outlined"
51
52
  >