@gridsuite/commons-ui 0.280.0 → 0.282.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 (207) hide show
  1. package/dist/components/composite/customAGGrid/custom-aggrid-filters/hooks/use-custom-aggrid-comparator-filter.js +1 -0
  2. package/dist/components/composite/customAGGrid/hooks/use-custom-aggrid-sort.js +1 -0
  3. package/dist/components/composite/reactQueryBuilder/OperatorSelector.js +1 -0
  4. package/dist/components/composite/report/QuickSearch.js +1 -0
  5. package/dist/components/composite/report/report-viewer/log-table/log-table.js +1 -1
  6. package/dist/components/ui/dialogs/elementSaveDialog/ElementSaveDialog.d.ts +6 -1
  7. package/dist/components/ui/dialogs/elementSaveDialog/ElementSaveDialog.js +29 -5
  8. package/dist/components/ui/directoryItemSelector/DirectoryItemSelector.js +1 -0
  9. package/dist/components/ui/reactHookForm/booleans/RadioInput.d.ts +1 -0
  10. package/dist/components/ui/reactHookForm/booleans/RadioInput.js +2 -1
  11. package/dist/features/index.js +92 -12
  12. package/dist/features/network-modification-table/network-modifications-table.js +1 -0
  13. package/dist/features/network-modification-table/renderers/reference-link-cell.js +1 -1
  14. package/dist/features/network-modification-table/renderers/root-network-chip-cell.js +1 -0
  15. package/dist/features/network-modification-table/renderers/switch-cell.js +1 -0
  16. package/dist/features/network-modification-table/row/drag-row-clone.js +1 -0
  17. package/dist/features/network-modification-table/use-modifications-drag-and-drop.js +1 -0
  18. package/dist/features/network-modifications/battery/modification/BatteryDialogTabs.d.ts +3 -3
  19. package/dist/features/network-modifications/battery/modification/BatteryDialogTabs.js +2 -2
  20. package/dist/features/network-modifications/battery/modification/BatteryModificationForm.d.ts +4 -1
  21. package/dist/features/network-modifications/battery/modification/BatteryModificationForm.js +7 -11
  22. package/dist/features/network-modifications/generator/modification/GeneratorDialogTabs.d.ts +3 -3
  23. package/dist/features/network-modifications/generator/modification/GeneratorDialogTabs.js +2 -2
  24. package/dist/features/network-modifications/generator/modification/GeneratorModificationForm.d.ts +4 -1
  25. package/dist/features/network-modifications/generator/modification/GeneratorModificationForm.js +4 -8
  26. package/dist/features/network-modifications/index.d.ts +1 -1
  27. package/dist/features/network-modifications/index.js +81 -6
  28. package/dist/features/network-modifications/line/common/LineDialogTabs.d.ts +3 -3
  29. package/dist/features/network-modifications/line/common/LineDialogTabs.js +2 -2
  30. package/dist/features/network-modifications/line/common/LineForm.d.ts +4 -1
  31. package/dist/features/network-modifications/line/common/LineForm.js +7 -11
  32. package/dist/features/network-modifications/line/common/line.utils.d.ts +1 -1
  33. package/dist/features/network-modifications/load/common/LoadDialogTabs.d.ts +3 -3
  34. package/dist/features/network-modifications/load/common/LoadDialogTabs.js +2 -2
  35. package/dist/features/network-modifications/load/common/LoadForm.d.ts +4 -1
  36. package/dist/features/network-modifications/load/common/LoadForm.js +7 -11
  37. package/dist/features/network-modifications/static-var-compensator/common/static-var-compensator-dialog-tabs.d.ts +3 -2
  38. package/dist/features/network-modifications/static-var-compensator/common/static-var-compensator-dialog-tabs.js +2 -2
  39. package/dist/features/network-modifications/static-var-compensator/creation/static-var-compensator-creation-form.d.ts +4 -1
  40. package/dist/features/network-modifications/static-var-compensator/creation/static-var-compensator-creation-form.js +8 -11
  41. package/dist/features/network-modifications/tabular/TabularForm.d.ts +22 -0
  42. package/dist/features/network-modifications/tabular/TabularForm.js +536 -0
  43. package/dist/features/network-modifications/tabular/index.d.ts +7 -0
  44. package/dist/features/network-modifications/tabular/index.js +65 -0
  45. package/dist/features/network-modifications/tabular/properties/DefineTabularPropertiesDialog.d.ts +12 -0
  46. package/dist/features/network-modifications/tabular/properties/DefineTabularPropertiesDialog.js +123 -0
  47. package/dist/features/network-modifications/tabular/properties/TabularPropertiesForm.d.ts +1 -0
  48. package/dist/features/network-modifications/tabular/properties/TabularPropertiesForm.js +87 -0
  49. package/dist/features/network-modifications/tabular/properties/TabularPropertyForm.d.ts +5 -0
  50. package/dist/features/network-modifications/tabular/properties/TabularPropertyForm.js +91 -0
  51. package/dist/features/network-modifications/tabular/properties/index.d.ts +4 -0
  52. package/dist/features/network-modifications/tabular/properties/index.js +13 -0
  53. package/dist/features/network-modifications/tabular/properties/tabularProperty.utils.d.ts +26 -0
  54. package/dist/features/network-modifications/tabular/properties/tabularProperty.utils.js +50 -0
  55. package/dist/features/network-modifications/tabular/tabular.constants.d.ts +59 -0
  56. package/dist/features/network-modifications/tabular/tabular.constants.js +75 -0
  57. package/dist/features/network-modifications/tabular/tabular.types.d.ts +41 -0
  58. package/dist/features/network-modifications/tabular/tabular.types.js +8 -0
  59. package/dist/features/network-modifications/tabular/tabular.utils.d.ts +68 -0
  60. package/dist/features/network-modifications/tabular/tabular.utils.js +301 -0
  61. package/dist/features/network-modifications/tabular/tabularCreation.utils.d.ts +25 -0
  62. package/dist/features/network-modifications/tabular/tabularCreation.utils.js +276 -0
  63. package/dist/features/network-modifications/tabular/tabularModification.utils.d.ts +43 -0
  64. package/dist/features/network-modifications/tabular/tabularModification.utils.js +406 -0
  65. package/dist/features/network-modifications/twoWindingsTransformer/common/TwoWindingsTransformerDialogTabs.d.ts +3 -3
  66. package/dist/features/network-modifications/twoWindingsTransformer/common/TwoWindingsTransformerDialogTabs.js +2 -2
  67. package/dist/features/network-modifications/twoWindingsTransformer/common/TwoWindingsTransformerForm.d.ts +4 -1
  68. package/dist/features/network-modifications/twoWindingsTransformer/common/TwoWindingsTransformerForm.js +7 -11
  69. package/dist/features/network-modifications/voltageLevel/creation/VoltageLevelCreationForm.d.ts +4 -7
  70. package/dist/features/network-modifications/voltageLevel/creation/VoltageLevelCreationForm.js +16 -19
  71. package/dist/features/network-modifications/voltageLevel/creation/index.d.ts +1 -1
  72. package/dist/features/network-modifications/voltageLevel/creation/index.js +3 -1
  73. package/dist/features/network-modifications/voltageLevel/index.d.ts +2 -1
  74. package/dist/features/network-modifications/voltageLevel/index.js +18 -4
  75. package/dist/features/network-modifications/voltageLevel/topology/{CreateVoltageLevelTopologyForm.d.ts → creation/CreateVoltageLevelTopologyForm.d.ts} +1 -1
  76. package/dist/features/network-modifications/voltageLevel/topology/{CreateVoltageLevelTopologyForm.js → creation/CreateVoltageLevelTopologyForm.js} +38 -38
  77. package/dist/features/network-modifications/voltageLevel/topology/{voltageLevelTopologyCreation.types.d.ts → creation/voltageLevelTopologyCreation.types.d.ts} +1 -1
  78. package/dist/features/network-modifications/voltageLevel/topology/{voltageLevelTopologyCreation.utils.d.ts → creation/voltageLevelTopologyCreation.utils.d.ts} +1 -1
  79. package/dist/features/network-modifications/voltageLevel/topology/{voltageLevelTopologyCreation.utils.js → creation/voltageLevelTopologyCreation.utils.js} +5 -5
  80. package/dist/features/network-modifications/voltageLevel/topology/modification/ConnectionCellRender.d.ts +6 -0
  81. package/dist/features/network-modifications/voltageLevel/topology/modification/ConnectionCellRender.js +80 -0
  82. package/dist/features/network-modifications/voltageLevel/topology/modification/VoltageLevelTopologyModificationForm.d.ts +10 -0
  83. package/dist/features/network-modifications/voltageLevel/topology/modification/VoltageLevelTopologyModificationForm.js +284 -0
  84. package/dist/features/network-modifications/voltageLevel/topology/modification/constants.d.ts +10 -0
  85. package/dist/features/network-modifications/voltageLevel/topology/modification/constants.js +10 -0
  86. package/dist/features/network-modifications/{hooks → voltageLevel/topology/modification}/index.d.ts +4 -1
  87. package/dist/features/network-modifications/voltageLevel/topology/modification/index.js +14 -0
  88. package/dist/features/network-modifications/voltageLevel/topology/modification/voltageLevelTopologyModification.types.d.ts +28 -0
  89. package/dist/features/network-modifications/voltageLevel/topology/modification/voltageLevelTopologyModification.types.js +1 -0
  90. package/dist/features/network-modifications/voltageLevel/topology/modification/voltageLevelTopologyModification.utils.d.ts +29 -0
  91. package/dist/features/network-modifications/voltageLevel/topology/modification/voltageLevelTopologyModification.utils.js +124 -0
  92. package/dist/features/parameters/common/hook/index.d.ts +0 -1
  93. package/dist/features/parameters/common/hook/index.js +1 -3
  94. package/dist/features/parameters/common/index.d.ts +1 -0
  95. package/dist/features/parameters/common/index.js +3 -3
  96. package/dist/features/parameters/common/parameter-field.d.ts +2 -2
  97. package/dist/features/parameters/common/parameter-field.js +1 -1
  98. package/dist/features/parameters/dynamic-margin-calculation/dynamic-margin-calculation-form.d.ts +1 -1
  99. package/dist/features/parameters/dynamic-margin-calculation/dynamic-margin-calculation-form.js +1 -1
  100. package/dist/features/parameters/dynamic-margin-calculation/dynamic-margin-calculation-inline.js +10 -10
  101. package/dist/features/parameters/dynamic-margin-calculation/dynamic-margin-calculation.type.d.ts +1 -0
  102. package/dist/features/parameters/dynamic-margin-calculation/dynamic-margin-calculation.type.js +2 -0
  103. package/dist/features/parameters/dynamic-margin-calculation/loads-variations-parameters.js +1 -1
  104. package/dist/features/parameters/dynamic-margin-calculation/time-delay-parameters.js +1 -1
  105. package/dist/features/parameters/dynamic-security-analysis/contingency-parameters.js +1 -1
  106. package/dist/features/parameters/dynamic-security-analysis/dynamic-security-analysis-inline.js +9 -9
  107. package/dist/features/parameters/dynamic-security-analysis/dynamic-security-analysis-parameters-form.d.ts +1 -1
  108. package/dist/features/parameters/dynamic-security-analysis/dynamic-security-analysis-parameters-form.js +1 -1
  109. package/dist/features/parameters/dynamic-security-analysis/dynamic-security-analysis.type.d.ts +1 -0
  110. package/dist/features/parameters/dynamic-security-analysis/dynamic-security-analysis.type.js +2 -0
  111. package/dist/features/parameters/dynamic-security-analysis/scenario-parameters.js +1 -1
  112. package/dist/features/parameters/dynamic-simulation/curve/dialog/curve-preview.js +1 -0
  113. package/dist/features/parameters/dynamic-simulation/curve/dialog/equipment-filter.js +1 -0
  114. package/dist/features/parameters/dynamic-simulation/dynamic-simulation-inline.js +9 -9
  115. package/dist/features/parameters/dynamic-simulation/dynamic-simulation-parameters-form.d.ts +1 -1
  116. package/dist/features/parameters/dynamic-simulation/dynamic-simulation-parameters-form.js +1 -1
  117. package/dist/features/parameters/dynamic-simulation/dynamic-simulation.type.d.ts +1 -0
  118. package/dist/features/parameters/dynamic-simulation/dynamic-simulation.type.js +2 -0
  119. package/dist/features/parameters/dynamic-simulation/network/network-parameters.js +1 -1
  120. package/dist/features/parameters/dynamic-simulation/solver/common-solver/common-solver-parameters.js +1 -1
  121. package/dist/features/parameters/dynamic-simulation/solver/ida-solver/ida-solver-parameters.js +1 -1
  122. package/dist/features/parameters/dynamic-simulation/solver/sim-solver/simplified-solver-parameters.js +1 -1
  123. package/dist/features/parameters/dynamic-simulation/solver/solver-parameters.js +1 -1
  124. package/dist/features/parameters/dynamic-simulation/time-delay/time-delay-parameters.js +1 -1
  125. package/dist/features/parameters/index.js +12 -7
  126. package/dist/features/parameters/loadflow/load-flow-advanced-parameters.js +1 -1
  127. package/dist/features/parameters/loadflow/load-flow-general-parameters.js +1 -1
  128. package/dist/features/parameters/loadflow/load-flow-parameters-inline.js +6 -6
  129. package/dist/features/parameters/loadflow/load-flow-parameters-utils.d.ts +1 -0
  130. package/dist/features/parameters/loadflow/load-flow-parameters-utils.js +2 -0
  131. package/dist/features/parameters/loadflow/load-flow-provider-specific-parameters.js +1 -1
  132. package/dist/features/parameters/loadflow/use-load-flow-parameters-form.js +3 -3
  133. package/dist/features/parameters/network-visualizations/constants.d.ts +1 -0
  134. package/dist/features/parameters/network-visualizations/constants.js +2 -0
  135. package/dist/features/parameters/network-visualizations/index.js +2 -1
  136. package/dist/features/parameters/network-visualizations/network-visualizations-parameters-inline.js +6 -6
  137. package/dist/features/parameters/network-visualizations/use-network-visualizations-parameters-form.js +3 -7
  138. package/dist/features/parameters/pcc-min/pcc-min-parameters-inline.js +6 -6
  139. package/dist/features/parameters/security-analysis/constants.d.ts +1 -0
  140. package/dist/features/parameters/security-analysis/constants.js +2 -0
  141. package/dist/features/parameters/security-analysis/index.js +2 -1
  142. package/dist/features/parameters/security-analysis/security-analysis-parameters-content.js +1 -1
  143. package/dist/features/parameters/security-analysis/security-analysis-parameters-dialog.js +1 -1
  144. package/dist/features/parameters/security-analysis/security-analysis-parameters-inline.js +6 -6
  145. package/dist/features/parameters/security-analysis/use-security-analysis-parameters-form.js +3 -3
  146. package/dist/features/parameters/sensi/columns-definitions.d.ts +2 -0
  147. package/dist/features/parameters/sensi/columns-definitions.js +36 -1
  148. package/dist/features/parameters/sensi/index.js +3 -1
  149. package/dist/features/parameters/sensi/sensitivity-analysis-parameters-dialog.js +1 -1
  150. package/dist/features/parameters/sensi/sensitivity-analysis-parameters-form.js +2 -1
  151. package/dist/features/parameters/sensi/sensitivity-analysis-parameters-inline.js +10 -7
  152. package/dist/features/parameters/sensi/sensitivity-parameters-selector.d.ts +3 -1
  153. package/dist/features/parameters/sensi/sensitivity-parameters-selector.js +19 -35
  154. package/dist/features/parameters/sensi/use-sensitivity-analysis-parameters.d.ts +9 -1
  155. package/dist/features/parameters/sensi/use-sensitivity-analysis-parameters.js +29 -1
  156. package/dist/features/parameters/short-circuit/short-circuit-parameters-inline.js +6 -6
  157. package/dist/features/parameters/short-circuit/short-circuit-parameters-utils.d.ts +1 -0
  158. package/dist/features/parameters/short-circuit/short-circuit-parameters-utils.js +2 -0
  159. package/dist/features/parameters/short-circuit/use-short-circuit-parameters-form.js +3 -3
  160. package/dist/features/parameters/voltage-init/constants.d.ts +1 -0
  161. package/dist/features/parameters/voltage-init/constants.js +2 -0
  162. package/dist/features/parameters/voltage-init/index.js +2 -1
  163. package/dist/features/parameters/voltage-init/use-voltage-init-parameters-form.js +4 -8
  164. package/dist/features/parameters/voltage-init/voltage-init-parameters-inline.js +6 -6
  165. package/dist/features/process-configs/loadflow/lf-process-config-edition.js +7 -1
  166. package/dist/features/process-configs/security-analysis/sa-process-config-edition.js +7 -1
  167. package/dist/features/process-configs/shortcircuit/sc-process-config-edition.js +7 -1
  168. package/dist/features/results/loadflow/limit-violation-result.js +1 -1
  169. package/dist/features/results/shortcircuit/shortcircuit-analysis-result.js +1 -1
  170. package/dist/features/side-bar/AppSideBarHeader.js +20 -5
  171. package/dist/features/side-bar/EnvironmentChip.d.ts +13 -0
  172. package/dist/features/side-bar/EnvironmentChip.js +49 -0
  173. package/dist/hooks/index.d.ts +1 -0
  174. package/dist/hooks/index.js +3 -1
  175. package/dist/hooks/use-tabs.d.ts +33 -0
  176. package/dist/hooks/use-tabs.js +55 -0
  177. package/dist/index.js +97 -13
  178. package/dist/services/appsMetadata.d.ts +2 -0
  179. package/dist/services/directory.d.ts +1 -1
  180. package/dist/services/directory.js +6 -2
  181. package/dist/services/index.js +2 -1
  182. package/dist/services/userAdmin.d.ts +2 -1
  183. package/dist/services/userAdmin.js +9 -1
  184. package/dist/translations/en/businessErrorsEn.d.ts +1 -0
  185. package/dist/translations/en/businessErrorsEn.js +1 -0
  186. package/dist/translations/en/networkModificationsEn.d.ts +85 -0
  187. package/dist/translations/en/networkModificationsEn.js +91 -1
  188. package/dist/translations/fr/businessErrorsFr.d.ts +1 -0
  189. package/dist/translations/fr/businessErrorsFr.js +1 -0
  190. package/dist/translations/fr/networkModificationsFr.d.ts +85 -0
  191. package/dist/translations/fr/networkModificationsFr.js +91 -1
  192. package/dist/utils/constants/index.js +2 -1
  193. package/dist/utils/constants/notificationsProvider.d.ts +1 -0
  194. package/dist/utils/constants/notificationsProvider.js +1 -0
  195. package/dist/utils/constants/translationKeys.d.ts +1 -0
  196. package/dist/utils/constants/translationKeys.js +2 -0
  197. package/dist/utils/index.js +2 -1
  198. package/dist/utils/types/types.d.ts +4 -0
  199. package/package.json +1 -1
  200. package/dist/features/network-modifications/hooks/index.js +0 -4
  201. package/dist/features/network-modifications/hooks/useTabsWithError.d.ts +0 -15
  202. package/dist/features/network-modifications/hooks/useTabsWithError.js +0 -28
  203. package/dist/features/parameters/common/hook/use-tabs.d.ts +0 -16
  204. package/dist/features/parameters/common/hook/use-tabs.js +0 -65
  205. /package/dist/features/network-modifications/voltageLevel/topology/{index.d.ts → creation/index.d.ts} +0 -0
  206. /package/dist/features/network-modifications/voltageLevel/topology/{index.js → creation/index.js} +0 -0
  207. /package/dist/features/network-modifications/voltageLevel/topology/{voltageLevelTopologyCreation.types.js → creation/voltageLevelTopologyCreation.types.js} +0 -0
