@gridsuite/commons-ui 0.222.0 → 0.224.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 (77) hide show
  1. package/dist/components/ui/directoryItemSelector/DirectoryItemSelector.d.ts +2 -1
  2. package/dist/components/ui/directoryItemSelector/DirectoryItemSelector.js +3 -1
  3. package/dist/components/ui/directoryItemSelector/utils.js +1 -1
  4. package/dist/components/ui/reactHookForm/DirectoryItemsInput.js +1 -1
  5. package/dist/components/ui/treeViewFinder/TreeViewFinder.d.ts +2 -0
  6. package/dist/components/ui/treeViewFinder/TreeViewFinder.js +53 -45
  7. package/dist/features/index.js +9 -1
  8. package/dist/features/network-modification-table/index.js +2 -1
  9. package/dist/features/network-modification-table/network-modifications-table.d.ts +4 -2
  10. package/dist/features/network-modification-table/network-modifications-table.js +54 -6
  11. package/dist/features/network-modification-table/renderers/cell-renderers.d.ts +1 -1
  12. package/dist/features/network-modification-table/renderers/cell-renderers.js +2 -2
  13. package/dist/features/network-modification-table/renderers/name-cell.d.ts +3 -2
  14. package/dist/features/network-modification-table/renderers/name-cell.js +24 -15
  15. package/dist/features/network-modification-table/utils.d.ts +1 -0
  16. package/dist/features/network-modification-table/utils.js +11 -0
  17. package/dist/features/network-modifications/common/reactiveLimits/reactiveCapabilityCurve/reactiveCapability.utils.d.ts +3 -2
  18. package/dist/features/network-modifications/common/reactiveLimits/reactiveCapabilityCurve/reactiveCapability.utils.js +29 -7
  19. package/dist/features/network-modifications/common/regulatingTerminal/RegulatingTerminalForm.js +1 -1
  20. package/dist/features/network-modifications/common/regulatingTerminal/regulatingTerminal.utils.d.ts +4 -4
  21. package/dist/features/network-modifications/generator/creation/GeneratorCreationForm.d.ts +8 -0
  22. package/dist/features/network-modifications/generator/creation/GeneratorCreationForm.js +192 -0
  23. package/dist/features/network-modifications/generator/creation/generatorCreation.types.d.ts +2 -3
  24. package/dist/features/network-modifications/generator/creation/generatorCreation.utils.d.ts +123 -0
  25. package/dist/features/network-modifications/generator/creation/generatorCreation.utils.js +200 -0
  26. package/dist/features/network-modifications/generator/creation/index.d.ts +2 -0
  27. package/dist/features/network-modifications/generator/creation/index.js +9 -1
  28. package/dist/features/network-modifications/generator/generatorDialog.type.d.ts +0 -3
  29. package/dist/features/network-modifications/generator/index.js +9 -1
  30. package/dist/features/network-modifications/index.js +7 -0
  31. package/dist/features/parameters/common/contingency-table/columns-definitions.d.ts +3 -3
  32. package/dist/features/parameters/common/contingency-table/columns-definitions.js +5 -5
  33. package/dist/features/parameters/common/contingency-table/contingency-table.js +1 -1
  34. package/dist/features/parameters/common/contingency-table/types.d.ts +6 -17
  35. package/dist/features/parameters/security-analysis/columns-definitions.d.ts +3 -3
  36. package/dist/features/parameters/security-analysis/columns-definitions.js +8 -8
  37. package/dist/features/parameters/security-analysis/security-analysis-parameters-inline.js +1 -1
  38. package/dist/features/parameters/security-analysis/security-analysis-parameters-selector.d.ts +1 -1
  39. package/dist/features/parameters/security-analysis/use-security-analysis-parameters-form.d.ts +1 -1
  40. package/dist/features/parameters/security-analysis/use-security-analysis-parameters-form.js +1 -1
  41. package/dist/features/parameters/sensi/constants.d.ts +0 -2
  42. package/dist/features/parameters/sensi/constants.js +0 -4
  43. package/dist/features/parameters/sensi/use-sensitivity-analysis-parameters.js +33 -32
  44. package/dist/features/parameters/sensi/utils.d.ts +31 -63
  45. package/dist/features/parameters/sensi/utils.js +49 -61
  46. package/dist/hooks/use-unique-name-validation.js +1 -1
  47. package/dist/index.js +20 -7
  48. package/dist/services/directory.d.ts +1 -1
  49. package/dist/services/index.js +6 -3
  50. package/dist/services/pcc-min.d.ts +2 -1
  51. package/dist/services/pcc-min.js +27 -1
  52. package/dist/services/security-analysis.d.ts +2 -1
  53. package/dist/services/security-analysis.js +33 -1
  54. package/dist/services/sensitivity-analysis.d.ts +2 -1
  55. package/dist/services/sensitivity-analysis.js +87 -1
  56. package/dist/translations/en/networkModificationsEn.d.ts +7 -0
  57. package/dist/translations/en/networkModificationsEn.js +7 -0
  58. package/dist/translations/fr/networkModificationsFr.d.ts +7 -0
  59. package/dist/translations/fr/networkModificationsFr.js +7 -0
  60. package/dist/utils/constants/filterConstant.d.ts +1 -1
  61. package/dist/utils/index.js +7 -5
  62. package/dist/utils/types/dynamic-security-analysis.type.d.ts +3 -5
  63. package/dist/utils/types/equipmentType.d.ts +20 -0
  64. package/dist/utils/types/equipmentType.js +13 -0
  65. package/dist/utils/types/index.d.ts +1 -0
  66. package/dist/utils/types/index.js +7 -5
  67. package/dist/utils/types/parameters.type.d.ts +1 -1
  68. package/dist/utils/types/pcc-min.type.d.ts +0 -1
  69. package/dist/utils/types/pcc-min.type.js +0 -21
  70. package/dist/utils/types/security-analysis.type.d.ts +26 -0
  71. package/dist/utils/types/security-analysis.type.js +14 -0
  72. package/dist/utils/types/sensitivity-analysis.type.d.ts +3 -7
  73. package/dist/utils/types/sensitivity-analysis.type.js +17 -103
  74. package/dist/utils/types/types.d.ts +7 -0
  75. package/package.json +1 -1
  76. package/dist/features/parameters/security-analysis/types.d.ts +0 -20
  77. package/dist/features/parameters/security-analysis/types.js +0 -42
