@centreon/ui 25.4.5 → 25.5.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": "25.4.5",
3
+ "version": "25.5.0",
4
4
  "description": "Centreon UI Components",
5
5
  "scripts": {
6
6
  "update:deps": "pnpx npm-check-updates -i --format group",
@@ -12,6 +12,7 @@ export type FormActionsProps = {
12
12
  labels: FormActionsLabels;
13
13
  onCancel: () => void;
14
14
  variant: FormVariant;
15
+ isCancelButtonVisible?: boolean;
15
16
  };
16
17
 
17
18
  export type FormActionsLabels = {
@@ -23,7 +24,8 @@ const FormActions = <TResource extends object>({
23
24
  labels,
24
25
  onCancel,
25
26
  variant,
26
- enableSubmitWhenNotDirty
27
+ enableSubmitWhenNotDirty,
28
+ isCancelButtonVisible = true
27
29
  }: FormActionsProps): ReactElement => {
28
30
  const { classes } = useStyles();
29
31
  const { isSubmitting, dirty, isValid, submitForm } =
@@ -34,16 +36,18 @@ const FormActions = <TResource extends object>({
34
36
 
35
37
  return (
36
38
  <div className={classes.actions}>
37
- <Button
38
- aria-label={labels.cancel}
39
- data-testid="cancel"
40
- disabled={isSubmitting}
41
- size="medium"
42
- variant="secondary"
43
- onClick={() => onCancel?.()}
44
- >
45
- {labels.cancel}
46
- </Button>
39
+ {isCancelButtonVisible && (
40
+ <Button
41
+ aria-label={labels.cancel}
42
+ data-testid="cancel"
43
+ disabled={isSubmitting}
44
+ size="medium"
45
+ variant="secondary"
46
+ onClick={() => onCancel?.()}
47
+ >
48
+ {labels.cancel}
49
+ </Button>
50
+ )}
47
51
  <Button
48
52
  aria-label={labels.submit[variant]}
49
53
  data-testid="submit"