@gridsuite/commons-ui 0.279.0 → 0.281.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.
Files changed (132) hide show
  1. package/dist/components/composite/customAGGrid/separatorCellRenderer.d.ts +7 -2
  2. package/dist/components/composite/customAGGrid/separatorCellRenderer.js +2 -2
  3. package/dist/components/ui/dialogs/elementSaveDialog/ElementSaveDialog.d.ts +6 -1
  4. package/dist/components/ui/dialogs/elementSaveDialog/ElementSaveDialog.js +29 -5
  5. package/dist/components/ui/reactHookForm/booleans/RadioInput.d.ts +1 -0
  6. package/dist/components/ui/reactHookForm/booleans/RadioInput.js +2 -1
  7. package/dist/features/index.js +93 -3
  8. package/dist/features/network-modifications/index.d.ts +1 -0
  9. package/dist/features/network-modifications/index.js +91 -3
  10. package/dist/features/network-modifications/tabular/TabularForm.d.ts +22 -0
  11. package/dist/features/network-modifications/tabular/TabularForm.js +536 -0
  12. package/dist/features/network-modifications/tabular/index.d.ts +7 -0
  13. package/dist/features/network-modifications/tabular/index.js +65 -0
  14. package/dist/features/network-modifications/tabular/properties/DefineTabularPropertiesDialog.d.ts +12 -0
  15. package/dist/features/network-modifications/tabular/properties/DefineTabularPropertiesDialog.js +123 -0
  16. package/dist/features/network-modifications/tabular/properties/TabularPropertiesForm.d.ts +1 -0
  17. package/dist/features/network-modifications/tabular/properties/TabularPropertiesForm.js +87 -0
  18. package/dist/features/network-modifications/tabular/properties/TabularPropertyForm.d.ts +5 -0
  19. package/dist/features/network-modifications/tabular/properties/TabularPropertyForm.js +91 -0
  20. package/dist/features/network-modifications/tabular/properties/index.d.ts +4 -0
  21. package/dist/features/network-modifications/tabular/properties/index.js +13 -0
  22. package/dist/features/network-modifications/tabular/properties/tabularProperty.utils.d.ts +26 -0
  23. package/dist/features/network-modifications/tabular/properties/tabularProperty.utils.js +50 -0
  24. package/dist/features/network-modifications/tabular/tabular.constants.d.ts +59 -0
  25. package/dist/features/network-modifications/tabular/tabular.constants.js +75 -0
  26. package/dist/features/network-modifications/tabular/tabular.types.d.ts +41 -0
  27. package/dist/features/network-modifications/tabular/tabular.types.js +8 -0
  28. package/dist/features/network-modifications/tabular/tabular.utils.d.ts +68 -0
  29. package/dist/features/network-modifications/tabular/tabular.utils.js +301 -0
  30. package/dist/features/network-modifications/tabular/tabularCreation.utils.d.ts +25 -0
  31. package/dist/features/network-modifications/tabular/tabularCreation.utils.js +276 -0
  32. package/dist/features/network-modifications/tabular/tabularModification.utils.d.ts +43 -0
  33. package/dist/features/network-modifications/tabular/tabularModification.utils.js +406 -0
  34. package/dist/features/network-modifications/voltageLevel/common/HeaderWithTooltip.d.ts +8 -0
  35. package/dist/features/network-modifications/voltageLevel/common/HeaderWithTooltip.js +119 -0
  36. package/dist/features/network-modifications/voltageLevel/common/index.d.ts +1 -0
  37. package/dist/features/network-modifications/voltageLevel/common/index.js +4 -0
  38. package/dist/features/network-modifications/voltageLevel/index.d.ts +4 -1
  39. package/dist/features/network-modifications/voltageLevel/index.js +28 -3
  40. package/dist/features/network-modifications/voltageLevel/moveFeederBays/MoveVoltageLevelFeederBaysForm.d.ts +8 -0
  41. package/dist/features/network-modifications/voltageLevel/moveFeederBays/MoveVoltageLevelFeederBaysForm.js +387 -0
  42. package/dist/features/network-modifications/voltageLevel/moveFeederBays/feederBay/FeederBayDirectionCellRender.d.ts +6 -0
  43. package/dist/features/network-modifications/voltageLevel/moveFeederBays/feederBay/FeederBayDirectionCellRender.js +64 -0
  44. package/dist/features/network-modifications/voltageLevel/moveFeederBays/feederBay/FeederBayPositionCellRender.d.ts +6 -0
  45. package/dist/features/network-modifications/voltageLevel/moveFeederBays/feederBay/FeederBayPositionCellRender.js +102 -0
  46. package/dist/features/network-modifications/voltageLevel/moveFeederBays/feederBay/index.d.ts +2 -0
  47. package/dist/features/network-modifications/voltageLevel/moveFeederBays/feederBay/index.js +6 -0
  48. package/dist/features/network-modifications/voltageLevel/moveFeederBays/index.d.ts +4 -0
  49. package/dist/features/network-modifications/voltageLevel/moveFeederBays/index.js +13 -0
  50. package/dist/features/network-modifications/voltageLevel/moveFeederBays/moveVoltageLevelFeederBays.type.d.ts +36 -0
  51. package/dist/features/network-modifications/voltageLevel/moveFeederBays/moveVoltageLevelFeederBays.utils.d.ts +37 -0
  52. package/dist/features/network-modifications/voltageLevel/moveFeederBays/moveVoltageLevelFeederBays.utils.js +86 -0
  53. package/dist/features/network-modifications/voltageLevel/topology/{CreateVoltageLevelTopologyForm.d.ts → creation/CreateVoltageLevelTopologyForm.d.ts} +1 -1
  54. package/dist/features/network-modifications/voltageLevel/topology/{CreateVoltageLevelTopologyForm.js → creation/CreateVoltageLevelTopologyForm.js} +38 -38
  55. package/dist/features/network-modifications/voltageLevel/topology/{voltageLevelTopologyCreation.types.d.ts → creation/voltageLevelTopologyCreation.types.d.ts} +1 -1
  56. package/dist/features/network-modifications/voltageLevel/topology/creation/voltageLevelTopologyCreation.types.js +1 -0
  57. package/dist/features/network-modifications/voltageLevel/topology/{voltageLevelTopologyCreation.utils.d.ts → creation/voltageLevelTopologyCreation.utils.d.ts} +1 -1
  58. package/dist/features/network-modifications/voltageLevel/topology/{voltageLevelTopologyCreation.utils.js → creation/voltageLevelTopologyCreation.utils.js} +5 -5
  59. package/dist/features/network-modifications/voltageLevel/topology/modification/ConnectionCellRender.d.ts +6 -0
  60. package/dist/features/network-modifications/voltageLevel/topology/modification/ConnectionCellRender.js +80 -0
  61. package/dist/features/network-modifications/voltageLevel/topology/modification/VoltageLevelTopologyModificationForm.d.ts +10 -0
  62. package/dist/features/network-modifications/voltageLevel/topology/modification/VoltageLevelTopologyModificationForm.js +284 -0
  63. package/dist/features/network-modifications/voltageLevel/topology/modification/constants.d.ts +10 -0
  64. package/dist/features/network-modifications/voltageLevel/topology/modification/constants.js +10 -0
  65. package/dist/features/network-modifications/voltageLevel/topology/modification/index.d.ts +10 -0
  66. package/dist/features/network-modifications/voltageLevel/topology/modification/index.js +14 -0
  67. package/dist/features/network-modifications/voltageLevel/topology/modification/voltageLevelTopologyModification.types.d.ts +28 -0
  68. package/dist/features/network-modifications/voltageLevel/topology/modification/voltageLevelTopologyModification.types.js +1 -0
  69. package/dist/features/network-modifications/voltageLevel/topology/modification/voltageLevelTopologyModification.utils.d.ts +29 -0
  70. package/dist/features/network-modifications/voltageLevel/topology/modification/voltageLevelTopologyModification.utils.js +124 -0
  71. package/dist/features/parameters/common/index.d.ts +1 -0
  72. package/dist/features/parameters/common/index.js +2 -0
  73. package/dist/features/parameters/common/parameter-field.d.ts +2 -2
  74. package/dist/features/parameters/common/parameter-field.js +1 -1
  75. package/dist/features/parameters/dynamic-margin-calculation/dynamic-margin-calculation-form.js +1 -1
  76. package/dist/features/parameters/dynamic-margin-calculation/dynamic-margin-calculation-inline.js +6 -6
  77. package/dist/features/parameters/dynamic-margin-calculation/loads-variations-parameters.js +1 -1
  78. package/dist/features/parameters/dynamic-margin-calculation/time-delay-parameters.js +1 -1
  79. package/dist/features/parameters/dynamic-security-analysis/contingency-parameters.js +1 -1
  80. package/dist/features/parameters/dynamic-security-analysis/dynamic-security-analysis-inline.js +6 -6
  81. package/dist/features/parameters/dynamic-security-analysis/dynamic-security-analysis-parameters-form.js +1 -1
  82. package/dist/features/parameters/dynamic-security-analysis/scenario-parameters.js +1 -1
  83. package/dist/features/parameters/dynamic-simulation/dynamic-simulation-inline.js +6 -6
  84. package/dist/features/parameters/dynamic-simulation/dynamic-simulation-parameters-form.js +1 -1
  85. package/dist/features/parameters/dynamic-simulation/network/network-parameters.js +1 -1
  86. package/dist/features/parameters/dynamic-simulation/solver/common-solver/common-solver-parameters.js +1 -1
  87. package/dist/features/parameters/dynamic-simulation/solver/ida-solver/ida-solver-parameters.js +1 -1
  88. package/dist/features/parameters/dynamic-simulation/solver/sim-solver/simplified-solver-parameters.js +1 -1
  89. package/dist/features/parameters/dynamic-simulation/solver/solver-parameters.js +1 -1
  90. package/dist/features/parameters/dynamic-simulation/time-delay/time-delay-parameters.js +1 -1
  91. package/dist/features/parameters/index.js +2 -0
  92. package/dist/features/parameters/loadflow/load-flow-advanced-parameters.js +1 -1
  93. package/dist/features/parameters/loadflow/load-flow-general-parameters.js +1 -1
  94. package/dist/features/parameters/loadflow/load-flow-parameters-inline.js +5 -5
  95. package/dist/features/parameters/loadflow/load-flow-provider-specific-parameters.js +1 -1
  96. package/dist/features/parameters/network-visualizations/network-visualizations-parameters-inline.js +5 -5
  97. package/dist/features/parameters/pcc-min/pcc-min-parameters-inline.js +5 -5
  98. package/dist/features/parameters/security-analysis/security-analysis-parameters-inline.js +6 -6
  99. package/dist/features/parameters/sensi/sensitivity-analysis-parameters-inline.js +6 -6
  100. package/dist/features/parameters/short-circuit/short-circuit-parameters-inline.js +5 -5
  101. package/dist/features/parameters/voltage-init/voltage-init-parameters-inline.js +5 -5
  102. package/dist/features/side-bar/AppSideBarHeader.js +20 -5
  103. package/dist/features/side-bar/EnvironmentChip.d.ts +13 -0
  104. package/dist/features/side-bar/EnvironmentChip.js +49 -0
  105. package/dist/index.js +97 -5
  106. package/dist/services/appsMetadata.d.ts +2 -0
  107. package/dist/services/directory.d.ts +1 -1
  108. package/dist/services/directory.js +6 -2
  109. package/dist/services/index.js +2 -1
  110. package/dist/services/userAdmin.d.ts +2 -1
  111. package/dist/services/userAdmin.js +9 -1
  112. package/dist/translations/en/businessErrorsEn.d.ts +1 -0
  113. package/dist/translations/en/businessErrorsEn.js +1 -0
  114. package/dist/translations/en/networkModificationsEn.d.ts +97 -0
  115. package/dist/translations/en/networkModificationsEn.js +103 -1
  116. package/dist/translations/fr/businessErrorsFr.d.ts +1 -0
  117. package/dist/translations/fr/businessErrorsFr.js +1 -0
  118. package/dist/translations/fr/networkModificationsFr.d.ts +97 -0
  119. package/dist/translations/fr/networkModificationsFr.js +103 -1
  120. package/dist/utils/constants/fieldConstants.d.ts +7 -1
  121. package/dist/utils/constants/fieldConstants.js +6 -0
  122. package/dist/utils/constants/index.js +2 -1
  123. package/dist/utils/constants/notificationsProvider.d.ts +1 -0
  124. package/dist/utils/constants/notificationsProvider.js +1 -0
  125. package/dist/utils/constants/translationKeys.d.ts +1 -0
  126. package/dist/utils/constants/translationKeys.js +2 -0
  127. package/dist/utils/index.js +2 -1
  128. package/dist/utils/types/types.d.ts +4 -0
  129. package/package.json +1 -1
  130. /package/dist/features/network-modifications/voltageLevel/{topology/voltageLevelTopologyCreation.types.js → moveFeederBays/moveVoltageLevelFeederBays.type.js} +0 -0
  131. /package/dist/features/network-modifications/voltageLevel/topology/{index.d.ts → creation/index.d.ts} +0 -0
  132. /package/dist/features/network-modifications/voltageLevel/topology/{index.js → creation/index.js} +0 -0
