@gridsuite/commons-ui 0.279.0 → 0.280.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 (32) hide show
  1. package/dist/components/composite/customAGGrid/separatorCellRenderer.d.ts +7 -2
  2. package/dist/components/composite/customAGGrid/separatorCellRenderer.js +2 -2
  3. package/dist/features/index.js +13 -0
  4. package/dist/features/network-modifications/index.js +13 -0
  5. package/dist/features/network-modifications/voltageLevel/common/HeaderWithTooltip.d.ts +8 -0
  6. package/dist/features/network-modifications/voltageLevel/common/HeaderWithTooltip.js +119 -0
  7. package/dist/features/network-modifications/voltageLevel/common/index.d.ts +1 -0
  8. package/dist/features/network-modifications/voltageLevel/common/index.js +4 -0
  9. package/dist/features/network-modifications/voltageLevel/index.d.ts +2 -0
  10. package/dist/features/network-modifications/voltageLevel/index.js +13 -0
  11. package/dist/features/network-modifications/voltageLevel/moveFeederBays/MoveVoltageLevelFeederBaysForm.d.ts +8 -0
  12. package/dist/features/network-modifications/voltageLevel/moveFeederBays/MoveVoltageLevelFeederBaysForm.js +387 -0
  13. package/dist/features/network-modifications/voltageLevel/moveFeederBays/feederBay/FeederBayDirectionCellRender.d.ts +6 -0
  14. package/dist/features/network-modifications/voltageLevel/moveFeederBays/feederBay/FeederBayDirectionCellRender.js +64 -0
  15. package/dist/features/network-modifications/voltageLevel/moveFeederBays/feederBay/FeederBayPositionCellRender.d.ts +6 -0
  16. package/dist/features/network-modifications/voltageLevel/moveFeederBays/feederBay/FeederBayPositionCellRender.js +102 -0
  17. package/dist/features/network-modifications/voltageLevel/moveFeederBays/feederBay/index.d.ts +2 -0
  18. package/dist/features/network-modifications/voltageLevel/moveFeederBays/feederBay/index.js +6 -0
  19. package/dist/features/network-modifications/voltageLevel/moveFeederBays/index.d.ts +4 -0
  20. package/dist/features/network-modifications/voltageLevel/moveFeederBays/index.js +13 -0
  21. package/dist/features/network-modifications/voltageLevel/moveFeederBays/moveVoltageLevelFeederBays.type.d.ts +36 -0
  22. package/dist/features/network-modifications/voltageLevel/moveFeederBays/moveVoltageLevelFeederBays.type.js +1 -0
  23. package/dist/features/network-modifications/voltageLevel/moveFeederBays/moveVoltageLevelFeederBays.utils.d.ts +37 -0
  24. package/dist/features/network-modifications/voltageLevel/moveFeederBays/moveVoltageLevelFeederBays.utils.js +86 -0
  25. package/dist/index.js +13 -0
  26. package/dist/translations/en/networkModificationsEn.d.ts +12 -0
  27. package/dist/translations/en/networkModificationsEn.js +13 -1
  28. package/dist/translations/fr/networkModificationsFr.d.ts +12 -0
  29. package/dist/translations/fr/networkModificationsFr.js +13 -1
  30. package/dist/utils/constants/fieldConstants.d.ts +7 -1
  31. package/dist/utils/constants/fieldConstants.js +6 -0
  32. package/package.json +1 -1
