@gridsuite/commons-ui 0.267.0 → 0.268.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/composite/grid/grid-section.d.ts +5 -2
- package/dist/components/composite/grid/grid-section.js +56 -4
- package/dist/components/ui/reactHookForm/booleans/BooleanInput.js +1 -1
- package/dist/features/common/index.d.ts +7 -0
- package/dist/features/common/index.js +4 -0
- package/dist/features/common/renderTable-ExportCsv.d.ts +18 -0
- package/dist/features/common/renderTable-ExportCsv.js +136 -0
- package/dist/features/index.d.ts +5 -0
- package/dist/features/index.js +43 -2
- package/dist/features/network-modifications/index.d.ts +1 -0
- package/dist/features/network-modifications/index.js +33 -1
- package/dist/features/network-modifications/static-var-compensator/common/constants.d.ts +20 -0
- package/dist/features/network-modifications/static-var-compensator/common/constants.js +9 -0
- package/dist/features/network-modifications/static-var-compensator/common/index.d.ts +13 -0
- package/dist/features/network-modifications/static-var-compensator/common/index.js +20 -0
- package/dist/features/network-modifications/static-var-compensator/common/set-points-limits-form-utils.d.ts +91 -0
- package/dist/features/network-modifications/static-var-compensator/common/set-points-limits-form-utils.js +166 -0
- package/dist/features/network-modifications/static-var-compensator/common/set-points-limits-form.d.ts +8 -0
- package/dist/features/network-modifications/static-var-compensator/common/set-points-limits-form.js +200 -0
- package/dist/features/network-modifications/static-var-compensator/common/standby-automaton-form-utils.d.ts +66 -0
- package/dist/features/network-modifications/static-var-compensator/common/standby-automaton-form-utils.js +149 -0
- package/dist/features/network-modifications/static-var-compensator/common/standby-automaton-form.d.ts +7 -0
- package/dist/features/network-modifications/static-var-compensator/common/standby-automaton-form.js +153 -0
- package/dist/features/network-modifications/static-var-compensator/common/static-var-compensator-dialog-header.d.ts +7 -0
- package/dist/features/network-modifications/static-var-compensator/common/static-var-compensator-dialog-header.js +72 -0
- package/dist/features/network-modifications/static-var-compensator/common/static-var-compensator-dialog-tabs.d.ts +7 -0
- package/dist/features/network-modifications/static-var-compensator/common/static-var-compensator-dialog-tabs.js +44 -0
- package/dist/features/network-modifications/static-var-compensator/common/static-var-compensator-tab-utils.d.ts +8 -0
- package/dist/features/network-modifications/static-var-compensator/common/static-var-compensator-tab-utils.js +34 -0
- package/dist/features/network-modifications/static-var-compensator/common/static-var-compensator-tabs-content.d.ts +9 -0
- package/dist/features/network-modifications/static-var-compensator/common/static-var-compensator-tabs-content.js +100 -0
- package/dist/features/network-modifications/static-var-compensator/common/static-var-compensator.types.d.ts +68 -0
- package/dist/features/network-modifications/static-var-compensator/common/static-var-compensator.types.js +1 -0
- package/dist/features/network-modifications/static-var-compensator/common/susceptance-area.d.ts +7 -0
- package/dist/features/network-modifications/static-var-compensator/common/susceptance-area.js +161 -0
- package/dist/features/network-modifications/static-var-compensator/creation/index.d.ts +9 -0
- package/dist/features/network-modifications/static-var-compensator/creation/index.js +9 -0
- package/dist/features/network-modifications/static-var-compensator/creation/static-var-compensator-creation-form.d.ts +8 -0
- package/dist/features/network-modifications/static-var-compensator/creation/static-var-compensator-creation-form.js +105 -0
- package/dist/features/network-modifications/static-var-compensator/creation/static-var-compensator-creation-utils.d.ts +114 -0
- package/dist/features/network-modifications/static-var-compensator/creation/static-var-compensator-creation-utils.js +189 -0
- package/dist/features/network-modifications/static-var-compensator/creation/static-var-compensator-creation.types.d.ts +34 -0
- package/dist/features/network-modifications/static-var-compensator/creation/static-var-compensator-creation.types.js +1 -0
- package/dist/features/network-modifications/static-var-compensator/index.d.ts +8 -0
- package/dist/features/network-modifications/static-var-compensator/index.js +27 -0
- package/dist/features/network-modifications/voltageLevel/coupling-device/coupling-device-creation-form.d.ts +8 -0
- package/dist/features/network-modifications/voltageLevel/coupling-device/coupling-device-creation-form.js +153 -0
- package/dist/features/network-modifications/voltageLevel/coupling-device/coupling-device-creation-utils.d.ts +20 -0
- package/dist/features/network-modifications/voltageLevel/coupling-device/coupling-device-creation-utils.js +40 -0
- package/dist/features/network-modifications/voltageLevel/coupling-device/coupling-device-creation.types.d.ts +11 -0
- package/dist/features/network-modifications/voltageLevel/coupling-device/coupling-device-creation.types.js +1 -0
- package/dist/features/network-modifications/voltageLevel/coupling-device/index.d.ts +3 -0
- package/dist/features/network-modifications/voltageLevel/coupling-device/index.js +9 -0
- package/dist/features/network-modifications/voltageLevel/creation/index.js +1 -1
- package/dist/features/network-modifications/voltageLevel/index.d.ts +1 -0
- package/dist/features/network-modifications/voltageLevel/index.js +8 -1
- package/dist/features/network-modifications/voltageLevel/topology/CreateVoltageLevelTopologyForm.js +12 -2
- package/dist/features/network-modifications/voltageLevel/topology/voltageLevelTopologyCreation.types.d.ts +1 -1
- package/dist/features/network-modifications/voltageLevel/topology/voltageLevelTopologyCreation.utils.d.ts +3 -3
- package/dist/features/results/constants.d.ts +7 -0
- package/dist/features/results/constants.js +4 -0
- package/dist/features/results/hooks/index.d.ts +7 -0
- package/dist/features/results/hooks/index.js +4 -0
- package/dist/features/results/hooks/useIntlResultStatusMessages.d.ts +19 -0
- package/dist/features/results/hooks/useIntlResultStatusMessages.js +23 -0
- package/dist/features/results/loadflow/index.d.ts +8 -0
- package/dist/features/results/loadflow/index.js +4 -0
- package/dist/features/results/loadflow/limit-violation-result.d.ts +2 -0
- package/dist/features/results/loadflow/limit-violation-result.js +134 -0
- package/dist/features/results/loadflow/load-flow-result.type.d.ts +29 -0
- package/dist/features/results/loadflow/load-flow-result.type.js +1 -0
- package/dist/features/results/securityanalysis/index.js +1 -2
- package/dist/features/results/securityanalysis/security-analysis-result-nmk.js +2 -1
- package/dist/features/results/securityanalysis/utils.d.ts +0 -2
- package/dist/features/results/securityanalysis/utils.js +0 -22
- package/dist/features/results/utils/index.d.ts +7 -0
- package/dist/features/results/utils/index.js +4 -0
- package/dist/features/results/utils/no-rows-message.d.ts +2 -0
- package/dist/features/results/utils/no-rows-message.js +24 -0
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/index.js +2 -0
- package/dist/hooks/useOpenLoaderShortWait.d.ts +18 -0
- package/dist/hooks/useOpenLoaderShortWait.js +19 -0
- package/dist/index.js +46 -1
- package/dist/translations/en/networkModificationsEn.d.ts +28 -0
- package/dist/translations/en/networkModificationsEn.js +30 -1
- package/dist/translations/fr/networkModificationsFr.d.ts +28 -0
- package/dist/translations/fr/networkModificationsFr.js +30 -1
- package/dist/utils/constants/fieldConstants.d.ts +19 -1
- package/dist/utils/constants/fieldConstants.js +18 -0
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.js +2 -0
- package/package.json +1 -1
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
import * as yup from "yup";
|
|
2
|
+
import { FieldConstants } from "../../../../utils/constants/fieldConstants.js";
|
|
3
|
+
import "../../../../utils/conversionUtils.js";
|
|
4
|
+
import { UNDEFINED_CONNECTION_DIRECTION } from "../../../../utils/types/equipmentType.js";
|
|
5
|
+
import { ModificationType } from "../../../../utils/types/modificationType.js";
|
|
6
|
+
import "react/jsx-runtime";
|
|
7
|
+
import "@mui/icons-material";
|
|
8
|
+
import { sanitizeString } from "../../../../utils/ts-utils.js";
|
|
9
|
+
import "react";
|
|
10
|
+
import "react-hook-form";
|
|
11
|
+
import { creationPropertiesSchema, emptyProperties, toModificationProperties, getFilledPropertiesFromModification } from "../../common/properties/propertyUtils.js";
|
|
12
|
+
import "@mui/material";
|
|
13
|
+
import "react-intl";
|
|
14
|
+
import "../../../../components/ui/overflowableText/OverflowableText.js";
|
|
15
|
+
import "localized-countries";
|
|
16
|
+
import "localized-countries/data/fr";
|
|
17
|
+
import "localized-countries/data/en";
|
|
18
|
+
import "notistack";
|
|
19
|
+
import "../../../../components/ui/reactHookForm/provider/CustomFormProvider.js";
|
|
20
|
+
import "../../../../components/ui/treeViewFinder/TreeViewFinder.js";
|
|
21
|
+
import "../../../../components/ui/reactHookForm/numbers/RangeInput.js";
|
|
22
|
+
import "@material-symbols/svg-400/outlined/left_panel_open.svg?react";
|
|
23
|
+
import "@material-symbols/svg-400/outlined/arrows_output.svg?react";
|
|
24
|
+
import "@material-symbols/svg-400/outlined/arrows_input.svg?react";
|
|
25
|
+
import "@material-symbols/svg-400/outlined/left_panel_close.svg?react";
|
|
26
|
+
import "@material-symbols/svg-400/outlined/add_notes-fill.svg?react";
|
|
27
|
+
import "../../../../components/ui/dialogs/descriptionModificationDialog/DescriptionModificationDialog.js";
|
|
28
|
+
import "../../../../components/ui/reactHookForm/expandableInput/ExpandableInput.js";
|
|
29
|
+
import "../../../../components/ui/reactHookForm/directory-item-input/directory-item-utils.js";
|
|
30
|
+
import "@hello-pangea/dnd";
|
|
31
|
+
import "../../../../components/ui/dialogs/elementSaveDialog/ElementSaveDialog.js";
|
|
32
|
+
import "../../../../components/ui/snackbarProvider/SnackbarProvider.js";
|
|
33
|
+
import "mui-nested-menu";
|
|
34
|
+
import "react-resizable-panels";
|
|
35
|
+
import "react-papaparse";
|
|
36
|
+
import "react-dom";
|
|
37
|
+
import "autosuggest-highlight/match";
|
|
38
|
+
import "autosuggest-highlight/parse";
|
|
39
|
+
import "clsx";
|
|
40
|
+
import "../../../../components/composite/filter/FilterCreationDialog.js";
|
|
41
|
+
import "../../../../components/composite/filter/HeaderFilterForm.js";
|
|
42
|
+
import "../../../../components/composite/filter/explicitNaming/ExplicitNamingFilterForm.js";
|
|
43
|
+
import "../../../../components/composite/filter/expert/ExpertFilterForm.js";
|
|
44
|
+
import "../../../../components/composite/filter/expert/ExpertFilterEditionDialog.js";
|
|
45
|
+
import "../../../../components/composite/filter/expert/expertFilterConstants.js";
|
|
46
|
+
import "react-querybuilder";
|
|
47
|
+
import "uuid";
|
|
48
|
+
import "../../../../components/composite/filter/explicitNaming/ExplicitNamingFilterEditionDialog.js";
|
|
49
|
+
import "../../../../components/composite/filter/utils/filterFormUtils.js";
|
|
50
|
+
import "@react-querybuilder/material";
|
|
51
|
+
import "../../../../components/composite/reactQueryBuilder/CustomReactQueryBuilder.js";
|
|
52
|
+
import "../../../../components/composite/reactQueryBuilder/PropertyValueEditor.js";
|
|
53
|
+
import "../../../../components/composite/agGridTable/BottomTableButtons.js";
|
|
54
|
+
import "../../../../components/composite/agGridTable/CustomAgGridTable.js";
|
|
55
|
+
import "ag-grid-community";
|
|
56
|
+
import "../../../../components/composite/customAGGrid/customAggrid.js";
|
|
57
|
+
import "../../../../components/composite/customAGGrid/context/custom-aggrid-context.js";
|
|
58
|
+
import "mathjs";
|
|
59
|
+
import "../../../../components/composite/report/report-viewer/log-table/log-table.js";
|
|
60
|
+
import "react-window";
|
|
61
|
+
import "../../../../components/composite/report/report-treeview/treeview-item.js";
|
|
62
|
+
import "../../../../components/composite/report/report-viewer/context/report-viewer-context.js";
|
|
63
|
+
import { getConnectivityWithPositionEmptyFormData, getConnectivityWithPositionSchema, getConnectivityFormDataProps } from "../../common/connectivity/connectivityForm.utils.js";
|
|
64
|
+
import "../../common/regulatingTerminal/RegulatingTerminalForm.js";
|
|
65
|
+
import { REGULATION_TYPES } from "../../common/voltageRegulation/voltageRegulation.utils.js";
|
|
66
|
+
import "@mui/material/colors";
|
|
67
|
+
import "@mui/x-charts";
|
|
68
|
+
import "../../common/currentLimits/limitsPane.utils.js";
|
|
69
|
+
import { getReactiveFormEmptyFormData, getReactiveFormValidationSchema, getReactiveFormData } from "../common/set-points-limits-form-utils.js";
|
|
70
|
+
import { getStandbyAutomatonEmptyFormData, getStandbyAutomatonFormValidationSchema, getStandbyAutomatonFormData } from "../common/standby-automaton-form-utils.js";
|
|
71
|
+
import { CHARACTERISTICS_CHOICES } from "../../shunt-compensator/common/shuntCompensator.utils.js";
|
|
72
|
+
import "../../shunt-compensator/creation/shuntCompensatorCreation.utils.js";
|
|
73
|
+
import "../../shunt-compensator/modification/shuntCompensatorModification.utils.js";
|
|
74
|
+
import "../common/static-var-compensator-tab-utils.js";
|
|
75
|
+
import { VOLTAGE_REGULATION_MODES } from "../common/constants.js";
|
|
76
|
+
const staticVarCompensatorCreationEmptyFormData = {
|
|
77
|
+
[FieldConstants.EQUIPMENT_ID]: "",
|
|
78
|
+
[FieldConstants.EQUIPMENT_NAME]: "",
|
|
79
|
+
...getConnectivityWithPositionEmptyFormData(),
|
|
80
|
+
...getReactiveFormEmptyFormData(),
|
|
81
|
+
...getStandbyAutomatonEmptyFormData(),
|
|
82
|
+
...emptyProperties
|
|
83
|
+
};
|
|
84
|
+
const staticVarCompensatorCreationFormSchema = yup.object().shape({
|
|
85
|
+
[FieldConstants.EQUIPMENT_ID]: yup.string().required(),
|
|
86
|
+
[FieldConstants.EQUIPMENT_NAME]: yup.string().nullable(),
|
|
87
|
+
[FieldConstants.CONNECTIVITY]: getConnectivityWithPositionSchema(false),
|
|
88
|
+
[FieldConstants.SETPOINTS_LIMITS]: getReactiveFormValidationSchema(),
|
|
89
|
+
[FieldConstants.AUTOMATON]: getStandbyAutomatonFormValidationSchema()
|
|
90
|
+
}).concat(creationPropertiesSchema).required();
|
|
91
|
+
const staticVarCompensatorDtoToForm = (staticCompensator) => {
|
|
92
|
+
return {
|
|
93
|
+
[FieldConstants.EQUIPMENT_ID]: staticCompensator.equipmentId,
|
|
94
|
+
[FieldConstants.EQUIPMENT_NAME]: staticCompensator.equipmentName ?? "",
|
|
95
|
+
[FieldConstants.CONNECTIVITY]: getConnectivityFormDataProps({
|
|
96
|
+
voltageLevelId: staticCompensator.voltageLevelId,
|
|
97
|
+
busbarSectionId: staticCompensator.busOrBusbarSectionId,
|
|
98
|
+
connectionDirection: staticCompensator.connectionDirection,
|
|
99
|
+
connectionName: staticCompensator.connectionName,
|
|
100
|
+
connectionPosition: staticCompensator.connectionPosition,
|
|
101
|
+
terminalConnected: staticCompensator.terminalConnected,
|
|
102
|
+
isEquipmentModification: false
|
|
103
|
+
}),
|
|
104
|
+
...getReactiveFormData({
|
|
105
|
+
maxSusceptance: staticCompensator.maxSusceptance,
|
|
106
|
+
minSusceptance: staticCompensator.minSusceptance,
|
|
107
|
+
nominalV: null,
|
|
108
|
+
maxQAtNominalV: staticCompensator.maxQAtNominalV,
|
|
109
|
+
minQAtNominalV: staticCompensator.minQAtNominalV,
|
|
110
|
+
regulationMode: staticCompensator.isRegulating ? staticCompensator.regulationMode : VOLTAGE_REGULATION_MODES.OFF.id,
|
|
111
|
+
voltageSetpoint: staticCompensator.voltageSetpoint,
|
|
112
|
+
reactivePowerSetpoint: staticCompensator.reactivePowerSetpoint,
|
|
113
|
+
voltageRegulationType: staticCompensator?.regulatingTerminalId || staticCompensator?.regulatingTerminalConnectableId ? REGULATION_TYPES.DISTANT.id : REGULATION_TYPES.LOCAL.id,
|
|
114
|
+
voltageLevelId: staticCompensator.regulatingTerminalVlId,
|
|
115
|
+
equipmentType: staticCompensator.regulatingTerminalType,
|
|
116
|
+
equipmentId: staticCompensator.regulatingTerminalConnectableId || staticCompensator.regulatingTerminalId
|
|
117
|
+
}),
|
|
118
|
+
...getStandbyAutomatonFormData({
|
|
119
|
+
addStandbyAutomaton: staticCompensator.standbyAutomatonOn,
|
|
120
|
+
standby: staticCompensator.standby,
|
|
121
|
+
b0: staticCompensator.b0,
|
|
122
|
+
q0: staticCompensator.q0,
|
|
123
|
+
lowVoltageSetpoint: staticCompensator.lowVoltageSetpoint,
|
|
124
|
+
highVoltageSetpoint: staticCompensator.highVoltageSetpoint,
|
|
125
|
+
lowVoltageThreshold: staticCompensator.lowVoltageThreshold,
|
|
126
|
+
highVoltageThreshold: staticCompensator.highVoltageThreshold
|
|
127
|
+
}),
|
|
128
|
+
[FieldConstants.ADDITIONAL_PROPERTIES]: getFilledPropertiesFromModification(staticCompensator.properties)
|
|
129
|
+
};
|
|
130
|
+
};
|
|
131
|
+
const getValueIf = (condition, value) => {
|
|
132
|
+
return condition ? value ?? null : null;
|
|
133
|
+
};
|
|
134
|
+
const staticVarCompensatorCreationFormToDto = (formData) => {
|
|
135
|
+
const { connectivity, setpointsLimits, automaton } = formData;
|
|
136
|
+
const { characteristicsChoice, voltageRegulationMode, equipment: regulationEquipment } = setpointsLimits;
|
|
137
|
+
const { addStandbyAutomaton } = automaton;
|
|
138
|
+
const isDistantRegulation = setpointsLimits.voltageRegulationType === REGULATION_TYPES.DISTANT.id;
|
|
139
|
+
return {
|
|
140
|
+
type: ModificationType.STATIC_VAR_COMPENSATOR_CREATION,
|
|
141
|
+
equipmentId: formData.equipmentID,
|
|
142
|
+
equipmentName: sanitizeString(formData.equipmentName),
|
|
143
|
+
voltageLevelId: connectivity.voltageLevel?.id ?? null,
|
|
144
|
+
busOrBusbarSectionId: connectivity.busOrBusbarSection?.id ?? null,
|
|
145
|
+
connectionName: sanitizeString(formData.connectivity.connectionName),
|
|
146
|
+
connectionDirection: connectivity.connectionDirection ?? UNDEFINED_CONNECTION_DIRECTION,
|
|
147
|
+
connectionPosition: connectivity.connectionPosition ?? null,
|
|
148
|
+
terminalConnected: connectivity.terminalConnected,
|
|
149
|
+
maxSusceptance: getValueIf(
|
|
150
|
+
characteristicsChoice === CHARACTERISTICS_CHOICES.SUSCEPTANCE.id,
|
|
151
|
+
setpointsLimits.maxSusceptance
|
|
152
|
+
),
|
|
153
|
+
minSusceptance: getValueIf(
|
|
154
|
+
characteristicsChoice === CHARACTERISTICS_CHOICES.SUSCEPTANCE.id,
|
|
155
|
+
setpointsLimits.minSusceptance
|
|
156
|
+
),
|
|
157
|
+
maxQAtNominalV: getValueIf(
|
|
158
|
+
characteristicsChoice === CHARACTERISTICS_CHOICES.Q_AT_NOMINAL_V.id,
|
|
159
|
+
setpointsLimits.maxQAtNominalV
|
|
160
|
+
),
|
|
161
|
+
minQAtNominalV: getValueIf(
|
|
162
|
+
characteristicsChoice === CHARACTERISTICS_CHOICES.Q_AT_NOMINAL_V.id,
|
|
163
|
+
setpointsLimits.minQAtNominalV
|
|
164
|
+
),
|
|
165
|
+
regulationMode: voltageRegulationMode === VOLTAGE_REGULATION_MODES.OFF.id ? null : voltageRegulationMode,
|
|
166
|
+
isRegulating: voltageRegulationMode !== VOLTAGE_REGULATION_MODES.OFF.id,
|
|
167
|
+
voltageSetpoint: setpointsLimits.voltageSetpoint ?? null,
|
|
168
|
+
reactivePowerSetpoint: setpointsLimits.reactivePowerSetpoint ?? null,
|
|
169
|
+
voltageRegulationType: setpointsLimits.voltageRegulationType,
|
|
170
|
+
regulatingTerminalId: getValueIf(isDistantRegulation, regulationEquipment?.id),
|
|
171
|
+
regulatingTerminalType: getValueIf(isDistantRegulation, regulationEquipment?.type),
|
|
172
|
+
regulatingTerminalVlId: getValueIf(isDistantRegulation, setpointsLimits.voltageLevel?.id),
|
|
173
|
+
standbyAutomatonOn: addStandbyAutomaton ?? null,
|
|
174
|
+
standby: automaton.StandbyAutomaton ?? null,
|
|
175
|
+
lowVoltageSetpoint: getValueIf(addStandbyAutomaton, automaton.lowVoltageSetpoint),
|
|
176
|
+
highVoltageSetpoint: getValueIf(addStandbyAutomaton, automaton.highVoltageSetpoint),
|
|
177
|
+
lowVoltageThreshold: getValueIf(addStandbyAutomaton, automaton.lowVoltageThreshold),
|
|
178
|
+
highVoltageThreshold: getValueIf(addStandbyAutomaton, automaton.highVoltageThreshold),
|
|
179
|
+
b0: addStandbyAutomaton && characteristicsChoice === CHARACTERISTICS_CHOICES.SUSCEPTANCE.id ? automaton.b0 ?? null : null,
|
|
180
|
+
q0: addStandbyAutomaton && characteristicsChoice === CHARACTERISTICS_CHOICES.Q_AT_NOMINAL_V.id ? automaton.q0 ?? null : null,
|
|
181
|
+
properties: toModificationProperties(formData)
|
|
182
|
+
};
|
|
183
|
+
};
|
|
184
|
+
export {
|
|
185
|
+
staticVarCompensatorCreationEmptyFormData,
|
|
186
|
+
staticVarCompensatorCreationFormSchema,
|
|
187
|
+
staticVarCompensatorCreationFormToDto,
|
|
188
|
+
staticVarCompensatorDtoToForm
|
|
189
|
+
};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { Property } from '../../common';
|
|
2
|
+
import { ModificationType } from '../../../../utils';
|
|
3
|
+
export interface StaticVarCompensatorCreationDto {
|
|
4
|
+
type: ModificationType.STATIC_VAR_COMPENSATOR_CREATION;
|
|
5
|
+
equipmentId: string;
|
|
6
|
+
equipmentName?: string | null;
|
|
7
|
+
voltageLevelId: string | null;
|
|
8
|
+
busOrBusbarSectionId?: string | null;
|
|
9
|
+
connectionDirection?: string | null;
|
|
10
|
+
connectionName?: string | null;
|
|
11
|
+
connectionPosition?: number | null;
|
|
12
|
+
terminalConnected?: boolean | null;
|
|
13
|
+
maxSusceptance: number | null;
|
|
14
|
+
minSusceptance: number | null;
|
|
15
|
+
maxQAtNominalV: number | null;
|
|
16
|
+
minQAtNominalV: number | null;
|
|
17
|
+
regulationMode: string | null;
|
|
18
|
+
isRegulating: boolean;
|
|
19
|
+
voltageSetpoint: number | null;
|
|
20
|
+
reactivePowerSetpoint: number | null;
|
|
21
|
+
voltageRegulationType: string;
|
|
22
|
+
regulatingTerminalId: string | null;
|
|
23
|
+
regulatingTerminalType: string | null;
|
|
24
|
+
regulatingTerminalVlId: string | null;
|
|
25
|
+
standbyAutomatonOn: boolean | null;
|
|
26
|
+
standby: boolean | null;
|
|
27
|
+
lowVoltageSetpoint: number | null;
|
|
28
|
+
highVoltageSetpoint: number | null;
|
|
29
|
+
lowVoltageThreshold: number | null;
|
|
30
|
+
highVoltageThreshold: number | null;
|
|
31
|
+
b0: number | null;
|
|
32
|
+
q0: number | null;
|
|
33
|
+
properties?: Property[] | null;
|
|
34
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1,8 @@
|
|
|
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 './common';
|
|
8
|
+
export * from './creation';
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { StaticVarCompensatorDialogHeader } from "./common/static-var-compensator-dialog-header.js";
|
|
2
|
+
import { StaticVarCompensatorDialogTabs } from "./common/static-var-compensator-dialog-tabs.js";
|
|
3
|
+
import { STATIC_VAR_COMPENSATOR_TAB_FIELDS, StaticVarCompensatorDialogTab } from "./common/static-var-compensator-tab-utils.js";
|
|
4
|
+
import { VOLTAGE_REGULATION_MODES } from "./common/constants.js";
|
|
5
|
+
import { getReactiveFormData, getReactiveFormEmptyFormData, getReactiveFormValidationSchema } from "./common/set-points-limits-form-utils.js";
|
|
6
|
+
import { computeQ0, getStandbyAutomatonEmptyFormData, getStandbyAutomatonFormData, getStandbyAutomatonFormValidationSchema } from "./common/standby-automaton-form-utils.js";
|
|
7
|
+
import { StaticVarCompensatorCreationForm } from "./creation/static-var-compensator-creation-form.js";
|
|
8
|
+
import { staticVarCompensatorCreationEmptyFormData, staticVarCompensatorCreationFormSchema, staticVarCompensatorCreationFormToDto, staticVarCompensatorDtoToForm } from "./creation/static-var-compensator-creation-utils.js";
|
|
9
|
+
export {
|
|
10
|
+
STATIC_VAR_COMPENSATOR_TAB_FIELDS,
|
|
11
|
+
StaticVarCompensatorCreationForm,
|
|
12
|
+
StaticVarCompensatorDialogHeader,
|
|
13
|
+
StaticVarCompensatorDialogTab,
|
|
14
|
+
StaticVarCompensatorDialogTabs,
|
|
15
|
+
VOLTAGE_REGULATION_MODES,
|
|
16
|
+
computeQ0,
|
|
17
|
+
getReactiveFormData,
|
|
18
|
+
getReactiveFormEmptyFormData,
|
|
19
|
+
getReactiveFormValidationSchema,
|
|
20
|
+
getStandbyAutomatonEmptyFormData,
|
|
21
|
+
getStandbyAutomatonFormData,
|
|
22
|
+
getStandbyAutomatonFormValidationSchema,
|
|
23
|
+
staticVarCompensatorCreationEmptyFormData,
|
|
24
|
+
staticVarCompensatorCreationFormSchema,
|
|
25
|
+
staticVarCompensatorCreationFormToDto,
|
|
26
|
+
staticVarCompensatorDtoToForm
|
|
27
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Option } from '../../../../utils';
|
|
2
|
+
import { PositionDiagramPaneType } from '../../common';
|
|
3
|
+
export interface CouplingDeviceCreationFormProps {
|
|
4
|
+
sectionOptions: Option[];
|
|
5
|
+
canOpenPositionDiagramPane?: boolean;
|
|
6
|
+
PositionDiagramPane?: PositionDiagramPaneType;
|
|
7
|
+
}
|
|
8
|
+
export declare function CouplingDeviceCreationForm({ sectionOptions, canOpenPositionDiagramPane, PositionDiagramPane, }: Readonly<CouplingDeviceCreationFormProps>): import("react").JSX.Element;
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { TextField, Grid, Button, Box } from "@mui/material";
|
|
3
|
+
import { useIntl, FormattedMessage } from "react-intl";
|
|
4
|
+
import { useWatch } from "react-hook-form";
|
|
5
|
+
import { useState } from "react";
|
|
6
|
+
import { InfoOutlined } from "@mui/icons-material";
|
|
7
|
+
import "../../../../components/ui/overflowableText/OverflowableText.js";
|
|
8
|
+
import { FieldConstants } from "../../../../utils/constants/fieldConstants.js";
|
|
9
|
+
import "../../../../utils/conversionUtils.js";
|
|
10
|
+
import "../../../../utils/types/equipmentType.js";
|
|
11
|
+
import { getObjectId } from "../../../../utils/ts-utils.js";
|
|
12
|
+
import "localized-countries";
|
|
13
|
+
import "localized-countries/data/fr";
|
|
14
|
+
import "localized-countries/data/en";
|
|
15
|
+
import "notistack";
|
|
16
|
+
import "../../../../components/ui/reactHookForm/provider/CustomFormProvider.js";
|
|
17
|
+
import "yup";
|
|
18
|
+
import { CustomTooltip } from "../../../../components/ui/tooltip/CustomTooltip.js";
|
|
19
|
+
import "../../../../components/ui/treeViewFinder/TreeViewFinder.js";
|
|
20
|
+
import { AutocompleteInput } from "../../../../components/ui/reactHookForm/autocompleteInputs/AutocompleteInput.js";
|
|
21
|
+
import "../../../../components/ui/reactHookForm/numbers/RangeInput.js";
|
|
22
|
+
import "@material-symbols/svg-400/outlined/left_panel_open.svg?react";
|
|
23
|
+
import "@material-symbols/svg-400/outlined/arrows_output.svg?react";
|
|
24
|
+
import "@material-symbols/svg-400/outlined/arrows_input.svg?react";
|
|
25
|
+
import "@material-symbols/svg-400/outlined/left_panel_close.svg?react";
|
|
26
|
+
import "@material-symbols/svg-400/outlined/add_notes-fill.svg?react";
|
|
27
|
+
import "../../../../components/ui/dialogs/descriptionModificationDialog/DescriptionModificationDialog.js";
|
|
28
|
+
import "../../../../components/ui/reactHookForm/expandableInput/ExpandableInput.js";
|
|
29
|
+
import "../../../../components/ui/reactHookForm/directory-item-input/directory-item-utils.js";
|
|
30
|
+
import "@hello-pangea/dnd";
|
|
31
|
+
import "../../../../components/ui/dialogs/elementSaveDialog/ElementSaveDialog.js";
|
|
32
|
+
import "../../../../components/ui/snackbarProvider/SnackbarProvider.js";
|
|
33
|
+
import "mui-nested-menu";
|
|
34
|
+
import "react-resizable-panels";
|
|
35
|
+
import "react-papaparse";
|
|
36
|
+
import "react-dom";
|
|
37
|
+
import "autosuggest-highlight/match";
|
|
38
|
+
import "autosuggest-highlight/parse";
|
|
39
|
+
import "clsx";
|
|
40
|
+
import "../../../../components/composite/filter/FilterCreationDialog.js";
|
|
41
|
+
import "../../../../components/composite/filter/HeaderFilterForm.js";
|
|
42
|
+
import "../../../../components/composite/filter/explicitNaming/ExplicitNamingFilterForm.js";
|
|
43
|
+
import "../../../../components/composite/filter/expert/ExpertFilterForm.js";
|
|
44
|
+
import "../../../../components/composite/filter/expert/ExpertFilterEditionDialog.js";
|
|
45
|
+
import "../../../../components/composite/filter/expert/expertFilterConstants.js";
|
|
46
|
+
import "react-querybuilder";
|
|
47
|
+
import "uuid";
|
|
48
|
+
import "../../../../components/composite/filter/explicitNaming/ExplicitNamingFilterEditionDialog.js";
|
|
49
|
+
import "../../../../components/composite/filter/utils/filterFormUtils.js";
|
|
50
|
+
import { GridItem } from "../../../../components/composite/grid/grid-item.js";
|
|
51
|
+
import { GridSection } from "../../../../components/composite/grid/grid-section.js";
|
|
52
|
+
import "@react-querybuilder/material";
|
|
53
|
+
import "../../../../components/composite/reactQueryBuilder/CustomReactQueryBuilder.js";
|
|
54
|
+
import "../../../../components/composite/reactQueryBuilder/PropertyValueEditor.js";
|
|
55
|
+
import "../../../../components/composite/agGridTable/BottomTableButtons.js";
|
|
56
|
+
import "../../../../components/composite/agGridTable/CustomAgGridTable.js";
|
|
57
|
+
import "ag-grid-community";
|
|
58
|
+
import "../../../../components/composite/customAGGrid/customAggrid.js";
|
|
59
|
+
import "../../../../components/composite/customAGGrid/context/custom-aggrid-context.js";
|
|
60
|
+
import "mathjs";
|
|
61
|
+
import "../../../../components/composite/report/report-viewer/log-table/log-table.js";
|
|
62
|
+
import "react-window";
|
|
63
|
+
import "../../../../components/composite/report/report-treeview/treeview-item.js";
|
|
64
|
+
import "../../../../components/composite/report/report-viewer/context/report-viewer-context.js";
|
|
65
|
+
import { filledTextField } from "../../common/form.utils.js";
|
|
66
|
+
import "../../common/properties/propertyUtils.js";
|
|
67
|
+
import "../../common/regulatingTerminal/RegulatingTerminalForm.js";
|
|
68
|
+
import "@mui/material/colors";
|
|
69
|
+
import "@mui/x-charts";
|
|
70
|
+
import "../../common/currentLimits/limitsPane.utils.js";
|
|
71
|
+
function CouplingDeviceCreationForm({
|
|
72
|
+
sectionOptions,
|
|
73
|
+
canOpenPositionDiagramPane,
|
|
74
|
+
PositionDiagramPane
|
|
75
|
+
}) {
|
|
76
|
+
const intl = useIntl();
|
|
77
|
+
const equipmentId = useWatch({ name: FieldConstants.EQUIPMENT_ID });
|
|
78
|
+
const [isDiagramPaneOpen, setIsDiagramPaneOpen] = useState(false);
|
|
79
|
+
const canOpenDiagram = Boolean(PositionDiagramPane && canOpenPositionDiagramPane);
|
|
80
|
+
const voltageLevelIdField = /* @__PURE__ */ jsx(
|
|
81
|
+
TextField,
|
|
82
|
+
{
|
|
83
|
+
size: "small",
|
|
84
|
+
fullWidth: true,
|
|
85
|
+
label: intl.formatMessage({ id: "VoltageLevelId" }),
|
|
86
|
+
value: equipmentId ?? "",
|
|
87
|
+
slotProps: {
|
|
88
|
+
input: { readOnly: true }
|
|
89
|
+
},
|
|
90
|
+
disabled: true,
|
|
91
|
+
...filledTextField
|
|
92
|
+
}
|
|
93
|
+
);
|
|
94
|
+
const busBarSectionId1Field = /* @__PURE__ */ jsx(
|
|
95
|
+
AutocompleteInput,
|
|
96
|
+
{
|
|
97
|
+
allowNewValue: true,
|
|
98
|
+
forcePopupIcon: !!sectionOptions,
|
|
99
|
+
name: `${FieldConstants.BUS_BAR_SECTION_ID1}`,
|
|
100
|
+
label: "BusBarSectionID1",
|
|
101
|
+
options: sectionOptions ?? [],
|
|
102
|
+
getOptionLabel: getObjectId,
|
|
103
|
+
size: "small",
|
|
104
|
+
sx: { paddingTop: 2, paddingRight: 1 }
|
|
105
|
+
}
|
|
106
|
+
);
|
|
107
|
+
const busBarSectionId2Field = /* @__PURE__ */ jsx(
|
|
108
|
+
AutocompleteInput,
|
|
109
|
+
{
|
|
110
|
+
allowNewValue: true,
|
|
111
|
+
forcePopupIcon: !!sectionOptions,
|
|
112
|
+
name: `${FieldConstants.BUS_BAR_SECTION_ID2}`,
|
|
113
|
+
label: "BusBarSectionID2",
|
|
114
|
+
options: sectionOptions ?? [],
|
|
115
|
+
getOptionLabel: getObjectId,
|
|
116
|
+
size: "small",
|
|
117
|
+
sx: { paddingTop: 2, paddingRight: 4 }
|
|
118
|
+
}
|
|
119
|
+
);
|
|
120
|
+
const diagramToolTip = canOpenDiagram ? /* @__PURE__ */ jsx(CustomTooltip, { sx: { paddingLeft: 1 }, title: intl.formatMessage({ id: "builtNodeTooltipForDiagram" }), children: /* @__PURE__ */ jsx(InfoOutlined, { color: "info", fontSize: "medium" }) }) : null;
|
|
121
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
122
|
+
/* @__PURE__ */ jsxs(Grid, { container: true, spacing: 2, children: [
|
|
123
|
+
/* @__PURE__ */ jsx(GridItem, { size: 4, children: voltageLevelIdField }),
|
|
124
|
+
canOpenDiagram && /* @__PURE__ */ jsx(GridItem, { size: 3, children: /* @__PURE__ */ jsxs(Grid, { sx: { paddingTop: 1 }, children: [
|
|
125
|
+
/* @__PURE__ */ jsx(Button, { onClick: () => setIsDiagramPaneOpen(true), variant: "outlined", children: /* @__PURE__ */ jsx(FormattedMessage, { id: "CreateCouplingDeviceDiagramButton" }) }),
|
|
126
|
+
diagramToolTip
|
|
127
|
+
] }) })
|
|
128
|
+
] }),
|
|
129
|
+
/* @__PURE__ */ jsx(
|
|
130
|
+
GridSection,
|
|
131
|
+
{
|
|
132
|
+
title: "CouplingDeviceText",
|
|
133
|
+
tooltipEnabled: true,
|
|
134
|
+
tooltipMessage: "CouplingDeviceBusBarSectionToolTipText"
|
|
135
|
+
}
|
|
136
|
+
),
|
|
137
|
+
/* @__PURE__ */ jsxs(Grid, { container: true, children: [
|
|
138
|
+
/* @__PURE__ */ jsx(GridItem, { size: 4, children: busBarSectionId1Field }),
|
|
139
|
+
/* @__PURE__ */ jsx(GridItem, { size: 4, children: busBarSectionId2Field })
|
|
140
|
+
] }),
|
|
141
|
+
PositionDiagramPane && /* @__PURE__ */ jsx(Box, { children: /* @__PURE__ */ jsx(
|
|
142
|
+
PositionDiagramPane,
|
|
143
|
+
{
|
|
144
|
+
open: isDiagramPaneOpen,
|
|
145
|
+
onClose: () => setIsDiagramPaneOpen(false),
|
|
146
|
+
voltageLevelId: equipmentId
|
|
147
|
+
}
|
|
148
|
+
) })
|
|
149
|
+
] });
|
|
150
|
+
}
|
|
151
|
+
export {
|
|
152
|
+
CouplingDeviceCreationForm
|
|
153
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { InferType } from 'yup';
|
|
2
|
+
import { CouplingDeviceCreationDto } from './coupling-device-creation.types';
|
|
3
|
+
import * as yup from 'yup';
|
|
4
|
+
export declare const emptyCouplingDeviceCreationFormData: {
|
|
5
|
+
equipmentID: null;
|
|
6
|
+
busbarSectionId1: null;
|
|
7
|
+
busbarSectionId2: null;
|
|
8
|
+
};
|
|
9
|
+
export declare const couplingDeviceCreationFormSchema: yup.ObjectSchema<{
|
|
10
|
+
equipmentID: string;
|
|
11
|
+
busbarSectionId1: string;
|
|
12
|
+
busbarSectionId2: string;
|
|
13
|
+
}, yup.AnyObject, {
|
|
14
|
+
equipmentID: undefined;
|
|
15
|
+
busbarSectionId1: undefined;
|
|
16
|
+
busbarSectionId2: undefined;
|
|
17
|
+
}, "">;
|
|
18
|
+
export type CouplingDeviceCreationFormData = InferType<typeof couplingDeviceCreationFormSchema>;
|
|
19
|
+
export declare const couplingDeviceCreationDtoToForm: (couplingDeviceCreation: CouplingDeviceCreationDto) => CouplingDeviceCreationFormData;
|
|
20
|
+
export declare const couplingDeviceCreationFormToDto: (couplingDeviceCreation: CouplingDeviceCreationFormData) => CouplingDeviceCreationDto;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import * as yup from "yup";
|
|
2
|
+
import { FieldConstants } from "../../../../utils/constants/fieldConstants.js";
|
|
3
|
+
import "../../../../utils/conversionUtils.js";
|
|
4
|
+
import "../../../../utils/types/equipmentType.js";
|
|
5
|
+
import { ModificationType } from "../../../../utils/types/modificationType.js";
|
|
6
|
+
import "react/jsx-runtime";
|
|
7
|
+
import "@mui/icons-material";
|
|
8
|
+
const emptyCouplingDeviceCreationFormData = {
|
|
9
|
+
[FieldConstants.EQUIPMENT_ID]: null,
|
|
10
|
+
[FieldConstants.BUS_BAR_SECTION_ID1]: null,
|
|
11
|
+
[FieldConstants.BUS_BAR_SECTION_ID2]: null
|
|
12
|
+
};
|
|
13
|
+
const couplingDeviceCreationFormSchema = yup.object().shape({
|
|
14
|
+
[FieldConstants.EQUIPMENT_ID]: yup.string().required(),
|
|
15
|
+
[FieldConstants.BUS_BAR_SECTION_ID1]: yup.string().nullable().required(),
|
|
16
|
+
[FieldConstants.BUS_BAR_SECTION_ID2]: yup.string().nullable().required().notOneOf([yup.ref(FieldConstants.BUS_BAR_SECTION_ID1), null], "CreateCouplingDeviceIdenticalBusBar")
|
|
17
|
+
});
|
|
18
|
+
const couplingDeviceCreationDtoToForm = (couplingDeviceCreation) => {
|
|
19
|
+
return {
|
|
20
|
+
[FieldConstants.EQUIPMENT_ID]: couplingDeviceCreation.voltageLevelId,
|
|
21
|
+
[FieldConstants.BUS_BAR_SECTION_ID1]: couplingDeviceCreation.couplingDeviceInfos.busbarSectionId1,
|
|
22
|
+
[FieldConstants.BUS_BAR_SECTION_ID2]: couplingDeviceCreation.couplingDeviceInfos.busbarSectionId2
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
const couplingDeviceCreationFormToDto = (couplingDeviceCreation) => {
|
|
26
|
+
return {
|
|
27
|
+
type: ModificationType.CREATE_COUPLING_DEVICE,
|
|
28
|
+
voltageLevelId: couplingDeviceCreation[FieldConstants.EQUIPMENT_ID],
|
|
29
|
+
couplingDeviceInfos: {
|
|
30
|
+
busbarSectionId1: couplingDeviceCreation[FieldConstants.BUS_BAR_SECTION_ID1],
|
|
31
|
+
busbarSectionId2: couplingDeviceCreation[FieldConstants.BUS_BAR_SECTION_ID2]
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
export {
|
|
36
|
+
couplingDeviceCreationDtoToForm,
|
|
37
|
+
couplingDeviceCreationFormSchema,
|
|
38
|
+
couplingDeviceCreationFormToDto,
|
|
39
|
+
emptyCouplingDeviceCreationFormData
|
|
40
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { UUID } from 'node:crypto';
|
|
2
|
+
import { ModificationType } from '../../../../utils';
|
|
3
|
+
export interface CouplingDeviceCreationDto {
|
|
4
|
+
type: ModificationType.CREATE_COUPLING_DEVICE;
|
|
5
|
+
uuid?: UUID;
|
|
6
|
+
voltageLevelId: string;
|
|
7
|
+
couplingDeviceInfos: {
|
|
8
|
+
busbarSectionId1: string;
|
|
9
|
+
busbarSectionId2: string;
|
|
10
|
+
};
|
|
11
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { CouplingDeviceCreationForm } from "./coupling-device-creation-form.js";
|
|
2
|
+
import { couplingDeviceCreationDtoToForm, couplingDeviceCreationFormSchema, couplingDeviceCreationFormToDto, emptyCouplingDeviceCreationFormData } from "./coupling-device-creation-utils.js";
|
|
3
|
+
export {
|
|
4
|
+
CouplingDeviceCreationForm,
|
|
5
|
+
couplingDeviceCreationDtoToForm,
|
|
6
|
+
couplingDeviceCreationFormSchema,
|
|
7
|
+
couplingDeviceCreationFormToDto,
|
|
8
|
+
emptyCouplingDeviceCreationFormData
|
|
9
|
+
};
|
|
@@ -5,9 +5,9 @@ import "react";
|
|
|
5
5
|
import "react-hook-form";
|
|
6
6
|
import "react-intl";
|
|
7
7
|
import "@mui/icons-material";
|
|
8
|
-
import "../../../../components/ui/overflowableText/OverflowableText.js";
|
|
9
8
|
import "../../../../utils/conversionUtils.js";
|
|
10
9
|
import "../../../../utils/types/equipmentType.js";
|
|
10
|
+
import "../../../../components/ui/overflowableText/OverflowableText.js";
|
|
11
11
|
import "localized-countries";
|
|
12
12
|
import "localized-countries/data/fr";
|
|
13
13
|
import "localized-countries/data/en";
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
5
5
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
6
6
|
*/
|
|
7
|
+
export * from './coupling-device';
|
|
7
8
|
export * from './creation';
|
|
8
9
|
export * from './voltage-level.type';
|
|
9
10
|
export * from './modification';
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { CouplingDeviceCreationForm } from "./coupling-device/coupling-device-creation-form.js";
|
|
2
|
+
import { couplingDeviceCreationDtoToForm, couplingDeviceCreationFormSchema, couplingDeviceCreationFormToDto, emptyCouplingDeviceCreationFormData } from "./coupling-device/coupling-device-creation-utils.js";
|
|
1
3
|
import { SwitchesBetweenSections } from "./creation/tabs/structureTab/switchesBetweenSections/SwitchesBetweenSections.js";
|
|
2
4
|
import "react/jsx-runtime";
|
|
3
5
|
import "@mui/material";
|
|
@@ -5,9 +7,9 @@ import "react";
|
|
|
5
7
|
import "react-hook-form";
|
|
6
8
|
import "react-intl";
|
|
7
9
|
import "@mui/icons-material";
|
|
8
|
-
import "../../../components/ui/overflowableText/OverflowableText.js";
|
|
9
10
|
import "../../../utils/conversionUtils.js";
|
|
10
11
|
import "../../../utils/types/equipmentType.js";
|
|
12
|
+
import "../../../components/ui/overflowableText/OverflowableText.js";
|
|
11
13
|
import "localized-countries";
|
|
12
14
|
import "localized-countries/data/fr";
|
|
13
15
|
import "localized-countries/data/en";
|
|
@@ -71,6 +73,7 @@ import { voltageLevelModificationDtoToForm, voltageLevelModificationEmptyFormDat
|
|
|
71
73
|
import { createVoltageLevelTopologyDtoToForm, createVoltageLevelTopologyEmptyFormData, createVoltageLevelTopologyFormSchema, createVoltageLevelTopologyFormToDto } from "./topology/voltageLevelTopologyCreation.utils.js";
|
|
72
74
|
import { CreateVoltageLevelTopologyForm } from "./topology/CreateVoltageLevelTopologyForm.js";
|
|
73
75
|
export {
|
|
76
|
+
CouplingDeviceCreationForm,
|
|
74
77
|
CreateVoltageLevelTopologyForm,
|
|
75
78
|
MAX_SECTIONS_COUNT,
|
|
76
79
|
SWITCH_TYPE,
|
|
@@ -79,10 +82,14 @@ export {
|
|
|
79
82
|
VoltageLevelCreationForm,
|
|
80
83
|
VoltageLevelModificationForm,
|
|
81
84
|
buildNewBusbarSections,
|
|
85
|
+
couplingDeviceCreationDtoToForm,
|
|
86
|
+
couplingDeviceCreationFormSchema,
|
|
87
|
+
couplingDeviceCreationFormToDto,
|
|
82
88
|
createVoltageLevelTopologyDtoToForm,
|
|
83
89
|
createVoltageLevelTopologyEmptyFormData,
|
|
84
90
|
createVoltageLevelTopologyFormSchema,
|
|
85
91
|
createVoltageLevelTopologyFormToDto,
|
|
92
|
+
emptyCouplingDeviceCreationFormData,
|
|
86
93
|
getCreateSwitchesEmptyFormData,
|
|
87
94
|
getCreateSwitchesValidationSchema,
|
|
88
95
|
translateSwitchKinds,
|
package/dist/features/network-modifications/voltageLevel/topology/CreateVoltageLevelTopologyForm.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
2
|
-
import { useState, useMemo } from "react";
|
|
2
|
+
import { useState, useRef, useEffect, useMemo } from "react";
|
|
3
3
|
import { TextField, Stack, Grid, Button, Tooltip, Box } from "@mui/material";
|
|
4
4
|
import { useIntl, FormattedMessage } from "react-intl";
|
|
5
5
|
import { InfoOutlined } from "@mui/icons-material";
|
|
6
|
+
import { useFormContext, useWatch } from "react-hook-form";
|
|
6
7
|
import "../../../../components/ui/overflowableText/OverflowableText.js";
|
|
7
8
|
import { FieldConstants } from "../../../../utils/constants/fieldConstants.js";
|
|
8
9
|
import "../../../../utils/conversionUtils.js";
|
|
9
10
|
import "../../../../utils/types/equipmentType.js";
|
|
10
|
-
import "react-hook-form";
|
|
11
11
|
import "localized-countries";
|
|
12
12
|
import "localized-countries/data/fr";
|
|
13
13
|
import "localized-countries/data/en";
|
|
@@ -75,6 +75,16 @@ function CreateVoltageLevelTopologyForm({
|
|
|
75
75
|
const [isDiagramPaneOpen, setIsDiagramPaneOpen] = useState(false);
|
|
76
76
|
const intl = useIntl();
|
|
77
77
|
const { isNodeBuilt } = useCustomFormContext();
|
|
78
|
+
const { trigger } = useFormContext();
|
|
79
|
+
const watchSectionCount = useWatch({ name: FieldConstants.SECTION_COUNT });
|
|
80
|
+
const isFirstRender = useRef(true);
|
|
81
|
+
useEffect(() => {
|
|
82
|
+
if (isFirstRender.current) {
|
|
83
|
+
isFirstRender.current = false;
|
|
84
|
+
return;
|
|
85
|
+
}
|
|
86
|
+
trigger(FieldConstants.SECTION_COUNT);
|
|
87
|
+
}, [watchSectionCount, trigger]);
|
|
78
88
|
const handleCloseDiagramPane = () => {
|
|
79
89
|
setIsDiagramPaneOpen(false);
|
|
80
90
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { IntlShape } from 'react-intl';
|
|
2
2
|
import { DeepNullable } from '../../../../utils';
|
|
3
|
-
import {
|
|
3
|
+
import { CreateVoltageLevelTopologyDto } from './voltageLevelTopologyCreation.types';
|
|
4
4
|
/**
|
|
5
5
|
* Copyright (c) 2026, RTE (http://www.rte-france.com)
|
|
6
6
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
@@ -21,5 +21,5 @@ export declare const createVoltageLevelTopologyFormSchema: yup.ObjectSchema<{
|
|
|
21
21
|
}, "">;
|
|
22
22
|
export type CreateVoltageLevelTopologyDialogSchemaForm = yup.InferType<typeof createVoltageLevelTopologyFormSchema>;
|
|
23
23
|
export declare const createVoltageLevelTopologyEmptyFormData: DeepNullable<CreateVoltageLevelTopologyDialogSchemaForm>;
|
|
24
|
-
export declare const createVoltageLevelTopologyDtoToForm: (editData:
|
|
25
|
-
export declare const createVoltageLevelTopologyFormToDto: (voltageLevelTopology: CreateVoltageLevelTopologyDialogSchemaForm, voltageLevelId: string) =>
|
|
24
|
+
export declare const createVoltageLevelTopologyDtoToForm: (editData: CreateVoltageLevelTopologyDto | undefined, intl: IntlShape) => DeepNullable<CreateVoltageLevelTopologyDialogSchemaForm>;
|
|
25
|
+
export declare const createVoltageLevelTopologyFormToDto: (voltageLevelTopology: CreateVoltageLevelTopologyDialogSchemaForm, voltageLevelId: string) => CreateVoltageLevelTopologyDto;
|