@gridsuite/commons-ui 0.265.0 → 0.266.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 (199) hide show
  1. package/dist/components/composite/dnd-table/dnd-table-add-rows-dialog.js +1 -1
  2. package/dist/components/composite/dnd-table/dnd-table-row.js +1 -1
  3. package/dist/components/composite/dnd-table/dnd-table.js +1 -1
  4. package/dist/components/composite/filter/FilterForm.js +1 -1
  5. package/dist/components/composite/filter/HeaderFilterForm.js +1 -1
  6. package/dist/components/composite/filter/expert/ExpertFilterForm.js +1 -1
  7. package/dist/components/composite/filter/explicitNaming/ExplicitNamingFilterForm.js +1 -1
  8. package/dist/components/composite/report/report-viewer/log-table/log-table.js +1 -1
  9. package/dist/components/ui/csvPicker/csv-picker-confirmation-dialog.js +1 -1
  10. package/dist/components/ui/dialogs/elementSaveDialog/ElementSaveDialog.js +1 -1
  11. package/dist/components/ui/dialogs/name-element-editor/name-element-editor-utils.js +1 -1
  12. package/dist/components/ui/icons/DatasetLinkedIcon.d.ts +2 -0
  13. package/dist/components/ui/icons/DatasetLinkedIcon.js +9 -0
  14. package/dist/components/ui/icons/EditNoteIcon.js +1 -1
  15. package/dist/features/global-filter/ui/global-filter-dropdown-panel.js +1 -1
  16. package/dist/features/global-filter/ui/global-filter-panel.js +1 -1
  17. package/dist/features/global-filter/ui/selected-global-filters.js +1 -1
  18. package/dist/features/index.js +6 -4
  19. package/dist/features/network-modification-table/columns-definition.d.ts +4 -0
  20. package/dist/features/network-modification-table/columns-definition.js +4 -0
  21. package/dist/features/network-modification-table/index.js +5 -3
  22. package/dist/features/network-modification-table/network-modification-table-styles.js +2 -2
  23. package/dist/features/network-modification-table/network-modifications-table.d.ts +1 -1
  24. package/dist/features/network-modification-table/network-modifications-table.js +15 -12
  25. package/dist/features/network-modification-table/renderers/cell-renderers.d.ts +1 -0
  26. package/dist/features/network-modification-table/renderers/cell-renderers.js +10 -0
  27. package/dist/features/network-modification-table/renderers/index.js +2 -1
  28. package/dist/features/network-modification-table/renderers/name-cell.js +3 -3
  29. package/dist/features/network-modification-table/renderers/reference-link-cell.d.ts +7 -0
  30. package/dist/features/network-modification-table/renderers/reference-link-cell.js +128 -0
  31. package/dist/features/network-modification-table/renderers/root-network-chip-cell.js +3 -1
  32. package/dist/features/network-modification-table/row/modification-row.js +76 -68
  33. package/dist/features/network-modification-table/use-modifications-drag-and-drop.js +40 -22
  34. package/dist/features/network-modification-table/use-modifications-selection.js +14 -14
  35. package/dist/features/network-modification-table/utils.d.ts +20 -12
  36. package/dist/features/network-modification-table/utils.js +102 -48
  37. package/dist/features/network-modifications/battery/creation/BatteryCreationForm.js +1 -1
  38. package/dist/features/network-modifications/battery/creation/batteryCreation.utils.js +1 -1
  39. package/dist/features/network-modifications/battery/modification/BatteryDialogHeader.js +1 -1
  40. package/dist/features/network-modifications/battery/modification/BatteryDialogTabsContent.js +1 -1
  41. package/dist/features/network-modifications/battery/modification/batteryModification.utils.js +1 -1
  42. package/dist/features/network-modifications/by-filter/assignment/assignment/assignment-form.js +1 -1
  43. package/dist/features/network-modifications/by-filter/assignment/modification-by-assignment-form.js +1 -1
  44. package/dist/features/network-modifications/by-filter/deletion/ByFilterDeletionForm.js +1 -1
  45. package/dist/features/network-modifications/by-filter/formula/formula/formula-form.js +1 -1
  46. package/dist/features/network-modifications/by-filter/formula/formula/reference-autocomplete-input.js +1 -1
  47. package/dist/features/network-modifications/by-filter/formula/modification-by-formula-form.js +1 -1
  48. package/dist/features/network-modifications/common/activePowerControl/ActivePowerControlForm.js +1 -1
  49. package/dist/features/network-modifications/common/connectivity/ConnectivityForm.js +1 -1
  50. package/dist/features/network-modifications/common/connectivity/PositionForm.js +1 -1
  51. package/dist/features/network-modifications/common/connectivity/VoltageLevelConnectivityForm.js +1 -1
  52. package/dist/features/network-modifications/common/currentLimits/LimitsPane.js +1 -1
  53. package/dist/features/network-modifications/common/currentLimits/SelectedOperationalLimitGroup.js +1 -1
  54. package/dist/features/network-modifications/common/currentLimits/limitsEditor/LimitsEditor.js +1 -1
  55. package/dist/features/network-modifications/common/currentLimits/limitsEditor/LimitsPropertiesSideStack.js +1 -1
  56. package/dist/features/network-modifications/common/currentLimits/limitsEditor/TemporaryLimitsTable.js +1 -1
  57. package/dist/features/network-modifications/common/currentLimits/limitsPane.utils.js +1 -1
  58. package/dist/features/network-modifications/common/measurements/BusbarSectionVoltageMeasurementsForm.js +1 -1
  59. package/dist/features/network-modifications/common/measurements/PowerWithValidityForm.js +1 -1
  60. package/dist/features/network-modifications/common/properties/PropertiesForm.js +1 -1
  61. package/dist/features/network-modifications/common/properties/PropertyForm.js +1 -1
  62. package/dist/features/network-modifications/common/reactiveLimits/ReactiveLimitsForm.js +1 -1
  63. package/dist/features/network-modifications/common/reactiveLimits/reactiveCapabilityCurve/ReactiveCapabilityCurveRowForm.js +1 -1
  64. package/dist/features/network-modifications/common/reactiveLimits/reactiveCapabilityCurve/ReactiveCapabilityCurveTableForm.js +1 -1
  65. package/dist/features/network-modifications/common/regulatingTerminal/RegulatingTerminalForm.js +1 -1
  66. package/dist/features/network-modifications/common/setpoints/SetPointsForm.js +1 -1
  67. package/dist/features/network-modifications/common/shortCircuit/ShortCircuitForm.js +1 -1
  68. package/dist/features/network-modifications/common/voltageRegulation/VoltageRegulationForm.js +1 -1
  69. package/dist/features/network-modifications/equipmentDeletion/EquipmentDeletionForm.js +1 -1
  70. package/dist/features/network-modifications/equipmentDeletion/equipmentDeletion.utils.js +1 -1
  71. package/dist/features/network-modifications/equipmentDeletion/hvdcLccDeletion/ShuntCompensatorSelectionForm.js +1 -1
  72. package/dist/features/network-modifications/generator/creation/GeneratorCreationForm.js +1 -1
  73. package/dist/features/network-modifications/generator/creation/generatorCreation.utils.js +1 -1
  74. package/dist/features/network-modifications/generator/modification/GeneratorDialogHeader.js +1 -1
  75. package/dist/features/network-modifications/generator/modification/GeneratorDialogTabsContent.js +1 -1
  76. package/dist/features/network-modifications/generator/modification/generatorModification.utils.js +1 -1
  77. package/dist/features/network-modifications/index.js +1 -1
  78. package/dist/features/network-modifications/line/characteristics/LineCharacteristicsPane.js +1 -1
  79. package/dist/features/network-modifications/line/common/LineDialogHeader.js +1 -1
  80. package/dist/features/network-modifications/line/common/LineDialogTabsContent.js +1 -1
  81. package/dist/features/network-modifications/line/creation/lineCreation.utils.js +1 -1
  82. package/dist/features/network-modifications/line/modification/lineModification.utils.js +1 -1
  83. package/dist/features/network-modifications/load/common/LoadDialogHeader.js +1 -1
  84. package/dist/features/network-modifications/load/creation/loadCreation.utils.js +1 -1
  85. package/dist/features/network-modifications/load/modification/loadModification.utils.js +1 -1
  86. package/dist/features/network-modifications/shunt-compensator/common/CharacteristicsForm.js +1 -1
  87. package/dist/features/network-modifications/shunt-compensator/creation/ShuntCompensatorCreationForm.js +1 -1
  88. package/dist/features/network-modifications/shunt-compensator/creation/shuntCompensatorCreation.utils.js +1 -1
  89. package/dist/features/network-modifications/shunt-compensator/modification/ShuntCompensatorModificationForm.js +1 -1
  90. package/dist/features/network-modifications/shunt-compensator/modification/shuntCompensatorModification.utils.js +1 -1
  91. package/dist/features/network-modifications/substation/creation/SubstationCreationForm.js +1 -1
  92. package/dist/features/network-modifications/substation/modification/SubstationModificationForm.js +1 -1
  93. package/dist/features/network-modifications/voltageLevel/creation/VoltageLevelCreationForm.js +1 -1
  94. package/dist/features/network-modifications/voltageLevel/creation/index.js +1 -1
  95. package/dist/features/network-modifications/voltageLevel/creation/tabs/characteristicsTab/CharacteristicsTab.js +1 -1
  96. package/dist/features/network-modifications/voltageLevel/creation/tabs/structureTab/StructureTab.js +1 -1
  97. package/dist/features/network-modifications/voltageLevel/creation/tabs/structureTab/couplingOmnibus/CouplingOmnibusForm.js +1 -1
  98. package/dist/features/network-modifications/voltageLevel/creation/tabs/structureTab/switchesBetweenSections/SwitchesBetweenSections.js +1 -1
  99. package/dist/features/network-modifications/voltageLevel/creation/tabs/substationTab/SubstationCreationSection.js +1 -1
  100. package/dist/features/network-modifications/voltageLevel/creation/tabs/substationTab/SubstationTab.js +1 -1
  101. package/dist/features/network-modifications/voltageLevel/creation/voltageLevelCreation.utils.js +1 -1
  102. package/dist/features/network-modifications/voltageLevel/index.js +1 -1
  103. package/dist/features/network-modifications/voltageLevel/modification/VoltageLevelModificationForm.js +1 -1
  104. package/dist/features/parameters/common/contingency-table/columns-definitions.js +1 -1
  105. package/dist/features/parameters/common/limitreductions/limit-reduction-table-cell.js +1 -1
  106. package/dist/features/parameters/common/limitreductions/limit-reductions-table-form.js +1 -1
  107. package/dist/features/parameters/common/parameter-field.js +1 -1
  108. package/dist/features/parameters/common/parameter-layout/parameter-layout.js +1 -1
  109. package/dist/features/parameters/common/parameter-table-field/parameter-table-field.js +1 -1
  110. package/dist/features/parameters/common/parameters-creation-dialog.js +1 -1
  111. package/dist/features/parameters/common/provider-param.js +1 -1
  112. package/dist/features/parameters/common/voltage-level-table/custom-voltage-level-table-cell.js +1 -1
  113. package/dist/features/parameters/common/widget/parameter-float.js +1 -1
  114. package/dist/features/parameters/common/widget/parameter-line-directory-items-input.js +1 -1
  115. package/dist/features/parameters/common/widget/parameter-line-slider.js +1 -1
  116. package/dist/features/parameters/dynamic-margin-calculation/dynamic-margin-calculation-form.js +1 -1
  117. package/dist/features/parameters/dynamic-margin-calculation/dynamic-margin-calculation-inline.js +1 -1
  118. package/dist/features/parameters/dynamic-margin-calculation/loads-variations-parameters.js +1 -1
  119. package/dist/features/parameters/dynamic-margin-calculation/use-dynamic-margin-calculation-parameters-form.js +1 -1
  120. package/dist/features/parameters/dynamic-security-analysis/contingency-parameters.js +1 -1
  121. package/dist/features/parameters/dynamic-security-analysis/dynamic-security-analysis-inline.js +1 -1
  122. package/dist/features/parameters/dynamic-security-analysis/dynamic-security-analysis-parameters-form.js +1 -1
  123. package/dist/features/parameters/dynamic-security-analysis/use-dynamic-security-analysis-parameters-form.js +1 -1
  124. package/dist/features/parameters/dynamic-simulation/dynamic-simulation-inline.js +1 -1
  125. package/dist/features/parameters/dynamic-simulation/dynamic-simulation-parameters-form.js +1 -1
  126. package/dist/features/parameters/dynamic-simulation/mapping/mapping-parameters-utils.js +1 -1
  127. package/dist/features/parameters/dynamic-simulation/mapping/mapping-parameters.js +1 -1
  128. package/dist/features/parameters/dynamic-simulation/use-dynamic-simulation-parameters-form.js +1 -1
  129. package/dist/features/parameters/loadflow/load-flow-advanced-parameters.js +1 -1
  130. package/dist/features/parameters/loadflow/load-flow-general-parameters.js +1 -1
  131. package/dist/features/parameters/loadflow/load-flow-parameters-content.js +1 -1
  132. package/dist/features/parameters/loadflow/load-flow-parameters-dialog.js +1 -1
  133. package/dist/features/parameters/loadflow/load-flow-parameters-header.js +1 -1
  134. package/dist/features/parameters/loadflow/load-flow-parameters-inline.js +1 -1
  135. package/dist/features/parameters/loadflow/load-flow-parameters-utils.js +1 -1
  136. package/dist/features/parameters/loadflow/load-flow-provider-specific-parameters.js +1 -1
  137. package/dist/features/parameters/loadflow/use-load-flow-parameters-form.js +1 -1
  138. package/dist/features/parameters/network-visualizations/map-parameters.js +1 -1
  139. package/dist/features/parameters/network-visualizations/network-area-diagram-parameters.js +1 -1
  140. package/dist/features/parameters/network-visualizations/network-visualizations-form.js +1 -1
  141. package/dist/features/parameters/network-visualizations/network-visualizations-parameters-dialog.js +1 -1
  142. package/dist/features/parameters/network-visualizations/network-visualizations-parameters-inline.js +1 -1
  143. package/dist/features/parameters/network-visualizations/single-line-diagram-parameters.js +1 -1
  144. package/dist/features/parameters/network-visualizations/use-network-visualizations-parameters-form.js +1 -1
  145. package/dist/features/parameters/pcc-min/pcc-min-form-utils.js +1 -1
  146. package/dist/features/parameters/pcc-min/pcc-min-parameters-dialog.js +1 -1
  147. package/dist/features/parameters/pcc-min/pcc-min-parameters-inline.js +1 -1
  148. package/dist/features/parameters/pcc-min/use-pcc-min-parameters-form.js +1 -1
  149. package/dist/features/parameters/security-analysis/columns-definitions.js +1 -1
  150. package/dist/features/parameters/security-analysis/security-analysis-parameters-content.js +1 -1
  151. package/dist/features/parameters/security-analysis/security-analysis-parameters-dialog.js +1 -1
  152. package/dist/features/parameters/security-analysis/security-analysis-parameters-form.js +1 -1
  153. package/dist/features/parameters/security-analysis/security-analysis-parameters-inline.js +1 -1
  154. package/dist/features/parameters/security-analysis/security-analysis-parameters-utils.js +1 -1
  155. package/dist/features/parameters/security-analysis/security-analysis-violations-hiding.js +1 -1
  156. package/dist/features/parameters/security-analysis/use-security-analysis-parameters-form.js +1 -1
  157. package/dist/features/parameters/sensi/columns-definitions.js +1 -1
  158. package/dist/features/parameters/sensi/sensitivity-analysis-parameters-dialog.js +1 -1
  159. package/dist/features/parameters/sensi/sensitivity-analysis-parameters-form.js +1 -1
  160. package/dist/features/parameters/sensi/sensitivity-analysis-parameters-inline.js +1 -1
  161. package/dist/features/parameters/sensi/sensitivity-parameters-fields.js +1 -1
  162. package/dist/features/parameters/sensi/sensitivity-parameters-selector.js +1 -1
  163. package/dist/features/parameters/sensi/use-sensitivity-analysis-parameters.js +1 -1
  164. package/dist/features/parameters/sensi/utils.js +1 -1
  165. package/dist/features/parameters/short-circuit/short-circuit-general-tab-panel.js +1 -1
  166. package/dist/features/parameters/short-circuit/short-circuit-icc-cluster-table-cell.js +1 -1
  167. package/dist/features/parameters/short-circuit/short-circuit-icc-material-table-cell.js +1 -1
  168. package/dist/features/parameters/short-circuit/short-circuit-parameters-content.js +1 -1
  169. package/dist/features/parameters/short-circuit/short-circuit-parameters-dialog.js +1 -1
  170. package/dist/features/parameters/short-circuit/short-circuit-parameters-inline.js +1 -1
  171. package/dist/features/parameters/short-circuit/short-circuit-parameters-utils.js +1 -1
  172. package/dist/features/parameters/short-circuit/short-circuit-power-electronics-tab-panel.js +1 -1
  173. package/dist/features/parameters/short-circuit/short-circuit-study-area-tab-panel.js +1 -1
  174. package/dist/features/parameters/short-circuit/use-short-circuit-parameters-form.js +1 -1
  175. package/dist/features/parameters/voltage-init/equipment-selection-parameters.js +1 -1
  176. package/dist/features/parameters/voltage-init/general-parameters.js +1 -1
  177. package/dist/features/parameters/voltage-init/use-voltage-init-parameters-form.js +1 -1
  178. package/dist/features/parameters/voltage-init/voltage-init-form-utils.js +1 -1
  179. package/dist/features/parameters/voltage-init/voltage-init-parameters-dialog.js +1 -1
  180. package/dist/features/parameters/voltage-init/voltage-init-parameters-form.js +1 -1
  181. package/dist/features/parameters/voltage-init/voltage-init-parameters-inline.js +1 -1
  182. package/dist/features/parameters/voltage-init/voltage-limits-parameters.js +1 -1
  183. package/dist/features/process-configs/common/process-config-modifications-edition.js +1 -1
  184. package/dist/features/process-configs/lf-process-config-edition-dialog.js +1 -1
  185. package/dist/features/process-configs/loadflow/lf-process-config-edition.js +1 -1
  186. package/dist/features/process-configs/loadflow/lf-process-config-edition.utils.js +1 -1
  187. package/dist/features/process-configs/process-config.utils.js +1 -1
  188. package/dist/features/process-configs/sa-process-config-edition-dialog.js +1 -1
  189. package/dist/features/process-configs/security-analysis/sa-process-config-edition.js +1 -1
  190. package/dist/features/process-configs/security-analysis/sa-process-config-edition.utils.js +1 -1
  191. package/dist/features/results/securityanalysis/security-analysis-result-nmk.js +1 -1
  192. package/dist/features/results/securityanalysis/security-analysis-table.js +1 -1
  193. package/dist/index.js +5 -3
  194. package/dist/translations/en/networkModificationsEn.d.ts +3 -0
  195. package/dist/translations/en/networkModificationsEn.js +4 -1
  196. package/dist/translations/fr/networkModificationsFr.d.ts +3 -0
  197. package/dist/translations/fr/networkModificationsFr.js +4 -1
  198. package/dist/utils/types/network-modification-metadata.d.ts +13 -1
  199. package/package.json +1 -1