@@ -0,0 +1,37 @@
1
+ import { InferType } from 'yup';
2
+ import { MoveVoltageLevelFeederBaysDto } from './moveVoltageLevelFeederBays.type';
3
+ import * as yup from 'yup';
4
+ export declare const emptyMoveVoltageLevelFeederBaysFormData: {
5
+ equipmentID: null;
6
+ moveVoltageLevelFeederBaysTable: {
7
+ equipmentID: null;
8
+ busbarSectionId: null;
9
+ busbarSectionIds: never[];
10
+ connectionSide: null;
11
+ connectionName: null;
12
+ connectionDirection: null;
13
+ connectionPosition: null;
14
+ isRemoved: boolean;
15
+ isSeparator: boolean;
16
+ }[];
17
+ };
18
+ export declare const moveVoltageLevelFeederBaysFormSchema: yup.ObjectSchema<{
19
+ equipmentID: string;
20
+ moveVoltageLevelFeederBaysTable: {
21
+ connectionSide?: string | null | undefined;
22
+ connectionDirection?: string | null | undefined;
23
+ connectionName?: string | null | undefined;
24
+ connectionPosition?: number | null | undefined;
25
+ equipmentID?: string | undefined;
26
+ busbarSectionId?: string | undefined;
27
+ busbarSectionIds?: (string | undefined)[] | undefined;
28
+ isRemoved?: boolean | undefined;
29
+ isSeparator?: boolean | undefined;
30
+ }[] | undefined;
31
+ }, yup.AnyObject, {
32
+ equipmentID: undefined;
33
+ moveVoltageLevelFeederBaysTable: "";
34
+ }, "">;
35
+ export type MoveVoltageLevelFeederBaysFormSchemaType = InferType<typeof moveVoltageLevelFeederBaysFormSchema>;
36
+ export declare const moveVoltageLevelFeederBaysDtoToForm: (moveVoltageLevelFeederBays: MoveVoltageLevelFeederBaysDto) => MoveVoltageLevelFeederBaysFormSchemaType;
37
+ export declare const moveVoltageLevelFeederBaysFormToDto: (moveVoltageLevelFeederBays: MoveVoltageLevelFeederBaysFormSchemaType) => MoveVoltageLevelFeederBaysDto;
@@ -0,0 +1,86 @@
1
+ import * as yup from "yup";
2
+ import { isNumber } from "mathjs";
3
+ import { FieldConstants } from "../../../../utils/constants/fieldConstants.js";
4
+ import "../../../../utils/conversionUtils.js";
5
+ import "../../../../utils/types/equipmentType.js";
6
+ import { ModificationType } from "../../../../utils/types/modificationType.js";
7
+ import "react/jsx-runtime";
8
+ import "@mui/icons-material";
9
+ const emptyMoveVoltageLevelFeederBaysFormData = {
10
+ [FieldConstants.EQUIPMENT_ID]: null,
11
+ [FieldConstants.MOVE_VOLTAGE_LEVEL_FEEDER_BAYS_TABLE]: [
12
+ {
13
+ [FieldConstants.EQUIPMENT_ID]: null,
14
+ [FieldConstants.BUSBAR_SECTION_ID]: null,
15
+ [FieldConstants.BUSBAR_SECTION_IDS]: [],
16
+ [FieldConstants.CONNECTION_SIDE]: null,
17
+ [FieldConstants.CONNECTION_NAME]: null,
18
+ [FieldConstants.CONNECTION_DIRECTION]: null,
19
+ [FieldConstants.CONNECTION_POSITION]: null,
20
+ [FieldConstants.IS_REMOVED]: false,
21
+ [FieldConstants.IS_SEPARATOR]: false
22
+ }
23
+ ]
24
+ };
25
+ function requiredWhenActive(schema) {
26
+ return schema.when(
27
+ [FieldConstants.IS_REMOVED, FieldConstants.IS_SEPARATOR],
28
+ ([isRemoved, isSeparator], baseSchema) => !isRemoved && !isSeparator ? baseSchema.nullable().required() : baseSchema.nullable()
29
+ );
30
+ }
31
+ const moveVoltageLevelFeederBaysFormSchema = yup.object().shape({
32
+ [FieldConstants.EQUIPMENT_ID]: yup.string().required(),
33
+ [FieldConstants.MOVE_VOLTAGE_LEVEL_FEEDER_BAYS_TABLE]: yup.array().of(
34
+ yup.object().shape({
35
+ [FieldConstants.EQUIPMENT_ID]: requiredWhenActive(yup.string()),
36
+ [FieldConstants.BUSBAR_SECTION_ID]: requiredWhenActive(yup.string()),
37
+ [FieldConstants.BUSBAR_SECTION_IDS]: requiredWhenActive(yup.array().of(yup.string())),
38
+ [FieldConstants.CONNECTION_SIDE]: yup.string().nullable(),
39
+ [FieldConstants.CONNECTION_NAME]: yup.string().nullable(),
40
+ [FieldConstants.CONNECTION_DIRECTION]: yup.string().nullable(),
41
+ [FieldConstants.CONNECTION_POSITION]: yup.number().nullable().positive(),
42
+ [FieldConstants.IS_REMOVED]: yup.boolean(),
43
+ [FieldConstants.IS_SEPARATOR]: yup.boolean()
44
+ })
45
+ )
46
+ });
47
+ const moveVoltageLevelFeederBaysDtoToForm = (moveVoltageLevelFeederBays) => {
48
+ const moveVoltageLevelFeederBaysTable = moveVoltageLevelFeederBays.feederBays.map((row, index) => ({
49
+ [FieldConstants.EQUIPMENT_ID]: row.equipmentId ?? "",
50
+ [FieldConstants.BUSBAR_SECTION_ID]: row.busbarSectionId ?? "",
51
+ [FieldConstants.BUSBAR_SECTION_IDS]: [],
52
+ [FieldConstants.CONNECTION_SIDE]: row.connectionSide ?? null,
53
+ [FieldConstants.CONNECTION_NAME]: row.connectionName ?? null,
54
+ [FieldConstants.CONNECTION_DIRECTION]: row.connectionDirection ?? null,
55
+ [FieldConstants.CONNECTION_POSITION]: isNumber(row.connectionPosition) ? Number.parseInt(row.connectionPosition, 10) : null,
56
+ [FieldConstants.IS_REMOVED]: false,
57
+ [FieldConstants.IS_SEPARATOR]: false,
58
+ [FieldConstants.ROW_ID]: `${row.equipmentId}-${row.connectionSide}-${index}`
59
+ }));
60
+ return {
61
+ [FieldConstants.EQUIPMENT_ID]: moveVoltageLevelFeederBays.voltageLevelId,
62
+ [FieldConstants.MOVE_VOLTAGE_LEVEL_FEEDER_BAYS_TABLE]: moveVoltageLevelFeederBaysTable
63
+ };
64
+ };
65
+ const moveVoltageLevelFeederBaysFormToDto = (moveVoltageLevelFeederBays) => {
66
+ const tableData = moveVoltageLevelFeederBays[FieldConstants.MOVE_VOLTAGE_LEVEL_FEEDER_BAYS_TABLE];
67
+ const feederBays = tableData && Array.isArray(tableData) ? tableData.filter((row) => row != null).map((row) => ({
68
+ equipmentId: row[FieldConstants.EQUIPMENT_ID] ?? "",
69
+ busbarSectionId: row[FieldConstants.BUSBAR_SECTION_ID] ?? "",
70
+ connectionSide: row[FieldConstants.CONNECTION_SIDE] ?? null,
71
+ connectionPosition: isNumber(row[FieldConstants.CONNECTION_POSITION]) ? row[FieldConstants.CONNECTION_POSITION].toString() : null,
72
+ connectionName: row[FieldConstants.CONNECTION_NAME] ?? null,
73
+ connectionDirection: row[FieldConstants.CONNECTION_DIRECTION] ?? null
74
+ })) : [];
75
+ return {
76
+ type: ModificationType.MOVE_VOLTAGE_LEVEL_FEEDER_BAYS,
77
+ voltageLevelId: moveVoltageLevelFeederBays[FieldConstants.EQUIPMENT_ID],
78
+ feederBays
79
+ };
80
+ };
81
+ export {
82
+ emptyMoveVoltageLevelFeederBaysFormData,
83
+ moveVoltageLevelFeederBaysDtoToForm,
84
+ moveVoltageLevelFeederBaysFormSchema,
85
+ moveVoltageLevelFeederBaysFormToDto
86
+ };
package/dist/index.js CHANGED
@@ -367,6 +367,11 @@ import { createVoltageLevelTopologyDtoToForm, createVoltageLevelTopologyEmptyFor
367
367
  import { CreateVoltageLevelTopologyForm } from "./features/network-modifications/voltageLevel/topology/CreateVoltageLevelTopologyForm.js";
368
368
  import { VoltageLevelSectionCreationForm } from "./features/network-modifications/voltageLevel/section/VoltageLevelSectionCreationForm.js";
369
369
  import { POSITION_NEW_SECTION_SIDE, voltageLevelSectionCreationDtoToForm, voltageLevelSectionCreationEmptyFormData, voltageLevelSectionCreationFormSchema, voltageLevelSectionCreationFormToDto } from "./features/network-modifications/voltageLevel/section/voltageLevelSectionCreation.utils.js";
370
+ import { FeederBayPositionCellRenderer } from "./features/network-modifications/voltageLevel/moveFeederBays/feederBay/FeederBayPositionCellRender.js";
371
+ import { FeederBayDirectionCellRenderer } from "./features/network-modifications/voltageLevel/moveFeederBays/feederBay/FeederBayDirectionCellRender.js";
372
+ import { emptyMoveVoltageLevelFeederBaysFormData, moveVoltageLevelFeederBaysDtoToForm, moveVoltageLevelFeederBaysFormSchema, moveVoltageLevelFeederBaysFormToDto } from "./features/network-modifications/voltageLevel/moveFeederBays/moveVoltageLevelFeederBays.utils.js";
373
+ import { MoveVoltageLevelFeederBaysForm } from "./features/network-modifications/voltageLevel/moveFeederBays/MoveVoltageLevelFeederBaysForm.js";
374
+ import { HeaderWithTooltip } from "./features/network-modifications/voltageLevel/common/HeaderWithTooltip.js";
370
375
  import { LOAD_TAB_FIELDS, LoadDialogTab } from "./features/network-modifications/load/common/load.utils.js";
371
376
  import { LoadDialogTabs } from "./features/network-modifications/load/common/LoadDialogTabs.js";
372
377
  import { LoadDialogTabsContent } from "./features/network-modifications/load/common/LoadDialogTabsContent.js";
@@ -821,6 +826,8 @@ export {
821
826
  FORMULAS,
822
827
  FROM_COLUMN_TO_FIELD,
823
828
  FROM_COLUMN_TO_FIELD_ONE_BUS,
829
+ FeederBayDirectionCellRenderer,
830
+ FeederBayPositionCellRenderer,
824
831
  FetchStatus,
825
832
  FieldConstants,
826
833
  FieldErrorAlert,
@@ -859,6 +866,7 @@ export {
859
866
  HIGH_VOLTAGE_PROPORTIONAL_THRESHOLD,
860
867
  HVDC_AC_EMULATION,
861
868
  HVDC_EQUIPMENT_TYPES,
869
+ HeaderWithTooltip,
862
870
  HelperPreviousValue,
863
871
  Hvdc,
864
872
  HvdcLccDeletionSpecificForm,
@@ -978,6 +986,7 @@ export {
978
986
  ModificationRow,
979
987
  ModificationType,
980
988
  ModifyElementSelection,
989
+ MoveVoltageLevelFeederBaysForm,
981
990
  MuiSelectInput,
982
991
  MultipleAutocompleteInput,
983
992
  MultipleSelectionDialog,
@@ -1408,6 +1417,7 @@ export {
1408
1417
  emptyLineSegment,
1409
1418
  emptyModificationByAssignmentFormData,
1410
1419
  emptyModificationFormData,
1420
+ emptyMoveVoltageLevelFeederBaysFormData,
1411
1421
  emptyProcessConfigModificationsFormData,
1412
1422
  emptyProperties,
1413
1423
  enrichPccMinParameters,
@@ -1769,6 +1779,9 @@ export {
1769
1779
  modificationPropertiesSchema,
1770
1780
  moveModification,
1771
1781
  moveSubModificationInTree,
1782
+ moveVoltageLevelFeederBaysDtoToForm,
1783
+ moveVoltageLevelFeederBaysFormSchema,
1784
+ moveVoltageLevelFeederBaysFormToDto,
1772
1785
  multipleSelectionDialogEn,
1773
1786
  multipleSelectionDialogFr,
1774
1787
  networkModificationTableStyles,
@@ -420,4 +420,16 @@ export declare const networkModificationsEn: {
420
420
  allOptionHelperText: string;
421
421
  areSwitchesOpen: string;
422
422
  areSwitchesClosed: string;
423
+ DuplicatedPositionsWarning: string;
424
+ moveFeederBaysSections: string;
425
+ MoveVoltageLevelFeederBays: string;
426
+ MoveVoltageLevelFeederBaysError: string;
427
+ Feeders: string;
428
+ equipmentID: string;
429
+ connectionDirection: string;
430
+ connectionPosition: string;
431
+ MissingConnectionsInVoltageLevel: string;
432
+ builtNodeTooltipVlTopoModif: string;
433
+ notBuiltNodeTooltipVlTopoModif: string;
434
+ Undefined: string;
423
435
  };
@@ -417,7 +417,19 @@ const networkModificationsEn = {
417
417
  allBusbarSections: "All",
418
418
  allOptionHelperText: "Busbars have different sections (number or index)",
419
419
  areSwitchesOpen: "Open",
420
- areSwitchesClosed: "Closed"
420
+ areSwitchesClosed: "Closed",
421
+ DuplicatedPositionsWarning: "Duplicated number",
422
+ moveFeederBaysSections: "Feeder bay will be connected onto the selected busbar section",
423
+ MoveVoltageLevelFeederBays: "Move connections",
424
+ MoveVoltageLevelFeederBaysError: "Error while moving feeder bays",
425
+ Feeders: "Feeder",
426
+ equipmentID: "Equipment ID",
427
+ connectionDirection: "Connection direction",
428
+ connectionPosition: "Connection position",
429
+ MissingConnectionsInVoltageLevel: "Missing connections in voltage level (Connections removed from list on validation)",
430
+ builtNodeTooltipVlTopoModif: "Switches list taking into account all applied modifications",
431
+ notBuiltNodeTooltipVlTopoModif: "Switches list from last built node in current branch",
432
+ Undefined: "Undefined"
421
433
  };
422
434
  export {
423
435
  networkModificationsEn
@@ -420,4 +420,16 @@ export declare const networkModificationsFr: {
420
420
  allOptionHelperText: string;
421
421
  areSwitchesOpen: string;
422
422
  areSwitchesClosed: string;
423
+ DuplicatedPositionsWarning: string;
424
+ moveFeederBaysSections: string;
425
+ MoveVoltageLevelFeederBays: string;
426
+ MoveVoltageLevelFeederBaysError: string;
427
+ Feeders: string;
428
+ equipmentID: string;
429
+ connectionDirection: string;
430
+ connectionPosition: string;
431
+ MissingConnectionsInVoltageLevel: string;
432
+ builtNodeTooltipVlTopoModif: string;
433
+ notBuiltNodeTooltipVlTopoModif: string;
434
+ Undefined: string;
423
435
  };
@@ -417,7 +417,19 @@ const networkModificationsFr = {
417
417
  allBusbarSections: "Tous",
418
418
  allOptionHelperText: "Tous les jeux de barres n'ont pas les mêmes sections (index et nombre)",
419
419
  areSwitchesOpen: "Ouverts",
420
- areSwitchesClosed: "Fermés"
420
+ areSwitchesClosed: "Fermés",
421
+ DuplicatedPositionsWarning: "Numéro en doublon",
422
+ moveFeederBaysSections: "Les départs déplacés sont préparés sur la section de barre sélectionnée",
423
+ MoveVoltageLevelFeederBays: "Déplacer les départs",
424
+ MoveVoltageLevelFeederBaysError: "Erreur lors du déplacement des départs",
425
+ Feeders: "Départs",
426
+ equipmentID: "ID de l'ouvrage",
427
+ connectionDirection: "Sens départ",
428
+ connectionPosition: "Position départ",
429
+ MissingConnectionsInVoltageLevel: "Départs absents du poste (Départs supprimés de la liste à la validation)",
430
+ builtNodeTooltipVlTopoModif: "Liste des organes de coupure tenant compte de toutes les modifications réalisées",
431
+ notBuiltNodeTooltipVlTopoModif: "Liste des organes de coupure d'après le dernier nœud réalisé de la branche courante",
432
+ Undefined: "Non défini"
421
433
  };
422
434
  export {
423
435
  networkModificationsFr
@@ -24,6 +24,7 @@ export declare enum FieldConstants {
24
24
  CHARACTERISTICS = "characteristics",
25
25
  CHARACTERISTICS_CHOICE = "characteristicsChoice",
26
26
  CONNECTED = "terminalConnected",
27
+ CONNECTION_SIDE = "connectionSide",
27
28
  CONNECTION_DIRECTION = "connectionDirection",
28
29
  CONNECTION_NAME = "connectionName",
29
30
  CONNECTION_POSITION = "connectionPosition",
@@ -157,6 +158,7 @@ export declare enum FieldConstants {
157
158
  BUS_BAR_SECTION_ID1 = "busbarSectionId1",
158
159
  BUS_BAR_SECTION_ID2 = "busbarSectionId2",
159
160
  BUSBAR_SECTION_ID = "busbarSectionId",
161
+ BUSBAR_SECTION_IDS = "busbarSectionIds",
160
162
  COUPLING_OMNIBUS = "couplingOmnibus",
161
163
  IS_AFTER_BUSBAR_SECTION_ID = "isAfterBusBarSectionId",
162
164
  NEW_SWITCH_STATES = "newSwitchStates",
@@ -247,5 +249,9 @@ export declare enum FieldConstants {
247
249
  SETPOINTS_LIMITS = "setpointsLimits",
248
250
  VOLTAGE_REGULATION_MODE = "voltageRegulationMode",
249
251
  B0 = "b0",
250
- Q0 = "q0"
252
+ Q0 = "q0",
253
+ MOVE_VOLTAGE_LEVEL_FEEDER_BAYS_TABLE = "moveVoltageLevelFeederBaysTable",
254
+ IS_REMOVED = "isRemoved",
255
+ IS_SEPARATOR = "isSeparator",
256
+ ROW_ID = "rowId"
251
257
  }
@@ -18,6 +18,7 @@ var FieldConstants = /* @__PURE__ */ ((FieldConstants2) => {
18
18
  FieldConstants2["CHARACTERISTICS"] = "characteristics";
19
19
  FieldConstants2["CHARACTERISTICS_CHOICE"] = "characteristicsChoice";
20
20
  FieldConstants2["CONNECTED"] = "terminalConnected";
21
+ FieldConstants2["CONNECTION_SIDE"] = "connectionSide";
21
22
  FieldConstants2["CONNECTION_DIRECTION"] = "connectionDirection";
22
23
  FieldConstants2["CONNECTION_NAME"] = "connectionName";
23
24
  FieldConstants2["CONNECTION_POSITION"] = "connectionPosition";
@@ -151,6 +152,7 @@ var FieldConstants = /* @__PURE__ */ ((FieldConstants2) => {
151
152
  FieldConstants2["BUS_BAR_SECTION_ID1"] = "busbarSectionId1";
152
153
  FieldConstants2["BUS_BAR_SECTION_ID2"] = "busbarSectionId2";
153
154
  FieldConstants2["BUSBAR_SECTION_ID"] = "busbarSectionId";
155
+ FieldConstants2["BUSBAR_SECTION_IDS"] = "busbarSectionIds";
154
156
  FieldConstants2["COUPLING_OMNIBUS"] = "couplingOmnibus";
155
157
  FieldConstants2["IS_AFTER_BUSBAR_SECTION_ID"] = "isAfterBusBarSectionId";
156
158
  FieldConstants2["NEW_SWITCH_STATES"] = "newSwitchStates";
@@ -242,6 +244,10 @@ var FieldConstants = /* @__PURE__ */ ((FieldConstants2) => {
242
244
  FieldConstants2["VOLTAGE_REGULATION_MODE"] = "voltageRegulationMode";
243
245
  FieldConstants2["B0"] = "b0";
244
246
  FieldConstants2["Q0"] = "q0";
247
+ FieldConstants2["MOVE_VOLTAGE_LEVEL_FEEDER_BAYS_TABLE"] = "moveVoltageLevelFeederBaysTable";
248
+ FieldConstants2["IS_REMOVED"] = "isRemoved";
249
+ FieldConstants2["IS_SEPARATOR"] = "isSeparator";
250
+ FieldConstants2["ROW_ID"] = "rowId";
245
251
  return FieldConstants2;
246
252
  })(FieldConstants || {});
247
253
  export {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gridsuite/commons-ui",
3
- "version": "0.279.0",
3
+ "version": "0.280.0",
4
4
  "description": "common react components for gridsuite applications",
5
5
  "author": "gridsuite team",
6
6
  "homepage": "https://github.com/gridsuite",