@gridsuite/commons-ui 0.255.0 → 0.257.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/filter/FilterCreationDialog.js +6 -2
- package/dist/components/composite/filter/HeaderFilterForm.js +3 -2
- package/dist/components/composite/reactQueryBuilder/CustomReactQueryBuilder.js +7 -4
- package/dist/components/ui/dialogs/descriptionModificationDialog/DescriptionModificationDialog.js +2 -1
- package/dist/components/ui/dialogs/elementSaveDialog/ElementSaveDialog.js +2 -1
- package/dist/features/index.js +16 -0
- package/dist/features/network-modifications/battery/creation/batteryCreation.utils.js +3 -2
- 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 +23 -2
- package/dist/features/network-modifications/by-filter/assignment/assignment/assignment-form.js +2 -1
- package/dist/features/network-modifications/by-filter/assignment/assignment/assignment-utils.js +2 -2
- 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/activePowerControl/activePowerControlForm.utils.js +2 -1
- package/dist/features/network-modifications/common/connectivity/connectivityForm.utils.js +2 -1
- package/dist/features/network-modifications/common/currentLimits/limitsPane.utils.js +2 -1
- package/dist/features/network-modifications/common/reactiveLimits/reactiveCapabilityCurve/reactiveCapability.utils.js +2 -1
- package/dist/features/network-modifications/common/reactiveLimits/reactiveLimits.utils.js +3 -2
- package/dist/features/network-modifications/common/voltageRegulation/VoltageRegulationForm.js +1 -1
- package/dist/features/network-modifications/common/voltageRegulation/voltageRegulation.utils.js +3 -2
- package/dist/features/network-modifications/generator/creation/generatorCreation.utils.js +4 -3
- package/dist/features/network-modifications/generator/modification/generatorModification.utils.js +5 -4
- package/dist/features/network-modifications/index.js +16 -0
- package/dist/features/network-modifications/line/characteristics/lineCharacteristicsPane.utils.js +7 -6
- package/dist/features/network-modifications/shunt-compensator/common/characteristicsForm.utils.js +7 -6
- package/dist/features/network-modifications/voltageLevel/creation/voltageLevelCreation.utils.js +10 -9
- package/dist/features/network-modifications/voltageLevel/modification/voltageLevelModification.utils.js +6 -5
- package/dist/features/parameters/common/limitreductions/columns-definitions.js +3 -2
- package/dist/features/parameters/dynamic-margin-calculation/loads-variations-parameters.js +2 -2
- package/dist/features/parameters/security-analysis/columns-definitions.js +4 -3
- package/dist/features/parameters/voltage-init/use-voltage-init-parameters-form.js +3 -3
- package/dist/hooks/use-unique-name-validation.js +3 -2
- package/dist/index.js +43 -1
- package/dist/translations/en/descriptionEn.d.ts +0 -6
- package/dist/translations/en/descriptionEn.js +6 -1
- package/dist/translations/en/filterEn.d.ts +0 -2
- package/dist/translations/en/filterEn.js +0 -2
- package/dist/translations/en/generic-validationEn.d.ts +23 -0
- package/dist/translations/en/generic-validationEn.js +25 -0
- package/dist/translations/en/index.d.ts +2 -0
- package/dist/translations/en/index.js +4 -0
- package/dist/translations/en/network-modification-validationEn.d.ts +23 -0
- package/dist/translations/en/network-modification-validationEn.js +31 -0
- package/dist/translations/en/networkModificationsEn.d.ts +16 -30
- package/dist/translations/en/networkModificationsEn.js +10 -35
- package/dist/translations/en/parameters.d.ts +0 -2
- package/dist/translations/en/parameters.js +0 -2
- package/dist/translations/en/use-unique-name-validation-en.d.ts +0 -2
- package/dist/translations/en/use-unique-name-validation-en.js +1 -3
- package/dist/translations/fr/descriptionFr.d.ts +0 -6
- package/dist/translations/fr/descriptionFr.js +6 -1
- package/dist/translations/fr/filterFr.d.ts +0 -2
- package/dist/translations/fr/filterFr.js +0 -2
- package/dist/translations/fr/generic-validationFr.d.ts +17 -0
- package/dist/translations/fr/generic-validationFr.js +25 -0
- package/dist/translations/fr/index.d.ts +2 -0
- package/dist/translations/fr/index.js +4 -0
- package/dist/translations/fr/network-modification-validationFr.d.ts +23 -0
- package/dist/translations/fr/network-modification-validationFr.js +31 -0
- package/dist/translations/fr/networkModificationsFr.d.ts +16 -30
- package/dist/translations/fr/networkModificationsFr.js +10 -35
- package/dist/translations/fr/parameters.d.ts +0 -2
- package/dist/translations/fr/parameters.js +0 -2
- package/dist/translations/fr/use-unique-name-validation-fr.d.ts +0 -2
- package/dist/translations/fr/use-unique-name-validation-fr.js +1 -3
- package/dist/utils/constants/fieldConstants.d.ts +1 -0
- package/dist/utils/constants/fieldConstants.js +1 -0
- package/dist/utils/constants/index.js +19 -1
- package/dist/utils/constants/translationKeys.d.ts +18 -0
- package/dist/utils/constants/translationKeys.js +36 -0
- package/dist/utils/index.js +19 -1
- package/package.json +1 -1
|
@@ -14,8 +14,12 @@ import { FilterType } from "./constants/FilterConstants.js";
|
|
|
14
14
|
import { MAX_CHAR_DESCRIPTION } from "../../../utils/constants/uiConstants.js";
|
|
15
15
|
import { EXPERT_FILTER_QUERY } from "./expert/expertFilterConstants.js";
|
|
16
16
|
import { FILTER_EQUIPMENTS_ATTRIBUTES } from "./explicitNaming/ExplicitNamingFilterConstants.js";
|
|
17
|
+
import { DESCRIPTION_LIMIT_ERROR, NAME_EMPTY } from "../../../utils/constants/translationKeys.js";
|
|
18
|
+
import "../../../utils/conversionUtils.js";
|
|
17
19
|
import { snackWithFallback } from "../../../utils/error.js";
|
|
18
20
|
import { isDisabledValidationButton } from "../../../utils/form-utils.js";
|
|
21
|
+
import "../../../utils/types/equipmentType.js";
|
|
22
|
+
import "@mui/icons-material";
|
|
19
23
|
const emptyFormData = {
|
|
20
24
|
[FieldConstants.NAME]: "",
|
|
21
25
|
[FieldConstants.DESCRIPTION]: "",
|
|
@@ -24,8 +28,8 @@ const emptyFormData = {
|
|
|
24
28
|
...getExpertFilterEmptyFormData()
|
|
25
29
|
};
|
|
26
30
|
const formSchemaByFilterType = (filterType) => yup.object().shape({
|
|
27
|
-
[FieldConstants.NAME]: yup.string().trim().required(
|
|
28
|
-
[FieldConstants.DESCRIPTION]: yup.string().max(MAX_CHAR_DESCRIPTION,
|
|
31
|
+
[FieldConstants.NAME]: yup.string().trim().required(NAME_EMPTY),
|
|
32
|
+
[FieldConstants.DESCRIPTION]: yup.string().max(MAX_CHAR_DESCRIPTION, DESCRIPTION_LIMIT_ERROR),
|
|
29
33
|
[FieldConstants.EQUIPMENT_TYPE]: yup.string().required(),
|
|
30
34
|
...filterType?.id === FilterType.EXPLICIT_NAMING.id ? explicitNamingFilterSchema : {},
|
|
31
35
|
...filterType?.id === FilterType.EXPERT.id ? expertFilterSchema : {}
|
|
@@ -3,6 +3,7 @@ import { Grid2 } from "@mui/material";
|
|
|
3
3
|
import * as yup from "yup";
|
|
4
4
|
import { FieldConstants } from "../../../utils/constants/fieldConstants.js";
|
|
5
5
|
import { MAX_CHAR_DESCRIPTION } from "../../../utils/constants/uiConstants.js";
|
|
6
|
+
import { DESCRIPTION_LIMIT_ERROR, NAME_EMPTY } from "../../../utils/constants/translationKeys.js";
|
|
6
7
|
import "../../../utils/conversionUtils.js";
|
|
7
8
|
import { ElementType } from "../../../utils/types/elementType.js";
|
|
8
9
|
import "../../../utils/types/equipmentType.js";
|
|
@@ -45,9 +46,9 @@ const filterStyles = {
|
|
|
45
46
|
}
|
|
46
47
|
};
|
|
47
48
|
const HeaderFilterSchema = {
|
|
48
|
-
[FieldConstants.NAME]: yup.string().trim().required(
|
|
49
|
+
[FieldConstants.NAME]: yup.string().trim().required(NAME_EMPTY),
|
|
49
50
|
[FieldConstants.EQUIPMENT_TYPE]: yup.string().required(),
|
|
50
|
-
[FieldConstants.DESCRIPTION]: yup.string().max(MAX_CHAR_DESCRIPTION,
|
|
51
|
+
[FieldConstants.DESCRIPTION]: yup.string().max(MAX_CHAR_DESCRIPTION, DESCRIPTION_LIMIT_ERROR)
|
|
51
52
|
};
|
|
52
53
|
function HeaderFilterForm({ creation, activeDirectory }) {
|
|
53
54
|
return /* @__PURE__ */ jsxs(Grid2, { container: true, spacing: 2, children: [
|
|
@@ -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/components/ui/dialogs/descriptionModificationDialog/DescriptionModificationDialog.js
CHANGED
|
@@ -10,8 +10,9 @@ import { CustomMuiDialog } from "../customMuiDialog/CustomMuiDialog.js";
|
|
|
10
10
|
import { ExpandingTextField } from "../../reactHookForm/text/ExpandingTextField.js";
|
|
11
11
|
import { MAX_CHAR_DESCRIPTION } from "../../../../utils/constants/uiConstants.js";
|
|
12
12
|
import { snackWithFallback } from "../../../../utils/error.js";
|
|
13
|
+
import { DESCRIPTION_LIMIT_ERROR } from "../../../../utils/constants/translationKeys.js";
|
|
13
14
|
const schema = yup.object().shape({
|
|
14
|
-
[FieldConstants.DESCRIPTION]: yup.string().max(MAX_CHAR_DESCRIPTION,
|
|
15
|
+
[FieldConstants.DESCRIPTION]: yup.string().max(MAX_CHAR_DESCRIPTION, DESCRIPTION_LIMIT_ERROR)
|
|
15
16
|
});
|
|
16
17
|
function DescriptionModificationDialog({
|
|
17
18
|
description,
|
|
@@ -8,6 +8,7 @@ import * as yup from "yup";
|
|
|
8
8
|
import "../../overflowableText/OverflowableText.js";
|
|
9
9
|
import { FieldConstants } from "../../../../utils/constants/fieldConstants.js";
|
|
10
10
|
import { MAX_CHAR_DESCRIPTION } from "../../../../utils/constants/uiConstants.js";
|
|
11
|
+
import { DESCRIPTION_LIMIT_ERROR } from "../../../../utils/constants/translationKeys.js";
|
|
11
12
|
import "../../../../utils/conversionUtils.js";
|
|
12
13
|
import { ElementType } from "../../../../utils/types/elementType.js";
|
|
13
14
|
import "../../../../utils/types/equipmentType.js";
|
|
@@ -39,7 +40,7 @@ var OperationType = /* @__PURE__ */ ((OperationType2) => {
|
|
|
39
40
|
})(OperationType || {});
|
|
40
41
|
const schema = yup.object().shape({
|
|
41
42
|
[FieldConstants.NAME]: yup.string().trim().required(),
|
|
42
|
-
[FieldConstants.DESCRIPTION]: yup.string().optional().max(MAX_CHAR_DESCRIPTION,
|
|
43
|
+
[FieldConstants.DESCRIPTION]: yup.string().optional().max(MAX_CHAR_DESCRIPTION, DESCRIPTION_LIMIT_ERROR),
|
|
43
44
|
[FieldConstants.OPERATION_TYPE]: yup.string().oneOf(Object.values(OperationType)).required()
|
|
44
45
|
}).required();
|
|
45
46
|
const emptyFormData = {
|
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,
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { object, number, string } from "yup";
|
|
2
2
|
import { FieldConstants } from "../../../../utils/constants/fieldConstants.js";
|
|
3
|
+
import { ACTIVE_LIMITS_MIN_MAX_INVALID } from "../../../../utils/constants/translationKeys.js";
|
|
3
4
|
import "../../../../utils/conversionUtils.js";
|
|
4
5
|
import { UNDEFINED_CONNECTION_DIRECTION } from "../../../../utils/types/equipmentType.js";
|
|
5
6
|
import { ModificationType } from "../../../../utils/types/modificationType.js";
|
|
@@ -74,14 +75,14 @@ import "../../common/currentLimits/limitsPane.utils.js";
|
|
|
74
75
|
const batteryCreationFormSchema = object().shape({
|
|
75
76
|
[FieldConstants.EQUIPMENT_ID]: string().required(),
|
|
76
77
|
[FieldConstants.EQUIPMENT_NAME]: string().nullable(),
|
|
77
|
-
[FieldConstants.MAXIMUM_ACTIVE_POWER]: number().nullable().required().test("max-greater-than-min",
|
|
78
|
+
[FieldConstants.MAXIMUM_ACTIVE_POWER]: number().nullable().required().test("max-greater-than-min", ACTIVE_LIMITS_MIN_MAX_INVALID, function checkMaxGreaterThanMin(value) {
|
|
78
79
|
const min = this.parent[FieldConstants.MINIMUM_ACTIVE_POWER];
|
|
79
80
|
if (value != null && min != null) {
|
|
80
81
|
return value >= min;
|
|
81
82
|
}
|
|
82
83
|
return true;
|
|
83
84
|
}),
|
|
84
|
-
[FieldConstants.MINIMUM_ACTIVE_POWER]: number().nullable().required().test("min-less-than-max",
|
|
85
|
+
[FieldConstants.MINIMUM_ACTIVE_POWER]: number().nullable().required().test("min-less-than-max", ACTIVE_LIMITS_MIN_MAX_INVALID, function checkMinLessThanMax(value) {
|
|
85
86
|
const max = this.parent[FieldConstants.MAXIMUM_ACTIVE_POWER];
|
|
86
87
|
if (value != null && max != null) {
|
|
87
88
|
return value <= max;
|
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
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { object, number, ref, string } from "yup";
|
|
2
2
|
import { FieldConstants } from "../../../../utils/constants/fieldConstants.js";
|
|
3
|
+
import { MIN_ACTIVE_POWER_MUST_BE_LESS_OR_EQUAL_TO_MAX_ACTIVE_POWER } from "../../../../utils/constants/translationKeys.js";
|
|
3
4
|
import { toModificationOperation } from "../../../../utils/conversionUtils.js";
|
|
4
5
|
import "../../../../utils/types/equipmentType.js";
|
|
5
6
|
import { ModificationType } from "../../../../utils/types/modificationType.js";
|
|
@@ -67,6 +68,8 @@ import { getActivePowerControlSchema, getActivePowerControlEmptyFormData } from
|
|
|
67
68
|
import { getShortCircuitFormSchema, getShortCircuitEmptyFormData, getShortCircuitFormData } from "../../common/shortCircuit/shortCircuitForm.utils.js";
|
|
68
69
|
import { getReactiveLimitsValidationSchema, getReactiveLimitsEmptyFormDataProps, getReactiveLimitsFormDataProps } from "../../common/reactiveLimits/reactiveLimits.utils.js";
|
|
69
70
|
import "../../common/regulatingTerminal/RegulatingTerminalForm.js";
|
|
71
|
+
import { getRegulatingTerminalEquipmentData, getRegulatingTerminalVoltageLevelData } from "../../common/regulatingTerminal/regulatingTerminal.utils.js";
|
|
72
|
+
import { getVoltageRegulationSchema, getVoltageRegulationEmptyFormData } from "../../common/voltageRegulation/voltageRegulation.utils.js";
|
|
70
73
|
import "@mui/material/colors";
|
|
71
74
|
import "@mui/x-charts";
|
|
72
75
|
import "../../common/currentLimits/limitsPane.utils.js";
|
|
@@ -78,13 +81,14 @@ const batteryModificationFormSchema = object().shape({
|
|
|
78
81
|
is: (maximumActivePower) => maximumActivePower != null,
|
|
79
82
|
then: (schema) => schema.max(
|
|
80
83
|
ref(FieldConstants.MAXIMUM_ACTIVE_POWER),
|
|
81
|
-
|
|
84
|
+
MIN_ACTIVE_POWER_MUST_BE_LESS_OR_EQUAL_TO_MAX_ACTIVE_POWER
|
|
82
85
|
)
|
|
83
86
|
}),
|
|
84
87
|
[FieldConstants.CONNECTIVITY]: getConnectivityWithPositionSchema(true),
|
|
85
88
|
[FieldConstants.REACTIVE_LIMITS]: getReactiveLimitsValidationSchema(true),
|
|
86
89
|
[FieldConstants.STATE_ESTIMATION]: getInjectionActiveReactivePowerValidationSchemaProperties(),
|
|
87
90
|
...getSetPointsSchema(true),
|
|
91
|
+
...getVoltageRegulationSchema(true),
|
|
88
92
|
...getActivePowerControlSchema(true),
|
|
89
93
|
...getShortCircuitFormSchema(true)
|
|
90
94
|
}).concat(modificationPropertiesSchema).required();
|
|
@@ -97,6 +101,7 @@ const batteryModificationEmptyFormData = {
|
|
|
97
101
|
reactiveLimits: getReactiveLimitsEmptyFormDataProps(),
|
|
98
102
|
...getSetPointsEmptyFormData(true),
|
|
99
103
|
...getActivePowerControlEmptyFormData(true),
|
|
104
|
+
...getVoltageRegulationEmptyFormData(true),
|
|
100
105
|
AdditionalProperties: [],
|
|
101
106
|
...getShortCircuitEmptyFormData(),
|
|
102
107
|
stateEstimation: getInjectionActiveReactivePowerEmptyFormDataProperties()
|
|
@@ -131,6 +136,16 @@ const batteryModificationDtoToForm = (dto, includePreviousValues = true) => {
|
|
|
131
136
|
directTransX: dto?.directTransX?.value ?? null,
|
|
132
137
|
stepUpTransformerX: dto?.stepUpTransformerX?.value ?? null
|
|
133
138
|
}),
|
|
139
|
+
voltageRegulationType: dto?.voltageRegulationType?.value ?? null,
|
|
140
|
+
voltageRegulation: dto?.voltageRegulationOn?.value ?? null,
|
|
141
|
+
voltageSetpoint: dto?.targetV?.value ?? null,
|
|
142
|
+
voltageLevel: getRegulatingTerminalVoltageLevelData({
|
|
143
|
+
voltageLevelId: dto.regulatingTerminalVlId?.value
|
|
144
|
+
}),
|
|
145
|
+
equipment: getRegulatingTerminalEquipmentData({
|
|
146
|
+
equipmentId: dto.regulatingTerminalId?.value,
|
|
147
|
+
equipmentType: dto.regulatingTerminalType?.value
|
|
148
|
+
}),
|
|
134
149
|
...getPropertiesFromModification(dto?.properties, includePreviousValues)
|
|
135
150
|
};
|
|
136
151
|
};
|
|
@@ -162,7 +177,13 @@ const batteryModificationFormToDto = (form) => {
|
|
|
162
177
|
qMeasurementValidity: toModificationOperation(form.stateEstimation?.measurementQ?.validity),
|
|
163
178
|
properties: toModificationProperties(form) ?? null,
|
|
164
179
|
directTransX: toModificationOperation(form.directTransX),
|
|
165
|
-
stepUpTransformerX: toModificationOperation(form.transformerReactance)
|
|
180
|
+
stepUpTransformerX: toModificationOperation(form.transformerReactance),
|
|
181
|
+
voltageRegulationType: toModificationOperation(form.voltageRegulationType),
|
|
182
|
+
regulatingTerminalId: toModificationOperation(form.equipment?.id),
|
|
183
|
+
regulatingTerminalType: toModificationOperation(form.equipment?.type),
|
|
184
|
+
regulatingTerminalVlId: toModificationOperation(form.voltageLevel?.id),
|
|
185
|
+
voltageRegulationOn: toModificationOperation(form.voltageRegulation),
|
|
186
|
+
targetV: toModificationOperation(form.voltageSetpoint)
|
|
166
187
|
};
|
|
167
188
|
};
|
|
168
189
|
export {
|
package/dist/features/network-modifications/by-filter/assignment/assignment/assignment-form.js
CHANGED
|
@@ -4,6 +4,7 @@ import { DensityLarge } from "@mui/icons-material";
|
|
|
4
4
|
import { useFormContext, useWatch } from "react-hook-form";
|
|
5
5
|
import { useIntl } from "react-intl";
|
|
6
6
|
import { FieldConstants } from "../../../../../utils/constants/fieldConstants.js";
|
|
7
|
+
import { NUMERIC_VALUE_OR_EMPTY_FIELD } from "../../../../../utils/constants/translationKeys.js";
|
|
7
8
|
import "../../../../../utils/conversionUtils.js";
|
|
8
9
|
import { ElementType } from "../../../../../utils/types/elementType.js";
|
|
9
10
|
import "../../../../../utils/types/equipmentType.js";
|
|
@@ -117,7 +118,7 @@ function AssignmentForm(props) {
|
|
|
117
118
|
const optionValue = getIdOrValue(option);
|
|
118
119
|
if (optionValue && optionValue !== emptyFieldLabel && optionValue !== EMPTY_FIELD_VALUE && Number.isNaN(Number(optionValue))) {
|
|
119
120
|
setError(`${name}.${index}.${FieldConstants.VALUE}`, {
|
|
120
|
-
message:
|
|
121
|
+
message: NUMERIC_VALUE_OR_EMPTY_FIELD
|
|
121
122
|
});
|
|
122
123
|
} else {
|
|
123
124
|
setError(`${name}.${index}.${FieldConstants.VALUE}`, {
|
package/dist/features/network-modifications/by-filter/assignment/assignment/assignment-utils.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as yup from "yup";
|
|
2
2
|
import { FieldConstants } from "../../../../../utils/constants/fieldConstants.js";
|
|
3
|
-
import { YUP_REQUIRED } from "../../../../../utils/constants/translationKeys.js";
|
|
3
|
+
import { YUP_REQUIRED, NUMERIC_VALUE_OR_EMPTY_FIELD } from "../../../../../utils/constants/translationKeys.js";
|
|
4
4
|
import "../../../../../utils/conversionUtils.js";
|
|
5
5
|
import "../../../../../utils/types/equipmentType.js";
|
|
6
6
|
import "react/jsx-runtime";
|
|
@@ -21,7 +21,7 @@ function getValueSchema(emptyValueStr, dataType, settable_to_none) {
|
|
|
21
21
|
let schema;
|
|
22
22
|
switch (dataType) {
|
|
23
23
|
case DataType.DOUBLE:
|
|
24
|
-
schema = settable_to_none ? yup.string().test("is-number-or-none",
|
|
24
|
+
schema = settable_to_none ? yup.string().test("is-number-or-none", NUMERIC_VALUE_OR_EMPTY_FIELD, (value) => {
|
|
25
25
|
return value === emptyValueStr || !Number.isNaN(Number(value));
|
|
26
26
|
}) : yup.number();
|
|
27
27
|
break;
|
|
@@ -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;
|