@@ -6,6 +6,7 @@ import { ActivableChip } from "../../../components/ui/inputs/ActivableChip.js";
6
6
  import "../../../utils/conversionUtils.js";
7
7
  import { snackWithFallback } from "../../../utils/error.js";
8
8
  import "../../../utils/types/equipmentType.js";
9
+ import { ModificationType } from "../../../utils/types/modificationType.js";
9
10
  import "@mui/icons-material";
10
11
  import { updateModificationStatusByRootNetwork } from "../../../services/networkModification.js";
11
12
  import "localized-countries";
@@ -54,6 +55,7 @@ function RootNetworkChipCell(props) {
54
55
  const [isLoading, setIsLoading] = useState(false);
55
56
  const { snackError } = useSnackMessage();
56
57
  const modificationUuid = data.uuid;
58
+ const isReferenceModificationOrInsideOne = data.type === ModificationType.MODIFICATION_REFERENCE || data.childFromShared;
57
59
  const isModificationActivated = useMemo(() => {
58
60
  if (rootNetwork.isCreating) {
59
61
  return true;
@@ -103,7 +105,7 @@ function RootNetworkChipCell(props) {
103
105
  label: rootNetwork.tag,
104
106
  tooltipMessage: rootNetwork.name,
105
107
  isActivated: isModificationActivated,
106
- isDisabled: isLoading || isDisabled,
108
+ isDisabled: isLoading || isDisabled || isReferenceModificationOrInsideOne,
107
109
  onClick: handleModificationActivationByRootNetwork
108
110
  }
109
111
  );
@@ -6,7 +6,7 @@ import { Draggable } from "@hello-pangea/dnd";
6
6
  import { useIntl } from "react-intl";
7
7
  import { BASE_MODIFICATION_TABLE_COLUMNS, AUTO_EXTENSIBLE_COLUMNS } from "../columns-definition.js";
8
8
  import { COLUMNS_WITHOUT_BORDER, createCellContentWrapperSx, createCellStyle, createRowSx, networkModificationTableStyles } from "../network-modification-table-styles.js";
9
- import { isCompositeModification } from "../utils.js";
9
+ import { isCompositeModification, isReferenceModification, isTargetChildOfReference } from "../utils.js";
10
10
  import "../../../utils/conversionUtils.js";
11
11
  import "../../../utils/types/equipmentType.js";
12
12
  import "@mui/icons-material";
@@ -30,76 +30,84 @@ function ModificationRow({
30
30
  },
31
31
  [handleCellClick, row.original]
32
32
  );
33
- return /* @__PURE__ */ jsx(Draggable, { draggableId: row.id, index: virtualRow.index, isDragDisabled: isRowDragDisabled, children: (provided, snapshot) => {
34
- const { style, ...draggablePropsWithoutStyle } = provided.draggableProps;
35
- return /* @__PURE__ */ jsx(
36
- TableRow,
37
- {
38
- ref: provided.innerRef,
39
- ...draggablePropsWithoutStyle,
40
- "data-row-id": row.original.uuid,
41
- sx: mergeSx(
42
- networkModificationTableStyles.tableRow,
43
- createRowSx(
44
- theme,
45
- isHighlighted,
46
- snapshot.isDragging,
47
- virtualRow,
48
- row.depth,
49
- isCompositeModification(row.original)
50
- )
51
- ),
52
- children: row.getVisibleCells().map((cell) => {
53
- const isNameColumn = cell.column.id === BASE_MODIFICATION_TABLE_COLUMNS.NAME.id;
54
- const isDragHandle = cell.column.id === BASE_MODIFICATION_TABLE_COLUMNS.DRAG_HANDLE.id;
55
- const isCheckboxColumn = cell.column.id === BASE_MODIFICATION_TABLE_COLUMNS.SELECT.id;
56
- const cellContent = flexRender(cell.column.columnDef.cell, cell.getContext());
57
- const cellWithoutBorders = (isExpanded || row.depth > 0) && COLUMNS_WITHOUT_BORDER.has(cell.column.columnDef.id ?? "");
58
- if (isDragHandle) {
59
- return /* @__PURE__ */ jsx(
60
- TableCell,
61
- {
62
- sx: createCellStyle(cell, AUTO_EXTENSIBLE_COLUMNS.includes(cell.column.id)),
63
- children: /* @__PURE__ */ jsx(
64
- Box,
33
+ return /* @__PURE__ */ jsx(
34
+ Draggable,
35
+ {
36
+ draggableId: row.id,
37
+ index: virtualRow.index,
38
+ isDragDisabled: isRowDragDisabled || isTargetChildOfReference(row),
39
+ children: (provided, snapshot) => {
40
+ const { style, ...draggablePropsWithoutStyle } = provided.draggableProps;
41
+ return /* @__PURE__ */ jsx(
42
+ TableRow,
43
+ {
44
+ ref: provided.innerRef,
45
+ ...draggablePropsWithoutStyle,
46
+ "data-row-id": row.id,
47
+ sx: mergeSx(
48
+ networkModificationTableStyles.tableRow,
49
+ createRowSx(
50
+ theme,
51
+ isHighlighted,
52
+ snapshot.isDragging,
53
+ virtualRow,
54
+ row.depth,
55
+ isCompositeModification(row.original) || isReferenceModification(row.original)
56
+ )
57
+ ),
58
+ children: row.getVisibleCells().map((cell) => {
59
+ const isNameColumn = cell.column.id === BASE_MODIFICATION_TABLE_COLUMNS.NAME.id;
60
+ const isDragHandle = cell.column.id === BASE_MODIFICATION_TABLE_COLUMNS.DRAG_HANDLE.id;
61
+ const isCheckboxColumn = cell.column.id === BASE_MODIFICATION_TABLE_COLUMNS.SELECT.id;
62
+ const cellContent = flexRender(cell.column.columnDef.cell, cell.getContext());
63
+ const cellWithoutBorders = (isExpanded || row.depth > 0) && COLUMNS_WITHOUT_BORDER.has(cell.column.columnDef.id ?? "");
64
+ if (isDragHandle) {
65
+ return /* @__PURE__ */ jsx(
66
+ TableCell,
65
67
  {
66
- sx: createCellContentWrapperSx(theme, cellWithoutBorders),
67
- ...provided.dragHandleProps,
68
- "aria-label": intl.formatMessage({ id: "moveModification" }),
69
- children: cellContent
70
- }
71
- )
72
- },
73
- cell.id
74
- );
75
- }
76
- if (isCheckboxColumn) {
77
- return /* @__PURE__ */ jsx(
78
- TableCell,
79
- {
80
- sx: createCellStyle(cell, AUTO_EXTENSIBLE_COLUMNS.includes(cell.column.id)),
81
- onClick: () => handleCellClickCallback(cell.column.id),
82
- children: /* @__PURE__ */ jsx(Box, { sx: createCellContentWrapperSx(theme, cellWithoutBorders), children: cellContent })
83
- },
84
- cell.id
85
- );
68
+ sx: createCellStyle(cell, AUTO_EXTENSIBLE_COLUMNS.includes(cell.column.id)),
69
+ children: /* @__PURE__ */ jsx(
70
+ Box,
71
+ {
72
+ sx: createCellContentWrapperSx(theme, cellWithoutBorders),
73
+ ...provided.dragHandleProps,
74
+ "aria-label": intl.formatMessage({ id: "moveModification" }),
75
+ children: cellContent
76
+ }
77
+ )
78
+ },
79
+ cell.id
80
+ );
81
+ }
82
+ if (isCheckboxColumn) {
83
+ return /* @__PURE__ */ jsx(
84
+ TableCell,
85
+ {
86
+ sx: createCellStyle(cell, AUTO_EXTENSIBLE_COLUMNS.includes(cell.column.id)),
87
+ onClick: () => handleCellClickCallback(cell.column.id),
88
+ children: /* @__PURE__ */ jsx(Box, { sx: createCellContentWrapperSx(theme, cellWithoutBorders), children: cellContent })
89
+ },
90
+ cell.id
91
+ );
92
+ }
93
+ return /* @__PURE__ */ jsx(
94
+ TableCell,
95
+ {
96
+ sx: createCellStyle(cell, AUTO_EXTENSIBLE_COLUMNS.includes(cell.column.id)),
97
+ onClick: () => handleCellClickCallback(cell.column.id),
98
+ children: isNameColumn ? (
99
+ // NameCell owns its own borders entirely
100
+ flexRender(cell.column.columnDef.cell, cell.getContext())
101
+ ) : /* @__PURE__ */ jsx(Box, { sx: createCellContentWrapperSx(theme, cellWithoutBorders), children: cellContent })
102
+ },
103
+ cell.id
104
+ );
105
+ })
86
106
  }
87
- return /* @__PURE__ */ jsx(
88
- TableCell,
89
- {
90
- sx: createCellStyle(cell, AUTO_EXTENSIBLE_COLUMNS.includes(cell.column.id)),
91
- onClick: () => handleCellClickCallback(cell.column.id),
92
- children: isNameColumn ? (
93
- // NameCell owns its own borders entirely
94
- flexRender(cell.column.columnDef.cell, cell.getContext())
95
- ) : /* @__PURE__ */ jsx(Box, { sx: createCellContentWrapperSx(theme, cellWithoutBorders), children: cellContent })
96
- },
97
- cell.id
98
- );
99
- })
107
+ );
100
108
  }
101
- );
102
- } });
109
+ }
110
+ );
103
111
  }
104
112
  export {
105
113
  ModificationRow
@@ -7,7 +7,7 @@ import "@hello-pangea/dnd";
7
7
  import "react-intl";
8
8
  import "./columns-definition.js";
9
9
  import { DROP_FORBIDDEN_INDICATOR_BOTTOM, DROP_FORBIDDEN_INDICATOR_TOP, DROP_INDICATOR_BOTTOM, DROP_INDICATOR_TOP } from "./network-modification-table-styles.js";
10
- import { isCompositeModification, MAX_COMPOSITE_NESTING_DEPTH, findModificationInTree, isSharedModification, moveSubModificationInTree } from "./utils.js";
10
+ import { isCompositeModification, isReferenceModification, isTargetChildOfReference, MAX_COMPOSITE_NESTING_DEPTH, findModificationInTree, moveSubModificationInTree } from "./utils.js";
11
11
  import "../../utils/conversionUtils.js";
12
12
  import { snackWithFallback } from "../../utils/error.js";
13
13
  import "../../utils/types/equipmentType.js";
@@ -25,14 +25,18 @@ const clearRowDragIndicators = (container) => {
25
25
  });
26
26
  container?.querySelectorAll(`[${CHIP_ATTR}]`).forEach((chip) => chip.remove());
27
27
  };
28
- function getTargetCompositeUuid(droppingIntoExpandedComposite, targetRow) {
28
+ function resolveTargetComposite(droppingIntoExpandedComposite, targetRow) {
29
29
  if (droppingIntoExpandedComposite) {
30
- return targetRow.original.uuid;
30
+ return { rowKey: targetRow.id, uuid: targetRow.original.uuid };
31
31
  }
32
- return targetRow.depth > 0 ? targetRow.getParentRow()?.original.uuid ?? null : null;
32
+ if (targetRow.depth > 0) {
33
+ const parent = targetRow.getParentRow();
34
+ return { rowKey: parent?.id ?? null, uuid: parent?.original.uuid ?? null };
35
+ }
36
+ return { rowKey: null, uuid: null };
33
37
  }
34
- function getTargetSiblings(targetCompositeUuid, rows) {
35
- return targetCompositeUuid ? rows.filter((r) => r.depth > 0 && r.getParentRow()?.original.uuid === targetCompositeUuid) : rows.filter((r) => r.depth === 0);
38
+ function getTargetSiblings(targetCompositeRowKey, rows) {
39
+ return targetCompositeRowKey ? rows.filter((r) => r.depth > 0 && r.getParentRow()?.id === targetCompositeRowKey) : rows.filter((r) => r.depth === 0);
36
40
  }
37
41
  function getContainerShadow(forbidden, isMovingDown) {
38
42
  if (forbidden) {
@@ -67,10 +71,15 @@ const useModificationsDragAndDrop = ({
67
71
  const isDropForbidden = useCallback(
68
72
  (sourceRow, targetRow) => {
69
73
  if (isCompositeModification(sourceRow.original)) {
74
+ if (isReferenceModification(targetRow.original) || isTargetChildOfReference(targetRow)) {
75
+ return true;
76
+ }
70
77
  const targetDepth = computeTargetDepth(sourceRow, targetRow);
71
- return (sourceRow.original.maxDepth ?? 0) + targetDepth > MAX_COMPOSITE_NESTING_DEPTH || !!(isCompositeModification(sourceRow.original) && findModificationInTree(targetRow.original.uuid, [sourceRow.original]));
78
+ return (sourceRow.original.maxDepth ?? 0) + targetDepth > MAX_COMPOSITE_NESTING_DEPTH || !!(isCompositeModification(sourceRow.original) && findModificationInTree(targetRow.id, [sourceRow.original]));
79
+ }
80
+ if (isReferenceModification(sourceRow.original) || isReferenceModification(targetRow.original) || isTargetChildOfReference(targetRow)) {
81
+ return true;
72
82
  }
73
- if (isSharedModification(sourceRow.original)) return true;
74
83
  return false;
75
84
  },
76
85
  [computeTargetDepth]
@@ -84,7 +93,7 @@ const useModificationsDragAndDrop = ({
84
93
  }
85
94
  const sourceRow = rows[source.index];
86
95
  const targetRow = rows[destination.index];
87
- const el = containerRef.current?.querySelector(`[data-row-id="${targetRow?.original.uuid}"]`);
96
+ const el = containerRef.current?.querySelector(`[data-row-id="${targetRow?.id}"]`);
88
97
  if (!el) {
89
98
  return;
90
99
  }
@@ -110,33 +119,42 @@ const useModificationsDragAndDrop = ({
110
119
  if (isDropForbidden(sourceRow, targetRow)) {
111
120
  return;
112
121
  }
122
+ const movingRowKey = sourceRow.id;
113
123
  const movingUuid = sourceRow.original.uuid;
114
- const sourceCompositeUuid = sourceRow.depth > 0 ? sourceRow.getParentRow()?.original.uuid ?? null : null;
124
+ const sourceParent = sourceRow.depth > 0 ? sourceRow.getParentRow() : void 0;
125
+ const sourceCompositeRowKey = sourceParent?.id ?? null;
126
+ const sourceContainerId = sourceParent?.original.uuid ?? null;
115
127
  const isDraggingDown = destination.index > source.index;
116
128
  const droppingIntoExpandedComposite = isDraggingDown && targetRow.getIsExpanded();
117
129
  const isSubRowInvolved = sourceRow.depth > 0 || targetRow.depth > 0;
118
- const targetCompositeUuid = getTargetCompositeUuid(droppingIntoExpandedComposite, targetRow);
119
- const sourceContainerId = sourceRow.depth > 0 ? sourceRow.getParentRow()?.original.uuid ?? null : null;
120
- const targetContainerId = targetCompositeUuid;
130
+ const targetComposite = resolveTargetComposite(droppingIntoExpandedComposite, targetRow);
131
+ const targetContainerId = targetComposite.uuid;
121
132
  const previousModifications = [...composedModifications];
122
133
  let beforeUuid;
123
134
  if (droppingIntoExpandedComposite || isSubRowInvolved) {
124
- const targetSiblings = getTargetSiblings(targetCompositeUuid, rows);
135
+ const targetSiblings = getTargetSiblings(targetComposite.rowKey, rows);
136
+ let landingSibling;
125
137
  if (droppingIntoExpandedComposite) {
126
- beforeUuid = targetSiblings[0]?.original.uuid ?? null;
138
+ [landingSibling] = targetSiblings;
127
139
  } else {
128
- const landingIndexInSiblings = targetSiblings.findIndex(
129
- (r) => r.original.uuid === targetRow.original.uuid
130
- );
140
+ const landingIndexInSiblings = targetSiblings.findIndex((r) => r.id === targetRow.id);
131
141
  const beforeSiblingIndex = isDraggingDown ? landingIndexInSiblings + 1 : landingIndexInSiblings;
132
- beforeUuid = targetSiblings[beforeSiblingIndex]?.original.uuid ?? null;
142
+ landingSibling = targetSiblings[beforeSiblingIndex];
133
143
  }
144
+ const beforeRowKey = landingSibling?.id ?? null;
145
+ beforeUuid = landingSibling?.original.uuid ?? null;
134
146
  setComposedModifications(
135
- (prev) => moveSubModificationInTree(movingUuid, sourceCompositeUuid, targetCompositeUuid, beforeUuid, prev)
147
+ (prev) => moveSubModificationInTree(
148
+ movingRowKey,
149
+ sourceCompositeRowKey,
150
+ targetComposite.rowKey,
151
+ beforeRowKey,
152
+ prev
153
+ )
136
154
  );
137
155
  } else {
138
- const oldPosition = composedModifications.findIndex((m) => m.uuid === sourceRow.original.uuid);
139
- const newPosition = composedModifications.findIndex((m) => m.uuid === targetRow.original.uuid);
156
+ const oldPosition = composedModifications.findIndex((m) => m.rowKey === sourceRow.id);
157
+ const newPosition = composedModifications.findIndex((m) => m.rowKey === targetRow.id);
140
158
  if (oldPosition === -1 || newPosition === -1 || oldPosition === newPosition || !currentNodeUuid) {
141
159
  return;
142
160
  }
@@ -4,13 +4,13 @@ function normalizeCompositeSelection(rawSelection, roots) {
4
4
  const visit = (node) => {
5
5
  const children = node.subModifications;
6
6
  if (!children || children.length === 0) {
7
- return next[node.uuid];
7
+ return next[node.rowKey];
8
8
  }
9
9
  const everyChildSelected = children.map((child) => visit(child)).every(Boolean);
10
10
  if (everyChildSelected) {
11
- next[node.uuid] = true;
11
+ next[node.rowKey] = true;
12
12
  } else {
13
- delete next[node.uuid];
13
+ delete next[node.rowKey];
14
14
  }
15
15
  return everyChildSelected;
16
16
  };
@@ -36,30 +36,30 @@ function propagateSelectionToLoadedDescendants(selection, roots) {
36
36
  let next = selection;
37
37
  let mutated = false;
38
38
  const visit = (node, ancestorSelected) => {
39
- const effectiveSelected = ancestorSelected || next[node.uuid];
40
- if (effectiveSelected && !next[node.uuid]) {
39
+ const effectiveSelected = ancestorSelected || next[node.rowKey];
40
+ if (effectiveSelected && !next[node.rowKey]) {
41
41
  if (!mutated) {
42
42
  next = { ...selection };
43
43
  mutated = true;
44
44
  }
45
- next[node.uuid] = true;
45
+ next[node.rowKey] = true;
46
46
  }
47
47
  node.subModifications?.forEach((child) => visit(child, effectiveSelected));
48
48
  };
49
49
  roots.forEach((root) => visit(root, false));
50
50
  return mutated ? next : selection;
51
51
  }
52
- function collectAllUuids(mods) {
53
- const uuids = /* @__PURE__ */ new Set();
52
+ function collectAllRowKeys(mods) {
53
+ const rowKeys = /* @__PURE__ */ new Set();
54
54
  const visit = (nodes) => nodes.forEach((m) => {
55
- uuids.add(m.uuid);
55
+ rowKeys.add(m.rowKey);
56
56
  visit(m.subModifications);
57
57
  });
58
58
  visit(mods);
59
- return uuids;
59
+ return rowKeys;
60
60
  }
61
- function pruneStaleSelection(selection, allUuids) {
62
- const pruned = Object.fromEntries(Object.entries(selection).filter(([uuid]) => allUuids.has(uuid)));
61
+ function pruneStaleSelection(selection, allRowKeys) {
62
+ const pruned = Object.fromEntries(Object.entries(selection).filter(([rowKey]) => allRowKeys.has(rowKey)));
63
63
  return Object.keys(pruned).length === Object.keys(selection).length ? selection : pruned;
64
64
  }
65
65
  function useModificationsSelection({
@@ -86,8 +86,8 @@ function useModificationsSelection({
86
86
  useEffect(() => {
87
87
  setRowSelection((prev) => {
88
88
  const propagated = propagateSelectionToLoadedDescendants(prev, modifications);
89
- const allUuids = collectAllUuids(modifications);
90
- return pruneStaleSelection(propagated, allUuids);
89
+ const allRowKeys = collectAllRowKeys(modifications);
90
+ return pruneStaleSelection(propagated, allRowKeys);
91
91
  });
92
92
  }, [modifications]);
93
93
  return { rowSelection, onRowSelectionChange, lastClickedRowId, emitSelection };
@@ -4,7 +4,10 @@ import { ComposedModificationMetadata, NetworkModificationMetadata } from '../..
4
4
  export declare const MAX_COMPOSITE_NESTING_DEPTH = 5;
5
5
  export declare const formatToComposedModification: (modifications: NetworkModificationMetadata[]) => ComposedModificationMetadata[];
6
6
  export declare function isCompositeModification(modification: ComposedModificationMetadata | undefined): boolean;
7
- export declare function isSharedModification(modification: ComposedModificationMetadata | undefined): boolean;
7
+ export declare function isReferenceModification(modification: ComposedModificationMetadata | undefined): boolean;
8
+ export declare function isTargetChildOfReference(targetRow: {
9
+ original: ComposedModificationMetadata;
10
+ }): boolean;
8
11
  export declare function findDepth(mods: ComposedModificationMetadata[], uuid: UUID, currentDepth?: number): number;
9
12
  export declare function removeUuidsFromTree(mods: ComposedModificationMetadata[], uuidsToRemove: Set<string>): ComposedModificationMetadata[];
10
13
  /**
@@ -13,14 +16,14 @@ export declare function removeUuidsFromTree(mods: ComposedModificationMetadata[]
13
16
  * @param composites result : all the composite modifications found
14
17
  */
15
18
  export declare function findAllLoadedCompositeModifications(modifications: ComposedModificationMetadata[], composites: ComposedModificationMetadata[]): void;
16
- export declare function findModificationInTree(uuid: string, mods: ComposedModificationMetadata[]): ComposedModificationMetadata | undefined;
19
+ export declare function findModificationInTree(rowKey: UUID, mods: ComposedModificationMetadata[]): ComposedModificationMetadata | undefined;
17
20
  /**
18
- * in the tree, replaces the sub-modifications of 'parentModUuid' with 'subModifications' and returns the result
19
- * @param parentModUuid
20
- * @param subModifications new subModifications of parentModUuid
21
+ * in the tree, replaces the sub-modifications of 'parentRowKey' with 'subModifications' and returns the result
22
+ * @param parentRowKey
23
+ * @param subModifications new subModifications of parentRowKey
21
24
  * @param tree all the modifications of the tree
22
25
  */
23
- export declare function updateSubModificationsOfACompositeInTree(parentModUuid: string, subModifications: ComposedModificationMetadata[], tree: ComposedModificationMetadata[]): ComposedModificationMetadata[];
26
+ export declare function updateSubModificationsOfACompositeInTree(parentRowKey: UUID, subModifications: ComposedModificationMetadata[], tree: ComposedModificationMetadata[]): ComposedModificationMetadata[];
24
27
  /**
25
28
  * Recursively merges already-loaded subModifications from the previous tree into a freshly
26
29
  * formatted tree (where all subModifications start as []). This ensures that when `modifications`
@@ -33,12 +36,17 @@ export declare function mergeSubModificationsIntoTree(nextMods: ComposedModifica
33
36
  */
34
37
  export declare function updateModificationFieldInTree(uuid: string, fields: Partial<ComposedModificationMetadata>, mods: ComposedModificationMetadata[]): ComposedModificationMetadata[];
35
38
  /**
36
- * @param movingUuid moved submodification uuid
37
- * @param sourceParentUuid composite from which movingUuid comes from. null if movingUuid is at the root level
38
- * @param targetParentUuid composite where movingUuid is moved. null if movingUuid is moved to the root level
39
- * @param beforeUuid movingUuid is moved just before beforeUuid. If null, movingUuid is moved to the end.
39
+ * @param movingRowKey moved submodification's internal row key
40
+ * @param sourceParentRowKey composite from which movingRowKey comes from. null if movingRowKey is at the root level
41
+ * @param targetParentRowKey composite where movingRowKey is moved. null if movingRowKey is moved to the root level
42
+ * @param beforeRowKey movingRowKey is moved just before beforeRowKey. If null, movingRowKey is moved to the end.
40
43
  * @param mods all the network modifications of the tree
41
44
  * @return mods updated according to the moved submodification
42
45
  */
43
- export declare function moveSubModificationInTree(movingUuid: UUID, sourceParentUuid: UUID | null, targetParentUuid: UUID | null, beforeUuid: UUID | null, mods: ComposedModificationMetadata[]): ComposedModificationMetadata[];
44
- export declare function fetchSubModificationsForExpandedRows(expandedIds: string[], mods: ComposedModificationMetadata[], setMods: Dispatch<SetStateAction<ComposedModificationMetadata[]>>, force?: boolean): void;
46
+ export declare function moveSubModificationInTree(movingRowKey: UUID, sourceParentRowKey: UUID | null, targetParentRowKey: UUID | null, beforeRowKey: UUID | null, mods: ComposedModificationMetadata[]): ComposedModificationMetadata[];
47
+ /**
48
+ * @param expandedRowKeys rowKeys of the rows that were just expanded — this is exactly what
49
+ * ExpandedState is keyed by now, since getRowId returns row.rowKey, so no translation is needed
50
+ * at the call site (unlike the previous resolveUuidFromRowId path-parsing scheme, now removed).
51
+ */
52
+ export declare function fetchSubModificationsForExpandedRows(expandedRowKeys: UUID[], mods: ComposedModificationMetadata[], setMods: Dispatch<SetStateAction<ComposedModificationMetadata[]>>, force?: boolean): Promise<void>;