@gridsuite/commons-ui 0.255.0 → 0.256.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/composite/reactQueryBuilder/CustomReactQueryBuilder.js +7 -4
- package/dist/features/index.js +16 -0
- package/dist/features/network-modifications/battery/modification/BatteryDialogTabsContent.d.ts +5 -1
- package/dist/features/network-modifications/battery/modification/BatteryDialogTabsContent.js +50 -10
- package/dist/features/network-modifications/battery/modification/BatteryModificationForm.d.ts +5 -1
- package/dist/features/network-modifications/battery/modification/BatteryModificationForm.js +4 -2
- package/dist/features/network-modifications/battery/modification/batteryModification.types.d.ts +6 -0
- package/dist/features/network-modifications/battery/modification/batteryModification.utils.d.ts +32 -0
- package/dist/features/network-modifications/battery/modification/batteryModification.utils.js +21 -1
- package/dist/features/network-modifications/by-filter/formula/formula/formula-constants.d.ts +10 -0
- package/dist/features/network-modifications/by-filter/formula/formula/formula-constants.js +10 -0
- package/dist/features/network-modifications/by-filter/formula/formula/formula-form.d.ts +12 -0
- package/dist/features/network-modifications/by-filter/formula/formula/formula-form.js +139 -0
- package/dist/features/network-modifications/by-filter/formula/formula/formula-utils.d.ts +40 -0
- package/dist/features/network-modifications/by-filter/formula/formula/formula-utils.js +164 -0
- package/dist/features/network-modifications/by-filter/formula/formula/formula.type.d.ts +27 -0
- package/dist/features/network-modifications/by-filter/formula/formula/formula.type.js +1 -0
- package/dist/features/network-modifications/by-filter/formula/formula/reference-autocomplete-input.d.ts +15 -0
- package/dist/features/network-modifications/by-filter/formula/formula/reference-autocomplete-input.js +123 -0
- package/dist/features/network-modifications/by-filter/formula/index.d.ts +11 -0
- package/dist/features/network-modifications/by-filter/formula/index.js +18 -0
- package/dist/features/network-modifications/by-filter/formula/modification-by-formula-form.d.ts +1 -0
- package/dist/features/network-modifications/by-filter/formula/modification-by-formula-form.js +110 -0
- package/dist/features/network-modifications/by-filter/formula/modificationByFormula.utils.d.ts +32 -0
- package/dist/features/network-modifications/by-filter/formula/modificationByFormula.utils.js +126 -0
- package/dist/features/network-modifications/by-filter/index.d.ts +1 -0
- package/dist/features/network-modifications/by-filter/index.js +17 -1
- package/dist/features/network-modifications/common/voltageRegulation/VoltageRegulationForm.js +1 -1
- package/dist/features/network-modifications/index.js +16 -0
- package/dist/index.js +16 -0
- package/dist/translations/en/networkModificationsEn.d.ts +13 -0
- package/dist/translations/en/networkModificationsEn.js +13 -0
- package/dist/translations/fr/networkModificationsFr.d.ts +13 -0
- package/dist/translations/fr/networkModificationsFr.js +13 -0
- package/dist/utils/constants/fieldConstants.d.ts +1 -0
- package/dist/utils/constants/fieldConstants.js +1 -0
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsxs, Fragment, jsx } from "react/jsx-runtime";
|
|
2
2
|
import { Box } from "@mui/material";
|
|
3
|
-
import { QueryBuilderDnD } from "@react-querybuilder/dnd";
|
|
3
|
+
import { createReactDnDAdapter, QueryBuilderDnD } from "@react-querybuilder/dnd";
|
|
4
4
|
import * as ReactDnD from "react-dnd";
|
|
5
5
|
import * as ReactDndHtml5Backend from "react-dnd-html5-backend";
|
|
6
6
|
import { QueryBuilderMaterial } from "@react-querybuilder/material";
|
|
@@ -8,7 +8,7 @@ import { defaultTranslations, QueryBuilder } from "react-querybuilder";
|
|
|
8
8
|
import { formatQuery } from "react-querybuilder/formatQuery";
|
|
9
9
|
import { useIntl } from "react-intl";
|
|
10
10
|
import { useFormContext } from "react-hook-form";
|
|
11
|
-
import { useCallback, useMemo } from "react";
|
|
11
|
+
import { useCallback, useState, useMemo } from "react";
|
|
12
12
|
import { CombinatorSelector } from "./CombinatorSelector.js";
|
|
13
13
|
import { AddButton } from "./AddButton.js";
|
|
14
14
|
import { ValueEditor } from "./ValueEditor.js";
|
|
@@ -38,7 +38,6 @@ const customTranslations = {
|
|
|
38
38
|
value: { title: "" },
|
|
39
39
|
combinators: { title: "" }
|
|
40
40
|
};
|
|
41
|
-
const dnd = { ...ReactDnD, ...ReactDndHtml5Backend };
|
|
42
41
|
const controlElements = {
|
|
43
42
|
addRuleAction: RuleAddButton,
|
|
44
43
|
addGroupAction: GroupAddButton,
|
|
@@ -78,6 +77,10 @@ function CustomReactQueryBuilder(props) {
|
|
|
78
77
|
},
|
|
79
78
|
[getValues, setValue, isSubmitted, name]
|
|
80
79
|
);
|
|
80
|
+
const [dnd, setDnd] = useState(() => createReactDnDAdapter({ ...ReactDnD, ...ReactDndHtml5Backend }));
|
|
81
|
+
const resetDnd = useCallback(() => {
|
|
82
|
+
setDnd(createReactDnDAdapter({ ...ReactDnD, ...ReactDndHtml5Backend }));
|
|
83
|
+
}, [setDnd]);
|
|
81
84
|
const combinators = useMemo(() => {
|
|
82
85
|
return Object.values(COMBINATOR_OPTIONS).map((c) => ({
|
|
83
86
|
name: c.name,
|
|
@@ -85,7 +88,7 @@ function CustomReactQueryBuilder(props) {
|
|
|
85
88
|
}));
|
|
86
89
|
}, [intl]);
|
|
87
90
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
88
|
-
/* @__PURE__ */ jsx(QueryBuilderMaterial, { children: /* @__PURE__ */ jsx(QueryBuilderDnD, { dnd, children: /* @__PURE__ */ jsx(
|
|
91
|
+
/* @__PURE__ */ jsx(QueryBuilderMaterial, { children: /* @__PURE__ */ jsx(QueryBuilderDnD, { dnd, onRuleDrop: resetDnd, children: /* @__PURE__ */ jsx(
|
|
89
92
|
QueryBuilder,
|
|
90
93
|
{
|
|
91
94
|
fields,
|
package/dist/features/index.js
CHANGED
|
@@ -174,6 +174,10 @@ import { EQUIPMENT_TYPE_ORDER, byFilterDeletionDtoToForm, byFilterDeletionFormSc
|
|
|
174
174
|
import { ModificationByAssignmentForm } from "./network-modifications/by-filter/assignment/modification-by-assignment-form.js";
|
|
175
175
|
import { emptyModificationByAssignmentFormData, modificationByAssignmentDtoToForm, modificationByAssignmentFormSchema, modificationByAssignmentFormToDto } from "./network-modifications/by-filter/assignment/modificationByAssignment.utils.js";
|
|
176
176
|
import { DataType } from "./network-modifications/by-filter/assignment/assignment/assignment.type.js";
|
|
177
|
+
import { ModificationByFormulaForm } from "./network-modifications/by-filter/formula/modification-by-formula-form.js";
|
|
178
|
+
import { EQUIPMENTS_FIELDS, getFormulaInitialValue, getFormulaSchema } from "./network-modifications/by-filter/formula/formula/formula-utils.js";
|
|
179
|
+
import { emptyModificationFormData, modificationByFormulaDtoToForm, modificationByFormulaFormSchema, modificationByFormulaFormToDto } from "./network-modifications/by-filter/formula/modificationByFormula.utils.js";
|
|
180
|
+
import { FORMULAS, OPERATOR, REFERENCE_FIELD_OR_VALUE_1, REFERENCE_FIELD_OR_VALUE_2 } from "./network-modifications/by-filter/formula/formula/formula-constants.js";
|
|
177
181
|
import { generatorCreationDtoToForm, generatorCreationEmptyFormData, generatorCreationFormSchema, generatorCreationFormToDto } from "./network-modifications/generator/creation/generatorCreation.utils.js";
|
|
178
182
|
import { GeneratorCreationForm } from "./network-modifications/generator/creation/GeneratorCreationForm.js";
|
|
179
183
|
import { generatorModificationDtoToForm, generatorModificationEmptyFormData, generatorModificationFormSchema, generatorModificationFormToDto } from "./network-modifications/generator/modification/generatorModification.utils.js";
|
|
@@ -319,6 +323,7 @@ export {
|
|
|
319
323
|
DynamicMarginCalculationInline,
|
|
320
324
|
DynamicSecurityAnalysisInline,
|
|
321
325
|
DynamicSimulationInline,
|
|
326
|
+
EQUIPMENTS_FIELDS,
|
|
322
327
|
EQUIPMENTS_IN_VOLTAGE_REGULATION_TYPES,
|
|
323
328
|
EQUIPMENT_TYPE_ORDER,
|
|
324
329
|
EquipmentDeletionForm,
|
|
@@ -326,6 +331,7 @@ export {
|
|
|
326
331
|
ErrorInLogoutAlert,
|
|
327
332
|
ErrorInUserValidationAlert,
|
|
328
333
|
FLOW_PROPORTIONAL_THRESHOLD,
|
|
334
|
+
FORMULAS,
|
|
329
335
|
GENERAL,
|
|
330
336
|
GENERAL_APPLY_MODIFICATIONS,
|
|
331
337
|
GENERATORS_SELECTION_TYPE,
|
|
@@ -409,6 +415,7 @@ export {
|
|
|
409
415
|
MONITORED_BRANCHES_EQUIPMENT_TYPES,
|
|
410
416
|
MONITORED_VOLTAGE_LEVELS_EQUIPMENT_TYPES,
|
|
411
417
|
ModificationByAssignmentForm,
|
|
418
|
+
ModificationByFormulaForm,
|
|
412
419
|
ModificationRow,
|
|
413
420
|
NAD_POSITIONS_GENERATION_MODE,
|
|
414
421
|
NAD_POSITIONS_GENERATION_MODE_LABEL,
|
|
@@ -427,6 +434,7 @@ export {
|
|
|
427
434
|
NotificationsContext,
|
|
428
435
|
NotificationsProvider,
|
|
429
436
|
OPERATIONAL_LIMITS_GROUPS_MODIFICATION_TYPE,
|
|
437
|
+
OPERATOR,
|
|
430
438
|
OperationalLimitsGroupTabLabel,
|
|
431
439
|
OperationalLimitsGroups,
|
|
432
440
|
PAGE_OPTIONS,
|
|
@@ -468,6 +476,8 @@ export {
|
|
|
468
476
|
REACTIVE_LIMIT_TYPES,
|
|
469
477
|
REACTIVE_SLACKS_THRESHOLD,
|
|
470
478
|
READ_SLACK_BUS,
|
|
479
|
+
REFERENCE_FIELD_OR_VALUE_1,
|
|
480
|
+
REFERENCE_FIELD_OR_VALUE_2,
|
|
471
481
|
REGULATION_TYPES,
|
|
472
482
|
REMOVE,
|
|
473
483
|
ReactiveCapabilityCurveRowForm,
|
|
@@ -607,6 +617,7 @@ export {
|
|
|
607
617
|
emptyFormData,
|
|
608
618
|
emptyLineSegment,
|
|
609
619
|
emptyModificationByAssignmentFormData,
|
|
620
|
+
emptyModificationFormData,
|
|
610
621
|
emptyProperties,
|
|
611
622
|
equipmentDeletionDtoToForm,
|
|
612
623
|
equipmentDeletionEmptyFormData,
|
|
@@ -675,6 +686,8 @@ export {
|
|
|
675
686
|
getCreateSwitchesEmptyFormData,
|
|
676
687
|
getCreateSwitchesValidationSchema,
|
|
677
688
|
getFilledPropertiesFromModification,
|
|
689
|
+
getFormulaInitialValue,
|
|
690
|
+
getFormulaSchema,
|
|
678
691
|
getHvdcLccDeletionSchema,
|
|
679
692
|
getInjectionActiveReactivePowerEditDataProperties,
|
|
680
693
|
getInjectionActiveReactivePowerEmptyFormData,
|
|
@@ -762,6 +775,9 @@ export {
|
|
|
762
775
|
modificationByAssignmentDtoToForm,
|
|
763
776
|
modificationByAssignmentFormSchema,
|
|
764
777
|
modificationByAssignmentFormToDto,
|
|
778
|
+
modificationByFormulaDtoToForm,
|
|
779
|
+
modificationByFormulaFormSchema,
|
|
780
|
+
modificationByFormulaFormToDto,
|
|
765
781
|
modificationPropertiesSchema,
|
|
766
782
|
moveSubModificationInTree,
|
|
767
783
|
networkModificationTableStyles,
|
package/dist/features/network-modifications/battery/modification/BatteryDialogTabsContent.d.ts
CHANGED
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
import { BatteryFormInfos } from '../batteryDialog.type';
|
|
2
2
|
import { ConnectivityNetworkProps } from '../../common';
|
|
3
|
+
import { EquipmentType, Identifiable } from '../../../../utils';
|
|
3
4
|
export interface BatteryDialogTabsContentProps extends ConnectivityNetworkProps {
|
|
4
5
|
batteryToModify?: BatteryFormInfos | null;
|
|
5
6
|
updatePreviousReactiveCapabilityCurveTable: (action: string, index: number) => void;
|
|
7
|
+
fetchVoltageLevelEquipments: (voltageLevelId: string) => Promise<(Identifiable & {
|
|
8
|
+
type: EquipmentType;
|
|
9
|
+
})[]>;
|
|
6
10
|
tabIndex: number;
|
|
7
11
|
}
|
|
8
|
-
export declare function BatteryDialogTabsContent({ batteryToModify, updatePreviousReactiveCapabilityCurveTable, tabIndex, voltageLevelOptions, PositionDiagramPane, fetchBusesOrBusbarSections, }: Readonly<BatteryDialogTabsContentProps>): import("react").JSX.Element;
|
|
12
|
+
export declare function BatteryDialogTabsContent({ batteryToModify, updatePreviousReactiveCapabilityCurveTable, tabIndex, voltageLevelOptions, PositionDiagramPane, fetchBusesOrBusbarSections, fetchVoltageLevelEquipments, }: Readonly<BatteryDialogTabsContentProps>): import("react").JSX.Element;
|
package/dist/features/network-modifications/battery/modification/BatteryDialogTabsContent.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { jsxs, Fragment
|
|
1
|
+
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
2
2
|
import { Box, Grid2 } from "@mui/material";
|
|
3
|
-
import { FormattedMessage } from "react-intl";
|
|
3
|
+
import { useIntl, FormattedMessage } from "react-intl";
|
|
4
4
|
import { BatteryDialogTab } from "./batteryTabs.utils.js";
|
|
5
5
|
import { GridSection } from "../../../../components/composite/grid/grid-section.js";
|
|
6
6
|
import { GridItem } from "../../../../components/composite/grid/grid-item.js";
|
|
@@ -29,6 +29,7 @@ import "@material-symbols/svg-400/outlined/left_panel_close.svg?react";
|
|
|
29
29
|
import "@material-symbols/svg-400/outlined/add_notes.svg?react";
|
|
30
30
|
import "../../../../components/ui/dialogs/descriptionModificationDialog/DescriptionModificationDialog.js";
|
|
31
31
|
import "../../../../components/ui/reactHookForm/expandableInput/ExpandableInput.js";
|
|
32
|
+
import { CheckboxNullableInput } from "../../../../components/ui/reactHookForm/CheckboxNullableInput.js";
|
|
32
33
|
import "../../../../components/ui/reactHookForm/directory-item-input/directory-item-utils.js";
|
|
33
34
|
import "@hello-pangea/dnd";
|
|
34
35
|
import "../../../../components/ui/dialogs/elementSaveDialog/ElementSaveDialog.js";
|
|
@@ -70,6 +71,7 @@ import { ActivePowerControlForm } from "../../common/activePowerControl/ActivePo
|
|
|
70
71
|
import { ShortCircuitForm } from "../../common/shortCircuit/ShortCircuitForm.js";
|
|
71
72
|
import { ReactiveLimitsForm } from "../../common/reactiveLimits/ReactiveLimitsForm.js";
|
|
72
73
|
import "../../common/regulatingTerminal/RegulatingTerminalForm.js";
|
|
74
|
+
import { VoltageRegulationForm } from "../../common/voltageRegulation/VoltageRegulationForm.js";
|
|
73
75
|
import "@mui/material/colors";
|
|
74
76
|
import "@mui/x-charts";
|
|
75
77
|
import "../../common/currentLimits/limitsPane.utils.js";
|
|
@@ -79,8 +81,42 @@ function BatteryDialogTabsContent({
|
|
|
79
81
|
tabIndex,
|
|
80
82
|
voltageLevelOptions = [],
|
|
81
83
|
PositionDiagramPane,
|
|
82
|
-
fetchBusesOrBusbarSections
|
|
84
|
+
fetchBusesOrBusbarSections,
|
|
85
|
+
fetchVoltageLevelEquipments
|
|
83
86
|
}) {
|
|
87
|
+
const intl = useIntl();
|
|
88
|
+
const previousRegulation = () => {
|
|
89
|
+
if (batteryToModify?.voltageRegulatorOn) {
|
|
90
|
+
return intl.formatMessage({ id: "On" });
|
|
91
|
+
}
|
|
92
|
+
if (batteryToModify?.voltageRegulatorOn === false) {
|
|
93
|
+
return intl.formatMessage({ id: "Off" });
|
|
94
|
+
}
|
|
95
|
+
return null;
|
|
96
|
+
};
|
|
97
|
+
const voltageRegulationField = /* @__PURE__ */ jsx(Box, { children: /* @__PURE__ */ jsx(
|
|
98
|
+
CheckboxNullableInput,
|
|
99
|
+
{
|
|
100
|
+
name: FieldConstants.VOLTAGE_REGULATION,
|
|
101
|
+
label: "VoltageRegulationText",
|
|
102
|
+
previousValue: previousRegulation() ?? void 0
|
|
103
|
+
}
|
|
104
|
+
) });
|
|
105
|
+
const voltageRegulationForm = /* @__PURE__ */ jsx(
|
|
106
|
+
VoltageRegulationForm,
|
|
107
|
+
{
|
|
108
|
+
voltageLevelOptions,
|
|
109
|
+
fetchVoltageLevelEquipments,
|
|
110
|
+
previousValues: {
|
|
111
|
+
regulatingTerminalConnectableId: batteryToModify?.regulatingTerminalConnectableId,
|
|
112
|
+
regulatingTerminalVlId: batteryToModify?.regulatingTerminalVlId,
|
|
113
|
+
regulatingTerminalConnectableType: batteryToModify?.regulatingTerminalConnectableType,
|
|
114
|
+
voltageSetPoint: batteryToModify?.targetV
|
|
115
|
+
},
|
|
116
|
+
isEquipmentModification: true,
|
|
117
|
+
isGenerator: false
|
|
118
|
+
}
|
|
119
|
+
);
|
|
84
120
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
85
121
|
/* @__PURE__ */ jsxs(Box, { hidden: tabIndex !== BatteryDialogTab.CONNECTIVITY_TAB, children: [
|
|
86
122
|
/* @__PURE__ */ jsx(GridSection, { title: "Connectivity" }),
|
|
@@ -124,13 +160,17 @@ function BatteryDialogTabsContent({
|
|
|
124
160
|
}
|
|
125
161
|
) })
|
|
126
162
|
] }),
|
|
127
|
-
/* @__PURE__ */
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
163
|
+
/* @__PURE__ */ jsxs(Grid2, { container: true, spacing: 2, paddingTop: 2, children: [
|
|
164
|
+
/* @__PURE__ */ jsx(GridItem, { size: 4, children: voltageRegulationField }),
|
|
165
|
+
voltageRegulationForm,
|
|
166
|
+
/* @__PURE__ */ jsx(
|
|
167
|
+
ActivePowerControlForm,
|
|
168
|
+
{
|
|
169
|
+
isEquipmentModification: true,
|
|
170
|
+
previousValues: batteryToModify?.activePowerControl
|
|
171
|
+
}
|
|
172
|
+
)
|
|
173
|
+
] }),
|
|
134
174
|
/* @__PURE__ */ jsx(Grid2, { container: true, spacing: 2, children: /* @__PURE__ */ jsxs(Grid2, { size: 12, children: [
|
|
135
175
|
/* @__PURE__ */ jsx("h3", { children: /* @__PURE__ */ jsx(FormattedMessage, { id: "Limits" }) }),
|
|
136
176
|
/* @__PURE__ */ jsx("h4", { children: /* @__PURE__ */ jsx(FormattedMessage, { id: "ActiveLimits" }) })
|
package/dist/features/network-modifications/battery/modification/BatteryModificationForm.d.ts
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import { BatteryDialogHeaderProps } from './BatteryDialogHeader';
|
|
2
2
|
import { BatteryDialogTabsContentProps } from './BatteryDialogTabsContent';
|
|
3
|
+
import { EquipmentType, Identifiable } from '../../../../utils';
|
|
3
4
|
interface BatteryModificationFormProps extends BatteryDialogHeaderProps, Omit<BatteryDialogTabsContentProps, 'tabIndex'> {
|
|
5
|
+
fetchVoltageLevelEquipments: (voltageLevelId: string) => Promise<(Identifiable & {
|
|
6
|
+
type: EquipmentType;
|
|
7
|
+
})[]>;
|
|
4
8
|
}
|
|
5
|
-
export declare function BatteryModificationForm({ batteryToModify, updatePreviousReactiveCapabilityCurveTable, voltageLevelOptions, fetchBusesOrBusbarSections, PositionDiagramPane, }: Readonly<BatteryModificationFormProps>): import("react").JSX.Element;
|
|
9
|
+
export declare function BatteryModificationForm({ batteryToModify, updatePreviousReactiveCapabilityCurveTable, voltageLevelOptions, fetchBusesOrBusbarSections, PositionDiagramPane, fetchVoltageLevelEquipments, }: Readonly<BatteryModificationFormProps>): import("react").JSX.Element;
|
|
6
10
|
export {};
|
|
@@ -15,7 +15,8 @@ function BatteryModificationForm({
|
|
|
15
15
|
updatePreviousReactiveCapabilityCurveTable,
|
|
16
16
|
voltageLevelOptions,
|
|
17
17
|
fetchBusesOrBusbarSections,
|
|
18
|
-
PositionDiagramPane
|
|
18
|
+
PositionDiagramPane,
|
|
19
|
+
fetchVoltageLevelEquipments
|
|
19
20
|
}) {
|
|
20
21
|
const { tabIndex, setTabIndex, tabIndexesWithError } = useTabsWithError(
|
|
21
22
|
BATTERY_TAB_FIELDS,
|
|
@@ -40,7 +41,8 @@ function BatteryModificationForm({
|
|
|
40
41
|
voltageLevelOptions,
|
|
41
42
|
fetchBusesOrBusbarSections,
|
|
42
43
|
PositionDiagramPane,
|
|
43
|
-
updatePreviousReactiveCapabilityCurveTable
|
|
44
|
+
updatePreviousReactiveCapabilityCurveTable,
|
|
45
|
+
fetchVoltageLevelEquipments
|
|
44
46
|
}
|
|
45
47
|
) })
|
|
46
48
|
] });
|
package/dist/features/network-modifications/battery/modification/batteryModification.types.d.ts
CHANGED
|
@@ -28,4 +28,10 @@ export interface BatteryModificationDto {
|
|
|
28
28
|
properties: Property[] | null;
|
|
29
29
|
directTransX: AttributeModification<number> | null;
|
|
30
30
|
stepUpTransformerX: AttributeModification<number> | null;
|
|
31
|
+
voltageRegulationOn: AttributeModification<boolean> | null;
|
|
32
|
+
targetV: AttributeModification<number> | null;
|
|
33
|
+
voltageRegulationType?: AttributeModification<string> | null;
|
|
34
|
+
regulatingTerminalId: AttributeModification<string> | null;
|
|
35
|
+
regulatingTerminalType: AttributeModification<string> | null;
|
|
36
|
+
regulatingTerminalVlId: AttributeModification<string> | null;
|
|
31
37
|
}
|
package/dist/features/network-modifications/battery/modification/batteryModification.utils.d.ts
CHANGED
|
@@ -6,6 +6,22 @@ export declare const batteryModificationFormSchema: import('yup').ObjectSchema<N
|
|
|
6
6
|
directTransX: number | null | undefined;
|
|
7
7
|
frequencyRegulation: boolean | null | undefined;
|
|
8
8
|
droop: number | null | undefined;
|
|
9
|
+
voltageRegulation: boolean | null | undefined;
|
|
10
|
+
voltageRegulationType: string | null | undefined;
|
|
11
|
+
voltageSetpoint: number | null | undefined;
|
|
12
|
+
qPercent: number | null | undefined;
|
|
13
|
+
voltageLevel: {
|
|
14
|
+
id?: string | undefined;
|
|
15
|
+
name?: string | undefined;
|
|
16
|
+
nominalVoltage?: string | undefined;
|
|
17
|
+
substationId?: string | undefined;
|
|
18
|
+
topologyKind?: string | null | undefined;
|
|
19
|
+
} | null;
|
|
20
|
+
equipment: {
|
|
21
|
+
id?: string | undefined;
|
|
22
|
+
name?: string | null | undefined;
|
|
23
|
+
type?: string | undefined;
|
|
24
|
+
} | null;
|
|
9
25
|
reactivePowerSetpoint: number | null | undefined;
|
|
10
26
|
activePowerSetpoint: number | undefined;
|
|
11
27
|
equipmentID: string;
|
|
@@ -57,6 +73,22 @@ export declare const batteryModificationFormSchema: import('yup').ObjectSchema<N
|
|
|
57
73
|
directTransX: undefined;
|
|
58
74
|
frequencyRegulation: undefined;
|
|
59
75
|
droop: undefined;
|
|
76
|
+
voltageRegulation: undefined;
|
|
77
|
+
voltageRegulationType: undefined;
|
|
78
|
+
voltageSetpoint: undefined;
|
|
79
|
+
qPercent: undefined;
|
|
80
|
+
voltageLevel: {
|
|
81
|
+
id: undefined;
|
|
82
|
+
name: undefined;
|
|
83
|
+
substationId: undefined;
|
|
84
|
+
nominalVoltage: undefined;
|
|
85
|
+
topologyKind: undefined;
|
|
86
|
+
};
|
|
87
|
+
equipment: {
|
|
88
|
+
id: undefined;
|
|
89
|
+
name: undefined;
|
|
90
|
+
type: undefined;
|
|
91
|
+
};
|
|
60
92
|
reactivePowerSetpoint: undefined;
|
|
61
93
|
activePowerSetpoint: undefined;
|
|
62
94
|
equipmentID: undefined;
|
package/dist/features/network-modifications/battery/modification/batteryModification.utils.js
CHANGED
|
@@ -67,6 +67,8 @@ import { getActivePowerControlSchema, getActivePowerControlEmptyFormData } from
|
|
|
67
67
|
import { getShortCircuitFormSchema, getShortCircuitEmptyFormData, getShortCircuitFormData } from "../../common/shortCircuit/shortCircuitForm.utils.js";
|
|
68
68
|
import { getReactiveLimitsValidationSchema, getReactiveLimitsEmptyFormDataProps, getReactiveLimitsFormDataProps } from "../../common/reactiveLimits/reactiveLimits.utils.js";
|
|
69
69
|
import "../../common/regulatingTerminal/RegulatingTerminalForm.js";
|
|
70
|
+
import { getRegulatingTerminalEquipmentData, getRegulatingTerminalVoltageLevelData } from "../../common/regulatingTerminal/regulatingTerminal.utils.js";
|
|
71
|
+
import { getVoltageRegulationSchema, getVoltageRegulationEmptyFormData } from "../../common/voltageRegulation/voltageRegulation.utils.js";
|
|
70
72
|
import "@mui/material/colors";
|
|
71
73
|
import "@mui/x-charts";
|
|
72
74
|
import "../../common/currentLimits/limitsPane.utils.js";
|
|
@@ -85,6 +87,7 @@ const batteryModificationFormSchema = object().shape({
|
|
|
85
87
|
[FieldConstants.REACTIVE_LIMITS]: getReactiveLimitsValidationSchema(true),
|
|
86
88
|
[FieldConstants.STATE_ESTIMATION]: getInjectionActiveReactivePowerValidationSchemaProperties(),
|
|
87
89
|
...getSetPointsSchema(true),
|
|
90
|
+
...getVoltageRegulationSchema(true),
|
|
88
91
|
...getActivePowerControlSchema(true),
|
|
89
92
|
...getShortCircuitFormSchema(true)
|
|
90
93
|
}).concat(modificationPropertiesSchema).required();
|
|
@@ -97,6 +100,7 @@ const batteryModificationEmptyFormData = {
|
|
|
97
100
|
reactiveLimits: getReactiveLimitsEmptyFormDataProps(),
|
|
98
101
|
...getSetPointsEmptyFormData(true),
|
|
99
102
|
...getActivePowerControlEmptyFormData(true),
|
|
103
|
+
...getVoltageRegulationEmptyFormData(true),
|
|
100
104
|
AdditionalProperties: [],
|
|
101
105
|
...getShortCircuitEmptyFormData(),
|
|
102
106
|
stateEstimation: getInjectionActiveReactivePowerEmptyFormDataProperties()
|
|
@@ -131,6 +135,16 @@ const batteryModificationDtoToForm = (dto, includePreviousValues = true) => {
|
|
|
131
135
|
directTransX: dto?.directTransX?.value ?? null,
|
|
132
136
|
stepUpTransformerX: dto?.stepUpTransformerX?.value ?? null
|
|
133
137
|
}),
|
|
138
|
+
voltageRegulationType: dto?.voltageRegulationType?.value ?? null,
|
|
139
|
+
voltageRegulation: dto?.voltageRegulationOn?.value ?? null,
|
|
140
|
+
voltageSetpoint: dto?.targetV?.value ?? null,
|
|
141
|
+
voltageLevel: getRegulatingTerminalVoltageLevelData({
|
|
142
|
+
voltageLevelId: dto.regulatingTerminalVlId?.value
|
|
143
|
+
}),
|
|
144
|
+
equipment: getRegulatingTerminalEquipmentData({
|
|
145
|
+
equipmentId: dto.regulatingTerminalId?.value,
|
|
146
|
+
equipmentType: dto.regulatingTerminalType?.value
|
|
147
|
+
}),
|
|
134
148
|
...getPropertiesFromModification(dto?.properties, includePreviousValues)
|
|
135
149
|
};
|
|
136
150
|
};
|
|
@@ -162,7 +176,13 @@ const batteryModificationFormToDto = (form) => {
|
|
|
162
176
|
qMeasurementValidity: toModificationOperation(form.stateEstimation?.measurementQ?.validity),
|
|
163
177
|
properties: toModificationProperties(form) ?? null,
|
|
164
178
|
directTransX: toModificationOperation(form.directTransX),
|
|
165
|
-
stepUpTransformerX: toModificationOperation(form.transformerReactance)
|
|
179
|
+
stepUpTransformerX: toModificationOperation(form.transformerReactance),
|
|
180
|
+
voltageRegulationType: toModificationOperation(form.voltageRegulationType),
|
|
181
|
+
regulatingTerminalId: toModificationOperation(form.equipment?.id),
|
|
182
|
+
regulatingTerminalType: toModificationOperation(form.equipment?.type),
|
|
183
|
+
regulatingTerminalVlId: toModificationOperation(form.voltageLevel?.id),
|
|
184
|
+
voltageRegulationOn: toModificationOperation(form.voltageRegulation),
|
|
185
|
+
targetV: toModificationOperation(form.voltageSetpoint)
|
|
166
186
|
};
|
|
167
187
|
};
|
|
168
188
|
export {
|
|
@@ -0,0 +1,10 @@
|
|
|
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
|
+
*/
|
|
7
|
+
export declare const FORMULAS = "formulas";
|
|
8
|
+
export declare const OPERATOR = "operator";
|
|
9
|
+
export declare const REFERENCE_FIELD_OR_VALUE_1 = "referenceFieldOrValue1";
|
|
10
|
+
export declare const REFERENCE_FIELD_OR_VALUE_2 = "referenceFieldOrValue2";
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
const FORMULAS = "formulas";
|
|
2
|
+
const OPERATOR = "operator";
|
|
3
|
+
const REFERENCE_FIELD_OR_VALUE_1 = "referenceFieldOrValue1";
|
|
4
|
+
const REFERENCE_FIELD_OR_VALUE_2 = "referenceFieldOrValue2";
|
|
5
|
+
export {
|
|
6
|
+
FORMULAS,
|
|
7
|
+
OPERATOR,
|
|
8
|
+
REFERENCE_FIELD_OR_VALUE_1,
|
|
9
|
+
REFERENCE_FIELD_OR_VALUE_2
|
|
10
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
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
|
+
*/
|
|
7
|
+
interface FormulaProps {
|
|
8
|
+
name: string;
|
|
9
|
+
index: number;
|
|
10
|
+
}
|
|
11
|
+
declare function FormulaForm({ name, index }: FormulaProps): import("react").JSX.Element;
|
|
12
|
+
export default FormulaForm;
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { useWatch } from "react-hook-form";
|
|
3
|
+
import { Grid2 } from "@mui/material";
|
|
4
|
+
import { DragHandle } from "@mui/icons-material";
|
|
5
|
+
import { EQUIPMENTS_FIELDS } from "./formula-utils.js";
|
|
6
|
+
import ReferenceAutocompleteInput from "./reference-autocomplete-input.js";
|
|
7
|
+
import { FieldConstants } from "../../../../../utils/constants/fieldConstants.js";
|
|
8
|
+
import { FILTERS } from "../../../../../utils/constants/filterConstant.js";
|
|
9
|
+
import "../../../../../utils/conversionUtils.js";
|
|
10
|
+
import { ElementType } from "../../../../../utils/types/elementType.js";
|
|
11
|
+
import { EquipmentType } from "../../../../../utils/types/equipmentType.js";
|
|
12
|
+
import { getIdOrValue, getLabelOrValue } from "../../../../../utils/ts-utils.js";
|
|
13
|
+
import "react";
|
|
14
|
+
import "react-intl";
|
|
15
|
+
import "localized-countries";
|
|
16
|
+
import "localized-countries/data/fr";
|
|
17
|
+
import "localized-countries/data/en";
|
|
18
|
+
import "notistack";
|
|
19
|
+
import { useFormatLabelWithUnit } from "../../../../../hooks/useFormatLabelWithUnit.js";
|
|
20
|
+
import "../../../../../components/ui/overflowableText/OverflowableText.js";
|
|
21
|
+
import "../../../../../components/ui/reactHookForm/provider/CustomFormProvider.js";
|
|
22
|
+
import "yup";
|
|
23
|
+
import { DirectoryItemsInput } from "../../../../../components/ui/reactHookForm/DirectoryItemsInput.js";
|
|
24
|
+
import { AutocompleteInput } from "../../../../../components/ui/reactHookForm/autocompleteInputs/AutocompleteInput.js";
|
|
25
|
+
import "../../../../../components/ui/reactHookForm/numbers/RangeInput.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 "../../../../../components/ui/reactHookForm/directory-item-input/directory-item-utils.js";
|
|
34
|
+
import "../../../../../components/ui/treeViewFinder/TreeViewFinder.js";
|
|
35
|
+
import "@hello-pangea/dnd";
|
|
36
|
+
import "../../../../../components/ui/dialogs/elementSaveDialog/ElementSaveDialog.js";
|
|
37
|
+
import "../../../../../components/ui/snackbarProvider/SnackbarProvider.js";
|
|
38
|
+
import "mui-nested-menu";
|
|
39
|
+
import "react-resizable-panels";
|
|
40
|
+
import "react-papaparse";
|
|
41
|
+
import "react-dom";
|
|
42
|
+
import "autosuggest-highlight/match";
|
|
43
|
+
import "autosuggest-highlight/parse";
|
|
44
|
+
import "clsx";
|
|
45
|
+
import "../../../../../components/composite/filter/FilterCreationDialog.js";
|
|
46
|
+
import "../../../../../components/composite/filter/HeaderFilterForm.js";
|
|
47
|
+
import "../../../../../components/composite/filter/explicitNaming/ExplicitNamingFilterForm.js";
|
|
48
|
+
import "../../../../../components/composite/filter/expert/ExpertFilterForm.js";
|
|
49
|
+
import "../../../../../components/composite/filter/expert/ExpertFilterEditionDialog.js";
|
|
50
|
+
import "../../../../../components/composite/filter/expert/expertFilterConstants.js";
|
|
51
|
+
import "react-querybuilder";
|
|
52
|
+
import "uuid";
|
|
53
|
+
import "../../../../../components/composite/filter/explicitNaming/ExplicitNamingFilterEditionDialog.js";
|
|
54
|
+
import "../../../../../components/composite/filter/utils/filterFormUtils.js";
|
|
55
|
+
import { GridItem } from "../../../../../components/composite/grid/grid-item.js";
|
|
56
|
+
import "@react-querybuilder/material";
|
|
57
|
+
import "../../../../../components/composite/reactQueryBuilder/CustomReactQueryBuilder.js";
|
|
58
|
+
import "../../../../../components/composite/reactQueryBuilder/PropertyValueEditor.js";
|
|
59
|
+
import "../../../../../components/composite/agGridTable/BottomTableButtons.js";
|
|
60
|
+
import "../../../../../components/composite/agGridTable/CustomAgGridTable.js";
|
|
61
|
+
import "ag-grid-community";
|
|
62
|
+
import "../../../../../components/composite/customAGGrid/customAggrid.js";
|
|
63
|
+
import "../../../../../components/composite/customAGGrid/context/custom-aggrid-context.js";
|
|
64
|
+
import "mathjs";
|
|
65
|
+
import "../../../../../components/composite/report/report-viewer/log-table/log-table.js";
|
|
66
|
+
import "react-window";
|
|
67
|
+
import "../../../../../components/composite/report/report-treeview/treeview-item.js";
|
|
68
|
+
import "../../../../../components/composite/report/report-viewer/context/report-viewer-context.js";
|
|
69
|
+
import { REFERENCE_FIELD_OR_VALUE_1, OPERATOR, REFERENCE_FIELD_OR_VALUE_2 } from "./formula-constants.js";
|
|
70
|
+
const OPERATOR_OPTIONS = [
|
|
71
|
+
{ id: "ADDITION", label: "+" },
|
|
72
|
+
{ id: "SUBTRACTION", label: "-" },
|
|
73
|
+
{ id: "MULTIPLICATION", label: "*" },
|
|
74
|
+
{ id: "DIVISION", label: "/" },
|
|
75
|
+
{ id: "PERCENTAGE", label: "%" }
|
|
76
|
+
];
|
|
77
|
+
function FormulaForm({ name, index }) {
|
|
78
|
+
const equipmentTypeWatch = useWatch({
|
|
79
|
+
name: FieldConstants.EQUIPMENT_TYPE
|
|
80
|
+
});
|
|
81
|
+
const equipmentFields = EQUIPMENTS_FIELDS[equipmentTypeWatch] ?? [];
|
|
82
|
+
const editableEquipmentFields = equipmentTypeWatch === EquipmentType.TWO_WINDINGS_TRANSFORMER ? EQUIPMENTS_FIELDS[equipmentTypeWatch].filter(
|
|
83
|
+
(field) => field.id !== "RATIO_HIGH_TAP_POSITION" && field.id !== "PHASE_HIGH_TAP_POSITION"
|
|
84
|
+
) ?? [] : EQUIPMENTS_FIELDS[equipmentTypeWatch] ?? [];
|
|
85
|
+
const formatLabelWithUnit = useFormatLabelWithUnit();
|
|
86
|
+
const filtersField = /* @__PURE__ */ jsx(
|
|
87
|
+
DirectoryItemsInput,
|
|
88
|
+
{
|
|
89
|
+
name: `${name}.${index}.${FILTERS}`,
|
|
90
|
+
equipmentTypes: [equipmentTypeWatch],
|
|
91
|
+
elementType: ElementType.FILTER,
|
|
92
|
+
label: "filter",
|
|
93
|
+
titleId: "FiltersListsSelection",
|
|
94
|
+
disable: !equipmentTypeWatch
|
|
95
|
+
}
|
|
96
|
+
);
|
|
97
|
+
const editedField = /* @__PURE__ */ jsx(
|
|
98
|
+
AutocompleteInput,
|
|
99
|
+
{
|
|
100
|
+
name: `${name}.${index}.${FieldConstants.EDITED_FIELD}`,
|
|
101
|
+
options: editableEquipmentFields,
|
|
102
|
+
label: "EditedField",
|
|
103
|
+
size: "small",
|
|
104
|
+
inputTransform: (value) => editableEquipmentFields.find((option) => option?.id === value) || value,
|
|
105
|
+
outputTransform: (option) => getIdOrValue(option) ?? null,
|
|
106
|
+
getOptionLabel: (option) => formatLabelWithUnit(option)
|
|
107
|
+
}
|
|
108
|
+
);
|
|
109
|
+
const referenceField1 = /* @__PURE__ */ jsx(ReferenceAutocompleteInput, { name: `${name}.${index}.${REFERENCE_FIELD_OR_VALUE_1}`, options: equipmentFields });
|
|
110
|
+
const inputTransform = (value) => {
|
|
111
|
+
const newVal = value ?? null;
|
|
112
|
+
return OPERATOR_OPTIONS.find((option) => option?.id === getIdOrValue(value)) || newVal;
|
|
113
|
+
};
|
|
114
|
+
const operatorField = /* @__PURE__ */ jsx(
|
|
115
|
+
AutocompleteInput,
|
|
116
|
+
{
|
|
117
|
+
name: `${name}.${index}.${OPERATOR}`,
|
|
118
|
+
options: OPERATOR_OPTIONS,
|
|
119
|
+
readOnly: true,
|
|
120
|
+
label: "Operator",
|
|
121
|
+
size: "small",
|
|
122
|
+
inputTransform,
|
|
123
|
+
outputTransform: getIdOrValue,
|
|
124
|
+
getOptionLabel: getLabelOrValue
|
|
125
|
+
}
|
|
126
|
+
);
|
|
127
|
+
const referenceField2 = /* @__PURE__ */ jsx(ReferenceAutocompleteInput, { name: `${name}.${index}.${REFERENCE_FIELD_OR_VALUE_2}`, options: equipmentFields });
|
|
128
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
129
|
+
/* @__PURE__ */ jsx(GridItem, { size: 2.25, children: filtersField }),
|
|
130
|
+
/* @__PURE__ */ jsx(GridItem, { size: 2.25, children: editedField }),
|
|
131
|
+
/* @__PURE__ */ jsx(Grid2, { size: 0.25, sx: { marginTop: 0.75 }, children: /* @__PURE__ */ jsx(DragHandle, {}) }),
|
|
132
|
+
/* @__PURE__ */ jsx(GridItem, { size: 2.5, children: referenceField1 }),
|
|
133
|
+
/* @__PURE__ */ jsx(GridItem, { size: 1.25, children: operatorField }),
|
|
134
|
+
/* @__PURE__ */ jsx(GridItem, { size: 2.5, children: referenceField2 })
|
|
135
|
+
] });
|
|
136
|
+
}
|
|
137
|
+
export {
|
|
138
|
+
FormulaForm as default
|
|
139
|
+
};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { EquipmentType } from '../../../../../utils';
|
|
2
|
+
/**
|
|
3
|
+
* Copyright (c) 2026, RTE (http://www.rte-france.com)
|
|
4
|
+
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
5
|
+
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
6
|
+
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
7
|
+
*/
|
|
8
|
+
import * as yup from 'yup';
|
|
9
|
+
export type EquipmentField = {
|
|
10
|
+
id: string;
|
|
11
|
+
label: string;
|
|
12
|
+
unit?: string;
|
|
13
|
+
};
|
|
14
|
+
type EquipmentFieldsKeys = EquipmentType.GENERATOR | EquipmentType.BATTERY | EquipmentType.SHUNT_COMPENSATOR | EquipmentType.VOLTAGE_LEVEL | EquipmentType.LOAD | EquipmentType.TWO_WINDINGS_TRANSFORMER | EquipmentType.LINE;
|
|
15
|
+
type EquipmentFields = {
|
|
16
|
+
[key in EquipmentFieldsKeys]: EquipmentField[];
|
|
17
|
+
};
|
|
18
|
+
export declare const EQUIPMENTS_FIELDS: EquipmentFields;
|
|
19
|
+
export type EquipmentTypeOptionType = keyof typeof EQUIPMENTS_FIELDS;
|
|
20
|
+
export declare const getFormulaInitialValue: () => {
|
|
21
|
+
filters: never[];
|
|
22
|
+
editedField: null;
|
|
23
|
+
referenceFieldOrValue1: null;
|
|
24
|
+
operator: null;
|
|
25
|
+
referenceFieldOrValue2: null;
|
|
26
|
+
};
|
|
27
|
+
export declare function getFormulaSchema(): yup.ArraySchema<{
|
|
28
|
+
filters: {
|
|
29
|
+
id: string;
|
|
30
|
+
name: string;
|
|
31
|
+
specificMetadata: {
|
|
32
|
+
type?: string | undefined;
|
|
33
|
+
};
|
|
34
|
+
}[];
|
|
35
|
+
editedField: string;
|
|
36
|
+
operator: string;
|
|
37
|
+
referenceFieldOrValue1: {};
|
|
38
|
+
referenceFieldOrValue2: {};
|
|
39
|
+
}[] | undefined, yup.AnyObject, "", "">;
|
|
40
|
+
export {};
|