@@ -0,0 +1,284 @@
1
+ import { jsxs, jsx } from "react/jsx-runtime";
2
+ import { useMemo, useCallback } from "react";
3
+ import { useIntl } from "react-intl";
4
+ import { useWatch } from "react-hook-form";
5
+ import { Stack, Grid, TextField, Button, Box } from "@mui/material";
6
+ import { PublishedWithChanges } 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 "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 { useCustomFormContext } from "../../../../../components/ui/reactHookForm/provider/useCustomFormContext.js";
17
+ import "yup";
18
+ import "../../../../../components/ui/treeViewFinder/TreeViewFinder.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-fill.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 { CustomAGGrid } from "../../../../../components/composite/customAGGrid/customAggrid.js";
55
+ import { SeparatorCellRenderer } from "../../../../../components/composite/customAGGrid/separatorCellRenderer.js";
56
+ import "../../../../../components/composite/customAGGrid/context/custom-aggrid-context.js";
57
+ import "mathjs";
58
+ import "../../../../../components/composite/report/report-viewer/log-table/log-table.js";
59
+ import "react-window";
60
+ import "../../../../../components/composite/report/report-treeview/treeview-item.js";
61
+ import "../../../../../components/composite/report/report-viewer/context/report-viewer-context.js";
62
+ import { ConnectionCellRenderer } from "./ConnectionCellRender.js";
63
+ import { filledTextField } from "../../../common/form.utils.js";
64
+ import "../../../common/properties/propertyUtils.js";
65
+ import "../../../common/regulatingTerminal/RegulatingTerminalForm.js";
66
+ import "@mui/material/colors";
67
+ import "@mui/x-charts";
68
+ import "../../../common/currentLimits/limitsPane.utils.js";
69
+ import { SWITCH_ID, PREV_CONNECTION_STATUS, CURRENT_CONNECTION_STATUS, TOPOLOGY_MODIFICATION_TABLE } from "./constants.js";
70
+ import { HeaderWithTooltip } from "../../common/HeaderWithTooltip.js";
71
+ const SEPARATOR_TYPE = "SEPARATOR";
72
+ const SWITCH_TYPE = "SWITCH";
73
+ function isSwitchModified(switchId, editData) {
74
+ return editData?.equipmentAttributeModificationList?.some((mod) => mod.equipmentId === switchId) ?? false;
75
+ }
76
+ function addModifiedSeparator(result, intl, modifiedSwitches) {
77
+ result.push({
78
+ type: SEPARATOR_TYPE,
79
+ id: "modified-separator",
80
+ title: `${intl.formatMessage({ id: "modifiedSwitchesSeparatorTitle" })} (${modifiedSwitches.length})`
81
+ });
82
+ }
83
+ function addUnmodifiedSeparator(result, intl, unmodifiedSwitches) {
84
+ result.push({
85
+ type: SEPARATOR_TYPE,
86
+ id: "unmodified-separator",
87
+ title: `${intl.formatMessage({ id: "unModifiedSwitchesSeparatorTitle" })} (${unmodifiedSwitches.length})`
88
+ });
89
+ }
90
+ function VoltageLevelTopologyModificationForm({
91
+ voltageLevelToModify,
92
+ switchesToModify = [],
93
+ isModification = false,
94
+ isPreviousStatusEnabled = false
95
+ }) {
96
+ const intl = useIntl();
97
+ const { setValue, getValues, isNodeBuilt } = useCustomFormContext();
98
+ const equipmentId = useWatch({ name: FieldConstants.EQUIPMENT_ID });
99
+ const defaultColDef = useMemo(
100
+ () => ({
101
+ sortable: false,
102
+ resizable: true,
103
+ wrapHeaderText: true,
104
+ editable: false,
105
+ headerClass: "centered-header",
106
+ suppressMovable: true
107
+ }),
108
+ []
109
+ );
110
+ const columnDefs = useMemo(
111
+ () => [
112
+ {
113
+ field: SWITCH_ID,
114
+ filter: true,
115
+ flex: 2,
116
+ cellRenderer: ({ data }) => {
117
+ if (!data) return null;
118
+ if (data.type === SEPARATOR_TYPE) {
119
+ return SeparatorCellRenderer({
120
+ value: data.title ?? ""
121
+ });
122
+ }
123
+ return data[SWITCH_ID];
124
+ },
125
+ headerComponent: HeaderWithTooltip,
126
+ headerComponentParams: {
127
+ displayName: intl.formatMessage({ id: "switchId" }),
128
+ tooltipTitle: intl.formatMessage({
129
+ id: isNodeBuilt ? "builtNodeTooltipVlTopoModif" : "notBuiltNodeTooltipVlTopoModif"
130
+ }),
131
+ isNodeBuilt,
132
+ disabledTooltip: !isPreviousStatusEnabled || !isModification && isNodeBuilt
133
+ }
134
+ },
135
+ ...isPreviousStatusEnabled ? [
136
+ {
137
+ field: PREV_CONNECTION_STATUS,
138
+ flex: 1,
139
+ headerComponent: HeaderWithTooltip,
140
+ cellRenderer: ({ data }) => {
141
+ if (!data) return null;
142
+ if (data.type === SEPARATOR_TYPE) {
143
+ return null;
144
+ }
145
+ return intl.formatMessage({
146
+ id: data[PREV_CONNECTION_STATUS] ? "Open" : "Closed"
147
+ });
148
+ },
149
+ headerComponentParams: {
150
+ displayName: intl.formatMessage({ id: "previousStatus" }),
151
+ tooltipTitle: intl.formatMessage({
152
+ id: isNodeBuilt ? "builtNodeTooltipVlTopoModif" : "notBuiltNodeTooltipVlTopoModif"
153
+ }),
154
+ isNodeBuilt,
155
+ disabledTooltip: !isModification && isNodeBuilt
156
+ }
157
+ }
158
+ ] : [],
159
+ {
160
+ field: CURRENT_CONNECTION_STATUS,
161
+ flex: 1,
162
+ cellRenderer: ({ data }) => {
163
+ if (!data) return null;
164
+ if (data.type === SEPARATOR_TYPE) {
165
+ return null;
166
+ }
167
+ const formValues = getValues(TOPOLOGY_MODIFICATION_TABLE);
168
+ const formIndex = formValues.findIndex((item) => item.switchId === data.switchId);
169
+ return ConnectionCellRenderer({
170
+ name: `${TOPOLOGY_MODIFICATION_TABLE}[${formIndex}].${CURRENT_CONNECTION_STATUS}`
171
+ });
172
+ },
173
+ headerComponent: HeaderWithTooltip,
174
+ headerComponentParams: {
175
+ displayName: intl.formatMessage({ id: "currentStatus" }),
176
+ tooltipTitle: intl.formatMessage({
177
+ id: isNodeBuilt ? "builtNodeTooltipVlTopoModif" : "notBuiltNodeTooltipVlTopoModif"
178
+ }),
179
+ isNodeBuilt,
180
+ disabledTooltip: true
181
+ },
182
+ editable: false
183
+ }
184
+ ],
185
+ [isNodeBuilt, intl, isModification, isPreviousStatusEnabled, getValues]
186
+ );
187
+ const copyPreviousToCurrentStatus = useCallback(() => {
188
+ const formValues = getValues(TOPOLOGY_MODIFICATION_TABLE);
189
+ formValues.forEach((row, index) => {
190
+ if (row.type === SEPARATOR_TYPE || row.currentConnectionStatus !== null) {
191
+ return;
192
+ }
193
+ const newValue = !row[PREV_CONNECTION_STATUS];
194
+ setValue(`${TOPOLOGY_MODIFICATION_TABLE}[${index}].${CURRENT_CONNECTION_STATUS}`, newValue, {
195
+ shouldDirty: true
196
+ });
197
+ });
198
+ }, [getValues, setValue]);
199
+ const mergedRowData = useMemo(() => {
200
+ const result = [];
201
+ const watchTable = getValues(TOPOLOGY_MODIFICATION_TABLE);
202
+ if (!watchTable?.length) {
203
+ return result;
204
+ }
205
+ const sortedWatchTable = [...watchTable].sort((a, b) => (a.switchId ?? "").localeCompare(b.switchId ?? ""));
206
+ const modifiedSwitches = sortedWatchTable.filter(
207
+ (sw) => sw.switchId && isSwitchModified(sw.switchId, voltageLevelToModify)
208
+ );
209
+ if (modifiedSwitches.length > 0) {
210
+ addModifiedSeparator(result, intl, modifiedSwitches);
211
+ modifiedSwitches.forEach((sw) => {
212
+ result.push({
213
+ ...sw,
214
+ type: SWITCH_TYPE
215
+ });
216
+ });
217
+ }
218
+ const unmodifiedSwitches = sortedWatchTable.filter(
219
+ (sw) => sw.switchId && !isSwitchModified(sw.switchId, voltageLevelToModify) && switchesToModify.some((item) => item.id === sw.switchId)
220
+ );
221
+ if (unmodifiedSwitches.length > 0) {
222
+ addUnmodifiedSeparator(result, intl, unmodifiedSwitches);
223
+ unmodifiedSwitches.forEach((sw) => {
224
+ result.push({
225
+ ...sw,
226
+ type: SWITCH_TYPE
227
+ });
228
+ });
229
+ }
230
+ return result;
231
+ }, [voltageLevelToModify, switchesToModify, intl, getValues]);
232
+ return /* @__PURE__ */ jsxs(Stack, { sx: { height: "100%", minHeight: 0 }, children: [
233
+ /* @__PURE__ */ jsxs(Grid, { container: true, spacing: 2, sx: { width: "100%" }, children: [
234
+ /* @__PURE__ */ jsx(Grid, { size: 4, children: /* @__PURE__ */ jsx(
235
+ TextField,
236
+ {
237
+ fullWidth: true,
238
+ label: "ID",
239
+ value: equipmentId ?? "",
240
+ size: "small",
241
+ slotProps: {
242
+ input: { readOnly: true }
243
+ },
244
+ disabled: true,
245
+ ...filledTextField
246
+ }
247
+ ) }),
248
+ /* @__PURE__ */ jsx(Grid, { size: 8, container: true, justifyContent: "flex-end", children: isPreviousStatusEnabled && /* @__PURE__ */ jsx(
249
+ Button,
250
+ {
251
+ variant: "outlined",
252
+ color: "primary",
253
+ size: "small",
254
+ onClick: copyPreviousToCurrentStatus,
255
+ startIcon: /* @__PURE__ */ jsx(
256
+ PublishedWithChanges,
257
+ {
258
+ style: {
259
+ width: 24,
260
+ height: 24
261
+ }
262
+ }
263
+ ),
264
+ children: intl.formatMessage({ id: "copyPreviousTopologyStatus" })
265
+ }
266
+ ) })
267
+ ] }),
268
+ /* @__PURE__ */ jsx(Box, { sx: { pt: 2, flex: 1, minHeight: 0 }, children: /* @__PURE__ */ jsx(
269
+ CustomAGGrid,
270
+ {
271
+ rowData: mergedRowData,
272
+ defaultColDef,
273
+ columnDefs,
274
+ suppressMovableColumns: true,
275
+ animateRows: false,
276
+ domLayout: "normal",
277
+ headerHeight: 48
278
+ }
279
+ ) })
280
+ ] });
281
+ }
282
+ export {
283
+ VoltageLevelTopologyModificationForm
284
+ };
@@ -0,0 +1,10 @@
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 declare const TOPOLOGY_MODIFICATION_TABLE = "topologyModificationTable";
8
+ export declare const SWITCH_ID = "switchId";
9
+ export declare const PREV_CONNECTION_STATUS = "prevConnectionStatus";
10
+ export declare const CURRENT_CONNECTION_STATUS = "currentConnectionStatus";
@@ -0,0 +1,10 @@
1
+ const TOPOLOGY_MODIFICATION_TABLE = "topologyModificationTable";
2
+ const SWITCH_ID = "switchId";
3
+ const PREV_CONNECTION_STATUS = "prevConnectionStatus";
4
+ const CURRENT_CONNECTION_STATUS = "currentConnectionStatus";
5
+ export {
6
+ CURRENT_CONNECTION_STATUS,
7
+ PREV_CONNECTION_STATUS,
8
+ SWITCH_ID,
9
+ TOPOLOGY_MODIFICATION_TABLE
10
+ };
@@ -0,0 +1,10 @@
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 './voltageLevelTopologyModification.utils';
8
+ export * from './VoltageLevelTopologyModificationForm';
9
+ export * from './voltageLevelTopologyModification.types';
10
+ export * from './constants';
@@ -0,0 +1,14 @@
1
+ import { voltageLevelTopologyModificationDtoToForm, voltageLevelTopologyModificationEmptyFormData, voltageLevelTopologyModificationFormSchema, voltageLevelTopologyModificationFormToDto } from "./voltageLevelTopologyModification.utils.js";
2
+ import { VoltageLevelTopologyModificationForm } from "./VoltageLevelTopologyModificationForm.js";
3
+ import { CURRENT_CONNECTION_STATUS, PREV_CONNECTION_STATUS, SWITCH_ID, TOPOLOGY_MODIFICATION_TABLE } from "./constants.js";
4
+ export {
5
+ CURRENT_CONNECTION_STATUS,
6
+ PREV_CONNECTION_STATUS,
7
+ SWITCH_ID,
8
+ TOPOLOGY_MODIFICATION_TABLE,
9
+ VoltageLevelTopologyModificationForm,
10
+ voltageLevelTopologyModificationDtoToForm,
11
+ voltageLevelTopologyModificationEmptyFormData,
12
+ voltageLevelTopologyModificationFormSchema,
13
+ voltageLevelTopologyModificationFormToDto
14
+ };
@@ -0,0 +1,28 @@
1
+ import { ModificationType } from '../../../../../utils';
2
+ import { Property } from '../../../common';
3
+ export type EquipmentAttributeModificationDto = {
4
+ type: string;
5
+ equipmentId: string;
6
+ equipmentAttributeName: string;
7
+ equipmentAttributeValue: boolean;
8
+ equipmentType: string;
9
+ };
10
+ export interface TopologyVoltageLevelModificationDto {
11
+ type: ModificationType;
12
+ uuid?: string | null;
13
+ equipmentId: string;
14
+ equipmentAttributeModificationList: EquipmentAttributeModificationDto[];
15
+ properties?: Property[] | null;
16
+ }
17
+ export type SwitchRowForm = {
18
+ id: string;
19
+ switchId?: string;
20
+ prevConnectionStatus?: boolean | null;
21
+ currentConnectionStatus?: boolean | null;
22
+ type: string;
23
+ title?: string;
24
+ };
25
+ export type SwitchDto = {
26
+ id: string;
27
+ open: boolean;
28
+ };
@@ -0,0 +1,29 @@
1
+ import { TopologyVoltageLevelModificationDto } from './voltageLevelTopologyModification.types';
2
+ /**
3
+ * Copyright (c) 2026, RTE (http://www.rte-france.com)
4
+ * This Source Code Form is subject to the terms of the Mozilla Public
5
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
6
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
7
+ */
8
+ import * as yup from 'yup';
9
+ export declare const voltageLevelTopologyModificationFormSchema: yup.ObjectSchema<{
10
+ equipmentID: string;
11
+ topologyModificationTable: {
12
+ switchId?: string | undefined;
13
+ prevConnectionStatus?: boolean | null | undefined;
14
+ currentConnectionStatus?: boolean | null | undefined;
15
+ }[];
16
+ }, yup.AnyObject, {
17
+ equipmentID: undefined;
18
+ topologyModificationTable: "";
19
+ }, "">;
20
+ export type VoltageLevelTopologyModificationFormSchemaType = yup.InferType<typeof voltageLevelTopologyModificationFormSchema>;
21
+ export declare const voltageLevelTopologyModificationEmptyFormData: {
22
+ topologyModificationTable: {
23
+ switchId: string;
24
+ prevConnectionStatus: null;
25
+ currentConnectionStatus: null;
26
+ }[];
27
+ };
28
+ export declare const voltageLevelTopologyModificationFormToDto: (formData: VoltageLevelTopologyModificationFormSchemaType) => TopologyVoltageLevelModificationDto;
29
+ export declare const voltageLevelTopologyModificationDtoToForm: (dto: TopologyVoltageLevelModificationDto, includePreviousValues?: boolean) => VoltageLevelTopologyModificationFormSchemaType;
@@ -0,0 +1,124 @@
1
+ import * as yup from "yup";
2
+ import { FieldConstants } from "../../../../../utils/constants/fieldConstants.js";
3
+ import "../../../../../utils/conversionUtils.js";
4
+ import { EquipmentType } from "../../../../../utils/types/equipmentType.js";
5
+ import { MODIFICATION_TYPES } from "../../../../../utils/types/modificationType.js";
6
+ import "react/jsx-runtime";
7
+ import "@mui/icons-material";
8
+ import { TOPOLOGY_MODIFICATION_TABLE, CURRENT_CONNECTION_STATUS, PREV_CONNECTION_STATUS, SWITCH_ID } from "./constants.js";
9
+ import "react";
10
+ import "react-hook-form";
11
+ import { getPropertiesFromModification } 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 "../../../common/regulatingTerminal/RegulatingTerminalForm.js";
64
+ import "@mui/material/colors";
65
+ import "@mui/x-charts";
66
+ import "../../../common/currentLimits/limitsPane.utils.js";
67
+ const voltageLevelTopologyModificationFormSchema = yup.object().shape({
68
+ [FieldConstants.EQUIPMENT_ID]: yup.string().required(),
69
+ [TOPOLOGY_MODIFICATION_TABLE]: yup.array().of(
70
+ yup.object().shape({
71
+ [SWITCH_ID]: yup.string(),
72
+ [PREV_CONNECTION_STATUS]: yup.boolean().nullable(),
73
+ // presents 'open'
74
+ [CURRENT_CONNECTION_STATUS]: yup.boolean().nullable()
75
+ // presents 'close'
76
+ })
77
+ ).required()
78
+ });
79
+ const voltageLevelTopologyModificationEmptyFormData = {
80
+ [TOPOLOGY_MODIFICATION_TABLE]: [
81
+ {
82
+ [SWITCH_ID]: "",
83
+ [PREV_CONNECTION_STATUS]: null,
84
+ [CURRENT_CONNECTION_STATUS]: null
85
+ }
86
+ ]
87
+ };
88
+ const voltageLevelTopologyModificationFormToDto = (formData) => {
89
+ let equipmentAttributeModificationDto = [];
90
+ if (formData[TOPOLOGY_MODIFICATION_TABLE]?.length > 0) {
91
+ equipmentAttributeModificationDto = formData[TOPOLOGY_MODIFICATION_TABLE].filter((item) => {
92
+ return item?.currentConnectionStatus != null;
93
+ }).map((item) => ({
94
+ type: MODIFICATION_TYPES.EQUIPMENT_ATTRIBUTE_MODIFICATION.type,
95
+ equipmentId: item.switchId ?? "",
96
+ equipmentAttributeName: "open",
97
+ // Note that 'currentConnectionStatus' which presents 'close' should be inverted when submitting open attribute
98
+ equipmentAttributeValue: Boolean(!item.currentConnectionStatus),
99
+ equipmentType: EquipmentType.SWITCH
100
+ }));
101
+ }
102
+ return {
103
+ type: MODIFICATION_TYPES.VOLTAGE_LEVEL_TOPOLOGY_MODIFICATION.type,
104
+ equipmentId: formData.equipmentID,
105
+ equipmentAttributeModificationList: equipmentAttributeModificationDto
106
+ };
107
+ };
108
+ const voltageLevelTopologyModificationDtoToForm = (dto, includePreviousValues = true) => {
109
+ return {
110
+ [FieldConstants.EQUIPMENT_ID]: dto.equipmentId,
111
+ [TOPOLOGY_MODIFICATION_TABLE]: dto.equipmentAttributeModificationList.map((item) => ({
112
+ [SWITCH_ID]: item.equipmentId,
113
+ [CURRENT_CONNECTION_STATUS]: Boolean(!item.equipmentAttributeValue),
114
+ [PREV_CONNECTION_STATUS]: null
115
+ })),
116
+ ...getPropertiesFromModification(dto.properties, includePreviousValues)
117
+ };
118
+ };
119
+ export {
120
+ voltageLevelTopologyModificationDtoToForm,
121
+ voltageLevelTopologyModificationEmptyFormData,
122
+ voltageLevelTopologyModificationFormSchema,
123
+ voltageLevelTopologyModificationFormToDto
124
+ };
@@ -9,6 +9,7 @@ export * from './computing-type';
9
9
  export * from './constants';
