@centreon/ui 24.4.68 → 24.4.69

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.4.68",
3
+ "version": "24.4.69",
4
4
  "description": "Centreon UI Components",
5
5
  "scripts": {
6
6
  "update:deps": "pnpx npm-check-updates -i --format group",
@@ -15,6 +15,7 @@ import { useMemoComponent } from '../utils';
15
15
  import { useDashboardItemStyles } from './Dashboard.styles';
16
16
 
17
17
  interface DashboardItemProps {
18
+ additionalMemoProps?: Array<unknown>;
18
19
  canMove?: boolean;
19
20
  children: ReactElement;
20
21
  className?: string;
@@ -39,7 +40,8 @@ const Item = forwardRef<HTMLDivElement, DashboardItemProps>(
39
40
  onTouchEnd,
40
41
  id,
41
42
  disablePadding = false,
42
- canMove = false
43
+ canMove = false,
44
+ additionalMemoProps = []
43
45
  }: DashboardItemProps,
44
46
  ref: ForwardedRef<HTMLDivElement>
45
47
  ): ReactElement => {
@@ -92,7 +94,14 @@ const Item = forwardRef<HTMLDivElement, DashboardItemProps>(
92
94
  </Card>
93
95
  </div>
94
96
  ),
95
- memoProps: [style, className, header, theme.palette.mode, canMove]
97
+ memoProps: [
98
+ style,
99
+ className,
100
+ header,
101
+ theme.palette.mode,
102
+ canMove,
103
+ ...additionalMemoProps
104
+ ]
96
105
  });
97
106
  }
98
107
  );
@@ -16,6 +16,7 @@ import Grid from './Grid';
16
16
  const ReactGridLayout = WidthProvider(GridLayout);
17
17
 
18
18
  interface DashboardLayoutProps<T> {
19
+ additionalMemoProps?: Array<unknown>;
19
20
  changeLayout?: (newLayout: Array<Layout>) => void;
20
21
  children: Array<JSX.Element>;
21
22
  displayGrid?: boolean;
@@ -28,7 +29,8 @@ const DashboardLayout = <T extends Layout>({
28
29
  changeLayout,
29
30
  displayGrid,
30
31
  layout,
31
- isStatic = false
32
+ isStatic = false,
33
+ additionalMemoProps = []
32
34
  }: DashboardLayoutProps<T>): JSX.Element => {
33
35
  const { classes } = useDashboardLayoutStyles(isStatic);
34
36
 
@@ -72,7 +74,7 @@ const DashboardLayout = <T extends Layout>({
72
74
  </ParentSize>
73
75
  </ResponsiveHeight>
74
76
  ),
75
- memoProps: [columns, layout, displayGrid, isStatic]
77
+ memoProps: [columns, layout, displayGrid, isStatic, ...additionalMemoProps]
76
78
  });
77
79
  };
78
80
 
@@ -24,6 +24,7 @@ interface CustomTimePeriod {
24
24
  interface UseMetricsQueryProps {
25
25
  baseEndpoint: string;
26
26
  bypassMetricsExclusion?: boolean;
27
+ bypassQueryParams?: boolean;
27
28
  includeAllResources?: boolean;
28
29
  metrics: Array<Metric>;
29
30
  refreshCount?: number;
@@ -90,7 +91,8 @@ const useGraphQuery = ({
90
91
  timePeriodType: 1
91
92
  },
92
93
  refreshInterval = false,
93
- refreshCount
94
+ refreshCount,
95
+ bypassQueryParams = false
94
96
  }: UseMetricsQueryProps): UseMetricsQueryState => {
95
97
  const timePeriodToUse = equals(timePeriod?.timePeriodType, -1)
96
98
  ? {
@@ -114,6 +116,10 @@ const useGraphQuery = ({
114
116
  isLoading
115
117
  } = useFetchQuery<PerformanceGraphData>({
116
118
  getEndpoint: () => {
119
+ if (bypassQueryParams) {
120
+ return baseEndpoint;
121
+ }
122
+
117
123
  const endpoint = buildListingEndpoint({
118
124
  baseEndpoint,
119
125
  parameters: {