@@ -67,6 +67,7 @@ export declare const networkModificationsFr: {
67
67
  'network_modifications.CREATE_VOLTAGE_LEVEL_SECTION': string;
68
68
  'network_modifications.MOVE_VOLTAGE_LEVEL_FEEDER_BAYS': string;
69
69
  ModificationReadError: string;
70
+ CompositeModification: string;
70
71
  CreateSubstation: string;
71
72
  DeleteEquipmentByFilter: string;
72
73
  ModifyByAssignment: string;
@@ -261,6 +262,12 @@ export declare const networkModificationsFr: {
261
262
  QminPmin: string;
262
263
  QmaxPmin: string;
263
264
  Pmax: string;
265
+ CreateGenerator: string;
266
+ GeneratorCreationError: string;
267
+ VoltageRegulationText: string;
268
+ GenerationDispatch: string;
269
+ generatorMinimumActivePowerMaxValueError: string;
270
+ PlannedActivePowerSetPointMustBeBetweenMinAndMaxActivePower: string;
264
271
  NoBusbarSectionFound: string;
265
272
  SubstationTab: string;
266
273
  ConnectivityTab: string;
@@ -72,6 +72,7 @@ const networkModificationsFr = {
72
72
  "network_modifications.CREATE_VOLTAGE_LEVEL_SECTION": "Ajout de section / tronçon dans le poste {computedLabel}",
73
73
  "network_modifications.MOVE_VOLTAGE_LEVEL_FEEDER_BAYS": "Déplacements de départs dans le poste {computedLabel}",
74
74
  ModificationReadError: "Une erreur est survenue lors de la récupération de la modification",
75
+ CompositeModification: "Modification composite",
75
76
  CreateSubstation: "Créer un site",
76
77
  DeleteEquipmentByFilter: "Supprimer des ouvrages par filtre",
77
78
  ModifyByAssignment: "Modification par filtre",
@@ -266,6 +267,12 @@ const networkModificationsFr = {
266
267
  QminPmin: "QminPmin",
267
268
  QmaxPmin: "QmaxPmin",
268
269
  Pmax: "Pmax",
270
+ CreateGenerator: "Créer un groupe",
271
+ GeneratorCreationError: "Erreur lors de la création d'un groupe",
272
+ VoltageRegulationText: "Réglage de tension",
273
+ GenerationDispatch: "Démarrage de groupes",
274
+ generatorMinimumActivePowerMaxValueError: "La puissance active min doit être inférieure à la puissance active max",
275
+ PlannedActivePowerSetPointMustBeBetweenMinAndMaxActivePower: "La valeur de la puissance imposée doit être comprise entre la valeur de la puissance active min et la valeur de la puissance active max",
269
276
  NoBusbarSectionFound: "Aucun jeu de barres trouvé pour ce poste",
270
277
  // Tabs
271
278
  SubstationTab: "Site",
@@ -5,5 +5,5 @@ export declare const FILTERS = "filters";
5
5
  export declare const ID = "id";
6
6
  export type FilterIdentifier = {
7
7
  [FILTER_ID]: UUID;
8
- [FILTER_NAME]: string;
8
+ [FILTER_NAME]?: string;
9
9
  };
@@ -21,17 +21,18 @@ import { CustomError } from "./types/CustomError.js";
21
21
  import { ProblemDetailError } from "./types/ProblemDetailError.js";
22
22
  import { NetworkTimeoutError } from "./types/NetworkTimeoutError.js";
23
23
  import { ElementType } from "./types/elementType.js";
24
- import { ALL_EQUIPMENTS, BASE_EQUIPMENTS, CONNECTION_DIRECTIONS, EQUIPMENTS_WITH_ONE_NOMINAL_VOLTAGE, EQUIPMENTS_WITH_ONE_SUBSTATION, EQUIPMENTS_WITH_THREE_NOMINAL_VOLTAGES, EQUIPMENTS_WITH_TWO_NOMINAL_VOLTAGES, EQUIPMENTS_WITH_TWO_SUBSTATIONS, EquipmentType, ExtendedEquipmentType, HvdcType, LOAD_TYPES, OperatingStatus, SEARCH_EQUIPMENTS, TYPE_TAG_MAX_SIZE, UNDEFINED_CONNECTION_DIRECTION, UNDEFINED_LOAD_TYPE, VL_TAG_MAX_SIZE, equipmentStyles, getConnectionDirectionLabel, getEquipmentsInfosForSearchBar, getLoadTypeLabel } from "./types/equipmentType.js";
24
+ import { ALL_EQUIPMENTS, BASE_EQUIPMENTS, CONNECTION_DIRECTIONS, ENERGY_SOURCES, EQUIPMENTS_WITH_ONE_NOMINAL_VOLTAGE, EQUIPMENTS_WITH_ONE_SUBSTATION, EQUIPMENTS_WITH_THREE_NOMINAL_VOLTAGES, EQUIPMENTS_WITH_TWO_NOMINAL_VOLTAGES, EQUIPMENTS_WITH_TWO_SUBSTATIONS, EquipmentType, ExtendedEquipmentType, HvdcType, LOAD_TYPES, OperatingStatus, SEARCH_EQUIPMENTS, TYPE_TAG_MAX_SIZE, UNDEFINED_CONNECTION_DIRECTION, UNDEFINED_LOAD_TYPE, VL_TAG_MAX_SIZE, equipmentStyles, getConnectionDirectionLabel, getEnergySourceLabel, getEquipmentsInfosForSearchBar, getLoadTypeLabel } from "./types/equipmentType.js";
25
25
  import { Battery, BoundaryLine, BusBar, Generator, Hvdc, LCC, Line, Load, SVC, ShuntCompensator, Substation, ThreeWindingTransfo, TwoWindingTransfo, VSC, VoltageLevel, isInjection } from "./types/equipmentTypes.js";
26
26
  import { AnnouncementSeverity, ArrayAction } from "./types/types.js";
27
27
  import { MODIFICATION_TYPES, ModificationType } from "./types/modificationType.js";
28
28
  import { FieldType } from "./types/fieldType.js";
29
29
  import { ParameterType } from "./types/parameters.type.js";
30
30
  import { SolverType } from "./types/dynamic-simulation.type.js";
31
- import { DistributionType, SensitivityType, enrichSensitivityAnalysisParameters, mapSensitivityAnalysisParameters } from "./types/sensitivity-analysis.type.js";
31
+ import { mapSecurityAnalysisParameters } from "./types/security-analysis.type.js";
32
+ import { DistributionType, SensitivityType, mapSensitivityAnalysisParameters } from "./types/sensitivity-analysis.type.js";
32
33
  import { CalculationType, LoadModelsRule } from "./types/dynamic-margin-calculation.type.js";
33
34
  import { OperationType } from "./types/network-modification-types.js";
34
- import { enrichPccMinParameters, mapPccMinParameters } from "./types/pcc-min.type.js";
35
+ import { mapPccMinParameters } from "./types/pcc-min.type.js";
35
36
  import { areIdsEqual, getIdOrSelf, getIdOrValue, getLabelOrValue, getObjectId, notNull, notUndefined, parseIntData, removeNullFields, richTypeEquals, sanitizeString } from "./ts-utils.js";
36
37
  import { toNumber, validateValueIsANumber } from "./validation-functions.js";
37
38
  import { NO_ITEM_SELECTION_FOR_COPY } from "./directory-utils.js";
@@ -55,6 +56,7 @@ export {
55
56
  DEGREE,
56
57
  DUPLICATED_PROPS_ERROR,
57
58
  DistributionType,
59
+ ENERGY_SOURCES,
58
60
  EQUIPMENTS_WITH_ONE_NOMINAL_VOLTAGE,
59
61
  EQUIPMENTS_WITH_ONE_SUBSTATION,
60
62
  EQUIPMENTS_WITH_THREE_NOMINAL_VOLTAGES,
@@ -147,13 +149,12 @@ export {
147
149
  convertInputValue,
148
150
  convertOutputValue,
149
151
  copyToClipboard,
150
- enrichPccMinParameters,
151
- enrichSensitivityAnalysisParameters,
152
152
  equalsArray,
153
153
  equipmentStyles,
154
154
  equipmentTypesForPredefinedPropertiesMapper,
155
155
  extractErrorMessageDescriptor,
156
156
  getConnectionDirectionLabel,
157
+ getEnergySourceLabel,
157
158
  getEquipmentTypeShortLabel,
158
159
  getEquipmentsInfosForSearchBar,
159
160
  getFileIcon,
@@ -170,6 +171,7 @@ export {
170
171
  kiloUnitToUnit,
171
172
  makeComposeClasses,
172
173
  mapPccMinParameters,
174
+ mapSecurityAnalysisParameters,
173
175
  mapSensitivityAnalysisParameters,
174
176
  mergeSx,
175
177
  microUnitToUnit,
@@ -1,13 +1,11 @@
1
1
  import { UUID } from 'node:crypto';
2
+ import { IdName } from './types';
2
3
  export type DynamicSecurityAnalysisParametersInfos = {
3
4
  provider?: string;
4
5
  scenarioDuration?: number;
5
6
  contingenciesStartTime?: number;
6
7
  contingencyListIds?: UUID[];
7
8
  };
8
- export type DynamicSecurityAnalysisParametersFetchReturn = Exclude<DynamicSecurityAnalysisParametersInfos, 'contingencyListIds'> & {
9
- contingencyListInfos?: {
10
- id: string;
11
- name: string;
12
- }[];
9
+ export type DynamicSecurityAnalysisParametersFetchReturn = Omit<DynamicSecurityAnalysisParametersInfos, 'contingencyListIds'> & {
10
+ contingencyListInfos?: IdName[];
13
11
  };
@@ -72,6 +72,26 @@ export declare enum HvdcType {
72
72
  LCC = "LCC",
73
73
  VSC = "VSC"
74
74
  }
75
+ export declare const ENERGY_SOURCES: readonly [{
76
+ readonly id: "HYDRO";
77
+ readonly label: "Hydro";
78
+ }, {
79
+ readonly id: "NUCLEAR";
80
+ readonly label: "Nuclear";
81
+ }, {
82
+ readonly id: "WIND";
83
+ readonly label: "Wind";
84
+ }, {
85
+ readonly id: "THERMAL";
86
+ readonly label: "Thermal";
87
+ }, {
88
+ readonly id: "SOLAR";
89
+ readonly label: "Solar";
90
+ }, {
91
+ readonly id: "OTHER";
92
+ readonly label: "Other";
93
+ }];
94
+ export declare function getEnergySourceLabel(energySourceId?: string): "Hydro" | "Nuclear" | "Wind" | "Thermal" | "Solar" | "Other" | undefined;
75
95
  export declare const LOAD_TYPES: {
76
96
  id: string;
77
97
  label: string;
@@ -110,6 +110,17 @@ var HvdcType = /* @__PURE__ */ ((HvdcType2) => {
110
110
  HvdcType2["VSC"] = "VSC";
111
111
  return HvdcType2;
112
112
  })(HvdcType || {});
113
+ const ENERGY_SOURCES = [
114
+ { id: "HYDRO", label: "Hydro" },
115
+ { id: "NUCLEAR", label: "Nuclear" },
116
+ { id: "WIND", label: "Wind" },
117
+ { id: "THERMAL", label: "Thermal" },
118
+ { id: "SOLAR", label: "Solar" },
119
+ { id: "OTHER", label: "Other" }
120
+ ];
121
+ function getEnergySourceLabel(energySourceId) {
122
+ return ENERGY_SOURCES.find(({ id }) => id === energySourceId)?.label;
123
+ }
113
124
  const LOAD_TYPES = [
114
125
  { id: "AUXILIARY", label: "Auxiliary" },
115
126
  { id: "FICTITIOUS", label: "Fictitious" }
@@ -443,6 +454,7 @@ export {
443
454
  ALL_EQUIPMENTS,
444
455
  BASE_EQUIPMENTS,
445
456
  CONNECTION_DIRECTIONS,
457
+ ENERGY_SOURCES,
446
458
  EQUIPMENTS_WITH_ONE_NOMINAL_VOLTAGE,
447
459
  EQUIPMENTS_WITH_ONE_SUBSTATION,
448
460
  EQUIPMENTS_WITH_THREE_NOMINAL_VOLTAGES,
@@ -460,6 +472,7 @@ export {
460
472
  VL_TAG_MAX_SIZE,
461
473
  equipmentStyles,
462
474
  getConnectionDirectionLabel,
475
+ getEnergySourceLabel,
463
476
  getEquipmentsInfosForSearchBar,
464
477
  getLoadTypeLabel
465
478
  };
@@ -18,6 +18,7 @@ export * from './parameters.type';
18
18
  export * from './dynamic-security-analysis.type';
19
19
  export * from './dynamic-simulation.type';
20
20
  export * from './loadflow.type';
21
+ export * from './security-analysis.type';
21
22
  export * from './sensitivity-analysis.type';
22
23
  export * from './dynamic-margin-calculation.type';
23
24
  export * from './network-modification-types';
@@ -2,17 +2,18 @@ import { CustomError } from "./CustomError.js";
2
2
  import { ProblemDetailError } from "./ProblemDetailError.js";
3
3
  import { NetworkTimeoutError } from "./NetworkTimeoutError.js";
4
4
  import { ElementType } from "./elementType.js";
5
- import { ALL_EQUIPMENTS, BASE_EQUIPMENTS, CONNECTION_DIRECTIONS, EQUIPMENTS_WITH_ONE_NOMINAL_VOLTAGE, EQUIPMENTS_WITH_ONE_SUBSTATION, EQUIPMENTS_WITH_THREE_NOMINAL_VOLTAGES, EQUIPMENTS_WITH_TWO_NOMINAL_VOLTAGES, EQUIPMENTS_WITH_TWO_SUBSTATIONS, EquipmentType, ExtendedEquipmentType, HvdcType, LOAD_TYPES, OperatingStatus, SEARCH_EQUIPMENTS, TYPE_TAG_MAX_SIZE, UNDEFINED_CONNECTION_DIRECTION, UNDEFINED_LOAD_TYPE, VL_TAG_MAX_SIZE, equipmentStyles, getConnectionDirectionLabel, getEquipmentsInfosForSearchBar, getLoadTypeLabel } from "./equipmentType.js";
5
+ import { ALL_EQUIPMENTS, BASE_EQUIPMENTS, CONNECTION_DIRECTIONS, ENERGY_SOURCES, EQUIPMENTS_WITH_ONE_NOMINAL_VOLTAGE, EQUIPMENTS_WITH_ONE_SUBSTATION, EQUIPMENTS_WITH_THREE_NOMINAL_VOLTAGES, EQUIPMENTS_WITH_TWO_NOMINAL_VOLTAGES, EQUIPMENTS_WITH_TWO_SUBSTATIONS, EquipmentType, ExtendedEquipmentType, HvdcType, LOAD_TYPES, OperatingStatus, SEARCH_EQUIPMENTS, TYPE_TAG_MAX_SIZE, UNDEFINED_CONNECTION_DIRECTION, UNDEFINED_LOAD_TYPE, VL_TAG_MAX_SIZE, equipmentStyles, getConnectionDirectionLabel, getEnergySourceLabel, getEquipmentsInfosForSearchBar, getLoadTypeLabel } from "./equipmentType.js";
6
6
  import { Battery, BoundaryLine, BusBar, Generator, Hvdc, LCC, Line, Load, SVC, ShuntCompensator, Substation, ThreeWindingTransfo, TwoWindingTransfo, VSC, VoltageLevel, isInjection } from "./equipmentTypes.js";
7
7
  import { AnnouncementSeverity, ArrayAction } from "./types.js";
8
8
  import { MODIFICATION_TYPES, ModificationType } from "./modificationType.js";
9
9
  import { FieldType } from "./fieldType.js";
10
10
  import { ParameterType } from "./parameters.type.js";
11
11
  import { SolverType } from "./dynamic-simulation.type.js";
12
- import { DistributionType, SensitivityType, enrichSensitivityAnalysisParameters, mapSensitivityAnalysisParameters } from "./sensitivity-analysis.type.js";
12
+ import { mapSecurityAnalysisParameters } from "./security-analysis.type.js";
13
+ import { DistributionType, SensitivityType, mapSensitivityAnalysisParameters } from "./sensitivity-analysis.type.js";
13
14
  import { CalculationType, LoadModelsRule } from "./dynamic-margin-calculation.type.js";
14
15
  import { OperationType } from "./network-modification-types.js";
15
- import { enrichPccMinParameters, mapPccMinParameters } from "./pcc-min.type.js";
16
+ import { mapPccMinParameters } from "./pcc-min.type.js";
16
17
  export {
17
18
  ALL_EQUIPMENTS,
18
19
  AnnouncementSeverity,
@@ -25,6 +26,7 @@ export {
25
26
  CalculationType,
26
27
  CustomError,
27
28
  DistributionType,
29
+ ENERGY_SOURCES,
28
30
  EQUIPMENTS_WITH_ONE_NOMINAL_VOLTAGE,
29
31
  EQUIPMENTS_WITH_ONE_SUBSTATION,
30
32
  EQUIPMENTS_WITH_THREE_NOMINAL_VOLTAGES,
@@ -63,13 +65,13 @@ export {
63
65
  VL_TAG_MAX_SIZE,
64
66
  VSC,
65
67
  VoltageLevel,
66
- enrichPccMinParameters,
67
- enrichSensitivityAnalysisParameters,
68
68
  equipmentStyles,
69
69
  getConnectionDirectionLabel,
70
+ getEnergySourceLabel,
70
71
  getEquipmentsInfosForSearchBar,
71
72
  getLoadTypeLabel,
72
73
  isInjection,
73
74
  mapPccMinParameters,
75
+ mapSecurityAnalysisParameters,
74
76
  mapSensitivityAnalysisParameters
75
77
  };
@@ -6,7 +6,7 @@ import { ILimitReductionsByVoltageLevel } from '../../features/parameters/common
6
6
  import { DynamicSimulationParametersInfos } from './dynamic-simulation.type';
7
7
  import { SensitivityAnalysisParametersInfosEnriched } from './sensitivity-analysis.type';
8
8
  import { ShortCircuitParametersInfos } from '../../features/parameters/short-circuit/short-circuit-parameters.type';
9
- import { SAParametersEnriched } from '../../features/parameters/security-analysis/types';
9
+ import { SAParametersEnriched } from './security-analysis.type';
10
10
  import { DynamicMarginCalculationParametersInfos } from './dynamic-margin-calculation.type';
11
11
  export declare enum ParameterType {
12
12
  BOOLEAN = "BOOLEAN",
@@ -7,4 +7,3 @@ export type PccMinParameters = {
7
7
  [FILTERS]: UUID[];
8
8
  };
9
9
  export declare function mapPccMinParameters(parametersInfos: PccMinParametersEnriched): PccMinParameters;
10
- export declare function enrichPccMinParameters(parameters: PccMinParameters): Promise<PccMinParametersEnriched>;
@@ -1,4 +1,3 @@
1
- import { fetchElementNames } from "../../services/directory.js";
2
1
  import { FILTERS } from "../constants/filterConstant.js";
3
2
  function mapPccMinParameters(parametersInfos) {
4
3
  return {
@@ -6,26 +5,6 @@ function mapPccMinParameters(parametersInfos) {
6
5
  [FILTERS]: parametersInfos.filters?.map((filter) => filter.filterId)
7
6
  };
8
7
  }
9
- function getFilterIdentifierIds(params) {
10
- return new Set(params[FILTERS]);
11
- }
12
- function enrichPccMinParameters(parameters) {
13
- const allElementIds = getFilterIdentifierIds(parameters);
14
- const elementNamesPromise = allElementIds.size === 0 ? Promise.resolve(null) : fetchElementNames(allElementIds);
15
- return elementNamesPromise.then((elementNames) => {
16
- const mapIdsToFilterIdentifiers = (ids) => {
17
- return ids ? ids.map((id) => ({
18
- filterId: id,
19
- filterName: elementNames?.[id] ?? null
20
- })) : [];
21
- };
22
- return {
23
- ...parameters,
24
- [FILTERS]: mapIdsToFilterIdentifiers(parameters[FILTERS])
25
- };
26
- });
27
- }
28
8
  export {
29
- enrichPccMinParameters,
30
9
  mapPccMinParameters
31
10
  };
@@ -0,0 +1,26 @@
1
+ import { UUID } from 'node:crypto';
2
+ import { ILimitReductionsByVoltageLevel } from '../../features/parameters/common/limitreductions/columns-definitions';
3
+ import { IdName } from './types';
4
+ export type ContingencyListsInfos = {
5
+ contingencyLists: UUID[];
6
+ description: string;
7
+ activated: boolean;
8
+ };
9
+ export type ContingencyListsInfosEnriched = Omit<ContingencyListsInfos, 'contingencyLists'> & {
10
+ contingencyLists: IdName[];
11
+ };
12
+ export type SAParameters = {
13
+ uuid?: UUID;
14
+ provider: string;
15
+ contingencyListsInfos: ContingencyListsInfos[];
16
+ limitReductions: ILimitReductionsByVoltageLevel[];
17
+ flowProportionalThreshold: number;
18
+ lowVoltageProportionalThreshold: number;
19
+ lowVoltageAbsoluteThreshold: number;
20
+ highVoltageProportionalThreshold: number;
21
+ highVoltageAbsoluteThreshold: number;
22
+ };
23
+ export type SAParametersEnriched = Omit<SAParameters, 'contingencyListsInfos'> & {
24
+ contingencyListsInfos: ContingencyListsInfosEnriched[];
25
+ };
26
+ export declare function mapSecurityAnalysisParameters(parameters: SAParametersEnriched): SAParameters;
@@ -0,0 +1,14 @@
1
+ function mapSecurityAnalysisParameters(parameters) {
2
+ return {
3
+ ...parameters,
4
+ contingencyListsInfos: parameters.contingencyListsInfos?.map((clInfos) => {
5
+ return {
6
+ ...clInfos,
7
+ contingencyLists: clInfos.contingencyLists.map((c) => c.id)
8
+ };
9
+ })
10
+ };
11
+ }
12
+ export {
13
+ mapSecurityAnalysisParameters
14
+ };
@@ -1,4 +1,5 @@
1
1
  import { UUID } from 'node:crypto';
2
+ import { IdName } from './types';
2
3
  export declare enum DistributionType {
3
4
  PROPORTIONAL = "PROPORTIONAL",
4
5
  PROPORTIONAL_MAXP = "PROPORTIONAL_MAXP",
@@ -9,11 +10,7 @@ export declare enum SensitivityType {
9
10
  DELTA_MW = "DELTA_MW",
10
11
  DELTA_A = "DELTA_A"
11
12
  }
12
- interface EquipmentsContainer {
13
- containerId: string;
14
- containerName: string;
15
- }
16
- type EquipmentsInfos = EquipmentsContainer | UUID;
13
+ type EquipmentsInfos = IdName | UUID;
17
14
  interface SensitivityParamsCommon<T extends EquipmentsInfos> {
18
15
  contingencies?: T[];
19
16
  activated?: boolean | null;
@@ -55,7 +52,7 @@ export interface SensitivityAnalysisParameters<T extends EquipmentsInfos> {
55
52
  sensitivityPST?: SensitivityPST<T>[];
56
53
  sensitivityNodes?: SensitivityNodes<T>[];
57
54
  }
58
- export type SensitivityAnalysisParametersInfosEnriched = SensitivityAnalysisParameters<EquipmentsContainer>;
55
+ export type SensitivityAnalysisParametersInfosEnriched = SensitivityAnalysisParameters<IdName>;
59
56
  export type SensitivityAnalysisParametersInfos = SensitivityAnalysisParameters<UUID>;
60
57
  export interface FactorsCount {
61
58
  resultCount: number | null;
@@ -99,5 +96,4 @@ export type SensitivityResultFilterOptions = {
99
96
  allVariableIds?: string[];
100
97
  };
101
98
  export declare function mapSensitivityAnalysisParameters(parameters: SensitivityAnalysisParametersInfosEnriched): SensitivityAnalysisParametersInfos;
102
- export declare function enrichSensitivityAnalysisParameters(parameters: SensitivityAnalysisParametersInfos): Promise<SensitivityAnalysisParametersInfosEnriched>;
103
99
  export {};
@@ -1,4 +1,3 @@
1
- import { fetchElementNames } from "../../services/directory.js";
2
1
  var DistributionType = /* @__PURE__ */ ((DistributionType2) => {
3
2
  DistributionType2["PROPORTIONAL"] = "PROPORTIONAL";
4
3
  DistributionType2["PROPORTIONAL_MAXP"] = "PROPORTIONAL_MAXP";
@@ -12,140 +11,55 @@ var SensitivityType = /* @__PURE__ */ ((SensitivityType2) => {
12
11
  return SensitivityType2;
13
12
  })(SensitivityType || {});
14
13
  function mapSensitivityAnalysisParameters(parameters) {
15
- const mapEquipmentsContainerToIds = (containers) => {
16
- return containers ? containers.map((c) => c.containerId) : [];
14
+ const mapIdNamesToIds = (objects) => {
15
+ return objects?.map((c) => c.id) ?? [];
17
16
  };
18
17
  return {
19
18
  ...parameters,
20
19
  sensitivityInjectionsSet: parameters.sensitivityInjectionsSet?.map((injectionsSet) => {
21
20
  return {
22
21
  ...injectionsSet,
23
- monitoredBranches: mapEquipmentsContainerToIds(injectionsSet.monitoredBranches),
24
- injections: mapEquipmentsContainerToIds(injectionsSet.injections),
25
- contingencies: mapEquipmentsContainerToIds(injectionsSet.contingencies)
22
+ monitoredBranches: mapIdNamesToIds(injectionsSet.monitoredBranches),
23
+ injections: mapIdNamesToIds(injectionsSet.injections),
24
+ contingencies: mapIdNamesToIds(injectionsSet.contingencies)
26
25
  };
27
26
  }),
28
27
  sensitivityInjection: parameters.sensitivityInjection?.map((injection) => {
29
28
  return {
30
29
  ...injection,
31
- monitoredBranches: mapEquipmentsContainerToIds(injection.monitoredBranches),
32
- injections: mapEquipmentsContainerToIds(injection.injections),
33
- contingencies: mapEquipmentsContainerToIds(injection.contingencies)
30
+ monitoredBranches: mapIdNamesToIds(injection.monitoredBranches),
31
+ injections: mapIdNamesToIds(injection.injections),
32
+ contingencies: mapIdNamesToIds(injection.contingencies)
34
33
  };
35
34
  }),
36
35
  sensitivityHVDC: parameters.sensitivityHVDC?.map((hvdc) => {
37
36
  return {
38
37
  ...hvdc,
39
- monitoredBranches: mapEquipmentsContainerToIds(hvdc.monitoredBranches),
40
- hvdcs: mapEquipmentsContainerToIds(hvdc.hvdcs),
41
- contingencies: mapEquipmentsContainerToIds(hvdc.contingencies)
38
+ monitoredBranches: mapIdNamesToIds(hvdc.monitoredBranches),
39
+ hvdcs: mapIdNamesToIds(hvdc.hvdcs),
40
+ contingencies: mapIdNamesToIds(hvdc.contingencies)
42
41
  };
43
42
  }),
44
43
  sensitivityPST: parameters.sensitivityPST?.map((pst) => {
45
44
  return {
46
45
  ...pst,
47
- monitoredBranches: mapEquipmentsContainerToIds(pst.monitoredBranches),
48
- psts: mapEquipmentsContainerToIds(pst.psts),
49
- contingencies: mapEquipmentsContainerToIds(pst.contingencies)
46
+ monitoredBranches: mapIdNamesToIds(pst.monitoredBranches),
47
+ psts: mapIdNamesToIds(pst.psts),
48
+ contingencies: mapIdNamesToIds(pst.contingencies)
50
49
  };
51
50
  }),
52
51
  sensitivityNodes: parameters.sensitivityNodes?.map((nodes) => {
53
52
  return {
54
53
  ...nodes,
55
- monitoredVoltageLevels: mapEquipmentsContainerToIds(nodes.monitoredVoltageLevels),
56
- equipmentsInVoltageRegulation: mapEquipmentsContainerToIds(nodes.equipmentsInVoltageRegulation),
57
- contingencies: mapEquipmentsContainerToIds(nodes.contingencies)
54
+ monitoredVoltageLevels: mapIdNamesToIds(nodes.monitoredVoltageLevels),
55
+ equipmentsInVoltageRegulation: mapIdNamesToIds(nodes.equipmentsInVoltageRegulation),
56
+ contingencies: mapIdNamesToIds(nodes.contingencies)
58
57
  };
59
58
  })
60
59
  };
61
60
  }
62
- function getEquipmentsContainerIds(parameters) {
63
- const allContainerIds = /* @__PURE__ */ new Set();
64
- parameters.sensitivityInjection?.forEach((i) => {
65
- i.monitoredBranches?.forEach((id) => allContainerIds.add(id));
66
- i.injections?.forEach((id) => allContainerIds.add(id));
67
- i.contingencies?.forEach((id) => allContainerIds.add(id));
68
- });
69
- parameters.sensitivityInjectionsSet?.forEach((is) => {
70
- is.monitoredBranches?.forEach((id) => allContainerIds.add(id));
71
- is.injections?.forEach((id) => allContainerIds.add(id));
72
- is.contingencies?.forEach((id) => allContainerIds.add(id));
73
- });
74
- parameters.sensitivityHVDC?.forEach((hvdc) => {
75
- hvdc.monitoredBranches?.forEach((id) => allContainerIds.add(id));
76
- hvdc.hvdcs?.forEach((id) => allContainerIds.add(id));
77
- hvdc.contingencies?.forEach((id) => allContainerIds.add(id));
78
- });
79
- parameters.sensitivityPST?.forEach((pst) => {
80
- pst.monitoredBranches?.forEach((id) => allContainerIds.add(id));
81
- pst.psts?.forEach((id) => allContainerIds.add(id));
82
- pst.contingencies?.forEach((id) => allContainerIds.add(id));
83
- });
84
- parameters.sensitivityNodes?.forEach((n) => {
85
- n.monitoredVoltageLevels?.forEach((id) => allContainerIds.add(id));
86
- n.equipmentsInVoltageRegulation?.forEach((id) => allContainerIds.add(id));
87
- n.contingencies?.forEach((id) => allContainerIds.add(id));
88
- });
89
- return allContainerIds;
90
- }
91
- function enrichSensitivityAnalysisParameters(parameters) {
92
- const allElementIds = getEquipmentsContainerIds(parameters);
93
- const elementNamesPromise = allElementIds.size === 0 ? Promise.resolve(null) : fetchElementNames(allElementIds);
94
- return elementNamesPromise.then((elementNames) => {
95
- const mapIdsToEquipmentsContainer = (ids) => {
96
- return ids ? ids.map((id) => ({
97
- containerId: id,
98
- containerName: elementNames?.[id] ?? null
99
- })) : [];
100
- };
101
- return {
102
- ...parameters,
103
- sensitivityInjectionsSet: parameters.sensitivityInjectionsSet ? parameters.sensitivityInjectionsSet.map((is) => {
104
- return {
105
- ...is,
106
- monitoredBranches: mapIdsToEquipmentsContainer(is.monitoredBranches),
107
- injections: mapIdsToEquipmentsContainer(is.injections),
108
- contingencies: mapIdsToEquipmentsContainer(is.contingencies)
109
- };
110
- }) : [],
111
- sensitivityInjection: parameters.sensitivityInjection ? parameters.sensitivityInjection.map((i) => {
112
- return {
113
- ...i,
114
- monitoredBranches: mapIdsToEquipmentsContainer(i.monitoredBranches),
115
- injections: mapIdsToEquipmentsContainer(i.injections),
116
- contingencies: mapIdsToEquipmentsContainer(i.contingencies)
117
- };
118
- }) : [],
119
- sensitivityHVDC: parameters.sensitivityHVDC ? parameters.sensitivityHVDC.map((hvdc) => {
120
- return {
121
- ...hvdc,
122
- monitoredBranches: mapIdsToEquipmentsContainer(hvdc.monitoredBranches),
123
- hvdcs: mapIdsToEquipmentsContainer(hvdc.hvdcs),
124
- contingencies: mapIdsToEquipmentsContainer(hvdc.contingencies)
125
- };
126
- }) : [],
127
- sensitivityPST: parameters.sensitivityPST ? parameters.sensitivityPST.map((pst) => {
128
- return {
129
- ...pst,
130
- monitoredBranches: mapIdsToEquipmentsContainer(pst.monitoredBranches),
131
- psts: mapIdsToEquipmentsContainer(pst.psts),
132
- contingencies: mapIdsToEquipmentsContainer(pst.contingencies)
133
- };
134
- }) : [],
135
- sensitivityNodes: parameters.sensitivityNodes ? parameters.sensitivityNodes.map((n) => {
136
- return {
137
- ...n,
138
- monitoredVoltageLevels: mapIdsToEquipmentsContainer(n.monitoredVoltageLevels),
139
- equipmentsInVoltageRegulation: mapIdsToEquipmentsContainer(n.equipmentsInVoltageRegulation),
140
- contingencies: mapIdsToEquipmentsContainer(n.contingencies)
141
- };
142
- }) : []
143
- };
144
- });
145
- }
146
61
  export {
147
62
  DistributionType,
148
63
  SensitivityType,
149
- enrichSensitivityAnalysisParameters,
150
64
  mapSensitivityAnalysisParameters
151
65
  };
@@ -77,3 +77,10 @@ export type ItemSelectionForCopy = {
77
77
  parentDirectoryUuid: UUID | null;
78
78
  specificTypeItem: string | null;
79
79
  };
80
+ /**
81
+ * A directory element uuid but enriched with the corresponding name.
82
+ */
83
+ export interface IdName {
84
+ id: UUID;
85
+ name?: string;
86
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gridsuite/commons-ui",
3
- "version": "0.222.0",
3
+ "version": "0.224.0",
4
4
  "description": "common react components for gridsuite applications",
5
5
  "author": "gridsuite team",
6
6
  "homepage": "https://github.com/gridsuite",
@@ -1,20 +0,0 @@
1
- import { UUID } from 'node:crypto';
2
- import { CONTINGENCY_LISTS_INFOS, PARAM_SA_FLOW_PROPORTIONAL_THRESHOLD, PARAM_SA_HIGH_VOLTAGE_ABSOLUTE_THRESHOLD, PARAM_SA_HIGH_VOLTAGE_PROPORTIONAL_THRESHOLD, PARAM_SA_LOW_VOLTAGE_ABSOLUTE_THRESHOLD, PARAM_SA_LOW_VOLTAGE_PROPORTIONAL_THRESHOLD, PARAM_SA_PROVIDER } from '../common/constants';
3
- import { ContingencyListsInfos, ContingencyListsInfosEnriched } from '../common/contingency-table/types';
4
- import { ILimitReductionsByVoltageLevel } from '../common/limitreductions/columns-definitions';
5
- export type SAParameters = {
6
- uuid?: UUID;
7
- [PARAM_SA_PROVIDER]: string;
8
- [CONTINGENCY_LISTS_INFOS]: ContingencyListsInfos[];
9
- limitReductions: ILimitReductionsByVoltageLevel[];
10
- [PARAM_SA_FLOW_PROPORTIONAL_THRESHOLD]: number;
11
- [PARAM_SA_LOW_VOLTAGE_PROPORTIONAL_THRESHOLD]: number;
12
- [PARAM_SA_LOW_VOLTAGE_ABSOLUTE_THRESHOLD]: number;
13
- [PARAM_SA_HIGH_VOLTAGE_PROPORTIONAL_THRESHOLD]: number;
14
- [PARAM_SA_HIGH_VOLTAGE_ABSOLUTE_THRESHOLD]: number;
15
- };
16
- export type SAParametersEnriched = Omit<SAParameters, typeof CONTINGENCY_LISTS_INFOS> & {
17
- [CONTINGENCY_LISTS_INFOS]: ContingencyListsInfosEnriched[];
18
- };
19
- export declare function mapSecurityAnalysisParameters(parameters: SAParametersEnriched): SAParameters;
20
- export declare function enrichSecurityAnalysisParameters(parameters: SAParameters): Promise<SAParametersEnriched>;
@@ -1,42 +0,0 @@
1
- import { fetchElementNames } from "../../../services/directory.js";
2
- import { NAME, ID } from "../common/parameter-table/constants.js";
3
- function mapSecurityAnalysisParameters(parameters) {
4
- return {
5
- ...parameters,
6
- contingencyListsInfos: parameters.contingencyListsInfos?.map((clInfos) => {
7
- return {
8
- ...clInfos,
9
- contingencyLists: clInfos.contingencyLists.map((c) => c.id)
10
- };
11
- })
12
- };
13
- }
14
- function getEquipmentsContainerIds(params) {
15
- const allContainerIds = params.contingencyListsInfos ? params.contingencyListsInfos.flatMap((cli) => cli.contingencyLists ?? []) : [];
16
- return new Set(allContainerIds);
17
- }
18
- function enrichSecurityAnalysisParameters(parameters) {
19
- const allElementIds = getEquipmentsContainerIds(parameters);
20
- const elementNamesPromise = allElementIds.size === 0 ? Promise.resolve(null) : fetchElementNames(allElementIds);
21
- return elementNamesPromise.then((elementNames) => {
22
- const mapIdsToIdNames = (ids) => {
23
- return ids ? ids.map((id) => ({
24
- [ID]: id,
25
- [NAME]: elementNames?.[id] ?? null
26
- })) : [];
27
- };
28
- return {
29
- ...parameters,
30
- contingencyListsInfos: parameters.contingencyListsInfos ? parameters.contingencyListsInfos.map((cli) => {
31
- return {
32
- ...cli,
33
- contingencyLists: mapIdsToIdNames(cli.contingencyLists)
34
- };
35
- }) : []
36
- };
37
- });
38
- }
39
- export {
40
- enrichSecurityAnalysisParameters,
41
- mapSecurityAnalysisParameters
42
- };