10
10
  export * from './parameters-edition-dialog-props';
11
11
  export * from './line-separator';
12
+ export * from './parameter-field';
12
13
  export * from './parameters';
13
14
  export * from './parameters-creation-dialog';
14
15
  export * from './provider-param';
@@ -3,6 +3,7 @@ import { ParameterLayoutProvider, useParameterLayoutContext } from "./parameter-
3
3
  import { formatComputingTypeLabel, isValidComputingType } from "./computing-type.js";
4
4
  import { ADVANCED_PARAMETERS, COMMON_PARAMETERS, CONTINGENCIES, CONTINGENCY_LISTS, CONTINGENCY_LISTS_INFOS, PROVIDER, SPECIFIC_PARAMETERS, VERSION_PARAMETER, VOLTAGE_LEVEL } from "./constants.js";
5
5
  import { LineSeparator } from "./line-separator.js";
6
+ import { ParameterField } from "./parameter-field.js";
6
7
  import { LabelledButton, SwitchWithLabel, TabPanel } from "./parameters.js";
7
8
  import { CreateParameterDialog } from "./parameters-creation-dialog.js";
8
9
  import { ProviderParam } from "./provider-param.js";
@@ -44,6 +45,7 @@ export {
44
45
  LimitReductionsTableForm,
45
46
  LineSeparator,
46
47
  PROVIDER,
48
+ ParameterField,
47
49
  ParameterFloat,
48
50
  ParameterGroup,
49
51
  ParameterLayout,
@@ -12,5 +12,5 @@ interface ParameterFieldProps {
12
12
  }[] | string[];
13
13
  sx?: SxProps;
14
14
  }
