@gridsuite/commons-ui 0.275.0 → 0.277.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-modifications/common/currentLimits/LimitsPane.js +3 -3
- package/dist/features/network-modifications/common/properties/properties.type.d.ts +3 -0
- package/dist/features/network-modifications/common/properties/propertyUtils.d.ts +3 -3
- package/dist/features/network-modifications/common/properties/propertyUtils.js +2 -2
- package/dist/features/network-modifications/voltageLevel/creation/voltageLevelCreation.utils.d.ts +1 -25
- package/dist/features/network-modifications/voltageLevel/creation/voltageLevelCreation.utils.js +8 -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
|
}
|
|
@@ -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
|
)
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { PredefinedProperties } from '../../../../utils';
|
|
2
|
-
import { FilledProperty, Properties, Property } from './properties.type';
|
|
2
|
+
import { FilledProperties, FilledProperty, Properties, Property } from './properties.type';
|
|
3
3
|
export type EquipmentWithProperties = {
|
|
4
4
|
properties?: Record<string, string>;
|
|
5
5
|
};
|
|
@@ -7,9 +7,9 @@ export declare const fetchPredefinedProperties: (networkElementType: string) =>
|
|
|
7
7
|
export declare const emptyProperties: Properties;
|
|
8
8
|
export declare const createPropertyModification: (name: string, value: string | null) => Property;
|
|
9
9
|
export declare const initializedProperty: () => Property;
|
|
10
|
-
export declare const getFilledPropertiesFromModification: (properties: Property[] | undefined | null) => FilledProperty[];
|
|
10
|
+
export declare const getFilledPropertiesFromModification: (properties: Property[] | undefined | null, includePreviousValue?: boolean) => FilledProperty[];
|
|
11
11
|
export declare const getPropertiesFromModification: (properties: Property[] | undefined | null, includePreviousValue?: boolean) => Properties;
|
|
12
|
-
export declare const copyEquipmentPropertiesForCreation: (equipmentInfos: EquipmentWithProperties) =>
|
|
12
|
+
export declare const copyEquipmentPropertiesForCreation: (equipmentInfos: EquipmentWithProperties) => FilledProperties;
|
|
13
13
|
export declare const mergeModificationAndEquipmentProperties: (modificationProperties: Property[], equipment: EquipmentWithProperties) => Property[];
|
|
14
14
|
export declare function getConcatenatedProperties(equipment: EquipmentWithProperties, getValues: (name: string) => any, id?: string): any;
|
|
15
15
|
export declare const toModificationProperties: (properties: Properties) => Property[] | null;
|
|
@@ -29,12 +29,12 @@ const initializedProperty = () => {
|
|
|
29
29
|
const isFilledProperty = (property) => {
|
|
30
30
|
return property.value != null;
|
|
31
31
|
};
|
|
32
|
-
const getFilledPropertiesFromModification = (properties) => {
|
|
32
|
+
const getFilledPropertiesFromModification = (properties, includePreviousValue = true) => {
|
|
33
33
|
return properties?.filter(isFilledProperty).map((p) => {
|
|
34
34
|
return {
|
|
35
35
|
[FieldConstants.NAME]: p[FieldConstants.NAME],
|
|
36
36
|
[FieldConstants.VALUE]: p[FieldConstants.VALUE],
|
|
37
|
-
[FieldConstants.PREVIOUS_VALUE]: p[FieldConstants.PREVIOUS_VALUE],
|
|
37
|
+
[FieldConstants.PREVIOUS_VALUE]: includePreviousValue ? p[FieldConstants.PREVIOUS_VALUE] : void 0,
|
|
38
38
|
[FieldConstants.ADDED]: p[FieldConstants.ADDED],
|
|
39
39
|
[FieldConstants.DELETION_MARK]: p[FieldConstants.DELETION_MARK]
|
|
40
40
|
};
|
package/dist/features/network-modifications/voltageLevel/creation/voltageLevelCreation.utils.d.ts
CHANGED
|
@@ -118,28 +118,4 @@ export declare const voltageLevelCreationEmptyFormData: {
|
|
|
118
118
|
};
|
|
119
119
|
export declare const voltageLevelCreationFormToDto: (voltageLevelForm: VoltageLevelCreationFormData) => VoltageLevelCreationDto;
|
|
120
120
|
export declare const translateSwitchKinds: (switchKinds: SwitchKind[] | null, intl?: IntlShape) => string;
|
|
121
|
-
export declare const voltageLevelCreationDtoToForm: (voltageLevelDto: VoltageLevelCreationDto, intl?: IntlShape, includePreviousValue?: boolean) =>
|
|
122
|
-
AdditionalProperties?: import('../..').Property[];
|
|
123
|
-
equipmentID: string;
|
|
124
|
-
equipmentName: string;
|
|
125
|
-
substationId: string | null;
|
|
126
|
-
nominalV: number | null;
|
|
127
|
-
lowVoltageLimit: number | null;
|
|
128
|
-
highVoltageLimit: number | null;
|
|
129
|
-
lowShortCircuitCurrentLimit: any;
|
|
130
|
-
highShortCircuitCurrentLimit: any;
|
|
131
|
-
busbarCount: number;
|
|
132
|
-
sectionCount: number;
|
|
133
|
-
switchesBetweenSections: string;
|
|
134
|
-
couplingOmnibus: import('./voltageLevelCreation.types').CouplingDevice[];
|
|
135
|
-
switchKinds: {
|
|
136
|
-
switchKind: SwitchKind;
|
|
137
|
-
}[];
|
|
138
|
-
addSubstationCreationId: boolean;
|
|
139
|
-
substationCreationId: string | null;
|
|
140
|
-
substationName: string | null;
|
|
141
|
-
country: string | null;
|
|
142
|
-
substationCreation: import('../..').Properties;
|
|
143
|
-
hideNominalVoltage: boolean;
|
|
144
|
-
hideBusBarSection: boolean;
|
|
145
|
-
};
|
|
121
|
+
export declare const voltageLevelCreationDtoToForm: (voltageLevelDto: VoltageLevelCreationDto, intl?: IntlShape, includePreviousValue?: boolean) => VoltageLevelCreationFormData;
|
package/dist/features/network-modifications/voltageLevel/creation/voltageLevelCreation.utils.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { object, array, string, ref, number, boolean } from "yup";
|
|
2
|
-
import { creationPropertiesSchema,
|
|
2
|
+
import { creationPropertiesSchema, getFilledPropertiesFromModification, toModificationProperties } from "../../common/properties/propertyUtils.js";
|
|
3
3
|
import { FieldConstants } from "../../../../utils/constants/fieldConstants.js";
|
|
4
4
|
import { SHORT_CIRCUIT_CURRENT_LIMIT_MUST_BE_GREATER_OR_EQUAL_TO_ZERO, MUST_BE_GREATER_OR_EQUAL_TO_ZERO, CREATE_SUBSTATION_IN_VOLTAGE_LEVEL_IDENTICAL_ID } from "../../../../utils/constants/translationKeys.js";
|
|
5
5
|
import { convertInputValue, convertOutputValue } from "../../../../utils/conversionUtils.js";
|
|
@@ -234,7 +234,9 @@ const voltageLevelCreationFormToDto = (voltageLevelForm) => {
|
|
|
234
234
|
const translateSwitchKinds = (switchKinds, intl) => switchKinds?.map((kind) => intl ? intl.formatMessage({ id: kind }) : kind).join(" / ") ?? "";
|
|
235
235
|
const voltageLevelCreationDtoToForm = (voltageLevelDto, intl, includePreviousValue = true) => {
|
|
236
236
|
const isSubstationCreation = voltageLevelDto.substationCreation?.equipmentId != null;
|
|
237
|
-
const substationProperties =
|
|
237
|
+
const substationProperties = {
|
|
238
|
+
[FieldConstants.ADDITIONAL_PROPERTIES]: isSubstationCreation ? getFilledPropertiesFromModification(voltageLevelDto.substationCreation?.properties, includePreviousValue) : []
|
|
239
|
+
};
|
|
238
240
|
return {
|
|
239
241
|
[FieldConstants.EQUIPMENT_ID]: voltageLevelDto.equipmentId,
|
|
240
242
|
[FieldConstants.EQUIPMENT_NAME]: voltageLevelDto.equipmentName ?? "",
|
|
@@ -264,7 +266,10 @@ const voltageLevelCreationDtoToForm = (voltageLevelDto, intl, includePreviousVal
|
|
|
264
266
|
[FieldConstants.SUBSTATION_CREATION]: substationProperties,
|
|
265
267
|
[FieldConstants.HIDE_NOMINAL_VOLTAGE]: false,
|
|
266
268
|
[FieldConstants.HIDE_BUS_BAR_SECTION]: false,
|
|
267
|
-
|
|
269
|
+
[FieldConstants.ADDITIONAL_PROPERTIES]: getFilledPropertiesFromModification(
|
|
270
|
+
voltageLevelDto.properties,
|
|
271
|
+
includePreviousValue
|
|
272
|
+
)
|
|
268
273
|
};
|
|
269
274
|
};
|
|
270
275
|
export {
|
|
@@ -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",
|