@centreon/ui 24.7.8 → 24.7.10

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.7.8",
3
+ "version": "24.7.10",
4
4
  "description": "Centreon UI Components",
5
5
  "scripts": {
6
6
  "update:deps": "pnpx npm-check-updates -i --format group",
@@ -53,55 +53,55 @@
53
53
  "@cypress/webpack-dev-server": "^3.10.0",
54
54
  "@faker-js/faker": "^8.4.1",
55
55
  "@mdx-js/react": "^3.0.1",
56
- "@modern-js/prod-server": "^2.54.5",
57
- "@modern-js/storybook": "^2.54.5",
58
- "@simonsmith/cypress-image-snapshot": "^9.0.3",
59
- "@storybook/addon-a11y": "^8.1.11",
60
- "@storybook/addon-docs": "^8.1.11",
61
- "@storybook/addon-essentials": "^8.1.11",
62
- "@storybook/addon-interactions": "^8.1.11",
63
- "@storybook/addon-themes": "^8.1.11",
64
- "@storybook/blocks": "^8.1.11",
65
- "@storybook/manager-api": "^8.1.11",
56
+ "@modern-js/prod-server": "^2.56.0",
57
+ "@modern-js/storybook": "^2.56.0",
58
+ "@simonsmith/cypress-image-snapshot": "^9.1.0",
59
+ "@storybook/addon-a11y": "^8.2.5",
60
+ "@storybook/addon-docs": "^8.2.5",
61
+ "@storybook/addon-essentials": "^8.2.5",
62
+ "@storybook/addon-interactions": "^8.2.5",
63
+ "@storybook/addon-themes": "^8.2.5",
64
+ "@storybook/blocks": "^8.2.5",
65
+ "@storybook/manager-api": "^8.2.5",
66
66
  "@storybook/mdx2-csf": "^1.1.0",
67
- "@storybook/preview-api": "^8.1.11",
68
- "@storybook/react": "^8.1.11",
69
- "@storybook/react-vite": "^8.1.11",
70
- "@storybook/test": "^8.1.11",
71
- "@storybook/test-runner": "^0.19.0",
72
- "@storybook/theming": "^8.1.11",
67
+ "@storybook/preview-api": "^8.2.5",
68
+ "@storybook/react": "^8.2.5",
69
+ "@storybook/react-vite": "^8.2.5",
70
+ "@storybook/test": "^8.2.5",
71
+ "@storybook/test-runner": "^0.19.1",
72
+ "@storybook/theming": "^8.2.5",
73
73
  "@testing-library/cypress": "^10.0.2",
74
74
  "@testing-library/jest-dom": "^6.4.6",
75
75
  "@testing-library/react": "^16.0.0",
76
76
  "@testing-library/react-hooks": "^8.0.1",
77
77
  "@types/jest": "^29.5.12",
78
78
  "@types/mocha": "^10.0.7",
79
- "@types/ramda": "^0.30.0",
79
+ "@types/ramda": "^0.30.1",
80
80
  "@types/react": "^18.3.3",
81
81
  "@types/testing-library__jest-dom": "^6.0.0",
82
82
  "@vitejs/plugin-react": "^4.3.1",
83
83
  "@vitejs/plugin-react-swc": "^3.7.0",
84
84
  "axios-mock-adapter": "^1.22.0",
85
85
  "chai": "^5.1.1",
86
- "cypress": "^13.13.0",
86
+ "cypress": "^13.13.1",
87
87
  "identity-obj-proxy": "^3.0.0",
88
88
  "jest-transform-stub": "^2.0.0",
89
89
  "mochawesome": "^7.1.3",
90
- "msw": "2.3.1",
91
- "msw-storybook-addon": "^2.0.2",
92
- "puppeteer": "^22.12.1",
90
+ "msw": "2.3.2",
91
+ "msw-storybook-addon": "^2.0.3",
92
+ "puppeteer": "^22.13.1",
93
93
  "react": "^18.3.1",
94
94
  "react-dom": "^18.3.1",
95
95
  "react-test-renderer": "^18.3.1",
96
96
  "remark-gfm": "^4.0.0",
97
97
  "speed-measure-vite-plugin": "^1.0.1",
98
- "storybook": "^8.1.11",
98
+ "storybook": "^8.2.5",
99
99
  "storybook-addon-mock": "^5.0.0",
100
100
  "storybook-dark-mode": "^4.0.2",
101
- "style-dictionary": "^4.0.0",
101
+ "style-dictionary": "^4.0.1",
102
102
  "ts-node": "^10.9.2",
103
103
  "use-resize-observer": "^9.1.0",
104
- "vite": "^5.3.3",
104
+ "vite": "^5.3.4",
105
105
  "vite-plugin-istanbul": "^6.0.2",
106
106
  "vite-plugin-svgr": "^4.2.0",
107
107
  "vite-plugin-turbosnap": "^1.0.3"
@@ -115,8 +115,8 @@
115
115
  "@lexical/rich-text": "^0.16.1",
116
116
  "@lexical/selection": "^0.16.1",
117
117
  "@lexical/utils": "^0.16.1",
118
- "@mui/material": "^5.15.21",
119
- "@react-spring/web": "^9.7.3",
118
+ "@mui/material": "^5.16.4",
119
+ "@react-spring/web": "^9.7.4",
120
120
  "@visx/clip-path": "^3.3.0",
121
121
  "@visx/curve": "^3.3.0",
122
122
  "@visx/event": "^3.3.0",
@@ -133,7 +133,7 @@
133
133
  "@visx/zoom": "^3.3.0",
134
134
  "anylogger": "^1.0.11",
135
135
  "d3-array": "3.2.4",
136
- "dayjs": "^1.11.11",
136
+ "dayjs": "^1.11.12",
137
137
  "humanize-duration": "^3.32.1",
138
138
  "lexical": "^0.16.1",
139
139
  "notistack": "^3.0.1",
@@ -142,7 +142,7 @@
142
142
  "react-grid-layout": "^1.4.4",
143
143
  "react-html-parser": "^2.0.2",
144
144
  "react-resizable": "^3.0.5",
145
- "react-router-dom": "^6.24.0",
145
+ "react-router-dom": "^6.25.1",
146
146
  "react-transition-group": "^4.4.5",
147
147
  "sanitize-html": "^2.13.0",
148
148
  "ulog": "^2.0.0-beta.19"
@@ -8,7 +8,7 @@
8
8
  * - Please do NOT serve this file on production.
9
9
  */
10
10
 
11
- const PACKAGE_VERSION = '2.3.1'
11
+ const PACKAGE_VERSION = '2.3.2'
12
12
  const INTEGRITY_CHECKSUM = '26357c79639bfa20d64c0efca2a87423'
13
13
  const IS_MOCKED_RESPONSE = Symbol('isMockedResponse')
14
14
  const activeClientIds = new Set()
@@ -65,7 +65,6 @@ describe('Dashboard', () => {
65
65
  cy.get('[data-widget-skeleton="a"]').should('not.exist');
66
66
  cy.get('[data-widget-skeleton="b"]').should('not.exist');
67
67
  cy.get('[data-widget-skeleton="c"]').should('not.exist');
68
- cy.get('[data-widget-skeleton="d"]').should('exist');
69
68
 
70
69
  cy.makeSnapshot();
71
70
  });
@@ -33,7 +33,8 @@ const ResponsiveBarStack = ({
33
33
  unit = 'number',
34
34
  displayValues,
35
35
  variant = 'vertical',
36
- legendDirection = 'column'
36
+ legendDirection = 'column',
37
+ tooltipProps = {}
37
38
  }: BarStackProps & { height: number; width: number }): JSX.Element => {
38
39
  const { t } = useTranslation();
39
40
  const { classes, cx } = useBarStackStyles();
@@ -143,6 +144,7 @@ const ResponsiveBarStack = ({
143
144
  title={title}
144
145
  total={total}
145
146
  value={barStack.bars[0].bar.data[barStack.key]}
147
+ {...tooltipProps}
146
148
  />
147
149
  )
148
150
  }
@@ -14,6 +14,7 @@ export type BarStackProps = {
14
14
  onSingleBarClick?: (barData) => void;
15
15
  size?: number;
16
16
  title?: string;
17
+ tooltipProps?: object;
17
18
  unit?: 'percentage' | 'number';
18
19
  variant?: 'vertical' | 'horizontal';
19
20
  };
@@ -55,17 +55,10 @@ const Template = (args): JSX.Element => {
55
55
  return <HeatMap {...args} arrowClassName={classes.arrow} />;
56
56
  };
57
57
 
58
- const TileContent = ({
59
- data,
60
- backgroundColor
61
- }: {
62
- backgroundColor: string;
63
- data: Data;
64
- }): JSX.Element => (
58
+ const TileContent = ({ data }: { data: Data }): JSX.Element => (
65
59
  <div
66
60
  style={{
67
61
  alignItems: 'center',
68
- backgroundColor,
69
62
  display: 'flex',
70
63
  height: '100%',
71
64
  justifyContent: 'center'
@@ -13,8 +13,9 @@ export const useHeatMapStyles = makeStyles()((theme) => ({
13
13
  width: '100%'
14
14
  },
15
15
  heatMapTileContent: {
16
- height: `calc(100% - ${theme.spacing(1)})`,
17
- width: `calc(100% - ${theme.spacing(1)})`
16
+ height: '100%',
17
+ position: 'relative',
18
+ width: '100%'
18
19
  },
19
20
  heatMapTooltip: {
20
21
  backgroundColor: theme.palette.background.paper,
@@ -2,10 +2,10 @@ import { useTranslation } from 'react-i18next';
2
2
 
3
3
  import { useTheme } from '@mui/material';
4
4
 
5
- import IconDowntime from '../../../Icons/Downtime';
6
5
  import { labelDowntime } from '../../../translatedLabels';
7
6
  import EventAnnotations from '../EventAnnotations';
8
7
  import { Args } from '../models';
8
+ import { DowntimeIcon } from '../../../../../Icon';
9
9
 
10
10
  const DowntimeAnnotations = (props: Args): JSX.Element => {
11
11
  const { t } = useTranslation();
@@ -15,7 +15,7 @@ const DowntimeAnnotations = (props: Args): JSX.Element => {
15
15
 
16
16
  return (
17
17
  <EventAnnotations
18
- Icon={IconDowntime}
18
+ Icon={DowntimeIcon}
19
19
  ariaLabel={t(labelDowntime)}
20
20
  color={color}
21
21
  type="downtime"
@@ -410,8 +410,6 @@ describe('Line chart', () => {
410
410
 
411
411
  cy.contains('8:00 AM').should('be.visible');
412
412
  cy.get('path[fill="rgba(102, 153, 204, 0.8)"]').should('be.visible');
413
-
414
- cy.makeSnapshot();
415
413
  });
416
414
 
417
415
  it('shows points when the prop is set', () => {
@@ -53,7 +53,8 @@ const ResponsivePie = ({
53
53
  onArcClick,
54
54
  displayValues,
55
55
  TooltipContent,
56
- legendDirection = 'column'
56
+ legendDirection = 'column',
57
+ tooltipProps = {}
57
58
  }: PieProps & { height: number; width: number }): JSX.Element => {
58
59
  const { t } = useTranslation();
59
60
  const theme = useTheme();
@@ -163,6 +164,7 @@ const ResponsivePie = ({
163
164
  title={title}
164
165
  total={total}
165
166
  value={arc.data.value}
167
+ {...tooltipProps}
166
168
  />
167
169
  )
168
170
  }
@@ -14,6 +14,7 @@ export interface PieProps {
14
14
  legendDirection?: 'row' | 'column';
15
15
  onArcClick?: (ardata) => void;
16
16
  title?: string;
17
+ tooltipProps?: object;
17
18
  unit?: 'percentage' | 'number';
18
19
  variant?: 'pie' | 'donut';
19
20
  }
@@ -0,0 +1,8 @@
1
+ import { Person } from '@mui/icons-material';
2
+ import { SvgIconProps } from '@mui/material';
3
+
4
+ import BaseIcon from './BaseIcon';
5
+
6
+ export const AcknowledgementIcon = (props: SvgIconProps): JSX.Element => (
7
+ <BaseIcon Icon={Person} dataTestId="AcknowledgementIcon" {...props} />
8
+ );
@@ -0,0 +1,32 @@
1
+ import { has } from 'ramda';
2
+
3
+ import { SvgIcon, SvgIconProps, SvgIconTypeMap } from '@mui/material';
4
+ import { OverridableComponent } from '@mui/material/OverridableComponent';
5
+
6
+ interface Props extends SvgIconProps {
7
+ Icon: JSX.Element | OverridableComponent<SvgIconTypeMap>;
8
+ dataTestId?: string;
9
+ }
10
+
11
+ const BaseIcon = ({ Icon, dataTestId, ...props }: Props): JSX.Element => {
12
+ if (!has('key', Icon)) {
13
+ const Component = Icon as (props: SvgIconProps) => JSX.Element;
14
+
15
+ return (
16
+ <SvgIcon
17
+ data-testid={dataTestId || (Icon as () => JSX.Element).name}
18
+ {...props}
19
+ >
20
+ <Component />
21
+ </SvgIcon>
22
+ );
23
+ }
24
+
25
+ return (
26
+ <SvgIcon data-testid={dataTestId} {...props}>
27
+ {Icon as JSX.Element}
28
+ </SvgIcon>
29
+ );
30
+ };
31
+
32
+ export default BaseIcon;
@@ -0,0 +1,14 @@
1
+ import { SvgIconProps } from '@mui/material';
2
+
3
+ import BaseIcon from './BaseIcon';
4
+
5
+ const icon = (
6
+ <g>
7
+ <path d="M7.6215 5.243C7.9422 5.243 8.2557 5.1479 8.52236 4.96972C8.78901 4.79155 8.99685 4.53831 9.11958 4.24202C9.2423 3.94573 9.27441 3.6197 9.21185 3.30516C9.14928 2.99062 8.99485 2.70169 8.76808 2.47492C8.54131 2.24815 8.25238 2.09372 7.93784 2.03116C7.6233 1.96859 7.29727 2.0007 7.00098 2.12343C6.70469 2.24616 6.45145 2.45399 6.27327 2.72065C6.0951 2.9873 6 3.30079 6 3.6215C6 4.05155 6.17084 4.46398 6.47493 4.76807C6.77902 5.07216 7.19145 5.243 7.6215 5.243Z" />
8
+ <path d="M17.8192 12.3739C17.743 12.1905 17.6143 12.0338 17.4492 11.9235C17.2841 11.8132 17.0901 11.7541 16.8915 11.7538C16.8915 11.7538 14.9107 11.4903 14.3232 11.8736C14.0659 12.083 13.8556 12.3442 13.706 12.6403L10.396 12.1161C10.142 11.2785 9.05429 8.10738 9.05429 8.10738L8.24354 6.81076C8.09994 6.57117 7.89855 6.37142 7.6578 6.22979C7.41705 6.08815 7.14463 6.00914 6.86545 6C6.64749 6.01064 6.43062 6.03754 6.21666 6.0805L2 7.86971V11.68H2.23096L4.36037 12.0174L2.81746 19.7866H4.52041L5.979 13.3006L7.68196 14.9221V19.7866H9.30345V13.706L8.16304 12.6183L13.3649 13.4415L10.4094 19.9725L20.928 19.8671L17.8192 12.3739ZM8.03845 9.87167C8.03845 9.87167 8.59142 11.1712 8.88179 11.8736L7.67525 11.682L8.03845 9.87167ZM3.62437 11.0408V8.921L5.08295 8.35368L4.52137 11.1827L3.62437 11.0408Z" />
9
+ </g>
10
+ );
11
+
12
+ export const DowntimeIcon = (props: SvgIconProps): JSX.Element => (
13
+ <BaseIcon {...props} Icon={icon} height="24" viewBox="0 0 24 24" width="24" />
14
+ );
@@ -0,0 +1,8 @@
1
+ import { Dns } from '@mui/icons-material';
2
+ import { SvgIconProps } from '@mui/material';
3
+
4
+ import BaseIcon from './BaseIcon';
5
+
6
+ export const HostIcon = (props: SvgIconProps): JSX.Element => (
7
+ <BaseIcon Icon={Dns} dataTestId="HostIcon" {...props} />
8
+ );
@@ -0,0 +1,8 @@
1
+ import { Grain } from '@mui/icons-material';
2
+ import { SvgIconProps } from '@mui/material';
3
+
4
+ import BaseIcon from './BaseIcon';
5
+
6
+ export const ServiceIcon = (props: SvgIconProps): JSX.Element => (
7
+ <BaseIcon Icon={Grain} dataTestId="ServiceIcon" {...props} />
8
+ );
@@ -0,0 +1,4 @@
1
+ export { HostIcon } from './HostIcon';
2
+ export { ServiceIcon } from './ServiceIcon';
3
+ export { DowntimeIcon } from './DowntimeIcon';
4
+ export { AcknowledgementIcon } from './AcnowledgementIcon';
package/src/index.ts CHANGED
@@ -166,3 +166,4 @@ export * from './ParentSize';
166
166
  export { default as Subtitle } from './Typography/Subtitle';
167
167
  export { default as TablePagination } from './Listing/ActionBar/Pagination';
168
168
  export { default as PaginationActions } from './Listing/ActionBar/PaginationActions';
169
+ export * from './Icon';
@@ -60,7 +60,12 @@ export const useInfiniteScrollListing = <T>({
60
60
  customQueryParameters,
61
61
  parameters: { limit, page: params?.page || page, ...parameters }
62
62
  }),
63
- getQueryKey: () => [queryKeyName, page],
63
+ getQueryKey: () => [
64
+ queryKeyName,
65
+ page,
66
+ JSON.stringify(parameters),
67
+ JSON.stringify(customQueryParameters)
68
+ ],
64
69
  isPaginated: true,
65
70
  queryOptions: {
66
71
  enabled,
@@ -1 +0,0 @@
1
- <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><defs><style>.a{fill:none;}.b{opacity:1;}</style></defs><g transform="translate(-94.852 -137.365)"><rect class="a" width="24" height="24" transform="translate(94.852 137.365)"/><g class="b" transform="translate(97.108 140.129)"><path d="M103.476,143.64a1.692,1.692,0,1,0-1.692-1.692A1.692,1.692,0,0,0,103.476,143.64Z" transform="translate(-97.132 -140.255)"/><path d="M114.266,150.2a1.05,1.05,0,0,0-.968-.647s-2.067-.275-2.68.125a2.464,2.464,0,0,0-.644.8l-3.454-.547c-.265-.874-1.4-4.183-1.4-4.183l-.846-1.353a1.743,1.743,0,0,0-1.438-.846,4.571,4.571,0,0,0-.677.084l-4.4,1.867v3.976H98l2.222.352-1.61,8.107h1.777l1.522-6.768,1.777,1.692v5.076h1.692v-6.345l-1.19-1.135,5.428.859-3.084,6.815,10.976-.11Zm-10.206-2.611s.577,1.356.88,2.089l-1.259-.2Zm-4.606,1.22v-2.212l1.522-.592-.586,2.952Z" transform="translate(-97.762 -139.74)"/></g></g></svg>
@@ -1,9 +0,0 @@
1
- import { SvgIcon, SvgIconProps } from '@mui/material';
2
-
3
- import IconDowntime from '../../../@assets/icons/downtime.icon.svg';
4
-
5
- const Downtime = (props: SvgIconProps): JSX.Element => (
6
- <SvgIcon component={IconDowntime} {...props} />
7
- );
8
-
9
- export default Downtime;