15
- declare function ParameterField({ id, name, type, label, inputLabel, description, possibleValues, sx, }: Readonly<ParameterFieldProps>): import("react").JSX.Element;
16
- export default ParameterField;
15
+ export declare function ParameterField({ id, name, type, label, inputLabel, description, possibleValues, sx, }: Readonly<ParameterFieldProps>): import("react").JSX.Element;
16
+ export {};
@@ -114,5 +114,5 @@ function ParameterField({
114
114
  ] }, name);
115
115
  }
116
116
  export {
117
- ParameterField as default
117
+ ParameterField
118
118
  };
@@ -31,8 +31,8 @@ import "mui-nested-menu";
31
31
  import "react-resizable-panels";
32
32
  import "react-papaparse";
33
33
  import "../common/parameter-layout/parameter-layout-provider.js";
34
- import { ProviderParam } from "../common/provider-param.js";
35
34
  import { parametersStyles, getTabStyle } from "../parameters-style.js";
35
+ import { ProviderParam } from "../common/provider-param.js";
36
36
  import "../common/widget/parameter-line-slider.js";
37
37
  import "../common/contingency-table/contingency-table.js";
38
38
  import "../common/contingency-table/columns-definitions.js";
@@ -11,27 +11,27 @@ import { ParameterLayout } from "../common/parameter-layout/parameter-layout.js"
11
11
  import "../common/parameter-layout/parameter-layout-provider.js";
