@gridsuite/commons-ui 0.106.1 → 0.107.1
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/directoryItemSelector/DirectoryItemSelector.js +1 -0
- package/dist/components/filter/expert/expertFilterConstants.d.ts +15 -0
- package/dist/components/filter/expert/expertFilterConstants.js +28 -0
- package/dist/components/filter/expert/expertFilterUtils.js +1 -1
- package/dist/components/grid/grid-item.d.ts +8 -0
- package/dist/components/grid/grid-item.js +8 -0
- package/dist/components/grid/grid-section.d.ts +8 -0
- package/dist/components/grid/grid-section.js +9 -0
- package/dist/components/grid/index.d.ts +8 -0
- package/dist/components/grid/index.js +3 -0
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.js +19 -0
- package/dist/components/inputs/reactQueryBuilder/ValueEditor.js +4 -2
- package/dist/components/parameters/common/index.d.ts +1 -0
- package/dist/components/parameters/common/parameters-edition-dialog-props.d.ts +14 -0
- package/dist/components/parameters/common/parameters-edition-dialog-props.js +1 -0
- package/dist/components/parameters/index.d.ts +1 -0
- package/dist/components/parameters/index.js +16 -0
- package/dist/components/parameters/loadflow/load-flow-parameters-dialog.d.ts +1 -14
- package/dist/components/parameters/loadflow/load-flow-parameters-dialog.js +1 -1
- package/dist/components/parameters/loadflow/load-flow-parameters-utils.d.ts +0 -3
- package/dist/components/parameters/loadflow/load-flow-parameters-utils.js +0 -35
- package/dist/components/parameters/loadflow/use-load-flow-parameters-form.js +1 -2
- package/dist/components/parameters/network-visualizations/network-visualizations-form.js +4 -4
- package/dist/components/parameters/network-visualizations/network-visualizations-parameters-dialog.d.ts +2 -14
- package/dist/components/parameters/network-visualizations/network-visualizations-parameters-dialog.js +7 -1
- package/dist/components/parameters/network-visualizations/network-visualizations-parameters-inline.js +7 -1
- package/dist/components/parameters/network-visualizations/use-network-visualizations-parameters-form.d.ts +16 -2
- package/dist/components/parameters/network-visualizations/use-network-visualizations-parameters-form.js +15 -6
- package/dist/components/parameters/short-circuit/constants.d.ts +37 -0
- package/dist/components/parameters/short-circuit/constants.js +58 -0
- package/dist/components/parameters/short-circuit/index.d.ts +10 -0
- package/dist/components/parameters/short-circuit/index.js +18 -0
- package/dist/components/parameters/short-circuit/short-circuit-fields.d.ts +9 -0
- package/dist/components/parameters/short-circuit/short-circuit-fields.js +169 -0
- package/dist/components/parameters/short-circuit/short-circuit-parameters-dialog.d.ts +2 -0
- package/dist/components/parameters/short-circuit/short-circuit-parameters-dialog.js +91 -0
- package/dist/components/parameters/short-circuit/short-circuit-parameters-form.d.ts +9 -0
- package/dist/components/parameters/short-circuit/short-circuit-parameters-form.js +69 -0
- package/dist/components/parameters/short-circuit/short-circuit-parameters-inline.d.ts +8 -0
- package/dist/components/parameters/short-circuit/short-circuit-parameters-inline.js +147 -0
- package/dist/components/parameters/short-circuit/short-circuit-parameters.type.d.ts +38 -0
- package/dist/components/parameters/short-circuit/short-circuit-parameters.type.js +1 -0
- package/dist/components/parameters/short-circuit/short-circuit-voltage-table.d.ts +5 -0
- package/dist/components/parameters/short-circuit/short-circuit-voltage-table.js +38 -0
- package/dist/components/parameters/short-circuit/use-short-circuit-parameters-form.d.ts +29 -0
- package/dist/components/parameters/short-circuit/use-short-circuit-parameters-form.js +222 -0
- package/dist/components/treeViewFinder/TreeViewFinder.d.ts +2 -0
- package/dist/index.js +23 -1
- package/dist/services/index.js +4 -1
- package/dist/services/short-circuit-analysis.d.ts +2 -0
- package/dist/services/short-circuit-analysis.js +13 -0
- package/dist/services/study.d.ts +4 -0
- package/dist/services/study.js +25 -1
- package/dist/translations/en/filterExpertEn.d.ts +3 -0
- package/dist/translations/en/filterExpertEn.js +4 -1
- package/dist/translations/en/parameters.d.ts +28 -0
- package/dist/translations/en/parameters.js +29 -1
- package/dist/translations/fr/filterExpertFr.d.ts +3 -0
- package/dist/translations/fr/filterExpertFr.js +4 -1
- package/dist/translations/fr/parameters.d.ts +28 -0
- package/dist/translations/fr/parameters.js +29 -1
- package/dist/utils/types/fieldType.d.ts +3 -0
- package/dist/utils/types/fieldType.js +3 -0
- package/package.json +1 -1
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useState, useCallback, useEffect } from "react";
|
|
3
|
+
import { Box, Grid } from "@mui/material";
|
|
4
|
+
import { useIntl, FormattedMessage } from "react-intl";
|
|
5
|
+
import "../../../utils/types/equipmentType.js";
|
|
6
|
+
import "localized-countries";
|
|
7
|
+
import "localized-countries/data/fr";
|
|
8
|
+
import "localized-countries/data/en";
|
|
9
|
+
import { useSnackMessage } from "../../../hooks/useSnackMessage.js";
|
|
10
|
+
import "@mui/icons-material";
|
|
11
|
+
import "react-hook-form";
|
|
12
|
+
import "../../inputs/reactHookForm/provider/CustomFormProvider.js";
|
|
13
|
+
import "yup";
|
|
14
|
+
import "../../overflowableText/OverflowableText.js";
|
|
15
|
+
import { DirectoryItemSelector } from "../../directoryItemSelector/DirectoryItemSelector.js";
|
|
16
|
+
import "../../inputs/reactHookForm/agGridTable/BottomRightButtons.js";
|
|
17
|
+
import "../../customAGGrid/customAggrid.js";
|
|
18
|
+
import "ag-grid-community";
|
|
19
|
+
import "react-papaparse";
|
|
20
|
+
import "react-csv-downloader";
|
|
21
|
+
import "../../inputs/reactHookForm/numbers/RangeInput.js";
|
|
22
|
+
import "../../../utils/conversionUtils.js";
|
|
23
|
+
import { ElementType } from "../../../utils/types/elementType.js";
|
|
24
|
+
import "../../../utils/yupConfig.js";
|
|
25
|
+
import { SubmitButton } from "../../inputs/reactHookForm/utils/SubmitButton.js";
|
|
26
|
+
import "@react-querybuilder/material";
|
|
27
|
+
import "../../filter/expert/expertFilterConstants.js";
|
|
28
|
+
import "../../inputs/reactQueryBuilder/CustomReactQueryBuilder.js";
|
|
29
|
+
import "uuid";
|
|
30
|
+
import "../../inputs/reactQueryBuilder/PropertyValueEditor.js";
|
|
31
|
+
import "react-querybuilder";
|
|
32
|
+
import { LabelledButton } from "../common/parameters.js";
|
|
33
|
+
import { CreateParameterDialog } from "../common/parameters-creation-dialog.js";
|
|
34
|
+
import "../common/widget/parameter-line-slider.js";
|
|
35
|
+
import "../common/limitreductions/columns-definitions.js";
|
|
36
|
+
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";
|
|
37
|
+
import { fetchShortCircuitParameters } from "../../../services/short-circuit-analysis.js";
|
|
38
|
+
import { ShortCircuitParametersForm } from "./short-circuit-parameters-form.js";
|
|
39
|
+
import { useShortCircuitParametersForm } from "./use-short-circuit-parameters-form.js";
|
|
40
|
+
function ShortCircuitParametersInLine({
|
|
41
|
+
studyUuid,
|
|
42
|
+
setHaveDirtyFields,
|
|
43
|
+
shortCircuitParameters
|
|
44
|
+
}) {
|
|
45
|
+
const shortCircuitMethods = useShortCircuitParametersForm({
|
|
46
|
+
parametersUuid: null,
|
|
47
|
+
name: null,
|
|
48
|
+
description: null,
|
|
49
|
+
studyUuid,
|
|
50
|
+
studyShortCircuitParameters: shortCircuitParameters
|
|
51
|
+
});
|
|
52
|
+
const intl = useIntl();
|
|
53
|
+
const [openCreateParameterDialog, setOpenCreateParameterDialog] = useState(false);
|
|
54
|
+
const [openSelectParameterDialog, setOpenSelectParameterDialog] = useState(false);
|
|
55
|
+
const { snackError } = useSnackMessage();
|
|
56
|
+
const { getCurrentValues, formMethods } = shortCircuitMethods;
|
|
57
|
+
const { setValue, formState, handleSubmit } = formMethods;
|
|
58
|
+
const replaceFormValues = useCallback(
|
|
59
|
+
(param) => {
|
|
60
|
+
const dirty = { shouldDirty: true };
|
|
61
|
+
setValue(SHORT_CIRCUIT_WITH_FEEDER_RESULT, param.parameters.withFeederResult, dirty);
|
|
62
|
+
setValue(SHORT_CIRCUIT_PREDEFINED_PARAMS, param.predefinedParameters, dirty);
|
|
63
|
+
setValue(SHORT_CIRCUIT_WITH_LOADS, param.parameters.withLoads, dirty);
|
|
64
|
+
setValue(SHORT_CIRCUIT_WITH_VSC_CONVERTER_STATIONS, param.parameters.withVSCConverterStations, dirty);
|
|
65
|
+
setValue(SHORT_CIRCUIT_WITH_SHUNT_COMPENSATORS, param.parameters.withShuntCompensators, dirty);
|
|
66
|
+
setValue(SHORT_CIRCUIT_WITH_NEUTRAL_POSITION, !param.parameters.withNeutralPosition, dirty);
|
|
67
|
+
setValue(
|
|
68
|
+
SHORT_CIRCUIT_INITIAL_VOLTAGE_PROFILE_MODE,
|
|
69
|
+
param.parameters.initialVoltageProfileMode === InitialVoltage.CONFIGURED ? InitialVoltage.CEI909 : param.parameters.initialVoltageProfileMode,
|
|
70
|
+
dirty
|
|
71
|
+
);
|
|
72
|
+
},
|
|
73
|
+
[setValue]
|
|
74
|
+
);
|
|
75
|
+
const handleLoadParameters = useCallback(
|
|
76
|
+
(newParams) => {
|
|
77
|
+
if (newParams == null ? void 0 : newParams.length) {
|
|
78
|
+
setOpenSelectParameterDialog(false);
|
|
79
|
+
const paramUuid = newParams[0].id;
|
|
80
|
+
fetchShortCircuitParameters(paramUuid).then((parameters) => {
|
|
81
|
+
replaceFormValues(parameters);
|
|
82
|
+
}).catch((error) => {
|
|
83
|
+
console.error(error);
|
|
84
|
+
snackError({
|
|
85
|
+
messageTxt: error.message,
|
|
86
|
+
headerId: "paramsRetrievingError"
|
|
87
|
+
});
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
setOpenSelectParameterDialog(false);
|
|
91
|
+
},
|
|
92
|
+
[snackError, replaceFormValues]
|
|
93
|
+
);
|
|
94
|
+
useEffect(() => {
|
|
95
|
+
setHaveDirtyFields(!!Object.keys(formState.dirtyFields).length);
|
|
96
|
+
}, [formState, setHaveDirtyFields]);
|
|
97
|
+
return /* @__PURE__ */ jsx(
|
|
98
|
+
ShortCircuitParametersForm,
|
|
99
|
+
{
|
|
100
|
+
shortCircuitMethods,
|
|
101
|
+
renderActions: () => {
|
|
102
|
+
return /* @__PURE__ */ jsxs(Box, { children: [
|
|
103
|
+
/* @__PURE__ */ jsxs(Grid, { container: true, item: true, children: [
|
|
104
|
+
/* @__PURE__ */ jsx(
|
|
105
|
+
LabelledButton,
|
|
106
|
+
{
|
|
107
|
+
callback: () => setOpenSelectParameterDialog(true),
|
|
108
|
+
label: "settings.button.chooseSettings"
|
|
109
|
+
}
|
|
110
|
+
),
|
|
111
|
+
/* @__PURE__ */ jsx(LabelledButton, { callback: () => setOpenCreateParameterDialog(true), label: "save" }),
|
|
112
|
+
/* @__PURE__ */ jsx(SubmitButton, { onClick: handleSubmit(shortCircuitMethods.onSaveInline), variant: "outlined", children: /* @__PURE__ */ jsx(FormattedMessage, { id: "validate" }) })
|
|
113
|
+
] }),
|
|
114
|
+
openCreateParameterDialog && /* @__PURE__ */ jsx(
|
|
115
|
+
CreateParameterDialog,
|
|
116
|
+
{
|
|
117
|
+
studyUuid,
|
|
118
|
+
open: openCreateParameterDialog,
|
|
119
|
+
onClose: () => setOpenCreateParameterDialog(false),
|
|
120
|
+
parameterValues: () => getCurrentValues(),
|
|
121
|
+
parameterFormatter: (newParams) => newParams,
|
|
122
|
+
parameterType: ElementType.SHORT_CIRCUIT_PARAMETERS
|
|
123
|
+
}
|
|
124
|
+
),
|
|
125
|
+
openSelectParameterDialog && /* @__PURE__ */ jsx(
|
|
126
|
+
DirectoryItemSelector,
|
|
127
|
+
{
|
|
128
|
+
open: openSelectParameterDialog,
|
|
129
|
+
onClose: handleLoadParameters,
|
|
130
|
+
types: [ElementType.SHORT_CIRCUIT_PARAMETERS],
|
|
131
|
+
title: intl.formatMessage({
|
|
132
|
+
id: "showSelectParameterDialog"
|
|
133
|
+
}),
|
|
134
|
+
multiSelect: false,
|
|
135
|
+
validationButtonText: intl.formatMessage({
|
|
136
|
+
id: "validate"
|
|
137
|
+
})
|
|
138
|
+
}
|
|
139
|
+
)
|
|
140
|
+
] });
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
);
|
|
144
|
+
}
|
|
145
|
+
export {
|
|
146
|
+
ShortCircuitParametersInLine
|
|
147
|
+
};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { InitialVoltage, PredefinedParameters } from './constants';
|
|
2
|
+
export interface VoltageRange {
|
|
3
|
+
minimumNominalVoltage: number;
|
|
4
|
+
maximumNominalVoltage: number;
|
|
5
|
+
}
|
|
6
|
+
export interface ShortCircuitParametersDto {
|
|
7
|
+
withFeederResult: boolean;
|
|
8
|
+
withLoads: boolean;
|
|
9
|
+
withVSCConverterStations: boolean;
|
|
10
|
+
withShuntCompensators: boolean;
|
|
11
|
+
withNeutralPosition: boolean;
|
|
12
|
+
initialVoltageProfileMode: InitialVoltage;
|
|
13
|
+
voltageRanges?: VoltageRange[];
|
|
14
|
+
}
|
|
15
|
+
export interface ShortCircuitParametersInfos {
|
|
16
|
+
parameters: ShortCircuitParametersDto;
|
|
17
|
+
predefinedParameters: PredefinedParameters;
|
|
18
|
+
cei909VoltageRanges?: any;
|
|
19
|
+
}
|
|
20
|
+
interface VoltageRanges {
|
|
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
|
+
};
|
|
37
|
+
}
|
|
38
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo } from "react";
|
|
3
|
+
import { Table, TableBody, TableRow, TableCell } from "@mui/material";
|
|
4
|
+
import { useIntl } from "react-intl";
|
|
5
|
+
import { InitialVoltage } from "./constants.js";
|
|
6
|
+
function VoltageTable({ voltageProfileMode }) {
|
|
7
|
+
const intl = useIntl();
|
|
8
|
+
const rows = useMemo(
|
|
9
|
+
() => [
|
|
10
|
+
{
|
|
11
|
+
name: intl.formatMessage({ id: "shortCircuitNominalVoltage" }),
|
|
12
|
+
values: [`380 ${intl.formatMessage({ id: "Or" })} 400`, 225, 150, 90, 63, 45, 20]
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
name: intl.formatMessage({ id: "shortCircuitInitialVoltage" }),
|
|
16
|
+
values: voltageProfileMode === InitialVoltage.NOMINAL ? [400, 225, 150, 90, 63, 45, 20] : [420, 245, 165, 99, 69.3, 49.5, 22]
|
|
17
|
+
}
|
|
18
|
+
],
|
|
19
|
+
[voltageProfileMode, intl]
|
|
20
|
+
);
|
|
21
|
+
return /* @__PURE__ */ jsx(Table, { children: /* @__PURE__ */ jsx(TableBody, { children: rows.map((row) => /* @__PURE__ */ jsxs(TableRow, { children: [
|
|
22
|
+
/* @__PURE__ */ jsx(TableCell, { children: row.name }),
|
|
23
|
+
row.values.map((value) => /* @__PURE__ */ jsx(
|
|
24
|
+
TableCell,
|
|
25
|
+
{
|
|
26
|
+
sx: {
|
|
27
|
+
width: "10%",
|
|
28
|
+
textAlign: "center"
|
|
29
|
+
},
|
|
30
|
+
children: value
|
|
31
|
+
},
|
|
32
|
+
value
|
|
33
|
+
))
|
|
34
|
+
] }, row.name)) }) });
|
|
35
|
+
}
|
|
36
|
+
export {
|
|
37
|
+
VoltageTable
|
|
38
|
+
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { FieldValues, UseFormReturn } from 'react-hook-form';
|
|
2
|
+
import { ObjectSchema } from 'yup';
|
|
3
|
+
import { UUID } from 'crypto';
|
|
4
|
+
import { PredefinedParameters } from './constants';
|
|
5
|
+
import { ShortCircuitParametersInfos } from './short-circuit-parameters.type';
|
|
6
|
+
export interface UseShortCircuitParametersFormReturn {
|
|
7
|
+
formMethods: UseFormReturn;
|
|
8
|
+
formSchema: ObjectSchema<any>;
|
|
9
|
+
paramsLoading: boolean;
|
|
10
|
+
onSaveInline: (formData: Record<string, any>) => void;
|
|
11
|
+
onSaveDialog: (formData: Record<string, any>) => void;
|
|
12
|
+
resetAll: (predefinedParameter: PredefinedParameters) => void;
|
|
13
|
+
getCurrentValues: () => FieldValues;
|
|
14
|
+
}
|
|
15
|
+
type UseShortCircuitParametersFormProps = {
|
|
16
|
+
parametersUuid: UUID;
|
|
17
|
+
name: string;
|
|
18
|
+
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
|
+
};
|
|
28
|
+
export declare const useShortCircuitParametersForm: ({ parametersUuid, name, description, studyUuid, studyShortCircuitParameters, }: UseShortCircuitParametersFormProps) => UseShortCircuitParametersFormReturn;
|
|
29
|
+
export {};
|
|
@@ -0,0 +1,222 @@
|
|
|
1
|
+
import { useForm } from "react-hook-form";
|
|
2
|
+
import { yupResolver } from "@hookform/resolvers/yup";
|
|
3
|
+
import { useState, useMemo, useCallback, useEffect } from "react";
|
|
4
|
+
import "../../../utils/yupConfig.js";
|
|
5
|
+
import "react/jsx-runtime";
|
|
6
|
+
import "react-intl";
|
|
7
|
+
import "@mui/material";
|
|
8
|
+
import { DESCRIPTION_INPUT, NAME } from "../../inputs/reactHookForm/DirectoryItemsInput.js";
|
|
9
|
+
import "../../inputs/reactHookForm/agGridTable/BottomRightButtons.js";
|
|
10
|
+
import "../../customAGGrid/customAggrid.js";
|
|
11
|
+
import "ag-grid-community";
|
|
12
|
+
import "react-papaparse";
|
|
13
|
+
import "react-csv-downloader";
|
|
14
|
+
import * as yup from "yup";
|
|
15
|
+
import "../../inputs/reactHookForm/provider/CustomFormProvider.js";
|
|
16
|
+
import "@mui/icons-material";
|
|
17
|
+
import "../../inputs/reactHookForm/numbers/RangeInput.js";
|
|
18
|
+
import "localized-countries";
|
|
19
|
+
import "localized-countries/data/fr";
|
|
20
|
+
import "localized-countries/data/en";
|
|
21
|
+
import "../../../utils/conversionUtils.js";
|
|
22
|
+
import { ElementType } from "../../../utils/types/elementType.js";
|
|
23
|
+
import "../../../utils/types/equipmentType.js";
|
|
24
|
+
import { updateParameter } from "../../../services/explore.js";
|
|
25
|
+
import { setStudyShortCircuitParameters, invalidateStudyShortCircuitStatus } from "../../../services/study.js";
|
|
26
|
+
import { useSnackMessage } from "../../../hooks/useSnackMessage.js";
|
|
27
|
+
import "@react-querybuilder/material";
|
|
28
|
+
import "../../filter/expert/expertFilterConstants.js";
|
|
29
|
+
import "../../inputs/reactQueryBuilder/CustomReactQueryBuilder.js";
|
|
30
|
+
import "uuid";
|
|
31
|
+
import "../../inputs/reactQueryBuilder/PropertyValueEditor.js";
|
|
32
|
+
import "react-querybuilder";
|
|
33
|
+
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_PREDEFINED_PARAMS, PredefinedParameters, SHORT_CIRCUIT_WITH_FEEDER_RESULT } from "./constants.js";
|
|
34
|
+
import "../../filter/HeaderFilterForm.js";
|
|
35
|
+
import { getNameElementEditorSchema, getNameElementEditorEmptyFormData } from "../common/name-element-editor/name-element-editor-utils.js";
|
|
36
|
+
import { fetchShortCircuitParameters } from "../../../services/short-circuit-analysis.js";
|
|
37
|
+
const useShortCircuitParametersForm = ({
|
|
38
|
+
parametersUuid,
|
|
39
|
+
name,
|
|
40
|
+
description,
|
|
41
|
+
studyUuid,
|
|
42
|
+
studyShortCircuitParameters
|
|
43
|
+
}) => {
|
|
44
|
+
const { snackError } = useSnackMessage();
|
|
45
|
+
const [paramsLoading, setParamsLoading] = useState(false);
|
|
46
|
+
const [shortCircuitParameters, setShortCircuitParameters] = useState();
|
|
47
|
+
const formSchema = useMemo(() => {
|
|
48
|
+
return yup.object().shape({
|
|
49
|
+
[SHORT_CIRCUIT_WITH_FEEDER_RESULT]: yup.boolean().required(),
|
|
50
|
+
[SHORT_CIRCUIT_PREDEFINED_PARAMS]: yup.mixed().oneOf(Object.values(PredefinedParameters)).required(),
|
|
51
|
+
[SHORT_CIRCUIT_WITH_LOADS]: yup.boolean().required(),
|
|
52
|
+
[SHORT_CIRCUIT_WITH_VSC_CONVERTER_STATIONS]: yup.boolean().required(),
|
|
53
|
+
[SHORT_CIRCUIT_WITH_SHUNT_COMPENSATORS]: yup.boolean().required(),
|
|
54
|
+
[SHORT_CIRCUIT_WITH_NEUTRAL_POSITION]: yup.boolean().required(),
|
|
55
|
+
[SHORT_CIRCUIT_INITIAL_VOLTAGE_PROFILE_MODE]: yup.mixed().oneOf(Object.values(InitialVoltage)).required()
|
|
56
|
+
}).required().concat(getNameElementEditorSchema(name));
|
|
57
|
+
}, [name]);
|
|
58
|
+
const emptyFormData = useMemo(() => {
|
|
59
|
+
return {
|
|
60
|
+
...getNameElementEditorEmptyFormData(name, description),
|
|
61
|
+
[SHORT_CIRCUIT_WITH_FEEDER_RESULT]: false,
|
|
62
|
+
[SHORT_CIRCUIT_PREDEFINED_PARAMS]: PredefinedParameters.ICC_MAX_WITH_CEI909,
|
|
63
|
+
[SHORT_CIRCUIT_WITH_LOADS]: false,
|
|
64
|
+
[SHORT_CIRCUIT_WITH_VSC_CONVERTER_STATIONS]: false,
|
|
65
|
+
[SHORT_CIRCUIT_WITH_SHUNT_COMPENSATORS]: false,
|
|
66
|
+
[SHORT_CIRCUIT_WITH_NEUTRAL_POSITION]: false,
|
|
67
|
+
[SHORT_CIRCUIT_INITIAL_VOLTAGE_PROFILE_MODE]: InitialVoltage.CEI909
|
|
68
|
+
};
|
|
69
|
+
}, [name, description]);
|
|
70
|
+
const formMethods = useForm({
|
|
71
|
+
defaultValues: emptyFormData,
|
|
72
|
+
resolver: yupResolver(formSchema)
|
|
73
|
+
});
|
|
74
|
+
const { getValues, reset, setValue } = formMethods;
|
|
75
|
+
const resetAll = useCallback(
|
|
76
|
+
(predefinedParameter) => {
|
|
77
|
+
const dirty = { shouldDirty: true };
|
|
78
|
+
setValue(SHORT_CIRCUIT_WITH_FEEDER_RESULT, true, dirty);
|
|
79
|
+
setValue(SHORT_CIRCUIT_WITH_LOADS, false, dirty);
|
|
80
|
+
setValue(
|
|
81
|
+
SHORT_CIRCUIT_WITH_VSC_CONVERTER_STATIONS,
|
|
82
|
+
predefinedParameter !== PredefinedParameters.ICC_MIN_WITH_NOMINAL_VOLTAGE_MAP,
|
|
83
|
+
dirty
|
|
84
|
+
);
|
|
85
|
+
setValue(SHORT_CIRCUIT_WITH_SHUNT_COMPENSATORS, false, dirty);
|
|
86
|
+
setValue(SHORT_CIRCUIT_WITH_NEUTRAL_POSITION, false, dirty);
|
|
87
|
+
const initialVoltageProfileMode = predefinedParameter === PredefinedParameters.ICC_MAX_WITH_CEI909 ? InitialVoltage.CEI909 : InitialVoltage.NOMINAL;
|
|
88
|
+
setValue(SHORT_CIRCUIT_INITIAL_VOLTAGE_PROFILE_MODE, initialVoltageProfileMode, dirty);
|
|
89
|
+
setValue(SHORT_CIRCUIT_PREDEFINED_PARAMS, predefinedParameter, dirty);
|
|
90
|
+
},
|
|
91
|
+
[setValue]
|
|
92
|
+
);
|
|
93
|
+
const prepareDataToSend = (shortCircuitParams, newParameters) => {
|
|
94
|
+
const oldParameters = { ...shortCircuitParams.parameters };
|
|
95
|
+
const {
|
|
96
|
+
predefinedParameters: omit,
|
|
97
|
+
[NAME]: omit2,
|
|
98
|
+
[DESCRIPTION_INPUT]: omit3,
|
|
99
|
+
...newParametersWithoutPredefinedParameters
|
|
100
|
+
} = newParameters;
|
|
101
|
+
let parameters = {
|
|
102
|
+
...oldParameters,
|
|
103
|
+
...newParametersWithoutPredefinedParameters,
|
|
104
|
+
// we need to add voltageRanges to the parameters only when initialVoltageProfileMode is equals to CEI909
|
|
105
|
+
voltageRanges: void 0,
|
|
106
|
+
withNeutralPosition: !newParameters.withNeutralPosition
|
|
107
|
+
};
|
|
108
|
+
if (newParameters.initialVoltageProfileMode === InitialVoltage.CEI909) {
|
|
109
|
+
parameters = {
|
|
110
|
+
...parameters,
|
|
111
|
+
voltageRanges: shortCircuitParams.cei909VoltageRanges,
|
|
112
|
+
initialVoltageProfileMode: InitialVoltage.CONFIGURED
|
|
113
|
+
};
|
|
114
|
+
}
|
|
115
|
+
return {
|
|
116
|
+
predefinedParameters: newParameters.predefinedParameters,
|
|
117
|
+
parameters
|
|
118
|
+
};
|
|
119
|
+
};
|
|
120
|
+
const getCurrentValues = useCallback(() => {
|
|
121
|
+
if (shortCircuitParameters) {
|
|
122
|
+
const currentValues = getValues();
|
|
123
|
+
return { ...prepareDataToSend(shortCircuitParameters, currentValues) };
|
|
124
|
+
}
|
|
125
|
+
return {};
|
|
126
|
+
}, [shortCircuitParameters, getValues]);
|
|
127
|
+
const formatShortCircuitParameters = (parameters, predefinedParameters) => {
|
|
128
|
+
return {
|
|
129
|
+
[SHORT_CIRCUIT_WITH_FEEDER_RESULT]: parameters.withFeederResult,
|
|
130
|
+
[SHORT_CIRCUIT_PREDEFINED_PARAMS]: predefinedParameters,
|
|
131
|
+
[SHORT_CIRCUIT_WITH_LOADS]: parameters.withLoads,
|
|
132
|
+
[SHORT_CIRCUIT_WITH_VSC_CONVERTER_STATIONS]: parameters.withVSCConverterStations,
|
|
133
|
+
[SHORT_CIRCUIT_WITH_SHUNT_COMPENSATORS]: parameters.withShuntCompensators,
|
|
134
|
+
[SHORT_CIRCUIT_WITH_NEUTRAL_POSITION]: !parameters.withNeutralPosition,
|
|
135
|
+
[SHORT_CIRCUIT_INITIAL_VOLTAGE_PROFILE_MODE]: parameters.initialVoltageProfileMode === InitialVoltage.CONFIGURED ? InitialVoltage.CEI909 : parameters.initialVoltageProfileMode
|
|
136
|
+
};
|
|
137
|
+
};
|
|
138
|
+
const onSaveInline = useCallback(
|
|
139
|
+
(formData) => {
|
|
140
|
+
if (studyUuid && shortCircuitParameters) {
|
|
141
|
+
const oldParams = shortCircuitParameters;
|
|
142
|
+
setStudyShortCircuitParameters(studyUuid, {
|
|
143
|
+
...prepareDataToSend(shortCircuitParameters, formData)
|
|
144
|
+
}).then(() => {
|
|
145
|
+
invalidateStudyShortCircuitStatus(studyUuid).catch((error) => {
|
|
146
|
+
snackError({
|
|
147
|
+
messageTxt: error.message,
|
|
148
|
+
headerId: "invalidateShortCircuitStatusError"
|
|
149
|
+
});
|
|
150
|
+
});
|
|
151
|
+
}).catch((error) => {
|
|
152
|
+
setShortCircuitParameters(oldParams);
|
|
153
|
+
snackError({
|
|
154
|
+
messageTxt: error.message,
|
|
155
|
+
headerId: "paramsChangingError"
|
|
156
|
+
});
|
|
157
|
+
});
|
|
158
|
+
}
|
|
159
|
+
},
|
|
160
|
+
[shortCircuitParameters, setShortCircuitParameters, snackError, studyUuid]
|
|
161
|
+
);
|
|
162
|
+
const onSaveDialog = useCallback(
|
|
163
|
+
(formData) => {
|
|
164
|
+
if (parametersUuid && shortCircuitParameters) {
|
|
165
|
+
updateParameter(
|
|
166
|
+
parametersUuid,
|
|
167
|
+
prepareDataToSend(shortCircuitParameters, formData),
|
|
168
|
+
formData[NAME],
|
|
169
|
+
ElementType.SHORT_CIRCUIT_PARAMETERS,
|
|
170
|
+
formData[DESCRIPTION_INPUT] ?? ""
|
|
171
|
+
).catch((error) => {
|
|
172
|
+
snackError({
|
|
173
|
+
messageTxt: error.message,
|
|
174
|
+
headerId: "paramsChangingError"
|
|
175
|
+
});
|
|
176
|
+
});
|
|
177
|
+
}
|
|
178
|
+
},
|
|
179
|
+
[parametersUuid, shortCircuitParameters, snackError]
|
|
180
|
+
);
|
|
181
|
+
useEffect(() => {
|
|
182
|
+
if (parametersUuid) {
|
|
183
|
+
const timer = setTimeout(() => {
|
|
184
|
+
setParamsLoading(true);
|
|
185
|
+
}, 700);
|
|
186
|
+
fetchShortCircuitParameters(parametersUuid).then((params) => {
|
|
187
|
+
setShortCircuitParameters(params);
|
|
188
|
+
}).catch((error) => {
|
|
189
|
+
snackError({
|
|
190
|
+
messageTxt: error.message,
|
|
191
|
+
headerId: "paramsRetrievingError"
|
|
192
|
+
});
|
|
193
|
+
}).finally(() => {
|
|
194
|
+
clearTimeout(timer);
|
|
195
|
+
setParamsLoading(false);
|
|
196
|
+
});
|
|
197
|
+
}
|
|
198
|
+
}, [parametersUuid, snackError]);
|
|
199
|
+
useEffect(() => {
|
|
200
|
+
if (studyShortCircuitParameters) {
|
|
201
|
+
setShortCircuitParameters(studyShortCircuitParameters);
|
|
202
|
+
}
|
|
203
|
+
}, [studyShortCircuitParameters]);
|
|
204
|
+
useEffect(() => {
|
|
205
|
+
if (shortCircuitParameters) {
|
|
206
|
+
const { parameters, predefinedParameters } = shortCircuitParameters;
|
|
207
|
+
reset(formatShortCircuitParameters(parameters, predefinedParameters));
|
|
208
|
+
}
|
|
209
|
+
}, [reset, shortCircuitParameters]);
|
|
210
|
+
return {
|
|
211
|
+
formMethods,
|
|
212
|
+
formSchema,
|
|
213
|
+
paramsLoading,
|
|
214
|
+
onSaveInline,
|
|
215
|
+
onSaveDialog,
|
|
216
|
+
resetAll,
|
|
217
|
+
getCurrentValues
|
|
218
|
+
};
|
|
219
|
+
};
|
|
220
|
+
export {
|
|
221
|
+
useShortCircuitParametersForm
|
|
222
|
+
};
|
|
@@ -2,10 +2,12 @@ import { ReactElement } from 'react';
|
|
|
2
2
|
import { ButtonProps, ModalProps } from '@mui/material';
|
|
3
3
|
import { SimpleTreeViewClasses } from '@mui/x-tree-view';
|
|
4
4
|
import { UUID } from 'crypto';
|
|
5
|
+
import { ElementType } from '../../utils';
|
|
5
6
|
export declare const generateTreeViewFinderClass: (className: string) => string;
|
|
6
7
|
export interface TreeViewFinderNodeProps {
|
|
7
8
|
id: UUID;
|
|
8
9
|
name: string;
|
|
10
|
+
type?: ElementType;
|
|
9
11
|
description?: string;
|
|
10
12
|
icon?: ReactElement;
|
|
11
13
|
childrenCount?: number;
|
package/dist/index.js
CHANGED
|
@@ -44,6 +44,9 @@ import { FILTER_EQUIPMENTS_ATTRIBUTES } from "./components/filter/explicitNaming
|
|
|
44
44
|
import { saveExpertFilter, saveExplicitNamingFilter } from "./components/filter/utils/filterApi.js";
|
|
45
45
|
import { CONTINGENCY_LIST_EQUIPMENTS, FILTER_EQUIPMENTS } from "./components/filter/utils/filterFormUtils.js";
|
|
46
46
|
import { FlatParameters, extractDefault } from "./components/flatParameters/FlatParameters.js";
|
|
47
|
+
import "react/jsx-runtime";
|
|
48
|
+
import "@mui/material";
|
|
49
|
+
import "react-intl";
|
|
47
50
|
import { SelectClearable } from "./components/inputs/SelectClearable.js";
|
|
48
51
|
import { DESCRIPTION_INPUT, DirectoryItemsInput, NAME } from "./components/inputs/reactHookForm/DirectoryItemsInput.js";
|
|
49
52
|
import { RawReadOnlyInput } from "./components/inputs/reactHookForm/RawReadOnlyInput.js";
|
|
@@ -140,6 +143,9 @@ import { getTabIndicatorStyle, getTabStyle, parametersStyles } from "./component
|
|
|
140
143
|
import { BALANCE_TYPE, COMMON_PARAMETERS, CONNECTED_COMPONENT_MODE, COUNTRIES_TO_BALANCE, DC, DC_POWER_FACTOR, DC_USE_TRANSFORMER_RATIO, DEFAULT_LIMIT_REDUCTION_VALUE, DISTRIBUTED_SLACK, HVDC_AC_EMULATION, MAX_VALUE_ALLOWED_FOR_LIMIT_REDUCTION, MIN_VALUE_ALLOWED_FOR_LIMIT_REDUCTION, PARAM_LIMIT_REDUCTION, PARAM_PROVIDER_OPENLOADFLOW, PHASE_SHIFTER_REGULATION_ON, READ_SLACK_BUS, SHUNT_COMPENSATOR_VOLTAGE_CONTROL_ON, SPECIFIC_PARAMETERS, TRANSFORMER_VOLTAGE_CONTROL_ON, TWT_SPLIT_SHUNT_ADMITTANCE, USE_REACTIVE_LIMITS, VOLTAGE_INIT_MODE, WRITE_SLACK_BUS, alertThresholdMarks } from "./components/parameters/loadflow/constants.js";
|
|
141
144
|
import { LoadFlowParametersInline } from "./components/parameters/loadflow/load-flow-parameters-inline.js";
|
|
142
145
|
import { LoadFlowParametersEditionDialog } from "./components/parameters/loadflow/load-flow-parameters-dialog.js";
|
|
146
|
+
import { InitialVoltage, PredefinedParameters, SHORT_CIRCUIT_INITIAL_VOLTAGE_PROFILE_MODE, SHORT_CIRCUIT_PREDEFINED_PARAMS, SHORT_CIRCUIT_WITH_FEEDER_RESULT, SHORT_CIRCUIT_WITH_LOADS, SHORT_CIRCUIT_WITH_NEUTRAL_POSITION, SHORT_CIRCUIT_WITH_SHUNT_COMPENSATORS, SHORT_CIRCUIT_WITH_VSC_CONVERTER_STATIONS, intlInitialVoltageProfileMode, intlPredefinedParametersOptions } from "./components/parameters/short-circuit/constants.js";
|
|
147
|
+
import { ShortCircuitParametersInLine } from "./components/parameters/short-circuit/short-circuit-parameters-inline.js";
|
|
148
|
+
import { ShortCircuitParametersEditionDialog } from "./components/parameters/short-circuit/short-circuit-parameters-dialog.js";
|
|
143
149
|
import { CustomMenuItem, CustomNestedMenuItem } from "./components/menus/custom-nested-menu.js";
|
|
144
150
|
import { useStateBoolean } from "./hooks/customStates/useStateBoolean.js";
|
|
145
151
|
import { useStateNumber } from "./hooks/customStates/useStateNumber.js";
|
|
@@ -161,7 +167,7 @@ import { createFilter, createParameter, fetchElementsInfos, saveFilter, updatePa
|
|
|
161
167
|
import { fetchAppsMetadata, fetchDefaultCountry, fetchEnv, fetchFavoriteAndDefaultCountries, fetchStudyMetadata, isStudyMetadata } from "./services/appsMetadata.js";
|
|
162
168
|
import { elementAlreadyExists, fetchDirectoryContent, fetchDirectoryElementPath, fetchRootFolders } from "./services/directory.js";
|
|
163
169
|
import { PREFIX_STUDY_QUERIES, fetchLoadFlowParameters, getDefaultLoadFlowProvider, getLoadFlowDefaultLimitReductions, getLoadFlowProviders, getLoadFlowSpecificParametersDescription, getLoadFlowUrl, setLoadFlowParameters } from "./services/loadflow.js";
|
|
164
|
-
import { exportFilter, getAvailableComponentLibraries, getStudyNetworkVisualizationsParameters, setStudyNetworkVisualizationParameters } from "./services/study.js";
|
|
170
|
+
import { exportFilter, getAvailableComponentLibraries, getStudyNetworkVisualizationsParameters, getStudyShortCircuitParameters, invalidateStudyShortCircuitStatus, setStudyNetworkVisualizationParameters, setStudyShortCircuitParameters } from "./services/study.js";
|
|
165
171
|
import { getNetworkVisualizationsParameters } from "./services/study-config.js";
|
|
166
172
|
import { fetchCurrentAnnouncement, fetchUserDetails } from "./services/userAdmin.js";
|
|
167
173
|
import { equalsArray } from "./utils/algos.js";
|
|
@@ -353,6 +359,7 @@ export {
|
|
|
353
359
|
INTL_MAP_BASE_MAP_OPTIONS,
|
|
354
360
|
INTL_SUBSTATION_LAYOUT_OPTIONS,
|
|
355
361
|
IST_FORM,
|
|
362
|
+
InitialVoltage,
|
|
356
363
|
InputWithPopupConfirmation,
|
|
357
364
|
IntegerInput,
|
|
358
365
|
KILO_AMPERE,
|
|
@@ -450,6 +457,7 @@ export {
|
|
|
450
457
|
ParameterSwitch,
|
|
451
458
|
ParameterType,
|
|
452
459
|
PopupConfirmationDialog,
|
|
460
|
+
PredefinedParameters,
|
|
453
461
|
PropertyValueEditor,
|
|
454
462
|
ProviderParam,
|
|
455
463
|
RATIO_REGULATION_MODE_OPTIONS,
|
|
@@ -464,6 +472,13 @@ export {
|
|
|
464
472
|
RemoveButton,
|
|
465
473
|
RuleValueEditor,
|
|
466
474
|
SEARCH_EQUIPMENTS,
|
|
475
|
+
SHORT_CIRCUIT_INITIAL_VOLTAGE_PROFILE_MODE,
|
|
476
|
+
SHORT_CIRCUIT_PREDEFINED_PARAMS,
|
|
477
|
+
SHORT_CIRCUIT_WITH_FEEDER_RESULT,
|
|
478
|
+
SHORT_CIRCUIT_WITH_LOADS,
|
|
479
|
+
SHORT_CIRCUIT_WITH_NEUTRAL_POSITION,
|
|
480
|
+
SHORT_CIRCUIT_WITH_SHUNT_COMPENSATORS,
|
|
481
|
+
SHORT_CIRCUIT_WITH_VSC_CONVERTER_STATIONS,
|
|
467
482
|
SHOW_AUTH_INFO_LOGIN,
|
|
468
483
|
SHUNT_COMPENSATOR_TYPE_OPTIONS,
|
|
469
484
|
SHUNT_COMPENSATOR_VOLTAGE_CONTROL_ON,
|
|
@@ -476,6 +491,8 @@ export {
|
|
|
476
491
|
SelectClearable,
|
|
477
492
|
SelectInput,
|
|
478
493
|
SensitivityType,
|
|
494
|
+
ShortCircuitParametersEditionDialog,
|
|
495
|
+
ShortCircuitParametersInLine,
|
|
479
496
|
ShuntCompensator,
|
|
480
497
|
SignInCallbackHandler,
|
|
481
498
|
SilentRenewCallbackHandler,
|
|
@@ -602,6 +619,7 @@ export {
|
|
|
602
619
|
getRequestParamFromList,
|
|
603
620
|
getSAParametersFromSchema,
|
|
604
621
|
getStudyNetworkVisualizationsParameters,
|
|
622
|
+
getStudyShortCircuitParameters,
|
|
605
623
|
getSystemLanguage,
|
|
606
624
|
getTabIndicatorStyle,
|
|
607
625
|
getTabStyle,
|
|
@@ -617,6 +635,9 @@ export {
|
|
|
617
635
|
initializeAuthenticationProd,
|
|
618
636
|
inputsEn,
|
|
619
637
|
inputsFr,
|
|
638
|
+
intlInitialVoltageProfileMode,
|
|
639
|
+
intlPredefinedParametersOptions,
|
|
640
|
+
invalidateStudyShortCircuitStatus,
|
|
620
641
|
isBlankOrEmpty,
|
|
621
642
|
isFieldRequired,
|
|
622
643
|
isFloatNumber,
|
|
@@ -659,6 +680,7 @@ export {
|
|
|
659
680
|
setShowAuthenticationRouterLogin,
|
|
660
681
|
setSignInCallbackError,
|
|
661
682
|
setStudyNetworkVisualizationParameters,
|
|
683
|
+
setStudyShortCircuitParameters,
|
|
662
684
|
setUnauthorizedUserInfo,
|
|
663
685
|
setUserValidationError,
|
|
664
686
|
styles,
|
package/dist/services/index.js
CHANGED
|
@@ -3,7 +3,7 @@ import { createFilter, createParameter, fetchElementsInfos, saveFilter, updatePa
|
|
|
3
3
|
import { fetchAppsMetadata, fetchDefaultCountry, fetchEnv, fetchFavoriteAndDefaultCountries, fetchStudyMetadata, isStudyMetadata } from "./appsMetadata.js";
|
|
4
4
|
import { elementAlreadyExists, fetchDirectoryContent, fetchDirectoryElementPath, fetchRootFolders } from "./directory.js";
|
|
5
5
|
import { PREFIX_STUDY_QUERIES, fetchLoadFlowParameters, getDefaultLoadFlowProvider, getLoadFlowDefaultLimitReductions, getLoadFlowProviders, getLoadFlowSpecificParametersDescription, getLoadFlowUrl, setLoadFlowParameters } from "./loadflow.js";
|
|
6
|
-
import { exportFilter, getAvailableComponentLibraries, getStudyNetworkVisualizationsParameters, setStudyNetworkVisualizationParameters } from "./study.js";
|
|
6
|
+
import { exportFilter, getAvailableComponentLibraries, getStudyNetworkVisualizationsParameters, getStudyShortCircuitParameters, invalidateStudyShortCircuitStatus, setStudyNetworkVisualizationParameters, setStudyShortCircuitParameters } from "./study.js";
|
|
7
7
|
import { getNetworkVisualizationsParameters } from "./study-config.js";
|
|
8
8
|
import { fetchCurrentAnnouncement, fetchUserDetails } from "./userAdmin.js";
|
|
9
9
|
export {
|
|
@@ -37,9 +37,12 @@ export {
|
|
|
37
37
|
getNetworkVisualizationsParameters,
|
|
38
38
|
getRequestParamFromList,
|
|
39
39
|
getStudyNetworkVisualizationsParameters,
|
|
40
|
+
getStudyShortCircuitParameters,
|
|
41
|
+
invalidateStudyShortCircuitStatus,
|
|
40
42
|
isStudyMetadata,
|
|
41
43
|
saveFilter,
|
|
42
44
|
setLoadFlowParameters,
|
|
43
45
|
setStudyNetworkVisualizationParameters,
|
|
46
|
+
setStudyShortCircuitParameters,
|
|
44
47
|
updateParameter
|
|
45
48
|
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { backendFetchJson } from "./utils.js";
|
|
2
|
+
const PREFIX_SHORT_CIRCUIT_SERVER_QUERIES = `${"api/gateway"}/shortcircuit`;
|
|
3
|
+
function getShortCircuitUrl() {
|
|
4
|
+
return `${PREFIX_SHORT_CIRCUIT_SERVER_QUERIES}/v1`;
|
|
5
|
+
}
|
|
6
|
+
function fetchShortCircuitParameters(parameterUuid) {
|
|
7
|
+
console.info("get short circuit analysis parameters");
|
|
8
|
+
const url = `${getShortCircuitUrl()}/parameters/${encodeURIComponent(parameterUuid)}`;
|
|
9
|
+
return backendFetchJson(url);
|
|
10
|
+
}
|
|
11
|
+
export {
|
|
12
|
+
fetchShortCircuitParameters
|
|
13
|
+
};
|
package/dist/services/study.d.ts
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import { UUID } from 'crypto';
|
|
2
2
|
import { NetworkVisualizationParameters } from '../components/parameters/network-visualizations/network-visualizations.types';
|
|
3
|
+
import { ShortCircuitParameters, ShortCircuitParametersInfos } from '../components/parameters/short-circuit/short-circuit-parameters.type';
|
|
3
4
|
export declare function exportFilter(studyUuid: UUID, filterUuid?: UUID, token?: string): Promise<any>;
|
|
4
5
|
export declare function getAvailableComponentLibraries(): Promise<string[]>;
|
|
5
6
|
export declare function getStudyNetworkVisualizationsParameters(studyUuid: UUID): Promise<NetworkVisualizationParameters>;
|
|
6
7
|
export declare function setStudyNetworkVisualizationParameters(studyUuid: UUID, newParams: Record<string, any>): Promise<Response>;
|
|
8
|
+
export declare function getStudyShortCircuitParameters(studyUuid: UUID): Promise<ShortCircuitParametersInfos>;
|
|
9
|
+
export declare function setStudyShortCircuitParameters(studyUuid: UUID, newParams: ShortCircuitParameters): Promise<Response>;
|
|
10
|
+
export declare function invalidateStudyShortCircuitStatus(studyUuid: UUID): Promise<Response>;
|