@@ -64,14 +64,17 @@ import "../common/regulatingTerminal/RegulatingTerminalForm.js";
64
64
  import "@mui/material/colors";
65
65
  import "@mui/x-charts";
66
66
  import "../common/currentLimits/limitsPane.utils.js";
67
- import { MAX_SECTIONS_COUNT } from "./creation/voltageLevel.constants.js";
67
+ import { MAX_SECTIONS_COUNT, VOLTAGE_LEVEL_TAB_FIELDS, VoltageLevelTab } from "./creation/voltageLevel.constants.js";
68
68
  import { VoltageLevelCreationForm } from "./creation/VoltageLevelCreationForm.js";
69
69
  import { SWITCH_TYPE, buildNewBusbarSections, getCreateSwitchesEmptyFormData, getCreateSwitchesValidationSchema, translateSwitchKinds, voltageLevelCreationDtoToForm, voltageLevelCreationEmptyFormData, voltageLevelCreationFormSchema, voltageLevelCreationFormToDto } from "./creation/voltageLevelCreation.utils.js";
70
70
  import { SwitchKind } from "./creation/voltageLevelCreation.types.js";
71
71
  import { VoltageLevelModificationForm } from "./modification/VoltageLevelModificationForm.js";
72
72
  import { voltageLevelModificationDtoToForm, voltageLevelModificationEmptyFormData, voltageLevelModificationFormSchema, voltageLevelModificationFormToDto, voltageLevelModificationWithMeasurementsDtoToForm, voltageLevelModificationWithMeasurementsFormSchema, voltageLevelModificationWithMeasurementsFormToDto } from "./modification/voltageLevelModification.utils.js";
