@centreon/ui 25.9.1 → 25.9.3
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
|
@@ -98,6 +98,7 @@ export type TextProps = {
|
|
|
98
98
|
transparent?: boolean;
|
|
99
99
|
value?: string;
|
|
100
100
|
textFieldSlotsAndSlotProps?: TextFieldSlotsAndSlotProps<InputProps>;
|
|
101
|
+
forceUncontrolled?: boolean;
|
|
101
102
|
} & Omit<TextFieldProps, 'variant' | 'size' | 'error'>;
|
|
102
103
|
|
|
103
104
|
const TextField = forwardRef(
|
|
@@ -123,6 +124,7 @@ const TextField = forwardRef(
|
|
|
123
124
|
containerClassName,
|
|
124
125
|
type,
|
|
125
126
|
textFieldSlotsAndSlotProps,
|
|
127
|
+
forceUncontrolled,
|
|
126
128
|
...rest
|
|
127
129
|
}: TextProps,
|
|
128
130
|
ref: React.ForwardedRef<HTMLDivElement>
|
|
@@ -141,7 +143,7 @@ const TextField = forwardRef(
|
|
|
141
143
|
const tooltipTitle = displayErrorInTooltip && !isNil(error) ? error : '';
|
|
142
144
|
|
|
143
145
|
const getValueProps = useCallback((): object => {
|
|
144
|
-
if (debounced) {
|
|
146
|
+
if (debounced || forceUncontrolled) {
|
|
145
147
|
return {};
|
|
146
148
|
}
|
|
147
149
|
if (defaultValue) {
|
|
@@ -149,7 +151,7 @@ const TextField = forwardRef(
|
|
|
149
151
|
}
|
|
150
152
|
|
|
151
153
|
return { value: innerValue };
|
|
152
|
-
}, [innerValue, debounced, defaultValue]);
|
|
154
|
+
}, [innerValue, debounced, defaultValue, forceUncontrolled]);
|
|
153
155
|
|
|
154
156
|
return (
|
|
155
157
|
<Box
|
|
@@ -36,6 +36,7 @@ interface UseMetricsQueryProps {
|
|
|
36
36
|
start?: string | null;
|
|
37
37
|
timePeriodType: number;
|
|
38
38
|
};
|
|
39
|
+
isEnabled?: boolean;
|
|
39
40
|
}
|
|
40
41
|
|
|
41
42
|
interface UseMetricsQueryState {
|
|
@@ -101,7 +102,8 @@ const useGraphQuery = ({
|
|
|
101
102
|
refreshInterval = false,
|
|
102
103
|
refreshCount,
|
|
103
104
|
bypassQueryParams = false,
|
|
104
|
-
prefix
|
|
105
|
+
prefix,
|
|
106
|
+
isEnabled=true
|
|
105
107
|
}: UseMetricsQueryProps): UseMetricsQueryState => {
|
|
106
108
|
const timePeriodToUse = equals(timePeriod?.timePeriodType, -1)
|
|
107
109
|
? {
|
|
@@ -158,7 +160,7 @@ const useGraphQuery = ({
|
|
|
158
160
|
refreshCount || 0
|
|
159
161
|
],
|
|
160
162
|
queryOptions: {
|
|
161
|
-
enabled: areResourcesFullfilled(resources) && !isEmpty(definedMetrics),
|
|
163
|
+
enabled: areResourcesFullfilled(resources) && !isEmpty(definedMetrics) && isEnabled,
|
|
162
164
|
refetchInterval: refreshInterval,
|
|
163
165
|
suspense: false
|
|
164
166
|
},
|