12
12
  import "@mui/material";
13
13
  import "react-intl";
14
+ import "../../../components/ui/overflowableText/OverflowableText.js";
15
+ import "react-hook-form";
14
16
  import { fetchDynamicMarginCalculationParameters } from "../../../services/dynamic-margin-calculation.js";
15
17
  import "localized-countries";
16
18
  import "localized-countries/data/fr";
17
19
  import "localized-countries/data/en";
18
20
  import { useSnackMessage } from "../../../hooks/useSnackMessage.js";
19
- import "react-hook-form";
20
21
  import { CustomFormProvider } from "../../../components/ui/reactHookForm/provider/CustomFormProvider.js";
21
- import "../../../components/ui/dialogs/descriptionModificationDialog/DescriptionModificationDialog.js";
22
- import "../../../components/ui/dialogs/elementSaveDialog/ElementSaveDialog.js";
23
- import "../../../components/ui/treeViewFinder/TreeViewFinder.js";
24
- import "@hello-pangea/dnd";
25
- import "../../../components/ui/overflowableText/OverflowableText.js";
26
22
  import "yup";
23
+ import "../../../components/ui/treeViewFinder/TreeViewFinder.js";
27
24
  import "../../../components/ui/reactHookForm/numbers/RangeInput.js";
28
25
  import "@material-symbols/svg-400/outlined/left_panel_open.svg?react";