73
- import { createVoltageLevelTopologyDtoToForm, createVoltageLevelTopologyEmptyFormData, createVoltageLevelTopologyFormSchema, createVoltageLevelTopologyFormToDto } from "./topology/voltageLevelTopologyCreation.utils.js";
74
- import { CreateVoltageLevelTopologyForm } from "./topology/CreateVoltageLevelTopologyForm.js";
73
+ import { createVoltageLevelTopologyDtoToForm, createVoltageLevelTopologyEmptyFormData, createVoltageLevelTopologyFormSchema, createVoltageLevelTopologyFormToDto } from "./topology/creation/voltageLevelTopologyCreation.utils.js";
74
+ import { CreateVoltageLevelTopologyForm } from "./topology/creation/CreateVoltageLevelTopologyForm.js";
75
+ import { voltageLevelTopologyModificationDtoToForm, voltageLevelTopologyModificationEmptyFormData, voltageLevelTopologyModificationFormSchema, voltageLevelTopologyModificationFormToDto } from "./topology/modification/voltageLevelTopologyModification.utils.js";
76
+ import { VoltageLevelTopologyModificationForm } from "./topology/modification/VoltageLevelTopologyModificationForm.js";
77
+ import { CURRENT_CONNECTION_STATUS, PREV_CONNECTION_STATUS, SWITCH_ID, TOPOLOGY_MODIFICATION_TABLE } from "./topology/modification/constants.js";
75
78
  import { VoltageLevelSectionCreationForm } from "./section/VoltageLevelSectionCreationForm.js";
