@gridsuite/commons-ui 0.221.1 → 0.223.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 (42) hide show
  1. package/dist/components/composite/agGridTable/CustomAgGridTable.js +9 -0
  2. package/dist/components/composite/filter/explicitNaming/ExplicitNamingFilterForm.js +0 -1
  3. package/dist/components/ui/directoryItemSelector/DirectoryItemSelector.d.ts +2 -1
  4. package/dist/components/ui/directoryItemSelector/DirectoryItemSelector.js +2 -0
  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/common/setpoints/setPoints.utils.js +1 -1
  22. package/dist/features/network-modifications/generator/creation/GeneratorCreationForm.d.ts +8 -0
  23. package/dist/features/network-modifications/generator/creation/GeneratorCreationForm.js +192 -0
  24. package/dist/features/network-modifications/generator/creation/generatorCreation.types.d.ts +2 -3
  25. package/dist/features/network-modifications/generator/creation/generatorCreation.utils.d.ts +123 -0
  26. package/dist/features/network-modifications/generator/creation/generatorCreation.utils.js +200 -0
  27. package/dist/features/network-modifications/generator/creation/index.d.ts +2 -0
  28. package/dist/features/network-modifications/generator/creation/index.js +9 -1
  29. package/dist/features/network-modifications/generator/generatorDialog.type.d.ts +0 -3
  30. package/dist/features/network-modifications/generator/index.js +9 -1
  31. package/dist/features/network-modifications/index.js +7 -0
  32. package/dist/features/parameters/short-circuit/columns-definition.js +1 -1
  33. package/dist/index.js +12 -2
  34. package/dist/translations/en/networkModificationsEn.d.ts +7 -0
  35. package/dist/translations/en/networkModificationsEn.js +7 -0
  36. package/dist/translations/fr/networkModificationsFr.d.ts +7 -0
  37. package/dist/translations/fr/networkModificationsFr.js +7 -0
  38. package/dist/utils/index.js +3 -1
  39. package/dist/utils/types/equipmentType.d.ts +20 -0
  40. package/dist/utils/types/equipmentType.js +13 -0
  41. package/dist/utils/types/index.js +3 -1
  42. package/package.json +1 -1