29
26
  import "@material-symbols/svg-400/outlined/arrows_output.svg?react";
30
27
  import "@material-symbols/svg-400/outlined/arrows_input.svg?react";
31
28
  import "@material-symbols/svg-400/outlined/left_panel_close.svg?react";
32
29
  import "@material-symbols/svg-400/outlined/add_notes-fill.svg?react";
30
+ import "../../../components/ui/dialogs/descriptionModificationDialog/DescriptionModificationDialog.js";
33
31
  import "../../../components/ui/reactHookForm/expandableInput/ExpandableInput.js";
34
32
  import "../../../components/ui/reactHookForm/directory-item-input/directory-item-utils.js";
33
+ import "@hello-pangea/dnd";
34
+ import "../../../components/ui/dialogs/elementSaveDialog/ElementSaveDialog.js";
35
35
  import "../../../components/ui/snackbarProvider/SnackbarProvider.js";
36
36
  import "mui-nested-menu";
37
37
  import "react-resizable-panels";
@@ -12,7 +12,7 @@ import { EquipmentType } from "../../../utils/types/equipmentType.js";
12
12
  import { ParameterType } from "../../../utils/types/parameters.type.js";
13
13
  import { CalculationType, LoadModelsRule } from "../../../utils/types/dynamic-margin-calculation.type.js";
