@centreon/ui 23.10.118 → 23.10.119

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.
Files changed (64) hide show
  1. package/package.json +12 -14
  2. package/src/Button/Save/StartIcon.tsx +3 -3
  3. package/src/Dashboard/Item.tsx +1 -1
  4. package/src/FileDropZone/index.tsx +1 -3
  5. package/src/Form/Inputs/CheckboxGroup.tsx +4 -1
  6. package/src/Form/Inputs/index.tsx +1 -1
  7. package/src/Graph/LineChart/BasicComponents/Lines/Threshold/index.tsx +4 -5
  8. package/src/Graph/LineChart/BasicComponents/useFilterLines.ts +1 -1
  9. package/src/Graph/LineChart/InteractiveComponents/Annotations/Annotation/index.tsx +3 -2
  10. package/src/Graph/LineChart/InteractiveComponents/Annotations/EventAnnotations.tsx +1 -1
  11. package/src/Graph/LineChart/Legend/useLegend.ts +5 -5
  12. package/src/Graph/LineChart/LineChart.tsx +2 -5
  13. package/src/Graph/LineChart/helpers/doc.ts +13 -16
  14. package/src/Graph/LineChart/helpers/index.ts +1 -1
  15. package/src/Graph/LineChart/index.stories.tsx +2 -1
  16. package/src/Graph/Text/Text.stories.tsx +4 -60
  17. package/src/Graph/common/timeSeries/index.ts +3 -3
  18. package/src/InputField/Select/Autocomplete/Connected/index.tsx +7 -10
  19. package/src/InputField/Select/Autocomplete/Draggable/SortableList.tsx +1 -1
  20. package/src/InputField/Select/Autocomplete/Draggable/SortableListContent.tsx +1 -1
  21. package/src/InputField/Select/Autocomplete/Draggable/index.tsx +1 -1
  22. package/src/InputField/Select/IconPopover/index.tsx +2 -2
  23. package/src/InputField/Select/index.tsx +1 -1
  24. package/src/Listing/Header/ListingHeader.tsx +1 -1
  25. package/src/Listing/index.stories.tsx +1 -12
  26. package/src/Listing/index.tsx +1 -1
  27. package/src/RichTextEditor/RichTextEditor.cypress.spec.tsx +52 -100
  28. package/src/RichTextEditor/RichTextEditor.tsx +4 -20
  29. package/src/RichTextEditor/plugins/ToolbarPlugin/AlignPicker.tsx +20 -21
  30. package/src/RichTextEditor/plugins/ToolbarPlugin/BlockButtons.tsx +77 -35
  31. package/src/RichTextEditor/plugins/ToolbarPlugin/FormatButtons.tsx +83 -29
  32. package/src/RichTextEditor/plugins/ToolbarPlugin/MacrosButton.tsx +39 -23
  33. package/src/RichTextEditor/plugins/ToolbarPlugin/ToolbarPlugin.styles.ts +14 -24
  34. package/src/RichTextEditor/plugins/ToolbarPlugin/UndoRedoButtons.tsx +0 -6
  35. package/src/RichTextEditor/plugins/ToolbarPlugin/index.tsx +10 -5
  36. package/src/RichTextEditor/translatedLabels.ts +0 -3
  37. package/src/SortableItems/index.tsx +7 -2
  38. package/src/TimePeriods/CustomTimePeriod/PopoverCustomTimePeriod/PickersStartEndDate.tsx +3 -8
  39. package/src/TimePeriods/CustomTimePeriod/PopoverCustomTimePeriod/models.ts +2 -0
  40. package/src/TimePeriods/DateTimePickerInput.tsx +17 -45
  41. package/src/TimePeriods/TimePeriods.cypress.spec.tsx +33 -9
  42. package/src/TimePeriods/helpers/index.ts +1 -1
  43. package/src/api/QueryProvider.tsx +1 -1
  44. package/src/api/TestQueryProvider.tsx +1 -1
  45. package/src/api/useFetchQuery/index.ts +24 -28
  46. package/src/api/useMutationQuery/index.ts +17 -39
  47. package/src/components/DataTable/Item/DataTableItem.tsx +2 -2
  48. package/src/components/Form/AccessRights/__fixtures__/contactAccessRight.mock.ts +0 -2
  49. package/src/components/Form/AccessRights/useAccessRightsForm.utils.ts +1 -1
  50. package/src/components/Form/Dashboard/DashboardForm.tsx +12 -15
  51. package/src/components/ItemComposition/ItemComposition.tsx +2 -4
  52. package/src/components/Menu/Button/MenuButton.tsx +2 -4
  53. package/src/components/Menu/MenuItem.tsx +3 -5
  54. package/src/components/Menu/MenuItems.tsx +3 -4
  55. package/src/index.ts +0 -1
  56. package/src/queryParameters/url/index.ts +1 -5
  57. package/src/screens/dashboard/DashboardsDetail.stories.tsx +108 -0
  58. package/src/screens/dashboard/DashboardsOverview.stories.tsx +281 -0
  59. package/src/utils/index.ts +1 -0
  60. package/src/utils/useDateTimePickerAdapter.ts +309 -0
  61. package/src/utils/{useLicenseExpirationWarning.test.tsx → useLicenseExpirationWarning.cypress.spec.tsx} +37 -48
  62. package/src/utils/useLicenseExpirationWarning.ts +18 -18
  63. package/src/RichTextEditor/plugins/ToolbarPlugin/LinkButton.tsx +0 -106
  64. package/src/RichTextEditor/plugins/ToolbarPlugin/ListButton.tsx +0 -155