@@ -34,7 +34,7 @@ const getActivePowerSetPointSchema = (isEquipmentModification = false) => ({
34
34
  }).when([], {
35
35
  is: () => !isEquipmentModification,
36
36
  then: (schema) => {
37
- return schema.required().nonNullable().test(
37
+ return schema.required().test(
38
38
  "activePowerSetPoint",
39
39
  "ActivePowerMustBeZeroOrBetweenMinAndMaxActivePower",
40
40
  testValueWithinPowerIntervalOrEqualToZero
@@ -0,0 +1,8 @@
1
+ import { ConnectivityNetworkProps } from '../../common';
2
+ import { EquipmentType, Identifiable } from '../../../../utils';
3
+ export interface GeneratorCreationFormProps extends ConnectivityNetworkProps {
4
+ fetchVoltageLevelEquipments: (voltageLevelId: string) => Promise<(Identifiable & {
5
+ type: EquipmentType;
6
+ })[]>;
7
+ }
8
+ export declare function GeneratorCreationForm({ voltageLevelOptions, fetchBusesOrBusbarSections, PositionDiagramPane, fetchVoltageLevelEquipments, }: Readonly<GeneratorCreationFormProps>): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,192 @@
1
+ import { jsx, jsxs, Fragment } from "react/jsx-runtime";
2
+ import { Box, Grid } from "@mui/material";
3
+ import { FormattedMessage } from "react-intl";
4
+ import { useWatch } from "react-hook-form";
5
+ import { filledTextField, italicFontTextField } from "../../common/form.utils.js";
6
+ import { PropertiesForm } from "../../common/properties/PropertiesForm.js";
7
+ import "react";
8
+ import { ActivePowerAdornment, MVAPowerAdornment } from "../../../../utils/constants/adornments.js";
9
+ import { FieldConstants } from "../../../../utils/constants/fieldConstants.js";
10
+ import "../../../../utils/conversionUtils.js";
11
+ import { ENERGY_SOURCES } from "../../../../utils/types/equipmentType.js";
12
+ import "@mui/icons-material";
13
+ import "../../../../components/ui/overflowableText/OverflowableText.js";
14
+ import "localized-countries";
15
+ import "localized-countries/data/fr";
16
+ import "localized-countries/data/en";
17
+ import "notistack";
18
+ import "../../../../components/ui/reactHookForm/provider/CustomFormProvider.js";
19
+ import "yup";
20
+ import "../../../../components/ui/treeViewFinder/TreeViewFinder.js";
21
+ import { SwitchInput } from "../../../../components/ui/reactHookForm/booleans/SwitchInput.js";
22
+ import { FloatInput } from "../../../../components/ui/reactHookForm/numbers/FloatInput.js";
23
+ import { TextInput } from "../../../../components/ui/reactHookForm/text/TextInput.js";
24
+ import "../../../../components/ui/reactHookForm/numbers/RangeInput.js";
25
+ import { SelectInput } from "../../../../components/ui/reactHookForm/selectInputs/SelectInput.js";
26
+ import "@material-symbols/svg-400/outlined/left_panel_open.svg?react";
27
+ import "@material-symbols/svg-400/outlined/arrows_output.svg?react";
28
+ import "@material-symbols/svg-400/outlined/arrows_input.svg?react";
29
+ import "@material-symbols/svg-400/outlined/left_panel_close.svg?react";
30
+ import "@material-symbols/svg-400/outlined/add_notes.svg?react";
31
+ import "../../../../components/ui/dialogs/descriptionModificationDialog/DescriptionModificationDialog.js";
32
+ import "../../../../components/ui/reactHookForm/expandableInput/ExpandableInput.js";
33
+ import "@hello-pangea/dnd";
34
+ import "../../../../components/ui/dialogs/elementSaveDialog/ElementSaveDialog.js";
35
+ import "../../../../components/ui/snackbarProvider/SnackbarProvider.js";
36
+ import "mui-nested-menu";
37
+ import "react-resizable-panels";
38
+ import "../../common/properties/propertyUtils.js";
39
+ import GridSection from "../../../../components/composite/grid/grid-section.js";
40
+ import "react-dom";
41
+ import "autosuggest-highlight/match";
42
+ import "autosuggest-highlight/parse";
43
+ import "clsx";
44
+ import "../../../../components/composite/filter/FilterCreationDialog.js";
45
+ import "../../../../components/composite/filter/HeaderFilterForm.js";
46
+ import "../../../../components/composite/filter/explicitNaming/ExplicitNamingFilterForm.js";
47
+ import "../../../../components/composite/filter/expert/ExpertFilterForm.js";
48
+ import "../../../../components/composite/filter/expert/ExpertFilterEditionDialog.js";
49
+ import "../../../../components/composite/filter/expert/expertFilterConstants.js";
50
+ import "react-querybuilder";
51
+ import "uuid";
52
+ import "../../../../components/composite/filter/explicitNaming/ExplicitNamingFilterEditionDialog.js";
53
+ import "../../../../components/composite/filter/utils/filterFormUtils.js";
54
+ import GridItem from "../../../../components/composite/grid/grid-item.js";
55
+ import "@react-querybuilder/material";
56
+ import "../../../../components/composite/reactQueryBuilder/CustomReactQueryBuilder.js";
57
+ import "../../../../components/composite/reactQueryBuilder/PropertyValueEditor.js";
58
+ import "../../../../components/composite/agGridTable/BottomRightButtons.js";
59
+ import "../../../../components/composite/agGridTable/CustomAgGridTable.js";
60
+ import "ag-grid-community";
61
+ import "react-papaparse";
62
+ import "react-csv-downloader";
63
+ import "../../../../components/composite/customAGGrid/customAggrid.js";
64
+ import { SetPointsForm } from "../../common/setpoints/SetPointsForm.js";
65
+ import { ConnectivityForm } from "../../common/connectivity/ConnectivityForm.js";
66
+ import { ActivePowerControlForm } from "../../common/activePowerControl/ActivePowerControlForm.js";
67
+ import { ShortCircuitForm } from "../../common/shortCircuit/ShortCircuitForm.js";
68
+ import { ReactiveLimitsForm } from "../../common/reactiveLimits/ReactiveLimitsForm.js";
69
+ import "../../common/regulatingTerminal/RegulatingTerminalForm.js";
70
+ import { VoltageRegulationForm } from "../../common/voltageRegulation/VoltageRegulationForm.js";
71
+ function GeneratorCreationForm({
72
+ voltageLevelOptions,
73
+ fetchBusesOrBusbarSections,
74
+ PositionDiagramPane,
75
+ fetchVoltageLevelEquipments
76
+ }) {
77
+ const watchVoltageRegulation = useWatch({
78
+ name: FieldConstants.VOLTAGE_REGULATION
79
+ });
80
+ const generatorIdField = /* @__PURE__ */ jsx(TextInput, { name: FieldConstants.EQUIPMENT_ID, label: "ID", formProps: { autoFocus: true, ...filledTextField } });
81
+ const generatorNameField = /* @__PURE__ */ jsx(TextInput, { name: FieldConstants.EQUIPMENT_NAME, label: "Name", formProps: filledTextField });
82
+ const energySourceField = /* @__PURE__ */ jsx(
83
+ SelectInput,
84
+ {
85
+ name: FieldConstants.ENERGY_SOURCE,
86
+ label: "energySource",
87
+ options: [...ENERGY_SOURCES],
88
+ fullWidth: true,
89
+ size: "small",
90
+ disableClearable: true,
91
+ formProps: { ...italicFontTextField, ...filledTextField }
92
+ }
93
+ );
94
+ const connectivityForm = /* @__PURE__ */ jsx(
95
+ ConnectivityForm,
96
+ {
97
+ voltageLevelOptions,
98
+ PositionDiagramPane,
99
+ fetchBusesOrBusbarSections
100
+ }
101
+ );
102
+ const maximumActivePowerField = /* @__PURE__ */ jsx(
103
+ FloatInput,
104
+ {
105
+ name: FieldConstants.MAXIMUM_ACTIVE_POWER,
106
+ label: "MaximumActivePowerText",
107
+ adornment: ActivePowerAdornment
108
+ }
109
+ );
110
+ const minimumActivePowerField = /* @__PURE__ */ jsx(
111
+ FloatInput,
112
+ {
113
+ name: FieldConstants.MINIMUM_ACTIVE_POWER,
114
+ label: "MinimumActivePowerText",
115
+ adornment: ActivePowerAdornment
116
+ }
117
+ );
118
+ const ratedNominalPowerField = /* @__PURE__ */ jsx(
119
+ FloatInput,
120
+ {
121
+ name: FieldConstants.RATED_NOMINAL_POWER,
122
+ label: "RatedNominalPowerText",
123
+ adornment: MVAPowerAdornment
124
+ }
125
+ );
126
+ const plannedActivePowerSetPointField = /* @__PURE__ */ jsx(
127
+ FloatInput,
128
+ {
129
+ name: FieldConstants.PLANNED_ACTIVE_POWER_SET_POINT,
130
+ label: "PlannedActivePowerSetPointForm",
131
+ adornment: ActivePowerAdornment
132
+ }
133
+ );
134
+ const marginalCostField = /* @__PURE__ */ jsx(FloatInput, { name: FieldConstants.MARGINAL_COST, label: "MarginalCost" });
135
+ const plannedOutageRateField = /* @__PURE__ */ jsx(FloatInput, { name: FieldConstants.PLANNED_OUTAGE_RATE, label: "plannedOutageRate" });
136
+ const forcedOutageRateField = /* @__PURE__ */ jsx(FloatInput, { name: FieldConstants.FORCED_OUTAGE_RATE, label: "forcedOutageRate" });
137
+ const voltageRegulationField = /* @__PURE__ */ jsx(Box, { children: /* @__PURE__ */ jsx(SwitchInput, { name: FieldConstants.VOLTAGE_REGULATION, label: "VoltageRegulationText" }) });
138
+ const voltageRegulationFields = /* @__PURE__ */ jsx(
139
+ VoltageRegulationForm,
140
+ {
141
+ voltageLevelOptions,
142
+ fetchVoltageLevelEquipments
143
+ }
144
+ );
145
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
146
+ /* @__PURE__ */ jsxs(Grid, { container: true, spacing: 2, children: [
147
+ /* @__PURE__ */ jsx(GridItem, { size: 4, children: generatorIdField }),
148
+ /* @__PURE__ */ jsx(GridItem, { size: 4, children: generatorNameField }),
149
+ /* @__PURE__ */ jsx(GridItem, { size: 4, children: energySourceField })
150
+ ] }),
151
+ /* @__PURE__ */ jsx(GridSection, { title: "Connectivity" }),
152
+ /* @__PURE__ */ jsx(Grid, { container: true, spacing: 2, children: /* @__PURE__ */ jsx(GridItem, { size: 12, children: connectivityForm }) }),
153
+ /* @__PURE__ */ jsx(GridSection, { title: "ActiveLimits" }),
154
+ /* @__PURE__ */ jsxs(Grid, { container: true, spacing: 2, children: [
155
+ /* @__PURE__ */ jsx(GridItem, { size: 4, children: minimumActivePowerField }),
156
+ /* @__PURE__ */ jsx(GridItem, { size: 4, children: maximumActivePowerField }),
157
+ /* @__PURE__ */ jsx(GridItem, { size: 4, children: ratedNominalPowerField })
158
+ ] }),
159
+ /* @__PURE__ */ jsx(GridSection, { title: "ReactiveLimits" }),
160
+ /* @__PURE__ */ jsx(ReactiveLimitsForm, {}),
161
+ /* @__PURE__ */ jsx(SetPointsForm, {}),
162
+ /* @__PURE__ */ jsxs(Grid, { container: true, spacing: 2, paddingTop: 2, children: [
163
+ /* @__PURE__ */ jsx(Box, { sx: { width: "100%" } }),
164
+ /* @__PURE__ */ jsx(
165
+ GridItem,
166
+ {
167
+ tooltip: watchVoltageRegulation !== null ? "" : /* @__PURE__ */ jsx(FormattedMessage, { id: "NoModification" }),
168
+ size: 4,
169
+ children: voltageRegulationField
170
+ }
171
+ ),
172
+ voltageRegulationFields,
173
+ /* @__PURE__ */ jsx(Box, { sx: { width: "100%" } }),
174
+ /* @__PURE__ */ jsx(ActivePowerControlForm, {})
175
+ ] }),
176
+ /* @__PURE__ */ jsx(GridSection, { title: "ShortCircuit" }),
177
+ /* @__PURE__ */ jsx(ShortCircuitForm, {}),
178
+ /* @__PURE__ */ jsx(GridSection, { title: "GenerationDispatch" }),
179
+ /* @__PURE__ */ jsxs(Grid, { container: true, spacing: 2, children: [
180
+ /* @__PURE__ */ jsx(GridItem, { size: 4, children: plannedActivePowerSetPointField }),
181
+ /* @__PURE__ */ jsx(GridItem, { size: 4, children: marginalCostField }),
182
+ /* @__PURE__ */ jsxs(Grid, { container: true, item: true, spacing: 2, children: [
183
+ /* @__PURE__ */ jsx(GridItem, { size: 4, children: plannedOutageRateField }),
184
+ /* @__PURE__ */ jsx(GridItem, { size: 4, children: forcedOutageRateField })
185
+ ] })
186
+ ] }),
187
+ /* @__PURE__ */ jsx(PropertiesForm, { networkElementType: "generator" })
188
+ ] });
189
+ }
190
+ export {
191
+ GeneratorCreationForm
192
+ };
@@ -3,12 +3,11 @@ import { ReactiveCapabilityCurvePoints } from '../../common/reactiveLimits/react
3
3
  import { ModificationType } from '../../../../utils';
4
4
  export interface GeneratorCreationDto {
5
5
  type: ModificationType;
6
- uuid?: string;
7
6
  equipmentId: string;
8
7
  equipmentName: string | null;
9
8
  energySource: string | null;
10
- minP: number | null;
11
- maxP: number | null;
9
+ minP: number;
10
+ maxP: number;
12
11
  ratedS: number | null;
13
12
  targetP: number | null;
14
13
  targetQ: number | null;
@@ -0,0 +1,123 @@
1
+ import { InferType } from 'yup';
2
+ import { DeepNullable } from '../../../../utils';
3
+ import { GeneratorCreationDto } from './generatorCreation.types';
4
+ export declare const generatorCreationFormSchema: import('yup').ObjectSchema<NonNullable<{
5
+ frequencyRegulation: boolean | null | undefined;
6
+ droop: number | null | undefined;
7
+ voltageRegulation: boolean | null | undefined;
8
+ voltageRegulationType: string | null | undefined;
9
+ voltageSetpoint: number | null | undefined;
10
+ qPercent: number | null | undefined;
11
+ voltageLevel: {
12
+ id?: string | undefined;
13
+ name?: string | undefined;
14
+ nominalVoltage?: string | undefined;
15
+ substationId?: string | undefined;
16
+ topologyKind?: string | null | undefined;
17
+ } | null;
18
+ equipment: {
19
+ id?: string | undefined;
20
+ name?: string | null | undefined;
21
+ type?: string | undefined;
22
+ } | null;
23
+ reactiveLimits: {
24
+ minimumReactivePower?: number | null | undefined;
25
+ maximumReactivePower?: number | null | undefined;
26
+ reactiveCapabilityCurveTable?: {
27
+ minQ: number | null;
28
+ maxQ: number | null;
29
+ p: number | null;
30
+ }[] | null | undefined;
31
+ reactiveCapabilityCurveChoice: string;
32
+ };
33
+ reactivePowerSetpoint: number | null | undefined;
34
+ activePowerSetpoint: number | undefined;
35
+ plannedActivePowerSetPoint: number | null;
36
+ marginalCost: number | null | undefined;
37
+ plannedOutageRate: number | null | undefined;
38
+ forcedOutageRate: number | null | undefined;
39
+ connectivity: {
40
+ terminalConnected?: boolean | null | undefined;
41
+ connectionDirection?: string | null | undefined;
42
+ connectionName?: string | undefined;
43
+ connectionPosition?: number | null | undefined;
44
+ busOrBusbarSection: {
45
+ id?: string | undefined;
46
+ } | null;
47
+ voltageLevel: {
48
+ id?: string | undefined;
49
+ } | null;
50
+ };
51
+ transformerReactance: number | null | undefined;
52
+ directTransX: number | null | undefined;
53
+ equipmentID: string;
54
+ equipmentName: string | null | undefined;
55
+ energySource: string;
56
+ maximumActivePower: number;
57
+ minimumActivePower: number;
58
+ ratedNominalPower: number | null | undefined;
59
+ } & {
60
+ AdditionalProperties: {
61
+ previousValue?: string | null | undefined;
62
+ added: NonNullable<boolean | undefined>;
63
+ deletionMark: NonNullable<boolean | undefined>;
64
+ name: string;
65
+ value: string;
66
+ }[] | undefined;
67
+ }>, import('yup').AnyObject, {
68
+ frequencyRegulation: undefined;
69
+ droop: undefined;
70
+ voltageRegulation: undefined;
71
+ voltageRegulationType: undefined;
72
+ voltageSetpoint: undefined;
73
+ qPercent: undefined;
74
+ voltageLevel: {
75
+ id: undefined;
76
+ name: undefined;
77
+ substationId: undefined;
78
+ nominalVoltage: undefined;
79
+ topologyKind: undefined;
80
+ };
81
+ equipment: {
82
+ id: undefined;
83
+ name: undefined;
84
+ type: undefined;
85
+ };
86
+ reactiveLimits: {
87
+ reactiveCapabilityCurveChoice: undefined;
88
+ minimumReactivePower: undefined;
89
+ maximumReactivePower: undefined;
90
+ reactiveCapabilityCurveTable: "";
91
+ };
92
+ reactivePowerSetpoint: undefined;
93
+ activePowerSetpoint: undefined;
94
+ plannedActivePowerSetPoint: null;
95
+ marginalCost: undefined;
96
+ plannedOutageRate: undefined;
97
+ forcedOutageRate: undefined;
98
+ connectivity: {
99
+ voltageLevel: {
100
+ id: undefined;
101
+ };
102
+ busOrBusbarSection: {
103
+ id: undefined;
104
+ };
105
+ connectionDirection: undefined;
106
+ connectionName: undefined;
107
+ connectionPosition: undefined;
108
+ terminalConnected: undefined;
109
+ };
110
+ transformerReactance: undefined;
111
+ directTransX: undefined;
112
+ equipmentID: undefined;
113
+ equipmentName: undefined;
114
+ energySource: undefined;
115
+ maximumActivePower: undefined;
116
+ minimumActivePower: undefined;
117
+ ratedNominalPower: undefined;
118
+ AdditionalProperties: "";
119
+ }, "">;
120
+ export type GeneratorCreationFormData = InferType<typeof generatorCreationFormSchema>;
121
+ export declare const generatorCreationEmptyFormData: DeepNullable<GeneratorCreationFormData>;
122
+ export declare const generatorCreationDtoToForm: (dto: GeneratorCreationDto) => GeneratorCreationFormData;
123
+ export declare const generatorCreationFormToDto: (form: GeneratorCreationFormData, dto?: GeneratorCreationDto) => GeneratorCreationDto;
@@ -0,0 +1,200 @@
1
+ import { object, number, string, ref } from "yup";
2
+ import { FieldConstants } from "../../../../utils/constants/fieldConstants.js";
3
+ import "../../../../utils/conversionUtils.js";
4
+ import { UNDEFINED_CONNECTION_DIRECTION } from "../../../../utils/types/equipmentType.js";
5
+ import { ModificationType } from "../../../../utils/types/modificationType.js";
6
+ import "react/jsx-runtime";
7
+ import "@mui/icons-material";
8
+ import { sanitizeString } from "../../../../utils/ts-utils.js";
9
+ import { getConnectivityWithPositionSchema, getConnectivityWithPositionEmptyFormDataProps, getConnectivityFormDataProps } from "../../common/connectivity/connectivityForm.utils.js";
10
+ import "@mui/material";
11
+ import "react";
12
+ import "react-intl";
13
+ import "../../../../components/ui/overflowableText/OverflowableText.js";
14
+ import "react-hook-form";
15
+ import "localized-countries";
16
+ import "localized-countries/data/fr";
17
+ import "localized-countries/data/en";
18
+ import "notistack";
19
+ import "../../../../components/ui/reactHookForm/provider/CustomFormProvider.js";
20
+ import "../../../../components/ui/treeViewFinder/TreeViewFinder.js";
21
+ import "../../../../components/ui/reactHookForm/numbers/RangeInput.js";
22
+ import "@material-symbols/svg-400/outlined/left_panel_open.svg?react";
23
+ import "@material-symbols/svg-400/outlined/arrows_output.svg?react";
24
+ import "@material-symbols/svg-400/outlined/arrows_input.svg?react";
25
+ import "@material-symbols/svg-400/outlined/left_panel_close.svg?react";
26
+ import "@material-symbols/svg-400/outlined/add_notes.svg?react";
27
+ import "../../../../components/ui/dialogs/descriptionModificationDialog/DescriptionModificationDialog.js";
28
+ import "../../../../components/ui/reactHookForm/expandableInput/ExpandableInput.js";
29
+ import "@hello-pangea/dnd";
30
+ import "../../../../components/ui/dialogs/elementSaveDialog/ElementSaveDialog.js";
31
+ import "../../../../components/ui/snackbarProvider/SnackbarProvider.js";
32
+ import "mui-nested-menu";
33
+ import "react-resizable-panels";
34
+ import { creationPropertiesSchema, getFilledPropertiesFromModification, toModificationProperties } from "../../common/properties/propertyUtils.js";
35
+ import "react-dom";
36
+ import "autosuggest-highlight/match";
37
+ import "autosuggest-highlight/parse";
38
+ import "clsx";
39
+ import "../../../../components/composite/filter/FilterCreationDialog.js";
40
+ import "../../../../components/composite/filter/HeaderFilterForm.js";
41
+ import "../../../../components/composite/filter/explicitNaming/ExplicitNamingFilterForm.js";
42
+ import "../../../../components/composite/filter/expert/ExpertFilterForm.js";
43
+ import "../../../../components/composite/filter/expert/ExpertFilterEditionDialog.js";
44
+ import "../../../../components/composite/filter/expert/expertFilterConstants.js";
45
+ import "react-querybuilder";
46
+ import "uuid";
47
+ import "../../../../components/composite/filter/explicitNaming/ExplicitNamingFilterEditionDialog.js";
48
+ import "../../../../components/composite/filter/utils/filterFormUtils.js";
49
+ import "@react-querybuilder/material";
50
+ import "../../../../components/composite/reactQueryBuilder/CustomReactQueryBuilder.js";
51
+ import "../../../../components/composite/reactQueryBuilder/PropertyValueEditor.js";
52
+ import "../../../../components/composite/agGridTable/BottomRightButtons.js";
53
+ import "../../../../components/composite/agGridTable/CustomAgGridTable.js";
54
+ import "ag-grid-community";
55
+ import "react-papaparse";
56
+ import "react-csv-downloader";
57
+ import "../../../../components/composite/customAGGrid/customAggrid.js";
58
+ import { getSetPointsSchema, testValueWithinPowerInterval, getSetPointsEmptyFormData } from "../../common/setpoints/setPoints.utils.js";
59
+ import { getActivePowerControlSchema, getActivePowerControlEmptyFormData } from "../../common/activePowerControl/activePowerControlForm.utils.js";
60
+ import { getShortCircuitFormSchema, getShortCircuitEmptyFormData, getShortCircuitFormData } from "../../common/shortCircuit/shortCircuitForm.utils.js";
61
+ import { toReactiveCapabilityCurveChoiceForGeneratorCreation } from "../../common/reactiveLimits/reactiveCapabilityCurve/reactiveCapability.utils.js";
62
+ import { getReactiveLimitsValidationSchema, getReactiveLimitsEmptyFormDataProps, getReactiveLimitsFormDataProps } from "../../common/reactiveLimits/reactiveLimits.utils.js";
63
+ import "../../common/regulatingTerminal/RegulatingTerminalForm.js";
64
+ import { getRegulatingTerminalEquipmentData, getRegulatingTerminalVoltageLevelData } from "../../common/regulatingTerminal/regulatingTerminal.utils.js";
65
+ import { getVoltageRegulationSchema, getVoltageRegulationEmptyFormData, REGULATION_TYPES } from "../../common/voltageRegulation/voltageRegulation.utils.js";
66
+ const generatorCreationFormSchema = object().shape({
67
+ [FieldConstants.EQUIPMENT_ID]: string().required(),
68
+ [FieldConstants.EQUIPMENT_NAME]: string().nullable(),
69
+ [FieldConstants.ENERGY_SOURCE]: string().nullable().required(),
70
+ [FieldConstants.MAXIMUM_ACTIVE_POWER]: number().nullable().required(),
71
+ [FieldConstants.MINIMUM_ACTIVE_POWER]: number().nullable().max(ref(FieldConstants.MAXIMUM_ACTIVE_POWER), "generatorMinimumActivePowerMaxValueError").required(),
72
+ [FieldConstants.RATED_NOMINAL_POWER]: number().nullable().min(0, "mustBeGreaterOrEqualToZero"),
73
+ ...getShortCircuitFormSchema(),
74
+ [FieldConstants.PLANNED_ACTIVE_POWER_SET_POINT]: number().nullable().default(null).test(
75
+ "activePowerSetPoint",
76
+ "PlannedActivePowerSetPointMustBeBetweenMinAndMaxActivePower",
77
+ testValueWithinPowerInterval
78
+ ),
79
+ [FieldConstants.MARGINAL_COST]: number().nullable(),
80
+ [FieldConstants.PLANNED_OUTAGE_RATE]: number().nullable().min(0, "RealPercentage").max(1, "RealPercentage"),
81
+ [FieldConstants.FORCED_OUTAGE_RATE]: number().nullable().min(0, "RealPercentage").max(1, "RealPercentage"),
82
+ [FieldConstants.CONNECTIVITY]: getConnectivityWithPositionSchema(),
83
+ ...getSetPointsSchema(),
84
+ [FieldConstants.REACTIVE_LIMITS]: getReactiveLimitsValidationSchema(),
85
+ ...getVoltageRegulationSchema(),
86
+ ...getActivePowerControlSchema()
87
+ }).concat(creationPropertiesSchema).required();
88
+ const generatorCreationEmptyFormData = {
89
+ [FieldConstants.EQUIPMENT_ID]: "",
90
+ [FieldConstants.EQUIPMENT_NAME]: "",
91
+ [FieldConstants.ENERGY_SOURCE]: "OTHER",
92
+ [FieldConstants.MAXIMUM_ACTIVE_POWER]: null,
93
+ [FieldConstants.MINIMUM_ACTIVE_POWER]: null,
94
+ [FieldConstants.RATED_NOMINAL_POWER]: null,
95
+ ...getShortCircuitEmptyFormData(),
96
+ [FieldConstants.PLANNED_ACTIVE_POWER_SET_POINT]: null,
97
+ [FieldConstants.MARGINAL_COST]: null,
98
+ [FieldConstants.PLANNED_OUTAGE_RATE]: null,
99
+ [FieldConstants.FORCED_OUTAGE_RATE]: null,
100
+ [FieldConstants.CONNECTIVITY]: getConnectivityWithPositionEmptyFormDataProps(),
101
+ [FieldConstants.REACTIVE_LIMITS]: getReactiveLimitsEmptyFormDataProps(),
102
+ ...getSetPointsEmptyFormData(),
103
+ ...getVoltageRegulationEmptyFormData(),
104
+ ...getActivePowerControlEmptyFormData(),
105
+ [FieldConstants.ADDITIONAL_PROPERTIES]: []
106
+ };
107
+ const generatorCreationDtoToForm = (dto) => {
108
+ return {
109
+ equipmentID: dto.equipmentId,
110
+ equipmentName: dto.equipmentName ?? "",
111
+ energySource: dto.energySource ?? "OTHER",
112
+ maximumActivePower: dto.maxP,
113
+ minimumActivePower: dto.minP,
114
+ ratedNominalPower: dto.ratedS,
115
+ activePowerSetpoint: dto.targetP ?? void 0,
116
+ voltageRegulation: dto.voltageRegulationOn,
117
+ voltageSetpoint: dto.targetV,
118
+ reactivePowerSetpoint: dto.targetQ,
119
+ plannedActivePowerSetPoint: dto.plannedActivePowerSetPoint,
120
+ marginalCost: dto.marginalCost,
121
+ plannedOutageRate: dto.plannedOutageRate,
122
+ forcedOutageRate: dto.forcedOutageRate,
123
+ frequencyRegulation: dto.participate,
124
+ droop: dto.droop,
125
+ ...getShortCircuitFormData({
126
+ directTransX: dto.directTransX,
127
+ stepUpTransformerX: dto.stepUpTransformerX
128
+ }),
129
+ voltageRegulationType: dto?.regulatingTerminalId ? REGULATION_TYPES.DISTANT.id : REGULATION_TYPES.LOCAL.id,
130
+ qPercent: dto.qPercent,
131
+ reactiveLimits: getReactiveLimitsFormDataProps({
132
+ reactiveCapabilityCurveChoice: dto?.reactiveCapabilityCurve ? "CURVE" : "MINMAX",
133
+ minimumReactivePower: dto?.minQ,
134
+ maximumReactivePower: dto?.maxQ,
135
+ reactiveCapabilityCurvePoints: dto?.reactiveCapabilityCurve ? dto?.reactiveCapabilityCurvePoints : null
136
+ }),
137
+ voltageLevel: getRegulatingTerminalVoltageLevelData({
138
+ voltageLevelId: dto.regulatingTerminalVlId
139
+ }),
140
+ equipment: getRegulatingTerminalEquipmentData({
141
+ equipmentId: dto.regulatingTerminalId,
142
+ equipmentType: dto.regulatingTerminalType ?? void 0
143
+ }),
144
+ connectivity: getConnectivityFormDataProps({
145
+ voltageLevelId: dto.voltageLevelId,
146
+ busbarSectionId: dto.busOrBusbarSectionId,
147
+ connectionDirection: dto.connectionDirection,
148
+ connectionName: dto.connectionName,
149
+ connectionPosition: dto.connectionPosition,
150
+ terminalConnected: dto.terminalConnected
151
+ }),
152
+ AdditionalProperties: getFilledPropertiesFromModification(dto.properties)
153
+ };
154
+ };
155
+ const generatorCreationFormToDto = (form, dto) => {
156
+ const isReactiveCapabilityCurveOn = toReactiveCapabilityCurveChoiceForGeneratorCreation(form, dto) === "CURVE";
157
+ const isDistantRegulation = form[FieldConstants.VOLTAGE_REGULATION_TYPE] === REGULATION_TYPES.DISTANT.id;
158
+ return {
159
+ type: ModificationType.GENERATOR_CREATION,
160
+ equipmentId: form.equipmentID,
161
+ equipmentName: sanitizeString(form.equipmentName),
162
+ energySource: form.energySource,
163
+ minP: form.minimumActivePower,
164
+ maxP: form.maximumActivePower,
165
+ ratedS: form.ratedNominalPower ?? null,
166
+ targetP: form.activePowerSetpoint ?? null,
167
+ targetQ: form.reactivePowerSetpoint ?? null,
168
+ voltageRegulationOn: form.voltageRegulation ?? null,
169
+ targetV: form.voltageSetpoint ?? null,
170
+ qPercent: form.qPercent ?? null,
171
+ voltageLevelId: form.connectivity.voltageLevel?.id ?? "",
172
+ busOrBusbarSectionId: form.connectivity.busOrBusbarSection?.id ?? "",
173
+ connectionDirection: form.connectivity.connectionDirection ?? UNDEFINED_CONNECTION_DIRECTION,
174
+ connectionName: sanitizeString(form.connectivity.connectionName),
175
+ connectionPosition: form.connectivity.connectionPosition ?? null,
176
+ terminalConnected: form.connectivity.terminalConnected ?? null,
177
+ plannedActivePowerSetPoint: form.plannedActivePowerSetPoint ?? null,
178
+ marginalCost: form.marginalCost ?? null,
179
+ plannedOutageRate: form.plannedOutageRate ?? null,
180
+ forcedOutageRate: form.forcedOutageRate ?? null,
181
+ directTransX: form.directTransX ?? null,
182
+ stepUpTransformerX: form.transformerReactance ?? null,
183
+ regulatingTerminalId: isDistantRegulation ? form.equipment?.id ?? null : null,
184
+ regulatingTerminalType: isDistantRegulation ? form.equipment?.type ?? null : null,
185
+ regulatingTerminalVlId: isDistantRegulation ? form.voltageLevel?.id ?? null : null,
186
+ reactiveCapabilityCurve: isReactiveCapabilityCurveOn,
187
+ participate: form.frequencyRegulation ?? null,
188
+ droop: form.droop ?? null,
189
+ maxQ: isReactiveCapabilityCurveOn ? null : form.reactiveLimits.maximumReactivePower ?? null,
190
+ minQ: isReactiveCapabilityCurveOn ? null : form.reactiveLimits.minimumReactivePower ?? null,
191
+ reactiveCapabilityCurvePoints: isReactiveCapabilityCurveOn ? form.reactiveLimits.reactiveCapabilityCurveTable ?? null : null,
192
+ properties: toModificationProperties(form)
193
+ };
194
+ };
195
+ export {
196
+ generatorCreationDtoToForm,
197
+ generatorCreationEmptyFormData,
198
+ generatorCreationFormSchema,
199
+ generatorCreationFormToDto
200
+ };
@@ -5,3 +5,5 @@
5
5
  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
6
6
  */
7
7
  export * from './generatorCreation.types';
8
+ export * from './generatorCreation.utils';
9
+ export * from './GeneratorCreationForm';
@@ -1 +1,9 @@
1
-
1
+ import { generatorCreationDtoToForm, generatorCreationEmptyFormData, generatorCreationFormSchema, generatorCreationFormToDto } from "./generatorCreation.utils.js";
2
+ import { GeneratorCreationForm } from "./GeneratorCreationForm.js";
3
+ export {
4
+ GeneratorCreationForm,
5
+ generatorCreationDtoToForm,
6
+ generatorCreationEmptyFormData,
7
+ generatorCreationFormSchema,
8
+ generatorCreationFormToDto
9
+ };
@@ -57,9 +57,6 @@ export type GeneratorDialogSchemaBaseForm = {
57
57
  };
58
58
  [FieldConstants.ADDITIONAL_PROPERTIES]?: Property[];
59
59
  };
60
- export type GeneratorCreationDialogSchemaForm = {
61
- equipmentId: string;
62
- } & GeneratorDialogSchemaBaseForm;
63
60
  export type GeneratorModificationDialogSchemaForm = {
64
61
  [FieldConstants.STATE_ESTIMATION]?: {
65
62
  [FieldConstants.MEASUREMENT_P]?: MeasurementInfo;
@@ -1 +1,9 @@
1
-
1
+ import { generatorCreationDtoToForm, generatorCreationEmptyFormData, generatorCreationFormSchema, generatorCreationFormToDto } from "./creation/generatorCreation.utils.js";
2
+ import { GeneratorCreationForm } from "./creation/GeneratorCreationForm.js";
3
+ export {
4
+ GeneratorCreationForm,
5
+ generatorCreationDtoToForm,
6
+ generatorCreationEmptyFormData,
7
+ generatorCreationFormSchema,
8
+ generatorCreationFormToDto
9
+ };
@@ -87,6 +87,8 @@ import { EQUIPMENT_TYPE_ORDER, byFilterDeletionDtoToForm, byFilterDeletionFormSc
87
87
  import { ModificationByAssignmentForm } from "./by-filter/assignment/modification-by-assignment-form.js";
88
88
  import { emptyModificationByAssignmentFormData, modificationByAssignmentDtoToForm, modificationByAssignmentFormSchema, modificationByAssignmentFormToDto } from "./by-filter/assignment/modificationByAssignment.utils.js";
89
89
  import { DataType } from "./by-filter/assignment/assignment/assignment.type.js";
90
+ import { generatorCreationDtoToForm, generatorCreationEmptyFormData, generatorCreationFormSchema, generatorCreationFormToDto } from "./generator/creation/generatorCreation.utils.js";
91
+ import { GeneratorCreationForm } from "./generator/creation/GeneratorCreationForm.js";
90
92
  import { batteryCreationDtoToForm, batteryCreationEmptyFormData, batteryCreationFormSchema, batteryCreationFormToDto } from "./battery/creation/batteryCreation.utils.js";
91
93
  import { BatteryCreationForm } from "./battery/creation/BatteryCreationForm.js";
92
94
  import { batteryModificationDtoToForm, batteryModificationEmptyFormData, batteryModificationFormSchema, batteryModificationFormToDto } from "./battery/modification/batteryModification.utils.js";
@@ -121,6 +123,7 @@ export {
121
123
  ConnectivityForm,
122
124
  EQUIPMENT_TYPE_ORDER,
123
125
  EquipmentDeletionForm,
126
+ GeneratorCreationForm,
124
127
  HvdcLccDeletionSpecificForm,
125
128
  INSERT,
126
129
  LOAD_TAB_FIELDS,
@@ -183,6 +186,10 @@ export {
183
186
  equipmentDeletionFormToDto,
184
187
  fetchPredefinedProperties,
185
188
  filledTextField,
189
+ generatorCreationDtoToForm,
190
+ generatorCreationEmptyFormData,
191
+ generatorCreationFormSchema,
192
+ generatorCreationFormToDto,
186
193
  getActivePowerControlEmptyFormData,
187
194
  getActivePowerControlSchema,
188
195
  getActivePowerSetPointSchema,
@@ -58,7 +58,7 @@ const COLUMNS_DEFINITIONS_ICC_CLUSTERS = [
58
58
  label: "ShortCircuitIccClusterFilters",
59
59
  dataKey: SHORT_CIRCUIT_ICC_CLUSTER_FILTERS,
60
60
  tooltip: "ShortCircuitIccClusterFiltersTooltip",
61
- equipmentTypes: [EquipmentType.GENERATOR, EquipmentType.BATTERY, EquipmentType.VSC_CONVERTER_STATION],
61
+ equipmentTypes: [EquipmentType.GENERATOR, EquipmentType.BATTERY, EquipmentType.HVDC_LINE],
62
62
  elementType: ElementType.FILTER,
63
63
  titleId: "FiltersListsSelection",
64
64
  initialValue: null