76
79
  import { POSITION_NEW_SECTION_SIDE, voltageLevelSectionCreationDtoToForm, voltageLevelSectionCreationEmptyFormData, voltageLevelSectionCreationFormSchema, voltageLevelSectionCreationFormToDto } from "./section/voltageLevelSectionCreation.utils.js";
77
80
  import { FeederBayPositionCellRenderer } from "./moveFeederBays/feederBay/FeederBayPositionCellRender.js";
@@ -80,6 +83,7 @@ import { emptyMoveVoltageLevelFeederBaysFormData, moveVoltageLevelFeederBaysDtoT
80
83
  import { MoveVoltageLevelFeederBaysForm } from "./moveFeederBays/MoveVoltageLevelFeederBaysForm.js";
81
84
  import { HeaderWithTooltip } from "./common/HeaderWithTooltip.js";
82
85
  export {
86
+ CURRENT_CONNECTION_STATUS,
83
87
  CouplingDeviceCreationForm,
84
88
  CreateVoltageLevelTopologyForm,
85
89
  FeederBayDirectionCellRenderer,
@@ -88,12 +92,18 @@ export {
88
92
  MAX_SECTIONS_COUNT,
89
93
  MoveVoltageLevelFeederBaysForm,
90
94
  POSITION_NEW_SECTION_SIDE,
95
+ PREV_CONNECTION_STATUS,
96
+ SWITCH_ID,
91
97
  SWITCH_TYPE,
92
98
  SwitchKind,
93
99
  SwitchesBetweenSections,
100
+ TOPOLOGY_MODIFICATION_TABLE,
101
+ VOLTAGE_LEVEL_TAB_FIELDS,
94
102
  VoltageLevelCreationForm,
95
103
  VoltageLevelModificationForm,
96
104
  VoltageLevelSectionCreationForm,
105
+ VoltageLevelTab,
106
+ VoltageLevelTopologyModificationForm,
97
107
  buildNewBusbarSections,
98
108
  couplingDeviceCreationDtoToForm,
99
109
  couplingDeviceCreationFormSchema,
@@ -124,5 +134,9 @@ export {
124
134
  voltageLevelSectionCreationDtoToForm,
125
135
  voltageLevelSectionCreationEmptyFormData,
126
136
  voltageLevelSectionCreationFormSchema,
127
- voltageLevelSectionCreationFormToDto
137
+ voltageLevelSectionCreationFormToDto,
138
+ voltageLevelTopologyModificationDtoToForm,
139
+ voltageLevelTopologyModificationEmptyFormData,
140
+ voltageLevelTopologyModificationFormSchema,
141
+ voltageLevelTopologyModificationFormToDto
128
142
  };
@@ -1,4 +1,4 @@
1
- import { PositionDiagramPaneType } from '../../common';
1
+ import { PositionDiagramPaneType } from '../../../common';
2
2
  export interface CreateVoltageLevelTopologyFormProps {
3
3
  voltageLevelId: string;
4
4
  PositionDiagramPane?: PositionDiagramPaneType;
@@ -4,70 +4,70 @@ 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
6
  import { useFormContext, useWatch } from "react-hook-form";
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";
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
11
  import "localized-countries";
12
12
  import "localized-countries/data/fr";
13
13
  import "localized-countries/data/en";
14
14
  import "notistack";
15
- import "../../../../components/ui/reactHookForm/provider/CustomFormProvider.js";
16
- import { useCustomFormContext } from "../../../../components/ui/reactHookForm/provider/useCustomFormContext.js";
15
+ import "../../../../../components/ui/reactHookForm/provider/CustomFormProvider.js";
16
+ import { useCustomFormContext } from "../../../../../components/ui/reactHookForm/provider/useCustomFormContext.js";
17
17
  import "yup";
18
- import "../../../../components/ui/treeViewFinder/TreeViewFinder.js";
19
- import { IntegerInput } from "../../../../components/ui/reactHookForm/numbers/IntegerInput.js";
20
- import "../../../../components/ui/reactHookForm/numbers/RangeInput.js";
18
+ import "../../../../../components/ui/treeViewFinder/TreeViewFinder.js";
19
+ import { IntegerInput } from "../../../../../components/ui/reactHookForm/numbers/IntegerInput.js";
20
+ import "../../../../../components/ui/reactHookForm/numbers/RangeInput.js";
21
21
  import "@material-symbols/svg-400/outlined/left_panel_open.svg?react";
22
22
  import "@material-symbols/svg-400/outlined/arrows_output.svg?react";
23
23
  import "@material-symbols/svg-400/outlined/arrows_input.svg?react";
24
24
  import "@material-symbols/svg-400/outlined/left_panel_close.svg?react";
25
25
  import "@material-symbols/svg-400/outlined/add_notes-fill.svg?react";
26
- import "../../../../components/ui/dialogs/descriptionModificationDialog/DescriptionModificationDialog.js";
27
- import "../../../../components/ui/reactHookForm/expandableInput/ExpandableInput.js";
28
- import "../../../../components/ui/reactHookForm/directory-item-input/directory-item-utils.js";
26
+ import "../../../../../components/ui/dialogs/descriptionModificationDialog/DescriptionModificationDialog.js";
27
+ import "../../../../../components/ui/reactHookForm/expandableInput/ExpandableInput.js";
28
+ import "../../../../../components/ui/reactHookForm/directory-item-input/directory-item-utils.js";
29
29
  import "@hello-pangea/dnd";
30
- import "../../../../components/ui/dialogs/elementSaveDialog/ElementSaveDialog.js";
31
- import "../../../../components/ui/snackbarProvider/SnackbarProvider.js";
30
+ import "../../../../../components/ui/dialogs/elementSaveDialog/ElementSaveDialog.js";
31
+ import "../../../../../components/ui/snackbarProvider/SnackbarProvider.js";
32
32
  import "mui-nested-menu";
33
33
  import "react-resizable-panels";
34
34
  import "react-papaparse";
35
- import { SwitchesBetweenSections } from "../creation/tabs/structureTab/switchesBetweenSections/SwitchesBetweenSections.js";
36
- import { filledTextField } from "../../common/form.utils.js";
37
- import "../../common/properties/propertyUtils.js";
35
+ import { SwitchesBetweenSections } from "../../creation/tabs/structureTab/switchesBetweenSections/SwitchesBetweenSections.js";
36
+ import { filledTextField } from "../../../common/form.utils.js";
37
+ import "../../../common/properties/propertyUtils.js";
38
38
  import "react-dom";
39
39
  import "autosuggest-highlight/match";
40
40
  import "autosuggest-highlight/parse";
41
41
  import "clsx";
42
- import "../../../../components/composite/filter/FilterCreationDialog.js";
43
- import "../../../../components/composite/filter/HeaderFilterForm.js";
44
- import "../../../../components/composite/filter/explicitNaming/ExplicitNamingFilterForm.js";
45
- import "../../../../components/composite/filter/expert/ExpertFilterForm.js";
46
- import "../../../../components/composite/filter/expert/ExpertFilterEditionDialog.js";
47
- import "../../../../components/composite/filter/expert/expertFilterConstants.js";
42
+ import "../../../../../components/composite/filter/FilterCreationDialog.js";
43
+ import "../../../../../components/composite/filter/HeaderFilterForm.js";
44
+ import "../../../../../components/composite/filter/explicitNaming/ExplicitNamingFilterForm.js";
45
+ import "../../../../../components/composite/filter/expert/ExpertFilterForm.js";
46
+ import "../../../../../components/composite/filter/expert/ExpertFilterEditionDialog.js";
47
+ import "../../../../../components/composite/filter/expert/expertFilterConstants.js";
48
48
  import "react-querybuilder";
49
49
  import "uuid";
50
- import "../../../../components/composite/filter/explicitNaming/ExplicitNamingFilterEditionDialog.js";
51
- import "../../../../components/composite/filter/utils/filterFormUtils.js";
50
+ import "../../../../../components/composite/filter/explicitNaming/ExplicitNamingFilterEditionDialog.js";
51
+ import "../../../../../components/composite/filter/utils/filterFormUtils.js";
52
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";
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
57
  import "ag-grid-community";
58
- import "../../../../components/composite/customAGGrid/customAggrid.js";
59
- import "../../../../components/composite/customAGGrid/context/custom-aggrid-context.js";
58
+ import "../../../../../components/composite/customAGGrid/customAggrid.js";
59
+ import "../../../../../components/composite/customAGGrid/context/custom-aggrid-context.js";
60
60
  import "mathjs";
61
- import "../../../../components/composite/report/report-viewer/log-table/log-table.js";
61
+ import "../../../../../components/composite/report/report-viewer/log-table/log-table.js";
62
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 "../../common/regulatingTerminal/RegulatingTerminalForm.js";
63
+ import "../../../../../components/composite/report/report-treeview/treeview-item.js";
64
+ import "../../../../../components/composite/report/report-viewer/context/report-viewer-context.js";
65
+ import "../../../common/regulatingTerminal/RegulatingTerminalForm.js";
66
66
  import "@mui/material/colors";
67
67
  import "@mui/x-charts";
68
- import "../../common/currentLimits/limitsPane.utils.js";
69
- import "../creation/voltageLevel.constants.js";
70
- import "../creation/voltageLevelCreation.utils.js";
68
+ import "../../../common/currentLimits/limitsPane.utils.js";
69
+ import "../../creation/voltageLevel.constants.js";
70
+ import "../../creation/voltageLevelCreation.utils.js";
71
71
  function CreateVoltageLevelTopologyForm({
72
72
  voltageLevelId,
73
73
  PositionDiagramPane
@@ -1,4 +1,4 @@
1
- import { ModificationType } from '../../../../utils';
1
+ import { ModificationType } from '../../../../../utils';
2
2
  export interface CreateVoltageLevelTopologyDto {
3
3
  type: ModificationType;
4
4
  uuid?: string;
@@ -1,5 +1,5 @@
1
1
  import { IntlShape } from 'react-intl';
2
- import { DeepNullable } from '../../../../utils';
2
+ import { DeepNullable } from '../../../../../utils';
3
3
  import { CreateVoltageLevelTopologyDto } from './voltageLevelTopologyCreation.types';
4
4
  /**
5
5
  * Copyright (c) 2026, RTE (http://www.rte-france.com)
@@ -1,11 +1,11 @@
1
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";
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
6
  import "react/jsx-runtime";
7
7
  import "@mui/icons-material";
8
- import { MAX_SECTIONS_COUNT } from "../creation/voltageLevel.constants.js";
8
+ import { MAX_SECTIONS_COUNT } from "../../creation/voltageLevel.constants.js";
9
9
  const createVoltageLevelTopologyFormSchema = yup.object().shape({
10
10
  [FieldConstants.SECTION_COUNT]: yup.number().required().nullable().min(1, "AtLeastOneSectionAdded").max(MAX_SECTIONS_COUNT, "SectionCountMustBeLessThanOrEqualToTwenty"),
11
11
  [FieldConstants.SWITCHES_BETWEEN_SECTIONS]: yup.string().nullable().when([FieldConstants.SECTION_COUNT], {
@@ -0,0 +1,6 @@
1
+ import { default as React } from 'react';
2
+ type ConnectionCellRendererProps = {
3
+ name: string;
4
+ };
5
+ export declare function ConnectionCellRenderer({ name }: Readonly<ConnectionCellRendererProps>): React.JSX.Element;
6
+ export {};
@@ -0,0 +1,80 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { useMemo, useCallback } from "react";
3
+ import { useController } from "react-hook-form";
4
+ import "@mui/material";
5
+ import "@mui/icons-material";
6
+ import "react-intl";
7
+ import "../../../../../components/ui/overflowableText/OverflowableText.js";
8
+ import "../../../../../utils/conversionUtils.js";
9
+ import "../../../../../utils/types/equipmentType.js";
10
+ import "localized-countries";
11
+ import "localized-countries/data/fr";
12
+ import "localized-countries/data/en";
13
+ import "notistack";
14
+ import "../../../../../components/ui/reactHookForm/provider/CustomFormProvider.js";
15
+ import "yup";
16
+ import "../../../../../components/ui/treeViewFinder/TreeViewFinder.js";
17
+ import "../../../../../components/ui/reactHookForm/numbers/RangeInput.js";
18
+ import "@material-symbols/svg-400/outlined/left_panel_open.svg?react";
19
+ import "@material-symbols/svg-400/outlined/arrows_output.svg?react";
20
+ import "@material-symbols/svg-400/outlined/arrows_input.svg?react";
21
+ import "@material-symbols/svg-400/outlined/left_panel_close.svg?react";
22
+ import "@material-symbols/svg-400/outlined/add_notes-fill.svg?react";
23
+ import "../../../../../components/ui/dialogs/descriptionModificationDialog/DescriptionModificationDialog.js";
24
+ import "../../../../../components/ui/reactHookForm/expandableInput/ExpandableInput.js";
25
+ import { CheckboxNullableInput } from "../../../../../components/ui/reactHookForm/CheckboxNullableInput.js";
26
+ import "../../../../../components/ui/reactHookForm/directory-item-input/directory-item-utils.js";
27
+ import "@hello-pangea/dnd";
28
+ import "../../../../../components/ui/dialogs/elementSaveDialog/ElementSaveDialog.js";
29
+ import "../../../../../components/ui/snackbarProvider/SnackbarProvider.js";
30
+ import "mui-nested-menu";
31
+ import "react-resizable-panels";
32
+ import "react-papaparse";
33
+ import "react-dom";
34
+ import "autosuggest-highlight/match";
35
+ import "autosuggest-highlight/parse";
36
+ import "clsx";
37
+ import "../../../../../components/composite/filter/FilterCreationDialog.js";
38
+ import "../../../../../components/composite/filter/HeaderFilterForm.js";
39
+ import "../../../../../components/composite/filter/explicitNaming/ExplicitNamingFilterForm.js";
40
+ import "../../../../../components/composite/filter/expert/ExpertFilterForm.js";
41
+ import "../../../../../components/composite/filter/expert/ExpertFilterEditionDialog.js";
42
+ import "../../../../../components/composite/filter/expert/expertFilterConstants.js";
43
+ import "react-querybuilder";
44
+ import "uuid";
45
+ import "../../../../../components/composite/filter/explicitNaming/ExplicitNamingFilterEditionDialog.js";
46
+ import "../../../../../components/composite/filter/utils/filterFormUtils.js";
47
+ import "@react-querybuilder/material";
48
+ import "../../../../../components/composite/reactQueryBuilder/CustomReactQueryBuilder.js";
49
+ import "../../../../../components/composite/reactQueryBuilder/PropertyValueEditor.js";
50
+ import "../../../../../components/composite/agGridTable/BottomTableButtons.js";
51
+ import "../../../../../components/composite/agGridTable/CustomAgGridTable.js";
52
+ import "ag-grid-community";
53
+ import "../../../../../components/composite/customAGGrid/customAggrid.js";
54
+ import "../../../../../components/composite/customAGGrid/context/custom-aggrid-context.js";
55
+ import "mathjs";
56
+ import "../../../../../components/composite/report/report-viewer/log-table/log-table.js";
57
+ import "react-window";
58
+ import "../../../../../components/composite/report/report-treeview/treeview-item.js";
59
+ import "../../../../../components/composite/report/report-viewer/context/report-viewer-context.js";
60
+ function ConnectionCellRenderer({ name }) {
61
+ const {
62
+ field: { value }
63
+ } = useController({ name });
64
+ const color = useMemo(() => {
65
+ if (value === null) {
66
+ return "grey";
67
+ }
68
+ return "";
69
+ }, [value]);
70
+ const getLabel = useCallback((checked) => {
71
+ if (checked === null) {
72
+ return "NoModification";
73
+ }
74
+ return checked ? "Closed" : "Open";
75
+ }, []);
76
+ return /* @__PURE__ */ jsx("div", { style: { display: "flex", alignItems: "center" }, children: /* @__PURE__ */ jsx(CheckboxNullableInput, { name, label: getLabel, style: { color } }) });
77
+ }
78
+ export {
79
+ ConnectionCellRenderer
80
+ };
@@ -0,0 +1,10 @@
1
+ import { default as React } from 'react';
2
+ import { SwitchDto, TopologyVoltageLevelModificationDto } from './voltageLevelTopologyModification.types';
3
+ interface VoltageLevelTopologyModificationFormProps {
4
+ voltageLevelToModify: TopologyVoltageLevelModificationDto | null | undefined;
5
+ switchesToModify?: SwitchDto[];
6
+ isModification?: boolean;
7
+ isPreviousStatusEnabled?: boolean;
8
+ }
9
+ export declare function VoltageLevelTopologyModificationForm({ voltageLevelToModify, switchesToModify, isModification, isPreviousStatusEnabled, }: Readonly<VoltageLevelTopologyModificationFormProps>): React.JSX.Element;
10
+ export {};
@@ -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
+ };
@@ -4,4 +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 './useTabsWithError';
7
+ export * from './voltageLevelTopologyModification.utils';
8
+ export * from './VoltageLevelTopologyModificationForm';
9
+ export * from './voltageLevelTopologyModification.types';
10
+ export * from './constants';