@gridsuite/commons-ui 0.241.1 → 0.243.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/README.md +10 -2
- package/dist/components/composite/filter/explicitNaming/ExplicitNamingFilterForm.js +1 -1
- package/dist/components/composite/grid/grid-item.d.ts +2 -1
- package/dist/components/composite/grid/grid-item.js +9 -2
- package/dist/components/ui/csvPicker/csv-picker.d.ts +7 -2
- package/dist/components/ui/csvPicker/csv-picker.js +7 -6
- package/dist/components/ui/inputs/checkbox-autocomplete/checkbox-autocomplete.d.ts +1 -2
- package/dist/features/index.js +87 -3
- package/dist/features/network-modification-table/index.js +2 -1
- package/dist/features/network-modification-table/use-modifications-drag-and-drop.js +2 -1
- package/dist/features/network-modification-table/utils.d.ts +1 -0
- package/dist/features/network-modification-table/utils.js +5 -1
- package/dist/features/network-modifications/battery/creation/BatteryCreationForm.js +3 -0
- package/dist/features/network-modifications/battery/creation/batteryCreation.utils.js +3 -0
- package/dist/features/network-modifications/battery/modification/BatteryDialogHeader.js +3 -0
- package/dist/features/network-modifications/battery/modification/BatteryDialogTabsContent.js +3 -0
- package/dist/features/network-modifications/battery/modification/batteryModification.utils.js +3 -0
- package/dist/features/network-modifications/common/connectivity/connectivityForm.utils.d.ts +71 -2
- package/dist/features/network-modifications/common/connectivity/connectivityForm.utils.js +26 -8
- package/dist/features/network-modifications/common/connectivity/index.js +3 -1
- package/dist/features/network-modifications/common/currentLimits/LimitsPane.d.ts +7 -0
- package/dist/features/network-modifications/common/currentLimits/LimitsPane.js +243 -0
- package/dist/features/network-modifications/common/currentLimits/LimitsTagChip.d.ts +9 -0
- package/dist/features/network-modifications/common/currentLimits/LimitsTagChip.js +29 -0
- package/dist/features/network-modifications/common/currentLimits/SelectedOperationalLimitGroup.d.ts +9 -0
- package/dist/features/network-modifications/common/currentLimits/SelectedOperationalLimitGroup.js +100 -0
- package/dist/features/network-modifications/common/currentLimits/index.d.ts +12 -0
- package/dist/features/network-modifications/common/currentLimits/index.js +47 -0
- package/dist/features/network-modifications/common/currentLimits/limits.types.d.ts +52 -0
- package/dist/features/network-modifications/common/currentLimits/limits.types.js +17 -0
- package/dist/features/network-modifications/common/currentLimits/limitsEditor/LimitsEditor.d.ts +10 -0
- package/dist/features/network-modifications/common/currentLimits/limitsEditor/LimitsEditor.js +285 -0
- package/dist/features/network-modifications/common/currentLimits/limitsEditor/LimitsPropertiesSideStack.d.ts +5 -0
- package/dist/features/network-modifications/common/currentLimits/limitsEditor/LimitsPropertiesSideStack.js +184 -0
- package/dist/features/network-modifications/common/currentLimits/limitsEditor/TemporaryLimitsTable.d.ts +14 -0
- package/dist/features/network-modifications/common/currentLimits/limitsEditor/TemporaryLimitsTable.js +166 -0
- package/dist/features/network-modifications/common/currentLimits/limitsEditor/index.d.ts +10 -0
- package/dist/features/network-modifications/common/currentLimits/limitsEditor/index.js +10 -0
- package/dist/features/network-modifications/common/currentLimits/limitsEditor/limitsChart.d.ts +11 -0
- package/dist/features/network-modifications/common/currentLimits/limitsEditor/limitsChart.js +177 -0
- package/dist/features/network-modifications/common/currentLimits/limitsPane.utils.d.ts +213 -0
- package/dist/features/network-modifications/common/currentLimits/limitsPane.utils.js +337 -0
- package/dist/features/network-modifications/common/currentLimits/operationalLimitsGroups/LimitsGroupsContextualMenu.d.ts +25 -0
- package/dist/features/network-modifications/common/currentLimits/operationalLimitsGroups/LimitsGroupsContextualMenu.js +92 -0
- package/dist/features/network-modifications/common/currentLimits/operationalLimitsGroups/LimitsPropertiesStack.d.ts +10 -0
- package/dist/features/network-modifications/common/currentLimits/operationalLimitsGroups/LimitsPropertiesStack.js +25 -0
- package/dist/features/network-modifications/common/currentLimits/operationalLimitsGroups/OperationalLimitsGroupTabLabel.d.ts +10 -0
- package/dist/features/network-modifications/common/currentLimits/operationalLimitsGroups/OperationalLimitsGroupTabLabel.js +73 -0
- package/dist/features/network-modifications/common/currentLimits/operationalLimitsGroups/OperationalLimitsGroups.d.ts +16 -0
- package/dist/features/network-modifications/common/currentLimits/operationalLimitsGroups/OperationalLimitsGroups.js +121 -0
- package/dist/features/network-modifications/common/currentLimits/operationalLimitsGroups/index.d.ts +11 -0
- package/dist/features/network-modifications/common/currentLimits/operationalLimitsGroups/index.js +12 -0
- package/dist/features/network-modifications/common/currentLimits/operationalLimitsGroups/operationalLimitsGroups.types.d.ts +71 -0
- package/dist/features/network-modifications/common/currentLimits/operationalLimitsGroups/operationalLimitsGroups.types.js +15 -0
- package/dist/features/network-modifications/common/currentLimits/operationalLimitsGroups/operationalLimitsGroupsStyles.d.ts +46 -0
- package/dist/features/network-modifications/common/currentLimits/operationalLimitsGroups/operationalLimitsGroupsStyles.js +45 -0
- package/dist/features/network-modifications/common/index.d.ts +1 -0
- package/dist/features/network-modifications/common/index.js +50 -2
- package/dist/features/network-modifications/common/measurements/branchActiveReactivePowerForm.utils.d.ts +11 -0
- package/dist/features/network-modifications/common/measurements/branchActiveReactivePowerForm.utils.js +6 -4
- package/dist/features/network-modifications/common/measurements/index.js +2 -1
- package/dist/features/network-modifications/common/reactiveLimits/reactiveCapabilityCurve/ReactiveCapabilityCurveTableForm.js +1 -1
- package/dist/features/network-modifications/common/voltageRegulation/VoltageRegulationForm.js +3 -7
- package/dist/features/network-modifications/equipmentDeletion/EquipmentDeletionForm.js +3 -0
- package/dist/features/network-modifications/generator/creation/GeneratorCreationForm.js +9 -6
- package/dist/features/network-modifications/generator/creation/generatorCreation.utils.js +3 -0
- package/dist/features/network-modifications/generator/modification/GeneratorDialogHeader.js +3 -0
- package/dist/features/network-modifications/generator/modification/GeneratorDialogTabsContent.js +9 -6
- package/dist/features/network-modifications/generator/modification/generatorModification.utils.js +3 -0
- package/dist/features/network-modifications/index.d.ts +1 -0
- package/dist/features/network-modifications/index.js +85 -2
- package/dist/features/network-modifications/line/catalog/index.d.ts +8 -0
- package/dist/features/network-modifications/line/catalog/index.js +14 -0
- package/dist/features/network-modifications/line/catalog/lineCatalog.type.d.ts +66 -0
- package/dist/features/network-modifications/line/catalog/lineCatalog.type.js +7 -0
- package/dist/features/network-modifications/line/catalog/segment.utils.d.ts +90 -0
- package/dist/features/network-modifications/line/catalog/segment.utils.js +100 -0
- package/dist/features/network-modifications/line/characteristics/LineCharacteristicsPane.d.ts +8 -0
- package/dist/features/network-modifications/line/characteristics/LineCharacteristicsPane.js +152 -0
- package/dist/features/network-modifications/line/characteristics/index.d.ts +9 -0
- package/dist/features/network-modifications/line/characteristics/index.js +9 -0
- package/dist/features/network-modifications/line/characteristics/lineCharacteristicsPane.types.d.ts +14 -0
- package/dist/features/network-modifications/line/characteristics/lineCharacteristicsPane.types.js +1 -0
- package/dist/features/network-modifications/line/characteristics/lineCharacteristicsPane.utils.d.ts +52 -0
- package/dist/features/network-modifications/line/characteristics/lineCharacteristicsPane.utils.js +53 -0
- package/dist/features/network-modifications/line/common/LineDialogHeader.d.ts +6 -0
- package/dist/features/network-modifications/line/common/LineDialogHeader.js +103 -0
- package/dist/features/network-modifications/line/common/LineDialogTabs.d.ts +9 -0
- package/dist/features/network-modifications/line/common/LineDialogTabs.js +61 -0
- package/dist/features/network-modifications/line/common/LineDialogTabsContent.d.ts +8 -0
- package/dist/features/network-modifications/line/common/LineDialogTabsContent.js +96 -0
- package/dist/features/network-modifications/line/common/LineForm.d.ts +6 -0
- package/dist/features/network-modifications/line/common/LineForm.js +50 -0
- package/dist/features/network-modifications/line/common/index.d.ts +12 -0
- package/dist/features/network-modifications/line/common/index.js +13 -0
- package/dist/features/network-modifications/line/common/line.types.d.ts +47 -0
- package/dist/features/network-modifications/line/common/line.types.js +1 -0
- package/dist/features/network-modifications/line/common/line.utils.d.ts +13 -0
- package/dist/features/network-modifications/line/common/line.utils.js +34 -0
- package/dist/features/network-modifications/line/creation/index.d.ts +8 -0
- package/dist/features/network-modifications/line/creation/index.js +7 -0
- package/dist/features/network-modifications/line/creation/lineCreation.types.d.ts +39 -0
- package/dist/features/network-modifications/line/creation/lineCreation.types.js +1 -0
- package/dist/features/network-modifications/line/creation/lineCreation.utils.d.ts +151 -0
- package/dist/features/network-modifications/line/creation/lineCreation.utils.js +172 -0
- package/dist/features/network-modifications/line/index.d.ts +10 -0
- package/dist/features/network-modifications/line/index.js +37 -0
- package/dist/features/network-modifications/load/common/LoadDialogHeader.js +3 -0
- package/dist/features/network-modifications/load/modification/loadModification.utils.js +3 -0
- package/dist/features/network-modifications/shunt-compensator/common/CharacteristicsForm.js +7 -6
- package/dist/features/network-modifications/shunt-compensator/creation/ShuntCompensatorCreationForm.js +3 -0
- package/dist/features/network-modifications/shunt-compensator/creation/shuntCompensatorCreation.utils.js +3 -0
- package/dist/features/network-modifications/shunt-compensator/modification/ShuntCompensatorModificationForm.js +3 -0
- package/dist/features/network-modifications/shunt-compensator/modification/shuntCompensatorModification.utils.js +3 -0
- package/dist/features/network-modifications/substation/creation/SubstationCreationForm.js +3 -0
- package/dist/features/network-modifications/substation/modification/SubstationModificationForm.js +3 -0
- package/dist/features/network-modifications/voltageLevel/creation/VoltageLevelCreationForm.js +3 -0
- package/dist/features/network-modifications/voltageLevel/creation/index.js +3 -0
- package/dist/features/network-modifications/voltageLevel/creation/tabs/substationTab/SubstationCreationSection.js +3 -0
- package/dist/features/network-modifications/voltageLevel/creation/voltageLevelCreation.utils.js +3 -0
- package/dist/features/network-modifications/voltageLevel/index.js +3 -0
- package/dist/features/network-modifications/voltageLevel/modification/VoltageLevelModificationForm.js +4 -1
- package/dist/features/parameters/common/contingency-table/contingency-table.js +22 -10
- package/dist/features/parameters/common/contingency-table/types.d.ts +7 -8
- package/dist/features/parameters/common/contingency-table/utils.d.ts +13 -0
- package/dist/features/parameters/common/contingency-table/utils.js +31 -0
- package/dist/features/parameters/loadflow/load-flow-general-parameters.js +5 -1
- package/dist/features/parameters/security-analysis/security-analysis-parameters-form.js +19 -31
- package/dist/hooks/useModificationLabelComputer.js +1 -0
- package/dist/index.js +87 -7
- package/dist/translations/en/index.d.ts +0 -1
- package/dist/translations/en/index.js +0 -2
- package/dist/translations/en/networkModificationsEn.d.ts +28 -0
- package/dist/translations/en/networkModificationsEn.js +28 -0
- package/dist/translations/en/parameters.d.ts +3 -1
- package/dist/translations/en/parameters.js +3 -1
- package/dist/translations/fr/index.d.ts +0 -1
- package/dist/translations/fr/index.js +0 -2
- package/dist/translations/fr/networkModificationsFr.d.ts +28 -0
- package/dist/translations/fr/networkModificationsFr.js +28 -0
- package/dist/translations/fr/parameters.d.ts +3 -1
- package/dist/translations/fr/parameters.js +3 -1
- package/dist/utils/constants/fieldConstants.d.ts +47 -1
- package/dist/utils/constants/fieldConstants.js +46 -0
- package/dist/utils/types/modificationType.d.ts +4 -0
- package/dist/utils/types/modificationType.js +5 -0
- package/package.json +11 -4
- package/dist/translations/en/inputsEn.d.ts +0 -24
- package/dist/translations/en/inputsEn.js +0 -21
- package/dist/translations/fr/inputsFr.d.ts +0 -24
- package/dist/translations/fr/inputsFr.js +0 -21
|
@@ -4,9 +4,9 @@ import "../../../../utils/conversionUtils.js";
|
|
|
4
4
|
import "../../../../utils/types/equipmentType.js";
|
|
5
5
|
import "react/jsx-runtime";
|
|
6
6
|
import "@mui/icons-material";
|
|
7
|
-
const getVoltageLevelAndBusOrBusBarSectionFieldsSchema = (isEquipmentModification, relatedFieldName) => {
|
|
7
|
+
const getVoltageLevelAndBusOrBusBarSectionFieldsSchema = (isEquipmentModification, relatedFieldName, displayConnectivity = true) => {
|
|
8
8
|
return object().nullable().when({
|
|
9
|
-
is: () => !isEquipmentModification,
|
|
9
|
+
is: () => !isEquipmentModification && displayConnectivity,
|
|
10
10
|
then: (schema) => schema.required()
|
|
11
11
|
}).shape({
|
|
12
12
|
[FieldConstants.ID]: string().when([], {
|
|
@@ -19,31 +19,43 @@ const getVoltageLevelAndBusOrBusBarSectionFieldsSchema = (isEquipmentModificatio
|
|
|
19
19
|
return !(isEmpty && !isEmptyRelatedField);
|
|
20
20
|
});
|
|
21
21
|
};
|
|
22
|
-
const getConnectivityPropertiesValidationSchema = (isEquipmentModification = false) => {
|
|
22
|
+
const getConnectivityPropertiesValidationSchema = (isEquipmentModification = false, displayConnectivity = true) => {
|
|
23
23
|
return {
|
|
24
24
|
[FieldConstants.VOLTAGE_LEVEL]: getVoltageLevelAndBusOrBusBarSectionFieldsSchema(
|
|
25
25
|
isEquipmentModification,
|
|
26
|
-
FieldConstants.BUS_OR_BUSBAR_SECTION
|
|
26
|
+
FieldConstants.BUS_OR_BUSBAR_SECTION,
|
|
27
|
+
displayConnectivity
|
|
27
28
|
),
|
|
28
29
|
[FieldConstants.BUS_OR_BUSBAR_SECTION]: getVoltageLevelAndBusOrBusBarSectionFieldsSchema(
|
|
29
30
|
isEquipmentModification,
|
|
30
|
-
FieldConstants.VOLTAGE_LEVEL
|
|
31
|
+
FieldConstants.VOLTAGE_LEVEL,
|
|
32
|
+
displayConnectivity
|
|
31
33
|
)
|
|
32
34
|
};
|
|
33
35
|
};
|
|
34
|
-
const getConnectivityWithPositionSchema = (isEquipmentModification = false) => object().shape({
|
|
36
|
+
const getConnectivityWithPositionSchema = (isEquipmentModification = false, displayConnectivity = true) => object().shape({
|
|
35
37
|
[FieldConstants.CONNECTION_DIRECTION]: string().nullable(),
|
|
36
38
|
[FieldConstants.CONNECTION_NAME]: string(),
|
|
37
39
|
[FieldConstants.CONNECTION_POSITION]: number().nullable(),
|
|
38
40
|
[FieldConstants.CONNECTED]: bool().nullable().when([], {
|
|
39
|
-
is: () => !isEquipmentModification,
|
|
41
|
+
is: () => !isEquipmentModification && displayConnectivity,
|
|
40
42
|
then: (schema) => schema.required()
|
|
41
43
|
}),
|
|
42
|
-
...getConnectivityPropertiesValidationSchema(isEquipmentModification)
|
|
44
|
+
...getConnectivityPropertiesValidationSchema(isEquipmentModification, displayConnectivity)
|
|
43
45
|
});
|
|
44
46
|
const getConnectivityWithPositionValidationSchema = (isEquipmentModification = false, id = FieldConstants.CONNECTIVITY) => ({
|
|
45
47
|
[id]: getConnectivityWithPositionSchema(isEquipmentModification)
|
|
46
48
|
});
|
|
49
|
+
const getBranchConnectivityWithPositionSchema = (isEquipmentModification, displayConnectivity) => object().shape({
|
|
50
|
+
[FieldConstants.CONNECTIVITY_1]: getConnectivityWithPositionSchema(
|
|
51
|
+
isEquipmentModification,
|
|
52
|
+
displayConnectivity
|
|
53
|
+
),
|
|
54
|
+
[FieldConstants.CONNECTIVITY_2]: getConnectivityWithPositionSchema(
|
|
55
|
+
isEquipmentModification,
|
|
56
|
+
displayConnectivity
|
|
57
|
+
)
|
|
58
|
+
});
|
|
47
59
|
const getCon1andCon2WithPositionValidationSchema = (isEquipmentModification = false, id = FieldConstants.CONNECTIVITY) => ({
|
|
48
60
|
[id]: object().shape({
|
|
49
61
|
...getConnectivityWithPositionValidationSchema(isEquipmentModification, FieldConstants.CONNECTIVITY_1),
|
|
@@ -68,6 +80,10 @@ const getConnectivityWithPositionEmptyFormDataProps = (isEquipmentModification =
|
|
|
68
80
|
[FieldConstants.CONNECTION_NAME]: "",
|
|
69
81
|
[FieldConstants.CONNECTION_POSITION]: null
|
|
70
82
|
});
|
|
83
|
+
const getBranchConnectivityWithPositionEmptyFormDataProps = (isEquipmentModification = false) => ({
|
|
84
|
+
[FieldConstants.CONNECTIVITY_1]: getConnectivityWithPositionEmptyFormDataProps(isEquipmentModification),
|
|
85
|
+
[FieldConstants.CONNECTIVITY_2]: getConnectivityWithPositionEmptyFormDataProps(isEquipmentModification)
|
|
86
|
+
});
|
|
71
87
|
const getConnectivityWithPositionEmptyFormData = (isEquipmentModification = false, id = FieldConstants.CONNECTIVITY) => ({
|
|
72
88
|
[id]: getConnectivityWithPositionEmptyFormDataProps(isEquipmentModification)
|
|
73
89
|
});
|
|
@@ -175,6 +191,8 @@ const createConnectivityData = (equipmentToModify, index) => ({
|
|
|
175
191
|
});
|
|
176
192
|
export {
|
|
177
193
|
createConnectivityData,
|
|
194
|
+
getBranchConnectivityWithPositionEmptyFormDataProps,
|
|
195
|
+
getBranchConnectivityWithPositionSchema,
|
|
178
196
|
getCon1andCon2WithPositionValidationSchema,
|
|
179
197
|
getConnectivityBusBarSectionData,
|
|
180
198
|
getConnectivityData,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { createConnectivityData, getCon1andCon2WithPositionValidationSchema, getConnectivityBusBarSectionData, getConnectivityData, getConnectivityFormData, getConnectivityFormDataProps, getConnectivityPropertiesData, getConnectivityPropertiesEmptyFormData, getConnectivityPropertiesValidationSchema, getConnectivityVoltageLevelData, getConnectivityWithPositionEmptyFormData, getConnectivityWithPositionEmptyFormDataProps, getConnectivityWithPositionSchema, getConnectivityWithPositionValidationSchema, getConnectivityWithoutPositionEmptyFormData, getConnectivityWithoutPositionValidationSchema, getCont1Cont2WithPositionEmptyFormData, getNewVoltageLevelData } from "./connectivityForm.utils.js";
|
|
1
|
+
import { createConnectivityData, getBranchConnectivityWithPositionEmptyFormDataProps, getBranchConnectivityWithPositionSchema, getCon1andCon2WithPositionValidationSchema, getConnectivityBusBarSectionData, getConnectivityData, getConnectivityFormData, getConnectivityFormDataProps, getConnectivityPropertiesData, getConnectivityPropertiesEmptyFormData, getConnectivityPropertiesValidationSchema, getConnectivityVoltageLevelData, getConnectivityWithPositionEmptyFormData, getConnectivityWithPositionEmptyFormDataProps, getConnectivityWithPositionSchema, getConnectivityWithPositionValidationSchema, getConnectivityWithoutPositionEmptyFormData, getConnectivityWithoutPositionValidationSchema, getCont1Cont2WithPositionEmptyFormData, getNewVoltageLevelData } from "./connectivityForm.utils.js";
|
|
2
2
|
import { ConnectivityForm } from "./ConnectivityForm.js";
|
|
3
3
|
import { BranchConnectivityForm } from "./BranchConnectivityForm.js";
|
|
4
4
|
import { VoltageLevelConnectivityForm } from "./VoltageLevelConnectivityForm.js";
|
|
@@ -7,6 +7,8 @@ export {
|
|
|
7
7
|
ConnectivityForm,
|
|
8
8
|
VoltageLevelConnectivityForm,
|
|
9
9
|
createConnectivityData,
|
|
10
|
+
getBranchConnectivityWithPositionEmptyFormDataProps,
|
|
11
|
+
getBranchConnectivityWithPositionSchema,
|
|
10
12
|
getCon1andCon2WithPositionValidationSchema,
|
|
11
13
|
getConnectivityBusBarSectionData,
|
|
12
14
|
getConnectivityData,
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { BranchInfos } from '../../line/common/line.types';
|
|
2
|
+
export interface LimitsPaneProps {
|
|
3
|
+
id?: string;
|
|
4
|
+
equipmentToModify?: BranchInfos | null;
|
|
5
|
+
clearableFields?: boolean;
|
|
6
|
+
}
|
|
7
|
+
export declare function LimitsPane({ id, equipmentToModify, clearableFields, }: Readonly<LimitsPaneProps>): import("react").JSX.Element;
|
|
@@ -0,0 +1,243 @@
|
|
|
1
|
+
import { jsxs, Fragment, jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Grid2, Box, IconButton, lighten } from "@mui/material";
|
|
3
|
+
import { useState, useMemo, useCallback } from "react";
|
|
4
|
+
import { useFormContext, useWatch, useFieldArray } from "react-hook-form";
|
|
5
|
+
import { ControlPoint } from "@mui/icons-material";
|
|
6
|
+
import { OperationalLimitsGroups } from "./operationalLimitsGroups/OperationalLimitsGroups.js";
|
|
7
|
+
import { SelectedOperationalLimitGroup } from "./SelectedOperationalLimitGroup.js";
|
|
8
|
+
import { LimitsEditor } from "./limitsEditor/LimitsEditor.js";
|
|
9
|
+
import { generateEmptyOperationalLimitsGroup, generateUniqueId, mapServerLimitsGroupsToFormInfos } from "./limitsPane.utils.js";
|
|
10
|
+
import { FieldConstants } from "../../../../utils/constants/fieldConstants.js";
|
|
11
|
+
import "../../../../utils/conversionUtils.js";
|
|
12
|
+
import "../../../../utils/types/equipmentType.js";
|
|
13
|
+
import { APPLICABILITY } from "./limits.types.js";
|
|
14
|
+
import "react-intl";
|
|
15
|
+
import "../../../../components/ui/overflowableText/OverflowableText.js";
|
|
16
|
+
import "localized-countries";
|
|
17
|
+
import "localized-countries/data/fr";
|
|
18
|
+
import "localized-countries/data/en";
|
|
19
|
+
import "notistack";
|
|
20
|
+
import "../../../../components/ui/reactHookForm/provider/CustomFormProvider.js";
|
|
21
|
+
import "yup";
|
|
22
|
+
import "../../../../components/ui/treeViewFinder/TreeViewFinder.js";
|
|
23
|
+
import { SwitchInput } from "../../../../components/ui/reactHookForm/booleans/SwitchInput.js";
|
|
24
|
+
import "../../../../components/ui/reactHookForm/numbers/RangeInput.js";
|
|
25
|
+
import { InputWithPopupConfirmation } from "../../../../components/ui/reactHookForm/selectInputs/InputWithPopupConfirmation.js";
|
|
26
|
+
import "@material-symbols/svg-400/outlined/left_panel_open.svg?react";
|
|
27
|
+
import "@material-symbols/svg-400/outlined/arrows_output.svg?react";
|
|
28
|
+
import "@material-symbols/svg-400/outlined/arrows_input.svg?react";
|
|
29
|
+
import "@material-symbols/svg-400/outlined/left_panel_close.svg?react";
|
|
30
|
+
import "@material-symbols/svg-400/outlined/add_notes.svg?react";
|
|
31
|
+
import "../../../../components/ui/dialogs/descriptionModificationDialog/DescriptionModificationDialog.js";
|
|
32
|
+
import "../../../../components/ui/reactHookForm/expandableInput/ExpandableInput.js";
|
|
33
|
+
import "../../../../components/ui/reactHookForm/directory-item-input/directory-item-utils.js";
|
|
34
|
+
import "@hello-pangea/dnd";
|
|
35
|
+
import "../../../../components/ui/dialogs/elementSaveDialog/ElementSaveDialog.js";
|
|
36
|
+
import "../../../../components/ui/snackbarProvider/SnackbarProvider.js";
|
|
37
|
+
import "mui-nested-menu";
|
|
38
|
+
import "react-resizable-panels";
|
|
39
|
+
import "react-papaparse";
|
|
40
|
+
import "react-dom";
|
|
41
|
+
import "autosuggest-highlight/match";
|
|
42
|
+
import "autosuggest-highlight/parse";
|
|
43
|
+
import "clsx";
|
|
44
|
+
import "../../../../components/composite/filter/FilterCreationDialog.js";
|
|
45
|
+
import "../../../../components/composite/filter/HeaderFilterForm.js";
|
|
46
|
+
import "../../../../components/composite/filter/explicitNaming/ExplicitNamingFilterForm.js";
|
|
47
|
+
import "../../../../components/composite/filter/expert/ExpertFilterForm.js";
|
|
48
|
+
import "../../../../components/composite/filter/expert/ExpertFilterEditionDialog.js";
|
|
49
|
+
import "../../../../components/composite/filter/expert/expertFilterConstants.js";
|
|
50
|
+
import "react-querybuilder";
|
|
51
|
+
import "uuid";
|
|
52
|
+
import "../../../../components/composite/filter/explicitNaming/ExplicitNamingFilterEditionDialog.js";
|
|
53
|
+
import "../../../../components/composite/filter/utils/filterFormUtils.js";
|
|
54
|
+
import { GridSection } from "../../../../components/composite/grid/grid-section.js";
|
|
55
|
+
import "@react-querybuilder/material";
|
|
56
|
+
import "../../../../components/composite/reactQueryBuilder/CustomReactQueryBuilder.js";
|
|
57
|
+
import "../../../../components/composite/reactQueryBuilder/PropertyValueEditor.js";
|
|
58
|
+
import "../../../../components/composite/agGridTable/BottomTableButtons.js";
|
|
59
|
+
import "../../../../components/composite/agGridTable/CustomAgGridTable.js";
|
|
60
|
+
import "ag-grid-community";
|
|
61
|
+
import "../../../../components/composite/customAGGrid/customAggrid.js";
|
|
62
|
+
import "../../../../components/composite/customAGGrid/context/custom-aggrid-context.js";
|
|
63
|
+
import "mathjs";
|
|
64
|
+
import "../../../../components/composite/report/report-viewer/log-table/log-table.js";
|
|
65
|
+
import "react-window";
|
|
66
|
+
import "../../../../components/composite/report/report-treeview/treeview-item.js";
|
|
67
|
+
import "../../../../components/composite/report/report-viewer/context/report-viewer-context.js";
|
|
68
|
+
const limitsStyles = {
|
|
69
|
+
parametersBox: (theme) => ({
|
|
70
|
+
backgroundColor: theme.palette.mode === "light" ? theme.palette.background.paper : lighten(theme.palette.background.paper, 0.2),
|
|
71
|
+
height: "100%",
|
|
72
|
+
position: "relative",
|
|
73
|
+
padding: 0
|
|
74
|
+
})
|
|
75
|
+
};
|
|
76
|
+
function LimitsPane({
|
|
77
|
+
id = FieldConstants.LIMITS,
|
|
78
|
+
equipmentToModify,
|
|
79
|
+
clearableFields
|
|
80
|
+
}) {
|
|
81
|
+
const [indexSelectedLimitSet, setIndexSelectedLimitSet] = useState(null);
|
|
82
|
+
const { getValues, reset } = useFormContext();
|
|
83
|
+
const olgEditable = useWatch({
|
|
84
|
+
name: `${id}.${FieldConstants.ENABLE_OLG_MODIFICATION}`
|
|
85
|
+
});
|
|
86
|
+
const operationalLimitsGroupsFormName = `${id}.${FieldConstants.OPERATIONAL_LIMITS_GROUPS}`;
|
|
87
|
+
const {
|
|
88
|
+
fields: operationalLimitsGroups,
|
|
89
|
+
append: appendToLimitsGroups,
|
|
90
|
+
prepend: prependToLimitsGroups,
|
|
91
|
+
remove: removeLimitsGroups
|
|
92
|
+
} = useFieldArray({
|
|
93
|
+
name: operationalLimitsGroupsFormName
|
|
94
|
+
});
|
|
95
|
+
const watchedOperationalLimitsGroups = useWatch({
|
|
96
|
+
name: operationalLimitsGroupsFormName
|
|
97
|
+
});
|
|
98
|
+
const isAModification = useMemo(() => !!equipmentToModify, [equipmentToModify]);
|
|
99
|
+
const getCurrentLimits = (equipment, operationalLimitsGroupId) => {
|
|
100
|
+
if (equipment?.currentLimits) {
|
|
101
|
+
return equipment.currentLimits.find(
|
|
102
|
+
(currentLimit) => currentLimit.id + currentLimit.applicability === operationalLimitsGroupId
|
|
103
|
+
);
|
|
104
|
+
}
|
|
105
|
+
return null;
|
|
106
|
+
};
|
|
107
|
+
const getCurrentLimitsIgnoreApplicability = (equipment, operationalLimitsGroupName) => {
|
|
108
|
+
if (equipment?.currentLimits) {
|
|
109
|
+
return equipment.currentLimits.find(
|
|
110
|
+
(currentLimit) => currentLimit.id === operationalLimitsGroupName
|
|
111
|
+
);
|
|
112
|
+
}
|
|
113
|
+
return null;
|
|
114
|
+
};
|
|
115
|
+
const handlePopupConfirmation = () => {
|
|
116
|
+
const resetOLGs = mapServerLimitsGroupsToFormInfos(
|
|
117
|
+
equipmentToModify?.currentLimits ?? []
|
|
118
|
+
);
|
|
119
|
+
const currentValues = getValues();
|
|
120
|
+
reset(
|
|
121
|
+
{
|
|
122
|
+
...currentValues,
|
|
123
|
+
[FieldConstants.LIMITS]: {
|
|
124
|
+
[FieldConstants.OPERATIONAL_LIMITS_GROUPS]: resetOLGs,
|
|
125
|
+
[FieldConstants.ENABLE_OLG_MODIFICATION]: false
|
|
126
|
+
}
|
|
127
|
+
},
|
|
128
|
+
{ keepDefaultValues: true }
|
|
129
|
+
);
|
|
130
|
+
};
|
|
131
|
+
const prependEmptyOperationalLimitsGroup = useCallback(
|
|
132
|
+
(name) => {
|
|
133
|
+
prependToLimitsGroups(generateEmptyOperationalLimitsGroup(name));
|
|
134
|
+
},
|
|
135
|
+
[prependToLimitsGroups]
|
|
136
|
+
);
|
|
137
|
+
const addNewLimitSet = useCallback(() => {
|
|
138
|
+
let name = "DEFAULT";
|
|
139
|
+
if (watchedOperationalLimitsGroups?.length > 0) {
|
|
140
|
+
const ids = watchedOperationalLimitsGroups.map((l) => l.name);
|
|
141
|
+
name = generateUniqueId("DEFAULT", ids);
|
|
142
|
+
}
|
|
143
|
+
prependEmptyOperationalLimitsGroup(name);
|
|
144
|
+
setIndexSelectedLimitSet(0);
|
|
145
|
+
}, [watchedOperationalLimitsGroups, prependEmptyOperationalLimitsGroup]);
|
|
146
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
147
|
+
/* @__PURE__ */ jsxs(Grid2, { container: true, columns: 6, spacing: 1, sx: { maxWidth: "600px" }, children: [
|
|
148
|
+
/* @__PURE__ */ jsx(Grid2, { size: 3, children: /* @__PURE__ */ jsx(GridSection, { title: "SelectedOperationalLimitGroups" }) }),
|
|
149
|
+
/* @__PURE__ */ jsx(
|
|
150
|
+
Grid2,
|
|
151
|
+
{
|
|
152
|
+
size: 3,
|
|
153
|
+
sx: {
|
|
154
|
+
display: "flex",
|
|
155
|
+
alignItems: "center"
|
|
156
|
+
},
|
|
157
|
+
children: isAModification && /* @__PURE__ */ jsx(
|
|
158
|
+
InputWithPopupConfirmation,
|
|
159
|
+
{
|
|
160
|
+
Input: SwitchInput,
|
|
161
|
+
name: `${id}.${FieldConstants.ENABLE_OLG_MODIFICATION}`,
|
|
162
|
+
label: olgEditable ? "Edit" : "View",
|
|
163
|
+
shouldOpenPopup: () => olgEditable,
|
|
164
|
+
resetOnConfirmation: handlePopupConfirmation,
|
|
165
|
+
message: "disableOLGedition",
|
|
166
|
+
validateButtonLabel: "validate"
|
|
167
|
+
}
|
|
168
|
+
)
|
|
169
|
+
}
|
|
170
|
+
),
|
|
171
|
+
/* @__PURE__ */ jsx(Grid2, { size: 3, children: /* @__PURE__ */ jsx(
|
|
172
|
+
SelectedOperationalLimitGroup,
|
|
173
|
+
{
|
|
174
|
+
selectedFormName: `${id}.${FieldConstants.SELECTED_OPERATIONAL_LIMITS_GROUP_ID1}`,
|
|
175
|
+
optionsFormName: `${id}.${FieldConstants.OPERATIONAL_LIMITS_GROUPS}`,
|
|
176
|
+
label: "Side1",
|
|
177
|
+
filteredApplicability: APPLICABILITY.SIDE1.id,
|
|
178
|
+
previousValue: equipmentToModify?.selectedOperationalLimitsGroupId1,
|
|
179
|
+
isABranchModif: !!equipmentToModify
|
|
180
|
+
}
|
|
181
|
+
) }),
|
|
182
|
+
/* @__PURE__ */ jsx(Grid2, { size: 3, children: /* @__PURE__ */ jsx(
|
|
183
|
+
SelectedOperationalLimitGroup,
|
|
184
|
+
{
|
|
185
|
+
selectedFormName: `${id}.${FieldConstants.SELECTED_OPERATIONAL_LIMITS_GROUP_ID2}`,
|
|
186
|
+
optionsFormName: `${id}.${FieldConstants.OPERATIONAL_LIMITS_GROUPS}`,
|
|
187
|
+
label: "Side2",
|
|
188
|
+
filteredApplicability: APPLICABILITY.SIDE2.id,
|
|
189
|
+
previousValue: equipmentToModify?.selectedOperationalLimitsGroupId2,
|
|
190
|
+
isABranchModif: !!equipmentToModify
|
|
191
|
+
}
|
|
192
|
+
) })
|
|
193
|
+
] }),
|
|
194
|
+
/* @__PURE__ */ jsxs(Grid2, { container: true, size: 12, columns: 10.25, children: [
|
|
195
|
+
/* @__PURE__ */ jsxs(Grid2, { size: 4, children: [
|
|
196
|
+
/* @__PURE__ */ jsxs(
|
|
197
|
+
Box,
|
|
198
|
+
{
|
|
199
|
+
sx: {
|
|
200
|
+
display: "flex",
|
|
201
|
+
alignItems: "center"
|
|
202
|
+
},
|
|
203
|
+
children: [
|
|
204
|
+
/* @__PURE__ */ jsx(GridSection, { size: 12, title: "LimitSets" }),
|
|
205
|
+
/* @__PURE__ */ jsx(IconButton, { color: "primary", onClick: addNewLimitSet, disabled: !olgEditable, children: /* @__PURE__ */ jsx(ControlPoint, {}) })
|
|
206
|
+
]
|
|
207
|
+
}
|
|
208
|
+
),
|
|
209
|
+
/* @__PURE__ */ jsx(
|
|
210
|
+
OperationalLimitsGroups,
|
|
211
|
+
{
|
|
212
|
+
parentFormName: id,
|
|
213
|
+
appendToLimitsGroups,
|
|
214
|
+
removeLimitsGroups,
|
|
215
|
+
indexSelectedLimitSet,
|
|
216
|
+
setIndexSelectedLimitSet,
|
|
217
|
+
editable: olgEditable,
|
|
218
|
+
currentLimitsToModify: equipmentToModify?.currentLimits ?? []
|
|
219
|
+
}
|
|
220
|
+
)
|
|
221
|
+
] }),
|
|
222
|
+
/* @__PURE__ */ jsx(Grid2, { size: 6, sx: limitsStyles.parametersBox, marginLeft: 2, children: indexSelectedLimitSet !== null && operationalLimitsGroups.map(
|
|
223
|
+
(operationalLimitsGroup, index) => index === indexSelectedLimitSet && /* @__PURE__ */ jsx(
|
|
224
|
+
LimitsEditor,
|
|
225
|
+
{
|
|
226
|
+
name: `${id}.${FieldConstants.OPERATIONAL_LIMITS_GROUPS}[${index}]`,
|
|
227
|
+
clearableFields,
|
|
228
|
+
permanentCurrentLimitPreviousValue: getCurrentLimits(equipmentToModify, operationalLimitsGroup.id)?.permanentLimit ?? getCurrentLimitsIgnoreApplicability(
|
|
229
|
+
equipmentToModify,
|
|
230
|
+
operationalLimitsGroup.name
|
|
231
|
+
)?.permanentLimit,
|
|
232
|
+
temporaryLimitsPreviousValues: getCurrentLimits(equipmentToModify, operationalLimitsGroup.id)?.temporaryLimits ?? [],
|
|
233
|
+
disabled: !olgEditable
|
|
234
|
+
},
|
|
235
|
+
operationalLimitsGroup.id
|
|
236
|
+
)
|
|
237
|
+
) })
|
|
238
|
+
] })
|
|
239
|
+
] });
|
|
240
|
+
}
|
|
241
|
+
export {
|
|
242
|
+
LimitsPane
|
|
243
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ChipProps } from '@mui/material';
|
|
2
|
+
import { LimitsProperty } from './limits.types';
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
export declare function getPropertyAvatar(type: string): string;
|
|
5
|
+
export interface LimitTagChipProps extends Omit<ChipProps, 'sx' | 'label' | 'avatar'> {
|
|
6
|
+
limitsProperty: LimitsProperty;
|
|
7
|
+
showTooltip?: boolean;
|
|
8
|
+
}
|
|
9
|
+
export declare function LimitsTagChip({ limitsProperty, showTooltip, onDelete, ...props }: Readonly<LimitTagChipProps>): React.JSX.Element;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Chip, Avatar, Tooltip } from "@mui/material";
|
|
3
|
+
function getPropertyAvatar(type) {
|
|
4
|
+
const transformedType = type;
|
|
5
|
+
const descriptions = {
|
|
6
|
+
[
|
|
7
|
+
"Limit type"
|
|
8
|
+
/* LIMITS_TYPE */
|
|
9
|
+
]: "Ty"
|
|
10
|
+
};
|
|
11
|
+
return descriptions[transformedType] ?? transformedType.substring(0, 2);
|
|
12
|
+
}
|
|
13
|
+
function LimitsTagChip({ limitsProperty, showTooltip, onDelete, ...props }) {
|
|
14
|
+
const chipContent = /* @__PURE__ */ jsx(
|
|
15
|
+
Chip,
|
|
16
|
+
{
|
|
17
|
+
avatar: /* @__PURE__ */ jsx(Avatar, { children: getPropertyAvatar(limitsProperty.name) }),
|
|
18
|
+
label: limitsProperty.value,
|
|
19
|
+
sx: { maxWidth: onDelete ? "200px" : "180px", margin: 0.5, borderRadius: "4px" },
|
|
20
|
+
onDelete,
|
|
21
|
+
...props
|
|
22
|
+
}
|
|
23
|
+
);
|
|
24
|
+
return showTooltip ? /* @__PURE__ */ jsx(Tooltip, { title: `${limitsProperty.name} : ${limitsProperty.value}`, children: chipContent }) : chipContent;
|
|
25
|
+
}
|
|
26
|
+
export {
|
|
27
|
+
LimitsTagChip,
|
|
28
|
+
getPropertyAvatar
|
|
29
|
+
};
|
package/dist/features/network-modifications/common/currentLimits/SelectedOperationalLimitGroup.d.ts
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export interface SelectedOperationalLimitGroupProps {
|
|
2
|
+
selectedFormName: string;
|
|
3
|
+
optionsFormName: string;
|
|
4
|
+
label?: string;
|
|
5
|
+
filteredApplicability?: string;
|
|
6
|
+
previousValue?: string;
|
|
7
|
+
isABranchModif: boolean;
|
|
8
|
+
}
|
|
9
|
+
export declare function SelectedOperationalLimitGroup({ selectedFormName, optionsFormName, label, filteredApplicability, previousValue, isABranchModif, }: Readonly<SelectedOperationalLimitGroupProps>): import("react").JSX.Element;
|
package/dist/features/network-modifications/common/currentLimits/SelectedOperationalLimitGroup.js
ADDED
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo } from "react";
|
|
3
|
+
import { useWatch } from "react-hook-form";
|
|
4
|
+
import { Box } from "@mui/material";
|
|
5
|
+
import { useIntl } from "react-intl";
|
|
6
|
+
import { APPLICABILITY } from "./limits.types.js";
|
|
7
|
+
import "@mui/icons-material";
|
|
8
|
+
import "../../../../components/ui/overflowableText/OverflowableText.js";
|
|
9
|
+
import "../../../../utils/conversionUtils.js";
|
|
10
|
+
import "../../../../utils/types/equipmentType.js";
|
|
11
|
+
import "localized-countries";
|
|
12
|
+
import "localized-countries/data/fr";
|
|
13
|
+
import "localized-countries/data/en";
|
|
14
|
+
import "notistack";
|
|
15
|
+
import "../../../../components/ui/reactHookForm/provider/CustomFormProvider.js";
|
|
16
|
+
import "yup";
|
|
17
|
+
import "../../../../components/ui/treeViewFinder/TreeViewFinder.js";
|
|
18
|
+
import { AutocompleteInput } from "../../../../components/ui/reactHookForm/autocompleteInputs/AutocompleteInput.js";
|
|
19
|
+
import "../../../../components/ui/reactHookForm/numbers/RangeInput.js";
|
|
20
|
+
import "@material-symbols/svg-400/outlined/left_panel_open.svg?react";
|
|
21
|
+
import "@material-symbols/svg-400/outlined/arrows_output.svg?react";
|
|
22
|
+
import "@material-symbols/svg-400/outlined/arrows_input.svg?react";
|
|
23
|
+
import "@material-symbols/svg-400/outlined/left_panel_close.svg?react";
|
|
24
|
+
import "@material-symbols/svg-400/outlined/add_notes.svg?react";
|
|
25
|
+
import "../../../../components/ui/dialogs/descriptionModificationDialog/DescriptionModificationDialog.js";
|
|
26
|
+
import "../../../../components/ui/reactHookForm/expandableInput/ExpandableInput.js";
|
|
27
|
+
import "../../../../components/ui/reactHookForm/directory-item-input/directory-item-utils.js";
|
|
28
|
+
import "@hello-pangea/dnd";
|
|
29
|
+
import "../../../../components/ui/dialogs/elementSaveDialog/ElementSaveDialog.js";
|
|
30
|
+
import "../../../../components/ui/snackbarProvider/SnackbarProvider.js";
|
|
31
|
+
import "mui-nested-menu";
|
|
32
|
+
import "react-resizable-panels";
|
|
33
|
+
import "react-papaparse";
|
|
34
|
+
import "react-dom";
|
|
35
|
+
import "autosuggest-highlight/match";
|
|
36
|
+
import "autosuggest-highlight/parse";
|
|
37
|
+
import "clsx";
|
|
38
|
+
import "../../../../components/composite/filter/FilterCreationDialog.js";
|
|
39
|
+
import "../../../../components/composite/filter/HeaderFilterForm.js";
|
|
40
|
+
import "../../../../components/composite/filter/explicitNaming/ExplicitNamingFilterForm.js";
|
|
41
|
+
import "../../../../components/composite/filter/expert/ExpertFilterForm.js";
|
|
42
|
+
import "../../../../components/composite/filter/expert/ExpertFilterEditionDialog.js";
|
|
43
|
+
import "../../../../components/composite/filter/expert/expertFilterConstants.js";
|
|
44
|
+
import "react-querybuilder";
|
|
45
|
+
import "uuid";
|
|
46
|
+
import "../../../../components/composite/filter/explicitNaming/ExplicitNamingFilterEditionDialog.js";
|
|
47
|
+
import "../../../../components/composite/filter/utils/filterFormUtils.js";
|
|
48
|
+
import "@react-querybuilder/material";
|
|
49
|
+
import "../../../../components/composite/reactQueryBuilder/CustomReactQueryBuilder.js";
|
|
50
|
+
import "../../../../components/composite/reactQueryBuilder/PropertyValueEditor.js";
|
|
51
|
+
import "../../../../components/composite/agGridTable/BottomTableButtons.js";
|
|
52
|
+
import "../../../../components/composite/agGridTable/CustomAgGridTable.js";
|
|
53
|
+
import "ag-grid-community";
|
|
54
|
+
import "../../../../components/composite/customAGGrid/customAggrid.js";
|
|
55
|
+
import "../../../../components/composite/customAGGrid/context/custom-aggrid-context.js";
|
|
56
|
+
import "mathjs";
|
|
57
|
+
import "../../../../components/composite/report/report-viewer/log-table/log-table.js";
|
|
58
|
+
import "react-window";
|
|
59
|
+
import "../../../../components/composite/report/report-treeview/treeview-item.js";
|
|
60
|
+
import "../../../../components/composite/report/report-viewer/context/report-viewer-context.js";
|
|
61
|
+
function SelectedOperationalLimitGroup({
|
|
62
|
+
selectedFormName,
|
|
63
|
+
optionsFormName,
|
|
64
|
+
label,
|
|
65
|
+
filteredApplicability,
|
|
66
|
+
previousValue,
|
|
67
|
+
isABranchModif
|
|
68
|
+
}) {
|
|
69
|
+
const optionsValues = useWatch({
|
|
70
|
+
name: optionsFormName
|
|
71
|
+
});
|
|
72
|
+
const intl = useIntl();
|
|
73
|
+
const opLimitsGroupsNames = useMemo(() => {
|
|
74
|
+
const finalOptions = optionsValues ? optionsValues.filter(
|
|
75
|
+
(optionObj) => optionObj.applicability && (optionObj.applicability === filteredApplicability || optionObj.applicability === APPLICABILITY.EQUIPMENT.id)
|
|
76
|
+
).map((filteredoptionObj) => filteredoptionObj.name).filter((id) => id != null) : [];
|
|
77
|
+
if (isABranchModif) {
|
|
78
|
+
finalOptions.push(
|
|
79
|
+
intl.formatMessage({
|
|
80
|
+
id: "None"
|
|
81
|
+
})
|
|
82
|
+
);
|
|
83
|
+
}
|
|
84
|
+
return finalOptions;
|
|
85
|
+
}, [filteredApplicability, intl, isABranchModif, optionsValues]);
|
|
86
|
+
return /* @__PURE__ */ jsx(Box, { sx: { maxWidth: 300 }, children: /* @__PURE__ */ jsx(
|
|
87
|
+
AutocompleteInput,
|
|
88
|
+
{
|
|
89
|
+
name: selectedFormName,
|
|
90
|
+
options: opLimitsGroupsNames,
|
|
91
|
+
label: label ?? "SelectedOperationalLimitGroup",
|
|
92
|
+
size: "small",
|
|
93
|
+
previousValue,
|
|
94
|
+
allowNewValue: isABranchModif
|
|
95
|
+
}
|
|
96
|
+
) });
|
|
97
|
+
}
|
|
98
|
+
export {
|
|
99
|
+
SelectedOperationalLimitGroup
|
|
100
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2026, RTE (http://www.rte-france.com)
|
|
3
|
+
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
4
|
+
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
5
|
+
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
6
|
+
*/
|
|
7
|
+
export * from './limits.types';
|
|
8
|
+
export * from './LimitsTagChip';
|
|
9
|
+
export * from './LimitsPane';
|
|
10
|
+
export * from './limitsPane.utils';
|
|
11
|
+
export * from './limitsEditor';
|
|
12
|
+
export * from './operationalLimitsGroups';
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { APPLICABILITY, TEMPORARY_LIMIT_MODIFICATION_TYPE } from "./limits.types.js";
|
|
2
|
+
import { LimitsTagChip, getPropertyAvatar } from "./LimitsTagChip.js";
|
|
3
|
+
import { LimitsPane } from "./LimitsPane.js";
|
|
4
|
+
import { addModificationTypeToOpLimitsGroups, addModificationTypeToTemporaryLimits, addOperationTypeToSelectedOpLG, convertToOperationalLimitsGroupFormSchema, formatMapInfosToTemporaryLimitsFormSchema, formatOpLimitGroupsToFormInfos, formatTemporaryLimitsModificationToFormSchema, generateEmptyOperationalLimitsGroup, generateUniqueId, getAllLimitsFormData, getAllLimitsFormDataProperties, getLimitsEmptyFormData, getLimitsEmptyFormDataProps, getLimitsValidationSchema, getLimitsValidationSchemaProps, mapServerLimitsGroupsToFormInfos, sanitizeLimitNames, sanitizeLimitsGroups } from "./limitsPane.utils.js";
|
|
5
|
+
import { LimitsChart } from "./limitsEditor/limitsChart.js";
|
|
6
|
+
import { LimitsPropertiesSideStack } from "./limitsEditor/LimitsPropertiesSideStack.js";
|
|
7
|
+
import { LimitsEditor } from "./limitsEditor/LimitsEditor.js";
|
|
8
|
+
import { TemporaryLimitsTable } from "./limitsEditor/TemporaryLimitsTable.js";
|
|
9
|
+
import { OPERATIONAL_LIMITS_GROUPS_MODIFICATION_TYPE } from "./operationalLimitsGroups/operationalLimitsGroups.types.js";
|
|
10
|
+
import { LimitsGroupsContextualMenu } from "./operationalLimitsGroups/LimitsGroupsContextualMenu.js";
|
|
11
|
+
import { LimitsPropertiesStack } from "./operationalLimitsGroups/LimitsPropertiesStack.js";
|
|
12
|
+
import { OperationalLimitsGroups } from "./operationalLimitsGroups/OperationalLimitsGroups.js";
|
|
13
|
+
import { OperationalLimitsGroupTabLabel } from "./operationalLimitsGroups/OperationalLimitsGroupTabLabel.js";
|
|
14
|
+
export {
|
|
15
|
+
APPLICABILITY,
|
|
16
|
+
LimitsChart,
|
|
17
|
+
LimitsEditor,
|
|
18
|
+
LimitsGroupsContextualMenu,
|
|
19
|
+
LimitsPane,
|
|
20
|
+
LimitsPropertiesSideStack,
|
|
21
|
+
LimitsPropertiesStack,
|
|
22
|
+
LimitsTagChip,
|
|
23
|
+
OPERATIONAL_LIMITS_GROUPS_MODIFICATION_TYPE,
|
|
24
|
+
OperationalLimitsGroupTabLabel,
|
|
25
|
+
OperationalLimitsGroups,
|
|
26
|
+
TEMPORARY_LIMIT_MODIFICATION_TYPE,
|
|
27
|
+
TemporaryLimitsTable,
|
|
28
|
+
addModificationTypeToOpLimitsGroups,
|
|
29
|
+
addModificationTypeToTemporaryLimits,
|
|
30
|
+
addOperationTypeToSelectedOpLG,
|
|
31
|
+
convertToOperationalLimitsGroupFormSchema,
|
|
32
|
+
formatMapInfosToTemporaryLimitsFormSchema,
|
|
33
|
+
formatOpLimitGroupsToFormInfos,
|
|
34
|
+
formatTemporaryLimitsModificationToFormSchema,
|
|
35
|
+
generateEmptyOperationalLimitsGroup,
|
|
36
|
+
generateUniqueId,
|
|
37
|
+
getAllLimitsFormData,
|
|
38
|
+
getAllLimitsFormDataProperties,
|
|
39
|
+
getLimitsEmptyFormData,
|
|
40
|
+
getLimitsEmptyFormDataProps,
|
|
41
|
+
getLimitsValidationSchema,
|
|
42
|
+
getLimitsValidationSchemaProps,
|
|
43
|
+
getPropertyAvatar,
|
|
44
|
+
mapServerLimitsGroupsToFormInfos,
|
|
45
|
+
sanitizeLimitNames,
|
|
46
|
+
sanitizeLimitsGroups
|
|
47
|
+
};
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { AttributeModification } from '../../../../utils';
|
|
2
|
+
export declare const APPLICABILITY: {
|
|
3
|
+
EQUIPMENT: {
|
|
4
|
+
id: string;
|
|
5
|
+
label: string;
|
|
6
|
+
};
|
|
7
|
+
SIDE1: {
|
|
8
|
+
id: string;
|
|
9
|
+
label: string;
|
|
10
|
+
};
|
|
11
|
+
SIDE2: {
|
|
12
|
+
id: string;
|
|
13
|
+
label: string;
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
export declare const TEMPORARY_LIMIT_MODIFICATION_TYPE: {
|
|
17
|
+
readonly MODIFY: "MODIFY";
|
|
18
|
+
readonly MODIFY_OR_ADD: "MODIFY_OR_ADD";
|
|
19
|
+
readonly ADD: "ADD";
|
|
20
|
+
readonly DELETE: "DELETE";
|
|
21
|
+
readonly REPLACE: "REPLACE";
|
|
22
|
+
};
|
|
23
|
+
export interface LimitsProperty {
|
|
24
|
+
name: string;
|
|
25
|
+
value: string;
|
|
26
|
+
}
|
|
27
|
+
export interface TemporaryLimitsData {
|
|
28
|
+
name: string;
|
|
29
|
+
value: number | null;
|
|
30
|
+
acceptableDuration: number | null;
|
|
31
|
+
}
|
|
32
|
+
export interface CurrentLimitsData {
|
|
33
|
+
id: string;
|
|
34
|
+
applicability: string;
|
|
35
|
+
limitsProperties?: LimitsProperty[];
|
|
36
|
+
permanentLimit: number;
|
|
37
|
+
temporaryLimits: TemporaryLimitsData[];
|
|
38
|
+
}
|
|
39
|
+
export interface Limit {
|
|
40
|
+
name: AttributeModification<string> | null;
|
|
41
|
+
acceptableDuration: AttributeModification<number> | null;
|
|
42
|
+
value: AttributeModification<number> | null;
|
|
43
|
+
}
|
|
44
|
+
export interface TemporaryLimit extends Limit {
|
|
45
|
+
modificationType: string | null;
|
|
46
|
+
selected?: boolean;
|
|
47
|
+
}
|
|
48
|
+
export interface CurrentLimits {
|
|
49
|
+
id?: string;
|
|
50
|
+
permanentLimit: number | null;
|
|
51
|
+
temporaryLimits: TemporaryLimit[];
|
|
52
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
const APPLICABILITY = {
|
|
2
|
+
EQUIPMENT: { id: "EQUIPMENT", label: "BothSides" },
|
|
3
|
+
SIDE1: { id: "SIDE1", label: "Side1" },
|
|
4
|
+
SIDE2: { id: "SIDE2", label: "Side2" }
|
|
5
|
+
};
|
|
6
|
+
const TEMPORARY_LIMIT_MODIFICATION_TYPE = {
|
|
7
|
+
MODIFY: "MODIFY",
|
|
8
|
+
MODIFY_OR_ADD: "MODIFY_OR_ADD",
|
|
9
|
+
// if the limit exists it is modified, if not it is created
|
|
10
|
+
ADD: "ADD",
|
|
11
|
+
DELETE: "DELETE",
|
|
12
|
+
REPLACE: "REPLACE"
|
|
13
|
+
};
|
|
14
|
+
export {
|
|
15
|
+
APPLICABILITY,
|
|
16
|
+
TEMPORARY_LIMIT_MODIFICATION_TYPE
|
|
17
|
+
};
|
package/dist/features/network-modifications/common/currentLimits/limitsEditor/LimitsEditor.d.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { TemporaryLimitsData } from '../limits.types';
|
|
2
|
+
export interface LimitsEditorProps {
|
|
3
|
+
name?: string;
|
|
4
|
+
permanentCurrentLimitPreviousValue: number | null | undefined;
|
|
5
|
+
temporaryLimitsPreviousValues: TemporaryLimitsData[];
|
|
6
|
+
applicabilityPreviousValue?: string;
|
|
7
|
+
clearableFields: boolean | undefined;
|
|
8
|
+
disabled: boolean;
|
|
9
|
+
}
|
|
10
|
+
export declare function LimitsEditor({ name, permanentCurrentLimitPreviousValue, temporaryLimitsPreviousValues, applicabilityPreviousValue, clearableFields, disabled, }: Readonly<LimitsEditorProps>): import("react").JSX.Element;
|