@@ -25,9 +25,7 @@ export interface UseFetchQueryProps<T> {
25
25
  getQueryKey: () => QueryKey;
26
26
  httpCodesBypassErrorSnackbar?: Array<number>;
27
27
  isPaginated?: boolean;
28
- queryOptions?: {
29
- suspense?: boolean;
30
- } & Omit<
28
+ queryOptions?: Omit<
31
29
  UseQueryOptions<T | ResponseError, Error, T | ResponseError, QueryKey>,
32
30
  'queryKey' | 'queryFn'
33
31
  >;
@@ -35,12 +33,11 @@ export interface UseFetchQueryProps<T> {
35
33
 
36
34
  export type UseFetchQueryState<T> = {
37
35
  data?: T;
38
- error: Omit<ResponseError, 'isError'> | null;
39
36
  fetchQuery: () => Promise<T | ResponseError>;
40
37
  prefetchNextPage: ({ page, getPrefetchQueryKey }) => void;
41
38
  prefetchPreviousPage: ({ page, getPrefetchQueryKey }) => void;
42
39
  prefetchQuery: ({ endpointParams, queryKey }) => void;
43
- } & Omit<QueryObserverBaseResult, 'data' | 'error'>;
40
+ } & Omit<QueryObserverBaseResult, 'data'>;
44
41
 
45
42
  export interface PrefetchEndpointParams {
46
43
  page: number;
@@ -61,8 +58,9 @@ const useFetchQuery = <T extends object>({
61
58
  }: UseFetchQueryProps<T>): UseFetchQueryState<T> => {
62
59
  const { showErrorMessage } = useSnackbar();
63
60
 
64
- const queryData = useQuery<T | ResponseError, Error>({
65
- queryFn: ({ signal }): Promise<T | ResponseError> =>
61
+ const queryData = useQuery<T | ResponseError, Error>(
62
+ getQueryKey(),
63
+ ({ signal }): Promise<T | ResponseError> =>
66
64
  customFetch<T>({
67
65
  catchError,
68
66
  decoder,
@@ -71,9 +69,10 @@ const useFetchQuery = <T extends object>({
71
69
  headers: new Headers(fetchHeaders),
72
70
  signal
73
71
  }),
74
- queryKey: getQueryKey(),
75
- ...queryOptions
76
- });
72
+ {
73
+ ...queryOptions
74
+ }
75
+ );
77
76
 
78
77
  const queryClient = useQueryClient();
79
78
 
@@ -93,8 +92,9 @@ const useFetchQuery = <T extends object>({
93
92
  };
94
93
 
95
94
  const prefetchQuery = ({ endpointParams, queryKey }): void => {
96
- queryClient.prefetchQuery({
97
- queryFn: ({ signal }): Promise<T | ResponseError> =>
95
+ queryClient.prefetchQuery(
96
+ queryKey,
97
+ ({ signal }): Promise<T | ResponseError> =>
98
98
  customFetch<T>({
99
99
  catchError,
100
100
  decoder,
@@ -102,9 +102,8 @@ const useFetchQuery = <T extends object>({
102
102
  endpoint: getEndpoint(endpointParams),
103
103
  headers: new Headers(fetchHeaders),
104
104
  signal
105
- }),
106
- queryKey
107
- });
105
+ })
106
+ );
108
107
  };
109
108
 
110
109
  const prefetchNextPage = ({ page, getPrefetchQueryKey }): void => {
@@ -134,8 +133,9 @@ const useFetchQuery = <T extends object>({
134
133
  };
135
134
 
136
135
  const fetchQuery = (): Promise<T | ResponseError> => {
137
- return queryClient.fetchQuery({
138
- queryFn: ({ signal }): Promise<T | ResponseError> =>
136
+ return queryClient.fetchQuery(
137
+ getQueryKey(),
138
+ ({ signal }): Promise<T | ResponseError> =>
139
139
  customFetch<T>({
140
140
  catchError,
141
141
  decoder,
@@ -143,9 +143,8 @@ const useFetchQuery = <T extends object>({
143
143
  endpoint: getEndpoint(),
144
144
  headers: new Headers(fetchHeaders),
145
145
  signal
146
- }),
147
- queryKey: getQueryKey()
148
- });
146
+ })
147
+ );
149
148
  };
150
149
 
151
150
  const data = useMemo(
@@ -158,19 +157,16 @@ const useFetchQuery = <T extends object>({
158
157
 
159
158
  useEffect(() => {
160
159
  return (): void => {
161
- queryClient.cancelQueries({ queryKey: getQueryKey() });
160
+ queryClient.cancelQueries(getQueryKey());
162
161
  };
163
162
  }, []);
164
163
 
165
- useEffect(
166
- () => {
167
- manageError();
168
- },
169
- useDeepCompare([queryData.data])
170
- );
164
+ useEffect(() => {
165
+ manageError();
166
+ }, useDeepCompare([queryData.data]));
171
167
 
172
168
  return {
173
- ...omit(['data', 'error'], queryData),
169
+ ...omit(['data'], queryData),
174
170
  data,
175
171
  error: errorData?.isError ? omit(['isError'], errorData) : null,
176
172
  fetchQuery,
@@ -8,7 +8,7 @@ import {
8
8
  } from '@tanstack/react-query';
9
9
  import { JsonDecoder } from 'ts.data.json';
10
10
  import anylogger from 'anylogger';
11
- import { includes, omit } from 'ramda';
11
+ import { includes } from 'ramda';
12
12
 
13
13
  import { CatchErrorProps, customFetch, ResponseError } from '../customFetch';
14
14
  import useSnackbar from '../../Snackbar/useSnackbar';
@@ -30,33 +30,14 @@ export type UseMutationQueryProps<T, TMeta> = {
30
30
  getEndpoint: (_meta: TMeta) => string;
31
31
  httpCodesBypassErrorSnackbar?: Array<number>;
32
32
  method: Method;
33
- onError?: (
34
- error: ResponseError,
35
- variables: T & { _meta: TMeta },
36
- context: unknown
37
- ) => unknown;
38
- onMutate?: (variables: T & { _meta: TMeta }) => Promise<unknown> | unknown;
39
- onSuccess?: (
40
- data: ResponseError | T,
41
- variables: T & {
42
- _meta: TMeta;
43
- },
44
- context: unknown
45
- ) => unknown;
46
- } & Omit<
47
- UseMutationOptions<T & { _meta?: TMeta }>,
48
- 'mutationFn' | 'onError' | 'onMutate' | 'onSuccess'
49
- >;
33
+ } & Omit<UseMutationOptions<T & { _meta?: TMeta }>, 'mutationFn'>;
50
34
 
51
35
  const log = anylogger('API Request');
52
36
 
53
- export type UseMutationQueryState<T> = Omit<
54
- UseMutationResult<T | ResponseError>,
55
- 'isError'
56
- > & {
37
+ export type UseMutationQueryState<T> = {
57
38
  isError: boolean;
58
39
  isMutating: boolean;
59
- };
40
+ } & UseMutationResult<T | ResponseError>;
60
41
 
61
42
  const useMutationQuery = <T extends object, TMeta>({
62
43
  getEndpoint,
@@ -76,10 +57,8 @@ const useMutationQuery = <T extends object, TMeta>({
76
57
  T | ResponseError,
77
58
  ResponseError,
78
59
  T & { _meta: TMeta }
79
- >({
80
- mutationFn: (
81
- _payload: T & { _meta: TMeta }
82
- ): Promise<T | ResponseError> => {
60
+ >(
61
+ (_payload: T & { _meta: TMeta }): Promise<T | ResponseError> => {
83
62
  const { _meta, ...payload } = _payload || {};
84
63
 
85
64
  return customFetch<T>({
@@ -96,10 +75,12 @@ const useMutationQuery = <T extends object, TMeta>({
96
75
  payload
97
76
  });
98
77
  },
99
- onError,
100
- onMutate,
101
- onSuccess
102
- });
78
+ {
79
+ onError,
80
+ onMutate,
81
+ onSuccess
82
+ }
83
+ );
103
84
 
104
85
  const manageError = (): void => {
105
86
  const data = queryData.data as ResponseError | undefined;
@@ -116,17 +97,14 @@ const useMutationQuery = <T extends object, TMeta>({
116
97
  }
117
98
  };
118
99
 
119
- useEffect(
120
- () => {
121
- manageError();
122
- },
123
- useDeepCompare([queryData.data])
124
- );
100
+ useEffect(() => {
101
+ manageError();
102
+ }, useDeepCompare([queryData.data]));
125
103
 
126
104
  return {
127
- ...omit(['isError'], queryData),
105
+ ...queryData,
128
106
  isError: (queryData.data as ResponseError | undefined)?.isError || false,
129
- isMutating: queryData.isPending
107
+ isMutating: queryData.isLoading
130
108
  };
131
109
  };
132
110
 
@@ -22,7 +22,7 @@ export interface DataTableItemProps {
22
22
  description?: string;
23
23
  hasActions?: boolean;
24
24
  hasCardAction?: boolean;
25
- labelsDelete?: {
25
+ labelsDelete: {
26
26
  cancel: string;
27
27
  confirm: {
28
28
  label: string;
@@ -76,7 +76,7 @@ const DataTableItem = forwardRef(
76
76
  {hasActions && (
77
77
  <MuiCardActions>
78
78
  <span>
79
- {onDelete && labelsDelete && (
79
+ {onDelete && (
80
80
  <ConfirmationTooltip
81
81
  confirmVariant="error"
82
82
  labels={labelsDelete}
@@ -7,8 +7,6 @@ import {
7
7
  RoleResource
8
8
  } from '../AccessRights.resource';
9
9
 
10
- faker.seed(42);
11
-
12
10
  export const rolesMock = (): Array<RoleResource> => [
13
11
  { role: 'viewer' },
14
12
  { role: 'editor' }
@@ -36,6 +36,6 @@ export const createInitialState = (
36
36
  contactAccessRight,
37
37
  state: 'unchanged',
38
38
  stateHistory: []
39
- }) as ContactAccessRightStateResource
39
+ } as ContactAccessRightStateResource)
40
40
  )
41
41
  .sort(sortOnAddedStateFirstAndContactName);
@@ -1,8 +1,7 @@
1
1
  import { ReactElement, useCallback, useMemo } from 'react';
2
2
 
3
- import { string, number, object } from 'yup';
3
+ import * as Yup from 'yup';
4
4
  import { useTranslation } from 'react-i18next';
5
- import { equals } from 'ramda';
6
5
 
7
6
  import { InputType } from '../../../Form/Inputs/models';
8
7
  import { Form, FormProps } from '../../../Form';
@@ -85,8 +84,8 @@ const DashboardForm = ({
85
84
  }
86
85
  ],
87
86
  submit: (values, bag) => onSubmit?.(values, bag),
88
- validationSchema: object({
89
- description: string()
87
+ validationSchema: Yup.object().shape({
88
+ description: Yup.string()
90
89
  .label(labels?.entity?.description || '')
91
90
  .max(
92
91
  180,
@@ -94,19 +93,17 @@ const DashboardForm = ({
94
93
  `${p.label} ${t(labelMustBeMost)} ${p.max} ${t(labelCharacters)}`
95
94
  )
96
95
  .nullable(),
97
- globalRefreshInterval: object({
98
- interval: number().when('type', ([type], schema) => {
99
- if (equals(type, 'manual')) {
100
- schema
101
- .min(1, ({ min }) => t(labelMustBeAtLeast, { min }))
102
- .required(t(labelRequired) as string);
103
- }
104
-
105
- return schema.nullable();
96
+ globalRefreshInterval: Yup.object().shape({
97
+ interval: Yup.number().when('type', {
98
+ is: 'global',
99
+ otherwise: Yup.number().nullable(),
100
+ then: Yup.number()
101
+ .min(1, ({ min }) => t(labelMustBeAtLeast, { min }))
102
+ .required(t(labelRequired) as string)
106
103
  }),
107
- type: string()
104
+ type: Yup.string()
108
105
  }),
109
- name: string()
106
+ name: Yup.string()
110
107
  .label(labels?.entity?.name)
111
108
  .min(3, ({ min, label }) => t(labelMustBeAtLeast, { label, min }))
112
109
  .max(50, ({ max, label }) => t(labelMustBeMost, { label, max }))
@@ -7,7 +7,6 @@ import { Button } from '..';
7
7
  import { useItemCompositionStyles } from './ItemComposition.styles';
8
8
 
9
9
  type Props = {
10
- IconAdd?;
11
10
  addButtonHidden?: boolean;
12
11
  addbuttonDisabled?: boolean;
13
12
  children: Array<ReactElement>;
@@ -20,8 +19,7 @@ export const ItemComposition = ({
20
19
  children,
21
20
  labelAdd,
22
21
  addbuttonDisabled,
23
- addButtonHidden,
24
- IconAdd
22
+ addButtonHidden
25
23
  }: Props): JSX.Element => {
26
24
  const { classes } = useItemCompositionStyles();
27
25
 
@@ -33,7 +31,7 @@ export const ItemComposition = ({
33
31
  aria-label={labelAdd}
34
32
  data-testid={labelAdd}
35
33
  disabled={addbuttonDisabled}
36
- icon={IconAdd || <AddIcon />}
34
+ icon={<AddIcon />}
37
35
  iconVariant="start"
38
36
  size="small"
39
37
  variant="ghost"
@@ -15,7 +15,6 @@ import { useStyles } from './MenuButton.styles';
15
15
  type MenuButtonProps = {
16
16
  ariaLabel?: string;
17
17
  children?: ReactNode;
18
- className?: string;
19
18
  hasArrow?: boolean;
20
19
  isOpen?: boolean;
21
20
  onClick?: (args: { isOpen: boolean }) => void;
@@ -30,10 +29,9 @@ const MenuButton = ({
30
29
  size = 'small',
31
30
  variant = 'ghost',
32
31
  ariaLabel,
33
- className,
34
32
  ...attr
35
33
  }: MenuButtonProps): ReactElement => {
36
- const { cx, classes } = useStyles();
34
+ const { classes } = useStyles();
37
35
 
38
36
  const { isMenuOpen, setIsMenuOpen, setAnchorEl, onOpen } = useMenu();
39
37
 
@@ -52,7 +50,7 @@ const MenuButton = ({
52
50
  <Button
53
51
  {...attr}
54
52
  aria-label={ariaLabel}
55
- className={cx(classes.menuButton, className)}
53
+ className={classes.menuButton}
56
54
  data-is-active={isMenuOpen}
57
55
  size={size}
58
56
  variant={variant}
@@ -6,7 +6,6 @@ import { useStyles } from './Menu.styles';
6
6
 
7
7
  type MenuItemProps = {
8
8
  children?: ReactNode;
9
- className?: string;
10
9
  isActive?: boolean;
11
10
  isDisabled?: boolean;
12
11
  onClick?: () => void;
@@ -16,14 +15,13 @@ const MenuItem = ({
16
15
  children,
17
16
  onClick,
18
17
  isActive = false,
19
- isDisabled = false,
20
- className
18
+ isDisabled = false
21
19
  }: MenuItemProps): ReactElement => {
22
- const { cx, classes } = useStyles();
20
+ const { classes } = useStyles();
23
21
 
24
22
  return (
25
23
  <MuiMenuItem
26
- className={cx(classes.menuItem, className)}
24
+ className={classes.menuItem}
27
25
  data-is-active={isActive}
28
26
  data-is-disabled={isDisabled}
29
27
  disabled={isDisabled}
@@ -7,10 +7,9 @@ import { useMenu } from './useMenu';
7
7
 
8
8
  type MenuItemsProps = {
9
9
  children?: ReactNode | Array<ReactNode>;
10
- className?: string;
11
10
  };
12
- const MenuItems = ({ children, className }: MenuItemsProps): ReactElement => {
13
- const { cx, classes } = useStyles();
11
+ const MenuItems = ({ children }: MenuItemsProps): ReactElement => {
12
+ const { classes } = useStyles();
14
13
 
15
14
  const { isMenuOpen, setIsMenuOpen, anchorEl, onClose } = useMenu();
16
15
 
@@ -22,7 +21,7 @@ const MenuItems = ({ children, className }: MenuItemsProps): ReactElement => {
22
21
  return (
23
22
  <MuiMenu
24
23
  anchorEl={anchorEl}
25
- className={cx(classes.menuItems, className)}
24
+ className={classes.menuItems}
26
25
  open={isMenuOpen}
27
26
  variant="menu"
28
27
  onClick={onCloseMenu}
package/src/index.ts CHANGED
@@ -162,5 +162,4 @@ export * from './Graph/common/timeSeries';
162
162
 
163
163
  export { default as TimePeriods } from './TimePeriods';
164
164
  export { default as SimpleCustomTimePeriod } from './TimePeriods/CustomTimePeriod/SimpleCustomTimePeriod';
165
- export { default as DateTimePickerInput } from './TimePeriods/DateTimePickerInput';
166
165
  export * from './ParentSize';
@@ -1,4 +1,4 @@
1
- import { fromPairs, startsWith } from 'ramda';
1
+ import { fromPairs } from 'ramda';
2
2
 
3
3
  import { QueryParameter } from '../models';
4
4
 
@@ -25,10 +25,6 @@ const getUrlQueryParameters = <
25
25
 
26
26
  const entries = [...urlParams.entries()].map<[string, string]>(
27
27
  ([key, value]) => {
28
- if (startsWith('/', value)) {
29
- return [key, value];
30
- }
31
-
32
28
  return [key, JSON.parse(value)];
33
29
  }
34
30
  );
@@ -0,0 +1,108 @@
1
+ /* eslint-disable @typescript-eslint/no-non-null-assertion */
2
+ import React, { ReactElement } from 'react';
3
+
4
+ import { Meta } from '@storybook/react';
5
+
6
+ import {
7
+ Add as AddIcon,
8
+ Settings as SettingsIcon,
9
+ Share as ShareIcon
10
+ } from '@mui/icons-material';
11
+
12
+ import {
13
+ Button,
14
+ IconButton,
15
+ Menu,
16
+ PageHeader,
17
+ PageLayout
18
+ } from '../../components';
19
+
20
+ const meta: Meta = {
21
+ args: {
22
+ actions: {}
23
+ },
24
+ parameters: {
25
+ layout: 'fullscreen'
26
+ },
27
+ title: 'screens/Dashboards detail'
28
+ };
29
+
30
+ export default meta;
31
+
32
+ const DefaultView = (args): ReactElement => {
33
+ const { data } = args;
34
+
35
+ return (
36
+ <PageLayout>
37
+ <PageLayout.Header>
38
+ <PageHeader>
39
+ <PageHeader.Main>
40
+ <PageHeader.Menu>
41
+ <Menu>
42
+ <Menu.Button />
43
+ <Menu.Items>
44
+ <Menu.Item>Menu Item</Menu.Item>
45
+ <Menu.Item>Menu Item</Menu.Item>
46
+ <Menu.Item>Menu Item</Menu.Item>
47
+ <Menu.Divider />
48
+ <Menu.Item>
49
+ <Button
50
+ icon={<AddIcon />}
51
+ iconVariant="start"
52
+ variant="ghost"
53
+ >
54
+ Add item
55
+ </Button>
56
+ </Menu.Item>
57
+ </Menu.Items>
58
+ </Menu>
59
+ </PageHeader.Menu>
60
+ <PageHeader.Title
61
+ description={data.dashboard.description}
62
+ title={data.dashboard.name}
63
+ />
64
+ </PageHeader.Main>
65
+ </PageHeader>
66
+ </PageLayout.Header>
67
+ <PageLayout.Body>
68
+ <PageLayout.Actions>
69
+ <IconButton
70
+ aria-label="edit"
71
+ data-testid="edit"
72
+ icon={<SettingsIcon />}
73
+ size="small"
74
+ variant="ghost"
75
+ />
76
+ <IconButton
77
+ aria-label="share"
78
+ data-testid="share"
79
+ icon={<ShareIcon />}
80
+ size="small"
81
+ variant="ghost"
82
+ />
83
+ </PageLayout.Actions>
84
+ </PageLayout.Body>
85
+ </PageLayout>
86
+ );
87
+ };
88
+
89
+ export const Default = {
90
+ args: {
91
+ data: {
92
+ dashboard: {
93
+ description:
94
+ 'Description et culpa sit commodo ea enim excepteur elit. Velit irure velit tempor culpa commodo eu adipisicing eu proident ullamco.',
95
+ id: 1,
96
+ name: 'Dashboard 1'
97
+ }
98
+ }
99
+ },
100
+ render: DefaultView
101
+ };
102
+
103
+ export const AsEditLayoutState = {
104
+ args: {
105
+ ...Default.args
106
+ },
107
+ render: DefaultView
108
+ };