@gridsuite/commons-ui 0.195.0 → 0.196.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.js +53 -0
- package/dist/components/network-modification-table/columns-definition.d.ts +26 -0
- package/dist/components/network-modification-table/columns-definition.js +36 -0
- package/dist/components/network-modification-table/index.d.ts +13 -0
- package/dist/components/network-modification-table/index.js +55 -0
- package/dist/components/network-modification-table/network-modification-table-styles.d.ts +210 -0
- package/dist/components/network-modification-table/network-modification-table-styles.js +333 -0
- package/dist/components/network-modification-table/network-modifications-table.d.ts +20 -0
- package/dist/components/network-modification-table/network-modifications-table.js +166 -0
- package/dist/components/network-modification-table/renderers/depth-box.d.ts +6 -0
- package/dist/components/network-modification-table/renderers/depth-box.js +21 -0
- package/dist/components/network-modification-table/renderers/drag-handle-cell.d.ts +5 -0
- package/dist/components/network-modification-table/renderers/drag-handle-cell.js +10 -0
- package/dist/components/network-modification-table/renderers/index.d.ts +12 -0
- package/dist/components/network-modification-table/renderers/index.js +14 -0
- package/dist/components/network-modification-table/renderers/name-cell.d.ts +7 -0
- package/dist/components/network-modification-table/renderers/name-cell.js +84 -0
- package/dist/components/network-modification-table/renderers/network-modification-node-editor-name-header.d.ts +14 -0
- package/dist/components/network-modification-table/renderers/network-modification-node-editor-name-header.js +40 -0
- package/dist/components/network-modification-table/renderers/select-cell.d.ts +8 -0
- package/dist/components/network-modification-table/renderers/select-cell.js +60 -0
- package/dist/components/network-modification-table/renderers/select-header-cell.d.ts +7 -0
- package/dist/components/network-modification-table/renderers/select-header-cell.js +26 -0
- package/dist/components/network-modification-table/row/drag-row-clone.d.ts +7 -0
- package/dist/components/network-modification-table/row/drag-row-clone.js +35 -0
- package/dist/components/network-modification-table/row/index.d.ts +8 -0
- package/dist/components/network-modification-table/row/index.js +6 -0
- package/dist/components/network-modification-table/row/modification-row.d.ts +12 -0
- package/dist/components/network-modification-table/row/modification-row.js +117 -0
- package/dist/components/network-modification-table/use-modifications-drag-and-drop.d.ts +21 -0
- package/dist/components/network-modification-table/use-modifications-drag-and-drop.js +170 -0
- package/dist/components/network-modification-table/utils.d.ts +40 -0
- package/dist/components/network-modification-table/utils.js +164 -0
- package/dist/hooks/useModificationLabelComputer.d.ts +1 -12
- package/dist/index.js +59 -1
- package/dist/module-tanstack.d.js +1 -0
- package/dist/services/index.js +6 -1
- package/dist/services/networkModification.d.ts +21 -0
- package/dist/services/networkModification.js +34 -0
- package/dist/utils/types/index.d.ts +1 -0
- package/dist/utils/types/network-modification-metadata.d.ts +15 -0
- package/dist/utils/types/network-modification-metadata.js +1 -0
- package/dist/utils/types/network-modification-types.d.ts +5 -6
- package/package.json +3 -1
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
import "../../utils/conversionUtils.js";
|
|
2
|
+
import "../../utils/types/equipmentType.js";
|
|
3
|
+
import { MODIFICATION_TYPES } from "../../utils/types/modificationType.js";
|
|
4
|
+
import "react/jsx-runtime";
|
|
5
|
+
import "@mui/icons-material";
|
|
6
|
+
import "../../utils/yupConfig.js";
|
|
7
|
+
import { getNetworkModificationsFromComposite } from "../../services/networkModification.js";
|
|
8
|
+
const formatToComposedModification = (modifications) => {
|
|
9
|
+
return modifications.map((modification) => ({ ...modification, subModifications: [] }));
|
|
10
|
+
};
|
|
11
|
+
function isCompositeModification(modification) {
|
|
12
|
+
return modification?.messageType === MODIFICATION_TYPES.COMPOSITE_MODIFICATION.type;
|
|
13
|
+
}
|
|
14
|
+
function findAllLoadedCompositeModifications(modifications, composites) {
|
|
15
|
+
modifications.forEach((modification) => {
|
|
16
|
+
if (isCompositeModification(modification) && modification.subModifications.length > 0) {
|
|
17
|
+
composites.push(modification);
|
|
18
|
+
findAllLoadedCompositeModifications(modification.subModifications, composites);
|
|
19
|
+
}
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
function findModificationInTree(uuid, mods) {
|
|
23
|
+
for (const mod of mods) {
|
|
24
|
+
if (mod.uuid === uuid) {
|
|
25
|
+
return mod;
|
|
26
|
+
}
|
|
27
|
+
const found = findModificationInTree(uuid, mod.subModifications);
|
|
28
|
+
if (found) {
|
|
29
|
+
return found;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
return void 0;
|
|
33
|
+
}
|
|
34
|
+
function updateSubModificationsOfACompositeInTree(parentModUuid, subModifications, tree) {
|
|
35
|
+
return tree.map((m) => {
|
|
36
|
+
if (m.uuid === parentModUuid) {
|
|
37
|
+
return { ...m, subModifications };
|
|
38
|
+
}
|
|
39
|
+
if (m.subModifications.length > 0) {
|
|
40
|
+
return {
|
|
41
|
+
...m,
|
|
42
|
+
subModifications: updateSubModificationsOfACompositeInTree(
|
|
43
|
+
parentModUuid,
|
|
44
|
+
subModifications,
|
|
45
|
+
m.subModifications
|
|
46
|
+
)
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
return m;
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
function mergeSubModificationsIntoTree(nextMods, prevMods) {
|
|
53
|
+
return nextMods.map((nextMod) => {
|
|
54
|
+
const prevMod = prevMods.find((m) => m.uuid === nextMod.uuid);
|
|
55
|
+
if (!prevMod || prevMod.subModifications.length === 0) {
|
|
56
|
+
return nextMod;
|
|
57
|
+
}
|
|
58
|
+
return {
|
|
59
|
+
...nextMod,
|
|
60
|
+
subModifications: mergeSubModificationsIntoTree(
|
|
61
|
+
nextMod.subModifications.length > 0 ? nextMod.subModifications : prevMod.subModifications,
|
|
62
|
+
prevMod.subModifications
|
|
63
|
+
)
|
|
64
|
+
};
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
function updateModificationFieldInTree(uuid, fields, mods) {
|
|
68
|
+
return mods.map((m) => {
|
|
69
|
+
if (m.uuid === uuid) {
|
|
70
|
+
return { ...m, ...fields };
|
|
71
|
+
}
|
|
72
|
+
if (m.subModifications.length > 0) {
|
|
73
|
+
return { ...m, subModifications: updateModificationFieldInTree(uuid, fields, m.subModifications) };
|
|
74
|
+
}
|
|
75
|
+
return m;
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
function getModificationInTree(modUuid, sourceParentUuid, mods) {
|
|
79
|
+
if (sourceParentUuid) {
|
|
80
|
+
const sourceMod = findModificationInTree(sourceParentUuid, mods);
|
|
81
|
+
if (!sourceMod) {
|
|
82
|
+
return void 0;
|
|
83
|
+
}
|
|
84
|
+
return sourceMod.subModifications.find((m) => m.uuid === modUuid);
|
|
85
|
+
}
|
|
86
|
+
return mods.find((m) => m.uuid === modUuid);
|
|
87
|
+
}
|
|
88
|
+
function moveSubModificationInTree(movingUuid, sourceParentUuid, targetParentUuid, beforeUuid, mods) {
|
|
89
|
+
const movedMod = getModificationInTree(
|
|
90
|
+
movingUuid,
|
|
91
|
+
sourceParentUuid,
|
|
92
|
+
mods
|
|
93
|
+
);
|
|
94
|
+
if (!movedMod) {
|
|
95
|
+
console.error(`Can't find the ${movingUuid} modification that should be moved`);
|
|
96
|
+
return mods;
|
|
97
|
+
}
|
|
98
|
+
let modsWithoutTheMovedModification;
|
|
99
|
+
if (sourceParentUuid) {
|
|
100
|
+
const sourceMod = findModificationInTree(sourceParentUuid, mods);
|
|
101
|
+
if (!sourceMod) {
|
|
102
|
+
return mods;
|
|
103
|
+
}
|
|
104
|
+
const newSourceSubs = sourceMod.subModifications.filter((m) => m.uuid !== movingUuid);
|
|
105
|
+
modsWithoutTheMovedModification = updateSubModificationsOfACompositeInTree(
|
|
106
|
+
sourceParentUuid,
|
|
107
|
+
newSourceSubs,
|
|
108
|
+
mods
|
|
109
|
+
);
|
|
110
|
+
} else {
|
|
111
|
+
modsWithoutTheMovedModification = mods.filter((m) => m.uuid !== movingUuid);
|
|
112
|
+
}
|
|
113
|
+
if (targetParentUuid) {
|
|
114
|
+
const targetMod = findModificationInTree(targetParentUuid, modsWithoutTheMovedModification);
|
|
115
|
+
if (!targetMod) {
|
|
116
|
+
return mods;
|
|
117
|
+
}
|
|
118
|
+
const newTargetSubs = [...targetMod.subModifications];
|
|
119
|
+
const insertIdx2 = beforeUuid ? newTargetSubs.findIndex((m) => m.uuid === beforeUuid) : -1;
|
|
120
|
+
newTargetSubs.splice(insertIdx2 === -1 ? newTargetSubs.length : insertIdx2, 0, movedMod);
|
|
121
|
+
return updateSubModificationsOfACompositeInTree(
|
|
122
|
+
targetParentUuid,
|
|
123
|
+
newTargetSubs,
|
|
124
|
+
modsWithoutTheMovedModification
|
|
125
|
+
);
|
|
126
|
+
}
|
|
127
|
+
const insertIdx = beforeUuid ? modsWithoutTheMovedModification.findIndex((m) => m.uuid === beforeUuid) : -1;
|
|
128
|
+
const result = [...modsWithoutTheMovedModification];
|
|
129
|
+
result.splice(insertIdx === -1 ? result.length : insertIdx, 0, movedMod);
|
|
130
|
+
return result;
|
|
131
|
+
}
|
|
132
|
+
function fetchSubModificationsForExpandedRows(expandedIds, mods, setMods, force = false) {
|
|
133
|
+
const uuidsToFetch = expandedIds.filter((id) => {
|
|
134
|
+
const mod = findModificationInTree(id, mods);
|
|
135
|
+
return isCompositeModification(mod) && (force || mod?.subModifications.length === 0);
|
|
136
|
+
});
|
|
137
|
+
if (uuidsToFetch.length === 0) {
|
|
138
|
+
return;
|
|
139
|
+
}
|
|
140
|
+
getNetworkModificationsFromComposite(uuidsToFetch).then((subModsByUuid) => {
|
|
141
|
+
setMods(
|
|
142
|
+
(prev) => Object.entries(subModsByUuid).reduce((tree, [uuid, subMods]) => {
|
|
143
|
+
const liveModifications = formatToComposedModification(subMods.filter((m) => !m.stashed));
|
|
144
|
+
const existingMod = findModificationInTree(uuid, tree);
|
|
145
|
+
const mergedSubs = mergeSubModificationsIntoTree(
|
|
146
|
+
liveModifications,
|
|
147
|
+
existingMod?.subModifications ?? []
|
|
148
|
+
);
|
|
149
|
+
return updateSubModificationsOfACompositeInTree(uuid, mergedSubs, tree);
|
|
150
|
+
}, prev)
|
|
151
|
+
);
|
|
152
|
+
});
|
|
153
|
+
}
|
|
154
|
+
export {
|
|
155
|
+
fetchSubModificationsForExpandedRows,
|
|
156
|
+
findAllLoadedCompositeModifications,
|
|
157
|
+
findModificationInTree,
|
|
158
|
+
formatToComposedModification,
|
|
159
|
+
isCompositeModification,
|
|
160
|
+
mergeSubModificationsIntoTree,
|
|
161
|
+
moveSubModificationInTree,
|
|
162
|
+
updateModificationFieldInTree,
|
|
163
|
+
updateSubModificationsOfACompositeInTree
|
|
164
|
+
};
|
|
@@ -1,15 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { ModificationType } from '../utils';
|
|
3
|
-
export interface NetworkModificationMetadata {
|
|
4
|
-
uuid: UUID;
|
|
5
|
-
type: ModificationType;
|
|
6
|
-
date: Date;
|
|
7
|
-
stashed: boolean;
|
|
8
|
-
activated: boolean;
|
|
9
|
-
description: string;
|
|
10
|
-
messageType: string;
|
|
11
|
-
messageValues: string;
|
|
12
|
-
}
|
|
1
|
+
import { NetworkModificationMetadata } from '../utils';
|
|
13
2
|
export declare const useModificationLabelComputer: () => {
|
|
14
3
|
computeLabel: (modif: NetworkModificationMetadata, formatBold?: boolean) => {
|
|
15
4
|
action: string;
|
package/dist/index.js
CHANGED
|
@@ -272,7 +272,7 @@ import { fetchCurrentAnnouncement, fetchUserDetails } from "./services/userAdmin
|
|
|
272
272
|
import { DEFAULT_TIMEOUT_MS, IGNORE_SIGNAL, backendFetch, backendFetchFile, backendFetchJson, backendFetchText, getRequestParamFromList, handleNotOkResponse, parseError, safeEncodeURIComponent } from "./services/utils.js";
|
|
273
273
|
import { getVoltageInitParameters, getVoltageInitUrl } from "./services/voltage-init.js";
|
|
274
274
|
import { fetchShortCircuitParameters, getShortCircuitSpecificParametersDescription, updateShortCircuitParameters } from "./services/short-circuit-analysis.js";
|
|
275
|
-
import { fetchBusBarSectionsForNewCoupler, fetchNetworkModification, updateModification } from "./services/networkModification.js";
|
|
275
|
+
import { changeCompositeSubModificationOrder, changeNetworkModificationOrder, fetchBusBarSectionsForNewCoupler, fetchNetworkModification, getBaseNetworkModificationUrl, getNetworkModificationsFromComposite, getStudyUrlWithNodeUuid, updateModification } from "./services/networkModification.js";
|
|
276
276
|
import { fetchDynamicSimulationModels, getDynamicMappings } from "./services/dynamic-mapping.js";
|
|
277
277
|
import { fetchDynamicSimulationParameters, fetchDynamicSimulationProviders, updateDynamicSimulationParameters } from "./services/dynamic-simulation.js";
|
|
278
278
|
import { fetchContingencyAndFiltersLists, fetchDynamicSecurityAnalysisProviders } from "./services/dynamic-security-analysis.js";
|
|
@@ -297,6 +297,19 @@ import { emptyModificationByAssignmentFormData, modificationByAssignmentDtoToFor
|
|
|
297
297
|
import { DataType as DataType2 } from "./components/network-modifications/by-filter/assignment/assignment/assignment.type.js";
|
|
298
298
|
import { BuildStatusChip } from "./components/node/build-status-chip.js";
|
|
299
299
|
import { BuildStatus } from "./components/node/constant.js";
|
|
300
|
+
import { COLUMNS_WITHOUT_BORDER, DEPTH_CELL_WIDTH, DROP_FORBIDDEN_INDICATOR_BOTTOM, DROP_FORBIDDEN_INDICATOR_TOP, DROP_INDICATOR_BOTTOM, DROP_INDICATOR_TOP, MODIFICATION_ROW_HEIGHT, createCellBorderColor, createCellContentWrapperSx, createCellStyle, createEditDescriptionStyle, createHeaderCellStyle, createModificationNameCellStyle, createNameCellLabelBoxSx, createNameCellRootStyle, createRootNetworkChipCellSx, createRowSx, networkModificationTableStyles } from "./components/network-modification-table/network-modification-table-styles.js";
|
|
301
|
+
import { AUTO_EXTENSIBLE_COLUMNS, BASE_MODIFICATION_TABLE_COLUMNS, computeTagMinSize } from "./components/network-modification-table/columns-definition.js";
|
|
302
|
+
import { NetworkModificationsTable } from "./components/network-modification-table/network-modifications-table.js";
|
|
303
|
+
import { useModificationsDragAndDrop } from "./components/network-modification-table/use-modifications-drag-and-drop.js";
|
|
304
|
+
import { DepthBox } from "./components/network-modification-table/renderers/depth-box.js";
|
|
305
|
+
import { DragHandleCell } from "./components/network-modification-table/renderers/drag-handle-cell.js";
|
|
306
|
+
import { NameCell } from "./components/network-modification-table/renderers/name-cell.js";
|
|
307
|
+
import { NetworkModificationEditorNameHeader } from "./components/network-modification-table/renderers/network-modification-node-editor-name-header.js";
|
|
308
|
+
import { SelectCell } from "./components/network-modification-table/renderers/select-cell.js";
|
|
309
|
+
import { SelectHeaderCell } from "./components/network-modification-table/renderers/select-header-cell.js";
|
|
310
|
+
import { DragCloneRow } from "./components/network-modification-table/row/drag-row-clone.js";
|
|
311
|
+
import { ModificationRow } from "./components/network-modification-table/row/modification-row.js";
|
|
312
|
+
import { fetchSubModificationsForExpandedRows, findAllLoadedCompositeModifications, findModificationInTree, formatToComposedModification, isCompositeModification, mergeSubModificationsIntoTree, moveSubModificationInTree, updateModificationFieldInTree, updateSubModificationsOfACompositeInTree } from "./components/network-modification-table/utils.js";
|
|
300
313
|
import { useStateBoolean } from "./hooks/customStates/useStateBoolean.js";
|
|
301
314
|
import { useStateNumber } from "./hooks/customStates/useStateNumber.js";
|
|
302
315
|
import { useModificationLabelComputer } from "./hooks/useModificationLabelComputer.js";
|
|
@@ -379,6 +392,7 @@ export {
|
|
|
379
392
|
ACTIVE,
|
|
380
393
|
ALL_EQUIPMENTS,
|
|
381
394
|
AMPERE,
|
|
395
|
+
AUTO_EXTENSIBLE_COLUMNS,
|
|
382
396
|
AboutDialog,
|
|
383
397
|
ActivableChip,
|
|
384
398
|
ActivePowerAdornment,
|
|
@@ -396,6 +410,7 @@ export {
|
|
|
396
410
|
AutocompleteWithFavorites,
|
|
397
411
|
BALANCE_TYPE,
|
|
398
412
|
BASE_EQUIPMENTS,
|
|
413
|
+
BASE_MODIFICATION_TABLE_COLUMNS,
|
|
399
414
|
Battery,
|
|
400
415
|
BooleanCellRenderer,
|
|
401
416
|
BooleanInput,
|
|
@@ -417,6 +432,7 @@ export {
|
|
|
417
432
|
COLUMNS_DEFINITIONS_LIMIT_REDUCTIONS,
|
|
418
433
|
COLUMNS_DEFINITIONS_NODES,
|
|
419
434
|
COLUMNS_DEFINITIONS_PSTS,
|
|
435
|
+
COLUMNS_WITHOUT_BORDER,
|
|
420
436
|
COMBINATOR_OPTIONS,
|
|
421
437
|
COMMON_APP_NAME,
|
|
422
438
|
COMMON_CONFIG_PARAMS_NAMES,
|
|
@@ -476,14 +492,20 @@ export {
|
|
|
476
492
|
DEFAULT_TIMEOUT_MS,
|
|
477
493
|
DEFAULT_UPDATE_BUS_VOLTAGE,
|
|
478
494
|
DEGREE,
|
|
495
|
+
DEPTH_CELL_WIDTH,
|
|
479
496
|
DESCRIPTION,
|
|
480
497
|
DIAGONAL_LABEL,
|
|
481
498
|
DISTRIBUTED_SLACK,
|
|
482
499
|
DISTRIBUTION_KEY,
|
|
500
|
+
DROP_FORBIDDEN_INDICATOR_BOTTOM,
|
|
501
|
+
DROP_FORBIDDEN_INDICATOR_TOP,
|
|
502
|
+
DROP_INDICATOR_BOTTOM,
|
|
503
|
+
DROP_INDICATOR_TOP,
|
|
483
504
|
DUPLICATED_PROPS_ERROR,
|
|
484
505
|
DanglingLine,
|
|
485
506
|
DataType,
|
|
486
507
|
DefaultCellRenderer,
|
|
508
|
+
DepthBox,
|
|
487
509
|
DescriptionField,
|
|
488
510
|
DescriptionInput,
|
|
489
511
|
DescriptionModificationDialog,
|
|
@@ -496,6 +518,8 @@ export {
|
|
|
496
518
|
DndTableAddRowsDialog,
|
|
497
519
|
DndTableBottomLeftButtons,
|
|
498
520
|
DndTableBottomRightButtons,
|
|
521
|
+
DragCloneRow,
|
|
522
|
+
DragHandleCell,
|
|
499
523
|
DynamicMarginCalculationInline,
|
|
500
524
|
DynamicSecurityAnalysisInline,
|
|
501
525
|
DynamicSimulationInline,
|
|
@@ -634,6 +658,7 @@ export {
|
|
|
634
658
|
MEGA_WATT,
|
|
635
659
|
MICRO_SIEMENS,
|
|
636
660
|
MIN_VALUE_ALLOWED_FOR_LIMIT_REDUCTION,
|
|
661
|
+
MODIFICATION_ROW_HEIGHT,
|
|
637
662
|
MODIFICATION_TYPES,
|
|
638
663
|
MONITORED_BRANCHES_EQUIPMENT_TYPES,
|
|
639
664
|
MONITORED_VOLTAGE_LEVELS_EQUIPMENT_TYPES,
|
|
@@ -642,6 +667,7 @@ export {
|
|
|
642
667
|
MicroSusceptanceAdornment,
|
|
643
668
|
MidFormError,
|
|
644
669
|
ModificationByAssignmentForm,
|
|
670
|
+
ModificationRow,
|
|
645
671
|
ModificationType,
|
|
646
672
|
ModifyElementSelection,
|
|
647
673
|
MuiSelectInput,
|
|
@@ -654,7 +680,10 @@ export {
|
|
|
654
680
|
NODE_CLUSTER_FILTER_IDS,
|
|
655
681
|
NO_ITEM_SELECTION_FOR_COPY,
|
|
656
682
|
NadPositionsGenerationMode,
|
|
683
|
+
NameCell,
|
|
684
|
+
NetworkModificationEditorNameHeader,
|
|
657
685
|
NetworkModificationNameCellRenderer,
|
|
686
|
+
NetworkModificationsTable,
|
|
658
687
|
NetworkTimeoutError,
|
|
659
688
|
NetworkVisualizationParametersInline,
|
|
660
689
|
NetworkVisualizationTabValues,
|
|
@@ -779,7 +808,9 @@ export {
|
|
|
779
808
|
SWITCH_TYPE,
|
|
780
809
|
SecurityAnalysisParametersDialog,
|
|
781
810
|
SecurityAnalysisParametersInline,
|
|
811
|
+
SelectCell,
|
|
782
812
|
SelectClearable,
|
|
813
|
+
SelectHeaderCell,
|
|
783
814
|
SelectInput,
|
|
784
815
|
SelectWithConfirmationInput,
|
|
785
816
|
SensiBranchesTabValues,
|
|
@@ -876,19 +907,32 @@ export {
|
|
|
876
907
|
cardErrorBoundaryEn,
|
|
877
908
|
cardErrorBoundaryFr,
|
|
878
909
|
catchErrorHandler,
|
|
910
|
+
changeCompositeSubModificationOrder,
|
|
911
|
+
changeNetworkModificationOrder,
|
|
879
912
|
commonButtonEn,
|
|
880
913
|
commonButtonFr,
|
|
881
914
|
componentsEn,
|
|
882
915
|
componentsFr,
|
|
916
|
+
computeTagMinSize,
|
|
883
917
|
convertInputValue,
|
|
884
918
|
convertOutputValue,
|
|
885
919
|
copyEquipmentPropertiesForCreation,
|
|
886
920
|
copyToClipboard,
|
|
887
921
|
countRules,
|
|
922
|
+
createCellBorderColor,
|
|
923
|
+
createCellContentWrapperSx,
|
|
924
|
+
createCellStyle,
|
|
888
925
|
createConnectivityData,
|
|
926
|
+
createEditDescriptionStyle,
|
|
889
927
|
createFilter,
|
|
928
|
+
createHeaderCellStyle,
|
|
929
|
+
createModificationNameCellStyle,
|
|
930
|
+
createNameCellLabelBoxSx,
|
|
931
|
+
createNameCellRootStyle,
|
|
890
932
|
createParameter,
|
|
891
933
|
createPropertyModification,
|
|
934
|
+
createRootNetworkChipCellSx,
|
|
935
|
+
createRowSx,
|
|
892
936
|
creationPropertiesSchema,
|
|
893
937
|
csvEn,
|
|
894
938
|
csvFr,
|
|
@@ -962,20 +1006,25 @@ export {
|
|
|
962
1006
|
fetchSecurityAnalysisProviders,
|
|
963
1007
|
fetchShortCircuitParameters,
|
|
964
1008
|
fetchStudyMetadata,
|
|
1009
|
+
fetchSubModificationsForExpandedRows,
|
|
965
1010
|
fetchUserDetails,
|
|
966
1011
|
filledTextField,
|
|
967
1012
|
filterEn,
|
|
968
1013
|
filterExpertEn,
|
|
969
1014
|
filterExpertFr,
|
|
970
1015
|
filterFr,
|
|
1016
|
+
findAllLoadedCompositeModifications,
|
|
1017
|
+
findModificationInTree,
|
|
971
1018
|
flatParametersEn,
|
|
972
1019
|
flatParametersFr,
|
|
973
1020
|
formatComputingTypeLabel,
|
|
1021
|
+
formatToComposedModification,
|
|
974
1022
|
genHelperError,
|
|
975
1023
|
generateTreeViewFinderClass,
|
|
976
1024
|
getActivePowerSetPointSchema,
|
|
977
1025
|
getAppName,
|
|
978
1026
|
getAvailableComponentLibraries,
|
|
1027
|
+
getBaseNetworkModificationUrl,
|
|
979
1028
|
getBranchActiveReactivePowerEditData,
|
|
980
1029
|
getBranchActiveReactivePowerEditDataProperties,
|
|
981
1030
|
getBranchActiveReactivePowerEmptyFormData,
|
|
@@ -1027,6 +1076,7 @@ export {
|
|
|
1027
1076
|
getLoadFlowSpecificParametersDescription,
|
|
1028
1077
|
getLoadFlowUrl,
|
|
1029
1078
|
getLoadTypeLabel,
|
|
1079
|
+
getNetworkModificationsFromComposite,
|
|
1030
1080
|
getNetworkVisualizationsParameters,
|
|
1031
1081
|
getNewVoltageLevelData,
|
|
1032
1082
|
getNumberOfSiblings,
|
|
@@ -1050,6 +1100,7 @@ export {
|
|
|
1050
1100
|
getStudyNetworkVisualizationsParameters,
|
|
1051
1101
|
getStudyShortCircuitParameters,
|
|
1052
1102
|
getStudyUrl,
|
|
1103
|
+
getStudyUrlWithNodeUuid,
|
|
1053
1104
|
getSystemLanguage,
|
|
1054
1105
|
getUserToken,
|
|
1055
1106
|
getVoltageInitParameters,
|
|
@@ -1072,6 +1123,7 @@ export {
|
|
|
1072
1123
|
intlInitialVoltageProfileMode,
|
|
1073
1124
|
intlPredefinedParametersOptions,
|
|
1074
1125
|
isBlankOrEmpty,
|
|
1126
|
+
isCompositeModification,
|
|
1075
1127
|
isEmpty,
|
|
1076
1128
|
isExploreMetadata,
|
|
1077
1129
|
isFieldRequired,
|
|
@@ -1098,14 +1150,17 @@ export {
|
|
|
1098
1150
|
logout,
|
|
1099
1151
|
makeComposeClasses,
|
|
1100
1152
|
mergeModificationAndEquipmentProperties,
|
|
1153
|
+
mergeSubModificationsIntoTree,
|
|
1101
1154
|
mergeSx,
|
|
1102
1155
|
microUnitToUnit,
|
|
1103
1156
|
modificationByAssignmentDtoToForm,
|
|
1104
1157
|
modificationByAssignmentFormSchema,
|
|
1105
1158
|
modificationByAssignmentFormToDto,
|
|
1106
1159
|
modificationPropertiesSchema,
|
|
1160
|
+
moveSubModificationInTree,
|
|
1107
1161
|
multipleSelectionDialogEn,
|
|
1108
1162
|
multipleSelectionDialogFr,
|
|
1163
|
+
networkModificationTableStyles,
|
|
1109
1164
|
networkModificationsEn,
|
|
1110
1165
|
networkModificationsFr,
|
|
1111
1166
|
newEquipmentDeletionDto,
|
|
@@ -1176,10 +1231,12 @@ export {
|
|
|
1176
1231
|
updateDynamicMarginCalculationParameters,
|
|
1177
1232
|
updateDynamicSimulationParameters,
|
|
1178
1233
|
updateModification,
|
|
1234
|
+
updateModificationFieldInTree,
|
|
1179
1235
|
updateParameter,
|
|
1180
1236
|
updatePccMinParameters,
|
|
1181
1237
|
updateSecurityAnalysisParameters,
|
|
1182
1238
|
updateShortCircuitParameters,
|
|
1239
|
+
updateSubModificationsOfACompositeInTree,
|
|
1183
1240
|
updateVoltageInitParameters,
|
|
1184
1241
|
useConfidentialityWarning,
|
|
1185
1242
|
useConvertValue,
|
|
@@ -1195,6 +1252,7 @@ export {
|
|
|
1195
1252
|
useListenerManager,
|
|
1196
1253
|
useLocalizedCountries,
|
|
1197
1254
|
useModificationLabelComputer,
|
|
1255
|
+
useModificationsDragAndDrop,
|
|
1198
1256
|
useNotificationsListener,
|
|
1199
1257
|
useParametersBackend,
|
|
1200
1258
|
useParametersForm,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
package/dist/services/index.js
CHANGED
|
@@ -11,7 +11,7 @@ import { fetchCurrentAnnouncement, fetchUserDetails } from "./userAdmin.js";
|
|
|
11
11
|
import { DEFAULT_TIMEOUT_MS, IGNORE_SIGNAL, backendFetch, backendFetchFile, backendFetchJson, backendFetchText, getRequestParamFromList, handleNotOkResponse, parseError, safeEncodeURIComponent } from "./utils.js";
|
|
12
12
|
import { getVoltageInitParameters, getVoltageInitUrl } from "./voltage-init.js";
|
|
13
13
|
import { fetchShortCircuitParameters, getShortCircuitSpecificParametersDescription, updateShortCircuitParameters } from "./short-circuit-analysis.js";
|
|
14
|
-
import { fetchBusBarSectionsForNewCoupler, fetchNetworkModification, updateModification } from "./networkModification.js";
|
|
14
|
+
import { changeCompositeSubModificationOrder, changeNetworkModificationOrder, fetchBusBarSectionsForNewCoupler, fetchNetworkModification, getBaseNetworkModificationUrl, getNetworkModificationsFromComposite, getStudyUrlWithNodeUuid, updateModification } from "./networkModification.js";
|
|
15
15
|
import { fetchDynamicSimulationModels, getDynamicMappings } from "./dynamic-mapping.js";
|
|
16
16
|
import { fetchDynamicSimulationParameters, fetchDynamicSimulationProviders, updateDynamicSimulationParameters } from "./dynamic-simulation.js";
|
|
17
17
|
import { fetchContingencyAndFiltersLists, fetchDynamicSecurityAnalysisProviders } from "./dynamic-security-analysis.js";
|
|
@@ -25,6 +25,8 @@ export {
|
|
|
25
25
|
backendFetchFile,
|
|
26
26
|
backendFetchJson,
|
|
27
27
|
backendFetchText,
|
|
28
|
+
changeCompositeSubModificationOrder,
|
|
29
|
+
changeNetworkModificationOrder,
|
|
28
30
|
createFilter,
|
|
29
31
|
createParameter,
|
|
30
32
|
elementAlreadyExists,
|
|
@@ -59,11 +61,13 @@ export {
|
|
|
59
61
|
fetchUserDetails,
|
|
60
62
|
getAppName,
|
|
61
63
|
getAvailableComponentLibraries,
|
|
64
|
+
getBaseNetworkModificationUrl,
|
|
62
65
|
getDynamicMappings,
|
|
63
66
|
getLoadFlowDefaultLimitReductions,
|
|
64
67
|
getLoadFlowProviders,
|
|
65
68
|
getLoadFlowSpecificParametersDescription,
|
|
66
69
|
getLoadFlowUrl,
|
|
70
|
+
getNetworkModificationsFromComposite,
|
|
67
71
|
getNetworkVisualizationsParameters,
|
|
68
72
|
getPccMinStudyParameters,
|
|
69
73
|
getRequestParamFromList,
|
|
@@ -73,6 +77,7 @@ export {
|
|
|
73
77
|
getStudyNetworkVisualizationsParameters,
|
|
74
78
|
getStudyShortCircuitParameters,
|
|
75
79
|
getStudyUrl,
|
|
80
|
+
getStudyUrlWithNodeUuid,
|
|
76
81
|
getVoltageInitParameters,
|
|
77
82
|
getVoltageInitUrl,
|
|
78
83
|
handleNotOkResponse,
|
|
@@ -1,7 +1,28 @@
|
|
|
1
1
|
import { UUID } from 'node:crypto';
|
|
2
|
+
import { NetworkModificationMetadata } from '../utils';
|
|
3
|
+
export declare const getBaseNetworkModificationUrl: () => string;
|
|
4
|
+
export declare const getStudyUrlWithNodeUuid: (studyUuid: string | null | undefined, nodeUuid: string | undefined) => string;
|
|
2
5
|
export declare function fetchNetworkModification(modificationUuid: UUID): Promise<Response>;
|
|
3
6
|
export declare function fetchBusBarSectionsForNewCoupler(voltageLevelId: string, busBarCount: number, sectionCount: number, switchKindList: string[]): Promise<string[]>;
|
|
4
7
|
export declare function updateModification({ modificationUuid, body }: {
|
|
5
8
|
modificationUuid: UUID;
|
|
6
9
|
body: string;
|
|
7
10
|
}): Promise<string>;
|
|
11
|
+
export declare function getNetworkModificationsFromComposite(compositeModificationUuids: string[], onlyMetadata?: boolean): Promise<Record<UUID, NetworkModificationMetadata[]>>;
|
|
12
|
+
/**
|
|
13
|
+
* Move a composite sub-modification within or between composites, or between a composite and the group root.
|
|
14
|
+
*
|
|
15
|
+
* The four scenarios are encoded by the nullable sourceCompositeUuid / targetCompositeUuid:
|
|
16
|
+
* - both present → sub-to-sub (same composite = reorder, different = cross-composite move)
|
|
17
|
+
* - source only → extract from composite to root level
|
|
18
|
+
* - target only → embed root-level modification into a composite
|
|
19
|
+
*
|
|
20
|
+
* @param studyUuid
|
|
21
|
+
* @param nodeUuid
|
|
22
|
+
* @param modificationUuid
|
|
23
|
+
* @param sourceCompositeUuid UUID of the composite that currently owns the modification; null if at root
|
|
24
|
+
* @param targetCompositeUuid UUID of the target composite; null to place at root level
|
|
25
|
+
* @param beforeUuid insert before this UUID in the target collection; null to append at end
|
|
26
|
+
*/
|
|
27
|
+
export declare function changeCompositeSubModificationOrder(studyUuid: UUID | null, nodeUuid: UUID | undefined, modificationUuid: UUID, sourceCompositeUuid: UUID | null, targetCompositeUuid: UUID | null, beforeUuid: UUID | null): Promise<Response>;
|
|
28
|
+
export declare function changeNetworkModificationOrder(studyUuid: UUID | null, nodeUuid: UUID | undefined, itemUuid: UUID, beforeUuid: UUID | null): Promise<Response>;
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import { safeEncodeURIComponent, backendFetch, backendFetchJson, backendFetchText } from "./utils.js";
|
|
2
|
+
import { PREFIX_STUDY_QUERIES } from "./loadflow.js";
|
|
2
3
|
const PREFIX_NETWORK_MODIFICATION_QUERIES = `${"api/gateway"}/network-modification`;
|
|
4
|
+
const getBaseNetworkModificationUrl = () => `${PREFIX_NETWORK_MODIFICATION_QUERIES}/v1`;
|
|
5
|
+
const getStudyUrlWithNodeUuid = (studyUuid, nodeUuid) => `${PREFIX_STUDY_QUERIES}/v1/studies/${safeEncodeURIComponent(studyUuid)}/nodes/${safeEncodeURIComponent(nodeUuid)}`;
|
|
3
6
|
function getUrl() {
|
|
4
7
|
return `${PREFIX_NETWORK_MODIFICATION_QUERIES}/v1/network-modifications`;
|
|
5
8
|
}
|
|
@@ -33,8 +36,39 @@ function updateModification({ modificationUuid, body }) {
|
|
|
33
36
|
body
|
|
34
37
|
});
|
|
35
38
|
}
|
|
39
|
+
function getNetworkModificationsFromComposite(compositeModificationUuids, onlyMetadata = true) {
|
|
40
|
+
const urlSearchParams = new URLSearchParams();
|
|
41
|
+
compositeModificationUuids.forEach((uuid) => urlSearchParams.append("uuids", uuid));
|
|
42
|
+
urlSearchParams.append("onlyMetadata", String(onlyMetadata));
|
|
43
|
+
const url = `${getBaseNetworkModificationUrl()}/network-composite-modifications/network-modifications?${urlSearchParams.toString()}`;
|
|
44
|
+
console.debug(url);
|
|
45
|
+
return backendFetchJson(url);
|
|
46
|
+
}
|
|
47
|
+
function changeCompositeSubModificationOrder(studyUuid, nodeUuid, modificationUuid, sourceCompositeUuid, targetCompositeUuid, beforeUuid) {
|
|
48
|
+
console.info(`move composite sub-modification ${modificationUuid} in node ${nodeUuid}`);
|
|
49
|
+
const params = new URLSearchParams();
|
|
50
|
+
if (sourceCompositeUuid) params.set("sourceCompositeUuid", sourceCompositeUuid);
|
|
51
|
+
if (targetCompositeUuid) params.set("targetCompositeUuid", targetCompositeUuid);
|
|
52
|
+
if (beforeUuid) params.set("beforeUuid", beforeUuid);
|
|
53
|
+
const paramsStr = params.toString() ? `?${params.toString()}` : ``;
|
|
54
|
+
const url = `${getStudyUrlWithNodeUuid(studyUuid, nodeUuid)}/composite-sub-modification/${modificationUuid}${paramsStr}`;
|
|
55
|
+
console.debug(url);
|
|
56
|
+
return backendFetch(url, { method: "put" });
|
|
57
|
+
}
|
|
58
|
+
function changeNetworkModificationOrder(studyUuid, nodeUuid, itemUuid, beforeUuid) {
|
|
59
|
+
console.info(`reorder node ${nodeUuid} of study ${studyUuid}`);
|
|
60
|
+
const beforeParam = new URLSearchParams({ beforeUuid: beforeUuid || "" }).toString();
|
|
61
|
+
const url = `${getStudyUrlWithNodeUuid(studyUuid, nodeUuid)}/network-modification/${itemUuid}?${beforeParam}`;
|
|
62
|
+
console.debug(url);
|
|
63
|
+
return backendFetch(url, { method: "put" });
|
|
64
|
+
}
|
|
36
65
|
export {
|
|
66
|
+
changeCompositeSubModificationOrder,
|
|
67
|
+
changeNetworkModificationOrder,
|
|
37
68
|
fetchBusBarSectionsForNewCoupler,
|
|
38
69
|
fetchNetworkModification,
|
|
70
|
+
getBaseNetworkModificationUrl,
|
|
71
|
+
getNetworkModificationsFromComposite,
|
|
72
|
+
getStudyUrlWithNodeUuid,
|
|
39
73
|
updateModification
|
|
40
74
|
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { UUID } from 'node:crypto';
|
|
2
|
+
import { ModificationType } from './modificationType';
|
|
3
|
+
export interface NetworkModificationMetadata {
|
|
4
|
+
uuid: UUID;
|
|
5
|
+
type: ModificationType;
|
|
6
|
+
date: Date;
|
|
7
|
+
stashed: boolean;
|
|
8
|
+
activated: boolean;
|
|
9
|
+
description: string;
|
|
10
|
+
messageType: string;
|
|
11
|
+
messageValues: string;
|
|
12
|
+
}
|
|
13
|
+
export interface ComposedModificationMetadata extends NetworkModificationMetadata {
|
|
14
|
+
subModifications: ComposedModificationMetadata[];
|
|
15
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -1,9 +1,4 @@
|
|
|
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
|
-
*/
|
|
1
|
+
import { UUID } from 'node:crypto';
|
|
7
2
|
export declare enum OperationType {
|
|
8
3
|
SET = "SET",
|
|
9
4
|
UNSET = "UNSET"
|
|
@@ -12,3 +7,7 @@ export type AttributeModification<T> = {
|
|
|
12
7
|
value?: T;
|
|
13
8
|
op: OperationType;
|
|
14
9
|
};
|
|
10
|
+
export interface ExcludedNetworkModifications {
|
|
11
|
+
rootNetworkUuid: UUID;
|
|
12
|
+
modificationUuidsToExclude: UUID[];
|
|
13
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gridsuite/commons-ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.196.0",
|
|
4
4
|
"description": "common react components for gridsuite applications",
|
|
5
5
|
"author": "gridsuite team",
|
|
6
6
|
"homepage": "https://github.com/gridsuite",
|
|
@@ -57,6 +57,8 @@
|
|
|
57
57
|
"react-window": "^2.2.1",
|
|
58
58
|
"reconnecting-websocket": "^4.4.0",
|
|
59
59
|
"type-fest": "^4.41.0",
|
|
60
|
+
"@tanstack/react-table": "^8.21.3",
|
|
61
|
+
"@tanstack/react-virtual": "^3.13.18",
|
|
60
62
|
"uuid": "^13.0.0"
|
|
61
63
|
},
|
|
62
64
|
"peerDependencies": {
|