14
14
  import "@mui/icons-material";
15
- import ParameterField from "../common/parameter-field.js";
15
+ import { ParameterField } from "../common/parameter-field.js";
16
16
  import "../../../components/ui/overflowableText/OverflowableText.js";
17
17
  import "react-hook-form";
18
18
  import "localized-countries";
@@ -6,7 +6,7 @@ import "../../../utils/conversionUtils.js";
6
6
  import "../../../utils/types/equipmentType.js";
7
7
  import { ParameterType } from "../../../utils/types/parameters.type.js";
8
8
  import "@mui/icons-material";
9
- import ParameterField from "../common/parameter-field.js";
9
+ import { ParameterField } from "../common/parameter-field.js";
10
10
  const formSchema = yup.object().shape({
11
11
  [START_TIME]: yup.number().required(),
12
12
  [STOP_TIME]: yup.number().required(),
@@ -32,13 +32,13 @@ import "mui-nested-menu";
32
32
  import "react-resizable-panels";
33
33
  import "react-papaparse";
34
34
  import "../common/parameter-layout/parameter-layout-provider.js";
35
+ import { ParameterField } from "../common/parameter-field.js";
35
36
  import { ParameterLineDirectoryItemsInput } from "../common/widget/parameter-line-directory-items-input.js";
36
37
  import "../common/widget/parameter-line-slider.js";
37
38
  import "../common/contingency-table/contingency-table.js";
38
39
  import "../common/contingency-table/columns-definitions.js";
39
40
  import "@hookform/resolvers/yup";
40
41
  import { CONTINGENCIES_START_TIME, CONTINGENCIES_LIST_INFOS } from "./constants.js";
41
- import ParameterField from "../common/parameter-field.js";
42
42
  const params = [
43
43
  {
44
44
  name: CONTINGENCIES_START_TIME,