@gridsuite/commons-ui 0.274.0 → 0.276.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/dist/components/ui/reactHookForm/booleans/BooleanInput.d.ts +1 -1
- package/dist/components/ui/reactHookForm/booleans/BooleanInput.js +4 -2
- package/dist/components/ui/reactHookForm/tableInputs/table-text-input.d.ts +1 -1
- package/dist/components/ui/reactHookForm/tableInputs/table-text-input.js +9 -2
- package/dist/features/network-modification-table/renderers/reference-link-cell.js +4 -1
- package/dist/features/network-modifications/common/currentLimits/LimitsPane.js +3 -3
- package/dist/translations/en/networkModificationsEn.d.ts +1 -0
- package/dist/translations/en/networkModificationsEn.js +2 -1
- package/dist/translations/fr/networkModificationsFr.d.ts +1 -0
- package/dist/translations/fr/networkModificationsFr.js +2 -1
- package/package.json +1 -1
|
@@ -9,5 +9,5 @@ export type BooleanInputProps<TInput extends InputTypes> = {
|
|
|
9
9
|
Input: TInput;
|
|
10
10
|
dataTestId?: string;
|
|
11
11
|
};
|
|
12
|
-
export declare function BooleanInput<TInput extends InputTypes>({ name, label, formProps, Input, dataTestId, }: Readonly<BooleanInputProps<TInput>>): JSX.Element;
|
|
12
|
+
export declare function BooleanInput<TInput extends InputTypes>({ name, label, formProps, Input, dataTestId, ...props }: Readonly<BooleanInputProps<TInput>>): JSX.Element;
|
|
13
13
|
export {};
|
|
@@ -8,7 +8,8 @@ function BooleanInput({
|
|
|
8
8
|
label,
|
|
9
9
|
formProps,
|
|
10
10
|
Input,
|
|
11
|
-
dataTestId
|
|
11
|
+
dataTestId,
|
|
12
|
+
...props
|
|
12
13
|
}) {
|
|
13
14
|
const { onChange, slotProps, ...otherFormProps } = formProps ?? { onChange: void 0 };
|
|
14
15
|
const {
|
|
@@ -30,7 +31,8 @@ function BooleanInput({
|
|
|
30
31
|
inputRef: ref,
|
|
31
32
|
slotProps: { input: { "aria-label": "primary checkbox" }, ...slotProps },
|
|
32
33
|
"data-testid": dataTestId,
|
|
33
|
-
...otherFormProps
|
|
34
|
+
...otherFormProps,
|
|
35
|
+
...props
|
|
34
36
|
}
|
|
35
37
|
);
|
|
36
38
|
if (label) {
|
|
@@ -5,5 +5,5 @@ interface TableTextInputProps {
|
|
|
5
5
|
inputProps?: InputBaseComponentProps;
|
|
6
6
|
dataTestId?: string;
|
|
7
7
|
}
|
|
8
|
-
export declare function TableTextInput({ name, hideErrorMessage, inputProps, dataTestId }: Readonly<TableTextInputProps>): import("react").JSX.Element;
|
|
8
|
+
export declare function TableTextInput({ name, hideErrorMessage, inputProps, dataTestId, ...props }: Readonly<TableTextInputProps>): import("react").JSX.Element;
|
|
9
9
|
export {};
|
|
@@ -5,7 +5,13 @@ import "react-intl";
|
|
|
5
5
|
import "react";
|
|
6
6
|
import "@mui/icons-material";
|
|
7
7
|
import { genHelperError } from "../utils/functions.js";
|
|
8
|
-
function TableTextInput({
|
|
8
|
+
function TableTextInput({
|
|
9
|
+
name,
|
|
10
|
+
hideErrorMessage,
|
|
11
|
+
inputProps,
|
|
12
|
+
dataTestId,
|
|
13
|
+
...props
|
|
14
|
+
}) {
|
|
9
15
|
const {
|
|
10
16
|
field: { onChange, value, ref },
|
|
11
17
|
fieldState: { error }
|
|
@@ -38,7 +44,8 @@ function TableTextInput({ name, hideErrorMessage, inputProps, dataTestId }) {
|
|
|
38
44
|
}
|
|
39
45
|
}
|
|
40
46
|
},
|
|
41
|
-
...hideErrorMessage ? {} : genHelperError(error?.message)
|
|
47
|
+
...hideErrorMessage ? {} : genHelperError(error?.message),
|
|
48
|
+
...props
|
|
42
49
|
}
|
|
43
50
|
);
|
|
44
51
|
}
|
|
@@ -90,7 +90,10 @@ function ReferenceLinkCell({ data, disabled = false }) {
|
|
|
90
90
|
`Cannot build reference link: ${!referenceId ? "referenceId" : "exploreUrl"} is missing`
|
|
91
91
|
);
|
|
92
92
|
}
|
|
93
|
-
const link =
|
|
93
|
+
const link = new URL(
|
|
94
|
+
`${exploreUrl}/elements/${referenceId}`,
|
|
95
|
+
globalThis.location.origin
|
|
96
|
+
).toString();
|
|
94
97
|
return navigator.clipboard.writeText(link).then(() => snackInfo({ headerId: "linkCopied" }));
|
|
95
98
|
}).catch((error) => snackWithFallback(snackError, error, { headerId: "linkCopyError" })).finally(() => setIsLoading(false));
|
|
96
99
|
},
|
|
@@ -95,7 +95,7 @@ function LimitsPane({
|
|
|
95
95
|
const watchedOperationalLimitsGroups = useWatch({
|
|
96
96
|
name: operationalLimitsGroupsFormName
|
|
97
97
|
});
|
|
98
|
-
const
|
|
98
|
+
const equipmentPresent = useMemo(() => !!equipmentToModify, [equipmentToModify]);
|
|
99
99
|
const getCurrentLimits = (equipment, operationalLimitsGroupId) => {
|
|
100
100
|
if (equipment?.currentLimits) {
|
|
101
101
|
return equipment.currentLimits.find(
|
|
@@ -155,7 +155,7 @@ function LimitsPane({
|
|
|
155
155
|
display: "flex",
|
|
156
156
|
alignItems: "center"
|
|
157
157
|
},
|
|
158
|
-
children:
|
|
158
|
+
children: isModification && /* @__PURE__ */ jsx(
|
|
159
159
|
InputWithPopupConfirmation,
|
|
160
160
|
{
|
|
161
161
|
Input: SwitchInput,
|
|
@@ -163,7 +163,7 @@ function LimitsPane({
|
|
|
163
163
|
label: olgEditable ? "Edit" : "View",
|
|
164
164
|
shouldOpenPopup: () => olgEditable,
|
|
165
165
|
onValueChange: resetOLGs,
|
|
166
|
-
message: "disableOLGedition",
|
|
166
|
+
message: equipmentPresent ? "disableOLGeditionByReplace" : "disableOLGedition",
|
|
167
167
|
validateButtonLabel: "validate"
|
|
168
168
|
}
|
|
169
169
|
)
|
|
@@ -284,7 +284,8 @@ const networkModificationsEn = {
|
|
|
284
284
|
unlimited: "Unlimited",
|
|
285
285
|
forbidden: "Forbidden",
|
|
286
286
|
Applicability: "Applicability",
|
|
287
|
-
|
|
287
|
+
disableOLGeditionByReplace: "Entered limit sets data will be lost to display their current values. Do you wish to continue ?",
|
|
288
|
+
disableOLGedition: "Entered limit sets data will be lost. Do you wish to continue ?",
|
|
288
289
|
Edit: "Edit",
|
|
289
290
|
View: "View",
|
|
290
291
|
TemporaryCurrentLimitsText: "Temporary current limits",
|
|
@@ -284,7 +284,8 @@ const networkModificationsFr = {
|
|
|
284
284
|
unlimited: "Illimité",
|
|
285
285
|
forbidden: "Interdit",
|
|
286
286
|
Applicability: "Applicable sur",
|
|
287
|
-
|
|
287
|
+
disableOLGeditionByReplace: "Les données saisies pour les jeux de limites seront perdues pour afficher leurs valeurs courantes. Voulez-vous continuer ?",
|
|
288
|
+
disableOLGedition: "Les données saisies pour les jeux de limites seront perdues. Voulez-vous continuer ?",
|
|
288
289
|
Edit: "Édition",
|
|
289
290
|
View: "Visualisation",
|
|
290
291
|
TemporaryCurrentLimitsText: "Limites d'intensité temporaires",
|