@gridsuite/commons-ui 0.142.0 → 0.144.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/dialogs/elementSaveDialog/ElementSaveDialog.js +1 -1
- package/dist/components/dnd-table/dnd-table-add-rows-dialog.js +2 -2
- package/dist/components/dnd-table/dnd-table.js +3 -3
- package/dist/components/index.js +6 -3
- package/dist/components/inputs/reactHookForm/DirectoryItemsInput.d.ts +2 -1
- package/dist/components/inputs/reactHookForm/DirectoryItemsInput.js +118 -75
- package/dist/components/inputs/reactHookForm/OverflowableChip.d.ts +3 -2
- package/dist/components/inputs/reactHookForm/OverflowableChip.js +5 -5
- package/dist/components/inputs/reactHookForm/OverflowableChipWithHelperText.d.ts +1 -1
- package/dist/components/inputs/reactHookForm/OverflowableChipWithHelperText.js +20 -4
- package/dist/components/inputs/reactHookForm/selectInputs/SelectInput.js +3 -1
- package/dist/components/inputs/reactHookForm/text/DescriptionField.d.ts +3 -1
- package/dist/components/inputs/reactHookForm/text/DescriptionField.js +13 -4
- package/dist/components/overflowableText/OverflowableText.js +9 -1
- package/dist/components/parameters/common/ProviderParam.js +3 -3
- package/dist/components/parameters/common/constant.d.ts +3 -0
- package/dist/components/parameters/common/constant.js +6 -0
- package/dist/components/parameters/common/index.js +4 -1
- package/dist/components/parameters/common/limitreductions/limit-reduction-table-cell.js +3 -3
- package/dist/components/parameters/common/limitreductions/limit-reductions-table-form.js +2 -2
- package/dist/components/parameters/common/name-element-editor/name-element-editor-utils.js +3 -3
- package/dist/components/parameters/common/utils.d.ts +14 -0
- package/dist/components/parameters/common/utils.js +89 -0
- package/dist/components/parameters/common/voltage-level-table/custom-voltage-level-table-cell.js +3 -3
- package/dist/components/parameters/common/widget/parameter-float.js +3 -3
- package/dist/components/parameters/common/widget/parameter-line-directory-items-input.js +3 -3
- package/dist/components/parameters/common/widget/parameter-line-slider.js +3 -3
- package/dist/components/parameters/index.js +6 -3
- package/dist/components/parameters/loadflow/constants.d.ts +0 -3
- package/dist/components/parameters/loadflow/constants.js +0 -6
- package/dist/components/parameters/loadflow/index.js +1 -4
- package/dist/components/parameters/loadflow/load-flow-general-parameters.js +7 -3
- package/dist/components/parameters/loadflow/load-flow-parameter-field.js +3 -3
- package/dist/components/parameters/loadflow/load-flow-parameters-form.js +5 -5
- package/dist/components/parameters/loadflow/load-flow-parameters-header.js +3 -3
- package/dist/components/parameters/loadflow/load-flow-parameters-type.d.ts +11 -0
- package/dist/components/parameters/loadflow/load-flow-parameters-type.js +1 -0
- package/dist/components/parameters/loadflow/load-flow-parameters-utils.d.ts +0 -11
- package/dist/components/parameters/loadflow/load-flow-parameters-utils.js +3 -50
- package/dist/components/parameters/loadflow/use-load-flow-parameters-form.d.ts +3 -3
- package/dist/components/parameters/loadflow/use-load-flow-parameters-form.js +33 -59
- package/dist/components/parameters/network-visualizations/network-area-diagram-parameters.js +3 -3
- package/dist/components/parameters/network-visualizations/network-visualizations-form.js +2 -2
- package/dist/components/parameters/network-visualizations/use-network-visualizations-parameters-form.js +1 -1
- package/dist/components/parameters/pcc-min/pcc-min-form-utils.js +3 -3
- package/dist/components/parameters/pcc-min/pcc-min-parameters-form.js +3 -3
- package/dist/components/parameters/security-analysis/security-analysis-parameters-form.js +3 -3
- package/dist/components/parameters/security-analysis/security-analysis-violations-hiding.js +3 -3
- package/dist/components/parameters/sensi/sensitivity-Flow-parameters.js +3 -3
- package/dist/components/parameters/sensi/sensitivity-analysis-parameters-form.js +3 -3
- package/dist/components/parameters/sensi/sensitivity-table.js +1 -1
- package/dist/components/parameters/sensi/table-cell.js +3 -3
- package/dist/components/parameters/short-circuit/constants.d.ts +12 -0
- package/dist/components/parameters/short-circuit/constants.js +16 -1
- package/dist/components/parameters/short-circuit/index.js +5 -2
- package/dist/components/parameters/short-circuit/short-circuit-fields.js +56 -15
- package/dist/components/parameters/short-circuit/short-circuit-parameters-dialog.d.ts +3 -1
- package/dist/components/parameters/short-circuit/short-circuit-parameters-dialog.js +24 -5
- package/dist/components/parameters/short-circuit/short-circuit-parameters-form.js +5 -5
- package/dist/components/parameters/short-circuit/short-circuit-parameters-inline.d.ts +4 -3
- package/dist/components/parameters/short-circuit/short-circuit-parameters-inline.js +22 -29
- package/dist/components/parameters/short-circuit/short-circuit-parameters-utils.d.ts +27 -0
- package/dist/components/parameters/short-circuit/short-circuit-parameters-utils.js +61 -0
- package/dist/components/parameters/short-circuit/short-circuit-parameters.type.d.ts +7 -21
- package/dist/components/parameters/short-circuit/use-short-circuit-parameters-form.d.ts +15 -15
- package/dist/components/parameters/short-circuit/use-short-circuit-parameters-form.js +121 -128
- package/dist/components/parameters/voltage-init/equipment-selection-parameters.js +3 -3
- package/dist/components/parameters/voltage-init/use-voltage-init-parameters-form.js +1 -1
- package/dist/components/parameters/voltage-init/voltage-init-form-utils.js +3 -3
- package/dist/components/parameters/voltage-init/voltage-init-parameters-form.js +3 -3
- package/dist/hooks/use-parameters-backend.d.ts +2 -2
- package/dist/hooks/use-parameters-backend.js +6 -4
- package/dist/index.js +13 -7
- package/dist/services/index.d.ts +1 -0
- package/dist/services/index.js +6 -5
- package/dist/services/short-circuit-analysis.d.ts +3 -0
- package/dist/services/short-circuit-analysis.js +25 -4
- package/dist/services/study.d.ts +1 -3
- package/dist/services/study.js +0 -19
- package/dist/services/utils.d.ts +0 -4
- package/dist/services/utils.js +4 -10
- package/dist/translations/en/businessErrorsEn.d.ts +17 -0
- package/dist/translations/en/businessErrorsEn.js +20 -3
- package/dist/translations/en/inputsEn.d.ts +1 -1
- package/dist/translations/en/inputsEn.js +1 -1
- package/dist/translations/en/parameters.d.ts +3 -0
- package/dist/translations/en/parameters.js +3 -0
- package/dist/translations/fr/businessErrorsFr.d.ts +17 -0
- package/dist/translations/fr/businessErrorsFr.js +20 -3
- package/dist/translations/fr/inputsFr.d.ts +1 -1
- package/dist/translations/fr/inputsFr.js +1 -1
- package/dist/translations/fr/parameters.d.ts +3 -0
- package/dist/translations/fr/parameters.js +3 -0
- package/dist/utils/error.js +8 -0
- package/dist/utils/index.js +2 -0
- package/dist/utils/types/NetworkTimeoutError.d.ts +10 -0
- package/dist/utils/types/NetworkTimeoutError.js +9 -0
- package/dist/utils/types/index.d.ts +1 -0
- package/dist/utils/types/index.js +2 -0
- package/dist/utils/types/loadflow.type.d.ts +1 -1
- package/dist/utils/types/parameters.type.d.ts +6 -3
- package/package.json +2 -2
|
@@ -13,11 +13,13 @@ import "notistack";
|
|
|
13
13
|
import "../../../utils/conversionUtils.js";
|
|
14
14
|
import "../../../utils/types/equipmentType.js";
|
|
15
15
|
import "../../../utils/yupConfig.js";
|
|
16
|
+
import { getShortCircuitSpecificParametersDescription, updateShortCircuitParameters, fetchShortCircuitParameters } from "../../../services/short-circuit-analysis.js";
|
|
16
17
|
import { NameElementEditorForm } from "../common/name-element-editor/name-element-editor-form.js";
|
|
17
18
|
import "../../overflowableText/OverflowableText.js";
|
|
18
19
|
import "localized-countries";
|
|
19
20
|
import "localized-countries/data/fr";
|
|
20
21
|
import "localized-countries/data/en";
|
|
22
|
+
import { useParametersBackend, OptionalServicesStatus } from "../../../hooks/use-parameters-backend.js";
|
|
21
23
|
import "../../inputs/reactHookForm/provider/CustomFormProvider.js";
|
|
22
24
|
import "yup";
|
|
23
25
|
import "../../inputs/reactHookForm/agGridTable/BottomRightButtons.js";
|
|
@@ -34,6 +36,9 @@ import "../../inputs/reactQueryBuilder/PropertyValueEditor.js";
|
|
|
34
36
|
import "react-querybuilder";
|
|
35
37
|
import { useShortCircuitParametersForm } from "./use-short-circuit-parameters-form.js";
|
|
36
38
|
import { ShortCircuitParametersForm } from "./short-circuit-parameters-form.js";
|
|
39
|
+
import { ComputingType } from "../common/computing-type.js";
|
|
40
|
+
import "../common/widget/parameter-line-slider.js";
|
|
41
|
+
import "../common/limitreductions/columns-definitions.js";
|
|
37
42
|
function ShortCircuitParametersEditionDialog({
|
|
38
43
|
id,
|
|
39
44
|
open,
|
|
@@ -42,15 +47,28 @@ function ShortCircuitParametersEditionDialog({
|
|
|
42
47
|
name,
|
|
43
48
|
description,
|
|
44
49
|
activeDirectory,
|
|
50
|
+
user,
|
|
45
51
|
language,
|
|
46
52
|
enableDeveloperMode
|
|
47
53
|
}) {
|
|
54
|
+
const parametersBackend = useParametersBackend(
|
|
55
|
+
user,
|
|
56
|
+
id,
|
|
57
|
+
ComputingType.SHORT_CIRCUIT,
|
|
58
|
+
OptionalServicesStatus.Up,
|
|
59
|
+
null,
|
|
60
|
+
null,
|
|
61
|
+
null,
|
|
62
|
+
null,
|
|
63
|
+
fetchShortCircuitParameters,
|
|
64
|
+
updateShortCircuitParameters,
|
|
65
|
+
getShortCircuitSpecificParametersDescription
|
|
66
|
+
);
|
|
48
67
|
const shortCircuitMethods = useShortCircuitParametersForm({
|
|
68
|
+
parametersBackend,
|
|
49
69
|
parametersUuid: id,
|
|
50
70
|
name,
|
|
51
|
-
description
|
|
52
|
-
studyUuid: null,
|
|
53
|
-
studyShortCircuitParameters: null
|
|
71
|
+
description
|
|
54
72
|
});
|
|
55
73
|
const {
|
|
56
74
|
formState: { errors, dirtyFields }
|
|
@@ -62,6 +80,7 @@ function ShortCircuitParametersEditionDialog({
|
|
|
62
80
|
open,
|
|
63
81
|
onClose,
|
|
64
82
|
onSave: shortCircuitMethods.onSaveDialog,
|
|
83
|
+
onValidationError: shortCircuitMethods.onValidationError,
|
|
65
84
|
formSchema: shortCircuitMethods.formSchema,
|
|
66
85
|
formMethods: shortCircuitMethods.formMethods,
|
|
67
86
|
titleId,
|
|
@@ -72,6 +91,7 @@ function ShortCircuitParametersEditionDialog({
|
|
|
72
91
|
ShortCircuitParametersForm,
|
|
73
92
|
{
|
|
74
93
|
shortCircuitMethods,
|
|
94
|
+
enableDeveloperMode,
|
|
75
95
|
renderTitleFields: () => {
|
|
76
96
|
return /* @__PURE__ */ jsx(
|
|
77
97
|
NameElementEditorForm,
|
|
@@ -81,8 +101,7 @@ function ShortCircuitParametersEditionDialog({
|
|
|
81
101
|
elementType: ElementType.SHORT_CIRCUIT_PARAMETERS
|
|
82
102
|
}
|
|
83
103
|
);
|
|
84
|
-
}
|
|
85
|
-
enableDeveloperMode: enableDeveloperMode ?? false
|
|
104
|
+
}
|
|
86
105
|
}
|
|
87
106
|
)
|
|
88
107
|
}
|
|
@@ -2,12 +2,12 @@ import { jsx, jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { Box, Grid, LinearProgress } from "@mui/material";
|
|
3
3
|
import "react-intl";
|
|
4
4
|
import "../../overflowableText/OverflowableText.js";
|
|
5
|
-
import "react";
|
|
6
|
-
import "react-hook-form";
|
|
7
|
-
import "../../../utils/types/equipmentType.js";
|
|
8
5
|
import "../../../utils/conversionUtils.js";
|
|
9
6
|
import "@mui/icons-material";
|
|
7
|
+
import "../../../utils/types/equipmentType.js";
|
|
10
8
|
import "../../../utils/yupConfig.js";
|
|
9
|
+
import "react";
|
|
10
|
+
import "react-hook-form";
|
|
11
11
|
import "localized-countries";
|
|
12
12
|
import "localized-countries/data/fr";
|
|
13
13
|
import "localized-countries/data/en";
|
|
@@ -35,7 +35,7 @@ function ShortCircuitParametersForm({
|
|
|
35
35
|
renderActions,
|
|
36
36
|
enableDeveloperMode
|
|
37
37
|
}) {
|
|
38
|
-
const { formMethods, formSchema,
|
|
38
|
+
const { formMethods, formSchema, paramsLoaded, resetAll } = shortCircuitMethods;
|
|
39
39
|
return /* @__PURE__ */ jsx(CustomFormProvider, { validationSchema: formSchema, ...formMethods, removeOptional: true, children: /* @__PURE__ */ jsxs(
|
|
40
40
|
Box,
|
|
41
41
|
{
|
|
@@ -47,7 +47,7 @@ function ShortCircuitParametersForm({
|
|
|
47
47
|
},
|
|
48
48
|
children: [
|
|
49
49
|
/* @__PURE__ */ jsx(Grid, { item: true, container: true, direction: "column", children: renderTitleFields?.() }),
|
|
50
|
-
|
|
50
|
+
paramsLoaded ? /* @__PURE__ */ jsx(Grid, { sx: parametersStyles.scrollableGrid, children: /* @__PURE__ */ jsx(ShortCircuitFields, { enableDeveloperMode, resetAll }) }) : /* @__PURE__ */ jsx(LinearProgress, {}),
|
|
51
51
|
/* @__PURE__ */ jsx(
|
|
52
52
|
Grid,
|
|
53
53
|
{
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { UUID } from 'node:crypto';
|
|
2
|
-
import {
|
|
3
|
-
|
|
2
|
+
import { UseParametersBackendReturnProps } from '../../../utils';
|
|
3
|
+
import { ComputingType } from '../common';
|
|
4
|
+
export declare function ShortCircuitParametersInLine({ studyUuid, setHaveDirtyFields, parametersBackend, enableDeveloperMode, }: Readonly<{
|
|
4
5
|
studyUuid: UUID | null;
|
|
5
6
|
setHaveDirtyFields: (isDirty: boolean) => void;
|
|
6
|
-
|
|
7
|
+
parametersBackend: UseParametersBackendReturnProps<ComputingType.SHORT_CIRCUIT>;
|
|
7
8
|
enableDeveloperMode: boolean;
|
|
8
9
|
}>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -8,6 +8,7 @@ import { snackWithFallback } from "../../../utils/error.js";
|
|
|
8
8
|
import "@mui/icons-material";
|
|
9
9
|
import { ElementType } from "../../../utils/types/elementType.js";
|
|
10
10
|
import "../../../utils/yupConfig.js";
|
|
11
|
+
import { fetchShortCircuitParameters } from "../../../services/short-circuit-analysis.js";
|
|
11
12
|
import "localized-countries";
|
|
12
13
|
import "localized-countries/data/fr";
|
|
13
14
|
import "localized-countries/data/en";
|
|
@@ -34,60 +35,42 @@ import { LabelledButton } from "../common/parameters.js";
|
|
|
34
35
|
import { CreateParameterDialog } from "../common/parameters-creation-dialog.js";
|
|
35
36
|
import "../common/widget/parameter-line-slider.js";
|
|
36
37
|
import "../common/limitreductions/columns-definitions.js";
|
|
37
|
-
import { SHORT_CIRCUIT_WITH_FEEDER_RESULT, SHORT_CIRCUIT_PREDEFINED_PARAMS, SHORT_CIRCUIT_WITH_LOADS, SHORT_CIRCUIT_WITH_VSC_CONVERTER_STATIONS, SHORT_CIRCUIT_WITH_SHUNT_COMPENSATORS, SHORT_CIRCUIT_WITH_NEUTRAL_POSITION, SHORT_CIRCUIT_INITIAL_VOLTAGE_PROFILE_MODE, InitialVoltage } from "./constants.js";
|
|
38
|
-
import { fetchShortCircuitParameters } from "../../../services/short-circuit-analysis.js";
|
|
39
38
|
import { ShortCircuitParametersForm } from "./short-circuit-parameters-form.js";
|
|
40
39
|
import { useShortCircuitParametersForm } from "./use-short-circuit-parameters-form.js";
|
|
41
40
|
function ShortCircuitParametersInLine({
|
|
42
41
|
studyUuid,
|
|
43
42
|
setHaveDirtyFields,
|
|
44
|
-
|
|
43
|
+
parametersBackend,
|
|
45
44
|
enableDeveloperMode
|
|
46
45
|
}) {
|
|
47
46
|
const shortCircuitMethods = useShortCircuitParametersForm({
|
|
47
|
+
parametersBackend,
|
|
48
48
|
parametersUuid: null,
|
|
49
49
|
name: null,
|
|
50
|
-
description: null
|
|
51
|
-
studyUuid,
|
|
52
|
-
studyShortCircuitParameters: shortCircuitParameters
|
|
50
|
+
description: null
|
|
53
51
|
});
|
|
54
52
|
const intl = useIntl();
|
|
55
53
|
const [openCreateParameterDialog, setOpenCreateParameterDialog] = useState(false);
|
|
56
54
|
const [openSelectParameterDialog, setOpenSelectParameterDialog] = useState(false);
|
|
57
55
|
const { snackError } = useSnackMessage();
|
|
58
|
-
const {
|
|
59
|
-
const {
|
|
60
|
-
const replaceFormValues = useCallback(
|
|
61
|
-
(param) => {
|
|
62
|
-
const dirty = { shouldDirty: true };
|
|
63
|
-
setValue(SHORT_CIRCUIT_WITH_FEEDER_RESULT, param.parameters.withFeederResult, dirty);
|
|
64
|
-
setValue(SHORT_CIRCUIT_PREDEFINED_PARAMS, param.predefinedParameters, dirty);
|
|
65
|
-
setValue(SHORT_CIRCUIT_WITH_LOADS, param.parameters.withLoads, dirty);
|
|
66
|
-
setValue(SHORT_CIRCUIT_WITH_VSC_CONVERTER_STATIONS, param.parameters.withVSCConverterStations, dirty);
|
|
67
|
-
setValue(SHORT_CIRCUIT_WITH_SHUNT_COMPENSATORS, param.parameters.withShuntCompensators, dirty);
|
|
68
|
-
setValue(SHORT_CIRCUIT_WITH_NEUTRAL_POSITION, !param.parameters.withNeutralPosition, dirty);
|
|
69
|
-
setValue(
|
|
70
|
-
SHORT_CIRCUIT_INITIAL_VOLTAGE_PROFILE_MODE,
|
|
71
|
-
param.parameters.initialVoltageProfileMode === InitialVoltage.CONFIGURED ? InitialVoltage.CEI909 : param.parameters.initialVoltageProfileMode,
|
|
72
|
-
dirty
|
|
73
|
-
);
|
|
74
|
-
},
|
|
75
|
-
[setValue]
|
|
76
|
-
);
|
|
56
|
+
const { formMethods } = shortCircuitMethods;
|
|
57
|
+
const { getValues, formState, handleSubmit, reset } = formMethods;
|
|
77
58
|
const handleLoadParameters = useCallback(
|
|
78
59
|
(newParams) => {
|
|
79
60
|
if (newParams?.length) {
|
|
80
61
|
setOpenSelectParameterDialog(false);
|
|
81
62
|
const paramUuid = newParams[0].id;
|
|
82
63
|
fetchShortCircuitParameters(paramUuid).then((parameters) => {
|
|
83
|
-
|
|
64
|
+
reset(shortCircuitMethods.toShortCircuitFormValues(parameters), {
|
|
65
|
+
keepDefaultValues: true
|
|
66
|
+
});
|
|
84
67
|
}).catch((error) => {
|
|
85
68
|
snackWithFallback(snackError, error, { headerId: "paramsRetrievingError" });
|
|
86
69
|
});
|
|
87
70
|
}
|
|
88
71
|
setOpenSelectParameterDialog(false);
|
|
89
72
|
},
|
|
90
|
-
[snackError,
|
|
73
|
+
[snackError, shortCircuitMethods, reset]
|
|
91
74
|
);
|
|
92
75
|
useEffect(() => {
|
|
93
76
|
setHaveDirtyFields(!!Object.keys(formState.dirtyFields).length);
|
|
@@ -108,7 +91,17 @@ function ShortCircuitParametersInLine({
|
|
|
108
91
|
}
|
|
109
92
|
),
|
|
110
93
|
/* @__PURE__ */ jsx(LabelledButton, { callback: () => setOpenCreateParameterDialog(true), label: "save" }),
|
|
111
|
-
/* @__PURE__ */ jsx(
|
|
94
|
+
/* @__PURE__ */ jsx(
|
|
95
|
+
SubmitButton,
|
|
96
|
+
{
|
|
97
|
+
onClick: handleSubmit(
|
|
98
|
+
shortCircuitMethods.onSaveInline,
|
|
99
|
+
shortCircuitMethods.onValidationError
|
|
100
|
+
),
|
|
101
|
+
variant: "outlined",
|
|
102
|
+
children: /* @__PURE__ */ jsx(FormattedMessage, { id: "validate" })
|
|
103
|
+
}
|
|
104
|
+
)
|
|
112
105
|
] }),
|
|
113
106
|
openCreateParameterDialog && /* @__PURE__ */ jsx(
|
|
114
107
|
CreateParameterDialog,
|
|
@@ -116,7 +109,7 @@ function ShortCircuitParametersInLine({
|
|
|
116
109
|
studyUuid,
|
|
117
110
|
open: openCreateParameterDialog,
|
|
118
111
|
onClose: () => setOpenCreateParameterDialog(false),
|
|
119
|
-
parameterValues: () =>
|
|
112
|
+
parameterValues: () => shortCircuitMethods.formatNewParams(getValues()),
|
|
120
113
|
parameterFormatter: (newParams) => newParams,
|
|
121
114
|
parameterType: ElementType.SHORT_CIRCUIT_PARAMETERS
|
|
122
115
|
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { InitialVoltage, PredefinedParameters } from './constants';
|
|
2
|
+
import { default as yup } from '../../../utils/yupConfig';
|
|
3
|
+
import { SpecificParametersValues } from '../../../utils';
|
|
4
|
+
export declare const getCommonShortCircuitParametersFormSchema: () => yup.ObjectSchema<{
|
|
5
|
+
commonParameters: {
|
|
6
|
+
withFeederResult: NonNullable<boolean | undefined>;
|
|
7
|
+
withLoads: NonNullable<boolean | undefined>;
|
|
8
|
+
withVSCConverterStations: NonNullable<boolean | undefined>;
|
|
9
|
+
withShuntCompensators: NonNullable<boolean | undefined>;
|
|
10
|
+
withNeutralPosition: NonNullable<boolean | undefined>;
|
|
11
|
+
initialVoltageProfileMode: NonNullable<InitialVoltage | undefined>;
|
|
12
|
+
};
|
|
13
|
+
}, yup.AnyObject, {
|
|
14
|
+
commonParameters: {
|
|
15
|
+
withFeederResult: undefined;
|
|
16
|
+
withLoads: undefined;
|
|
17
|
+
withVSCConverterStations: undefined;
|
|
18
|
+
withShuntCompensators: undefined;
|
|
19
|
+
withNeutralPosition: undefined;
|
|
20
|
+
initialVoltageProfileMode: undefined;
|
|
21
|
+
};
|
|
22
|
+
}, "">;
|
|
23
|
+
export declare const resetSpecificParameters: (specificDefaultValues: SpecificParametersValues, predefinedParameter: PredefinedParameters) => {
|
|
24
|
+
onlyStartedGenerators: boolean;
|
|
25
|
+
} | {
|
|
26
|
+
[x: string]: any;
|
|
27
|
+
};
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { SHORT_CIRCUIT_INITIAL_VOLTAGE_PROFILE_MODE, InitialVoltage, SHORT_CIRCUIT_WITH_NEUTRAL_POSITION, SHORT_CIRCUIT_WITH_SHUNT_COMPENSATORS, SHORT_CIRCUIT_WITH_VSC_CONVERTER_STATIONS, SHORT_CIRCUIT_WITH_LOADS, SHORT_CIRCUIT_WITH_FEEDER_RESULT, SHORT_CIRCUIT_ONLY_STARTED_GENERATORS, PredefinedParameters } from "./constants.js";
|
|
2
|
+
import "../../../utils/yupConfig.js";
|
|
3
|
+
import { COMMON_PARAMETERS } from "../common/constant.js";
|
|
4
|
+
import "react/jsx-runtime";
|
|
5
|
+
import "@mui/material";
|
|
6
|
+
import "react-intl";
|
|
7
|
+
import "react";
|
|
8
|
+
import "../../../utils/types/equipmentType.js";
|
|
9
|
+
import "../../../utils/conversionUtils.js";
|
|
10
|
+
import "@mui/icons-material";
|
|
11
|
+
import "localized-countries";
|
|
12
|
+
import "localized-countries/data/fr";
|
|
13
|
+
import "localized-countries/data/en";
|
|
14
|
+
import "notistack";
|
|
15
|
+
import "react-hook-form";
|
|
16
|
+
import "../../inputs/reactHookForm/provider/CustomFormProvider.js";
|
|
17
|
+
import "../../dialogs/descriptionModificationDialog/DescriptionModificationDialog.js";
|
|
18
|
+
import "../../dialogs/elementSaveDialog/ElementSaveDialog.js";
|
|
19
|
+
import "../../treeViewFinder/TreeViewFinder.js";
|
|
20
|
+
import "../../overflowableText/OverflowableText.js";
|
|
21
|
+
import * as yup from "yup";
|
|
22
|
+
import "../../inputs/reactHookForm/agGridTable/BottomRightButtons.js";
|
|
23
|
+
import "../../customAGGrid/customAggrid.js";
|
|
24
|
+
import "ag-grid-community";
|
|
25
|
+
import "react-papaparse";
|
|
26
|
+
import "react-csv-downloader";
|
|
27
|
+
import "../../inputs/reactHookForm/numbers/RangeInput.js";
|
|
28
|
+
import "@react-querybuilder/material";
|
|
29
|
+
import "../../filter/expert/expertFilterConstants.js";
|
|
30
|
+
import "../../inputs/reactQueryBuilder/CustomReactQueryBuilder.js";
|
|
31
|
+
import "uuid";
|
|
32
|
+
import "../../inputs/reactQueryBuilder/PropertyValueEditor.js";
|
|
33
|
+
import "react-querybuilder";
|
|
34
|
+
import "../common/widget/parameter-line-slider.js";
|
|
35
|
+
import "../common/limitreductions/columns-definitions.js";
|
|
36
|
+
const getCommonShortCircuitParametersFormSchema = () => {
|
|
37
|
+
return yup.object().shape({
|
|
38
|
+
[COMMON_PARAMETERS]: yup.object().shape({
|
|
39
|
+
[SHORT_CIRCUIT_WITH_FEEDER_RESULT]: yup.boolean().required(),
|
|
40
|
+
[SHORT_CIRCUIT_WITH_LOADS]: yup.boolean().required(),
|
|
41
|
+
[SHORT_CIRCUIT_WITH_VSC_CONVERTER_STATIONS]: yup.boolean().required(),
|
|
42
|
+
[SHORT_CIRCUIT_WITH_SHUNT_COMPENSATORS]: yup.boolean().required(),
|
|
43
|
+
[SHORT_CIRCUIT_WITH_NEUTRAL_POSITION]: yup.boolean().required(),
|
|
44
|
+
[SHORT_CIRCUIT_INITIAL_VOLTAGE_PROFILE_MODE]: yup.mixed().oneOf(Object.values(InitialVoltage)).required()
|
|
45
|
+
})
|
|
46
|
+
});
|
|
47
|
+
};
|
|
48
|
+
const resetSpecificParameters = (specificDefaultValues, predefinedParameter) => {
|
|
49
|
+
if (Object.hasOwn(specificDefaultValues, SHORT_CIRCUIT_ONLY_STARTED_GENERATORS)) {
|
|
50
|
+
return {
|
|
51
|
+
...specificDefaultValues,
|
|
52
|
+
// Forced to override specificly this param here because its default value depends of the PredefinedParameters value
|
|
53
|
+
[SHORT_CIRCUIT_ONLY_STARTED_GENERATORS]: predefinedParameter === PredefinedParameters.ICC_MIN_WITH_NOMINAL_VOLTAGE_MAP
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
return { ...specificDefaultValues };
|
|
57
|
+
};
|
|
58
|
+
export {
|
|
59
|
+
getCommonShortCircuitParametersFormSchema,
|
|
60
|
+
resetSpecificParameters
|
|
61
|
+
};
|
|
@@ -1,7 +1,10 @@
|
|
|
1
|
+
import { SpecificParametersPerProvider } from '../../../utils';
|
|
1
2
|
import { InitialVoltage, PredefinedParameters } from './constants';
|
|
2
3
|
export interface VoltageRange {
|
|
3
4
|
minimumNominalVoltage: number;
|
|
4
5
|
maximumNominalVoltage: number;
|
|
6
|
+
voltage: number;
|
|
7
|
+
voltageRangeCoefficient: number;
|
|
5
8
|
}
|
|
6
9
|
export interface ShortCircuitParametersDto {
|
|
7
10
|
withFeederResult: boolean;
|
|
@@ -13,26 +16,9 @@ export interface ShortCircuitParametersDto {
|
|
|
13
16
|
voltageRanges?: VoltageRange[];
|
|
14
17
|
}
|
|
15
18
|
export interface ShortCircuitParametersInfos {
|
|
16
|
-
|
|
19
|
+
provider: string;
|
|
17
20
|
predefinedParameters: PredefinedParameters;
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
maximumNominalVoltage: number;
|
|
22
|
-
minimumNominalVoltage: number;
|
|
23
|
-
voltage: number;
|
|
24
|
-
voltageRangeCoefficient: number;
|
|
25
|
-
}
|
|
26
|
-
export interface ShortCircuitParameters {
|
|
27
|
-
predefinedParameters: NonNullable<PredefinedParameters | undefined>;
|
|
28
|
-
parameters: {
|
|
29
|
-
withFeederResult: boolean;
|
|
30
|
-
withLoads: boolean;
|
|
31
|
-
withVSCConverterStations: boolean;
|
|
32
|
-
withShuntCompensators: boolean;
|
|
33
|
-
withNeutralPosition: boolean;
|
|
34
|
-
initialVoltageProfileMode: NonNullable<InitialVoltage | undefined>;
|
|
35
|
-
voltageRanges?: VoltageRanges;
|
|
36
|
-
};
|
|
21
|
+
commonParameters: ShortCircuitParametersDto;
|
|
22
|
+
specificParametersPerProvider: SpecificParametersPerProvider;
|
|
23
|
+
cei909VoltageRanges?: VoltageRange[];
|
|
37
24
|
}
|
|
38
|
-
export {};
|
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { FieldErrors, UseFormReturn } from 'react-hook-form';
|
|
2
2
|
import { ObjectSchema } from 'yup';
|
|
3
3
|
import { UUID } from 'node:crypto';
|
|
4
4
|
import { PredefinedParameters } from './constants';
|
|
5
|
+
import { SpecificParameterInfos, UseParametersBackendReturnProps } from '../../../utils';
|
|
5
6
|
import { ShortCircuitParametersInfos } from './short-circuit-parameters.type';
|
|
7
|
+
import { ComputingType } from '../common';
|
|
6
8
|
export interface UseShortCircuitParametersFormReturn {
|
|
7
9
|
formMethods: UseFormReturn;
|
|
8
10
|
formSchema: ObjectSchema<any>;
|
|
9
|
-
|
|
11
|
+
resetAll: (predefinedParameter: PredefinedParameters) => void;
|
|
12
|
+
specificParametersDescriptionForProvider: SpecificParameterInfos[];
|
|
13
|
+
toShortCircuitFormValues: (_params: ShortCircuitParametersInfos) => any;
|
|
14
|
+
formatNewParams: (formData: Record<string, any>) => ShortCircuitParametersInfos;
|
|
15
|
+
params: ShortCircuitParametersInfos | null;
|
|
16
|
+
provider: string | undefined;
|
|
17
|
+
paramsLoaded: boolean;
|
|
18
|
+
onValidationError: (errors: FieldErrors) => void;
|
|
10
19
|
onSaveInline: (formData: Record<string, any>) => void;
|
|
11
20
|
onSaveDialog: (formData: Record<string, any>) => void;
|
|
12
|
-
resetAll: (predefinedParameter: PredefinedParameters) => void;
|
|
13
|
-
getCurrentValues: () => FieldValues;
|
|
14
21
|
}
|
|
15
22
|
type UseShortCircuitParametersFormProps = {
|
|
16
|
-
|
|
17
|
-
|
|
23
|
+
parametersBackend: UseParametersBackendReturnProps<ComputingType.SHORT_CIRCUIT>;
|
|
24
|
+
parametersUuid: UUID | null;
|
|
25
|
+
name: string | null;
|
|
18
26
|
description: string | null;
|
|
19
|
-
studyUuid: null;
|
|
20
|
-
studyShortCircuitParameters: null;
|
|
21
|
-
} | {
|
|
22
|
-
parametersUuid: null;
|
|
23
|
-
name: null;
|
|
24
|
-
description: null;
|
|
25
|
-
studyUuid: UUID | null;
|
|
26
|
-
studyShortCircuitParameters: ShortCircuitParametersInfos | null;
|
|
27
27
|
};
|
|
28
|
-
export declare const useShortCircuitParametersForm: ({ parametersUuid, name, description,
|
|
28
|
+
export declare const useShortCircuitParametersForm: ({ parametersBackend, parametersUuid, name, description, }: UseShortCircuitParametersFormProps) => UseShortCircuitParametersFormReturn;
|
|
29
29
|
export {};
|