@gridsuite/commons-ui 0.143.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/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/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/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/loadflow/load-flow-general-parameters.js +2 -2
- package/dist/components/parameters/loadflow/load-flow-parameter-field.js +3 -3
- package/dist/components/parameters/loadflow/load-flow-parameters-form.js +3 -3
- package/dist/components/parameters/loadflow/load-flow-parameters-header.js +3 -3
- package/dist/components/parameters/loadflow/use-load-flow-parameters-form.js +7 -4
- 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/short-circuit-fields.js +1 -1
- package/dist/components/parameters/short-circuit/short-circuit-parameters-form.js +3 -3
- package/dist/components/parameters/short-circuit/use-short-circuit-parameters-form.js +1 -1
- 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/index.js +2 -1
- package/dist/services/index.js +1 -2
- 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/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/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/package.json +1 -1
|
@@ -4,12 +4,12 @@ import LoadFlowParametersHeader from "./load-flow-parameters-header.js";
|
|
|
4
4
|
import LoadFlowParametersContent from "./load-flow-parameters-content.js";
|
|
5
5
|
import "react-intl";
|
|
6
6
|
import "../../overflowableText/OverflowableText.js";
|
|
7
|
-
import "react";
|
|
8
|
-
import "react-hook-form";
|
|
9
|
-
import "../../../utils/types/equipmentType.js";
|
|
10
7
|
import "../../../utils/conversionUtils.js";
|
|
11
8
|
import "@mui/icons-material";
|
|
9
|
+
import "../../../utils/types/equipmentType.js";
|
|
12
10
|
import "../../../utils/yupConfig.js";
|
|
11
|
+
import "react";
|
|
12
|
+
import "react-hook-form";
|
|
13
13
|
import "localized-countries";
|
|
14
14
|
import "localized-countries/data/fr";
|
|
15
15
|
import "localized-countries/data/en";
|
|
@@ -4,12 +4,12 @@ import { FormattedMessage } from "react-intl";
|
|
|
4
4
|
import { TabValues } from "./load-flow-parameters-utils.js";
|
|
5
5
|
import { parametersStyles, getTabStyle } from "../parameters-style.js";
|
|
6
6
|
import "../../overflowableText/OverflowableText.js";
|
|
7
|
-
import "react";
|
|
8
|
-
import "react-hook-form";
|
|
9
|
-
import "../../../utils/types/equipmentType.js";
|
|
10
7
|
import "../../../utils/conversionUtils.js";
|
|
11
8
|
import "@mui/icons-material";
|
|
9
|
+
import "../../../utils/types/equipmentType.js";
|
|
12
10
|
import "../../../utils/yupConfig.js";
|
|
11
|
+
import "react";
|
|
12
|
+
import "react-hook-form";
|
|
13
13
|
import "localized-countries";
|
|
14
14
|
import "localized-countries/data/fr";
|
|
15
15
|
import "localized-countries/data/en";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useForm } from "react-hook-form";
|
|
2
2
|
import { yupResolver } from "@hookform/resolvers/yup";
|
|
3
|
-
import { useState, useCallback, useMemo, useEffect } from "react";
|
|
3
|
+
import { useState, useCallback, useMemo, useEffectEvent, useEffect } from "react";
|
|
4
4
|
import { TabValues, getCommonLoadFlowParametersFormSchema, mapLimitReductions, setLimitReductions } from "./load-flow-parameters-utils.js";
|
|
5
5
|
import { PROVIDER, SPECIFIC_PARAMETERS, COMMON_PARAMETERS, VERSION_PARAMETER } from "../common/constant.js";
|
|
6
6
|
import "react/jsx-runtime";
|
|
@@ -96,7 +96,7 @@ const useLoadFlowParametersForm = (parametersBackend, enableDeveloperMode, param
|
|
|
96
96
|
resolver: yupResolver(formSchema)
|
|
97
97
|
});
|
|
98
98
|
const { watch, reset } = formMethods;
|
|
99
|
-
const watchProvider = watch(
|
|
99
|
+
const watchProvider = watch(PROVIDER);
|
|
100
100
|
const toLimitReductions = useCallback(
|
|
101
101
|
(formLimits) => {
|
|
102
102
|
if (formLimits?.length === 0) {
|
|
@@ -201,12 +201,15 @@ const useLoadFlowParametersForm = (parametersBackend, enableDeveloperMode, param
|
|
|
201
201
|
},
|
|
202
202
|
[parametersUuid, formatNewParams, snackError]
|
|
203
203
|
);
|
|
204
|
+
const resetForm = useEffectEvent((_params) => {
|
|
205
|
+
reset(toLoadFlowFormValues(_params));
|
|
206
|
+
});
|
|
204
207
|
useEffect(() => {
|
|
205
208
|
if (!params) {
|
|
206
209
|
return;
|
|
207
210
|
}
|
|
208
|
-
|
|
209
|
-
}, [paramsLoaded, params
|
|
211
|
+
resetForm(params);
|
|
212
|
+
}, [paramsLoaded, params]);
|
|
210
213
|
useEffect(() => {
|
|
211
214
|
if (watchProvider && watchProvider !== currentProvider) {
|
|
212
215
|
setCurrentProvider(watchProvider);
|
package/dist/components/parameters/network-visualizations/network-area-diagram-parameters.js
CHANGED
|
@@ -4,12 +4,12 @@ import { FormattedMessage } from "react-intl";
|
|
|
4
4
|
import { NAD_POSITIONS_GENERATION_MODE_LABEL, NetworkVisualizationTabValues, PARAM_NAD_POSITIONS_GENERATION_MODE, NAD_POSITIONS_GENERATION_MODE } from "./constants.js";
|
|
5
5
|
import { parametersStyles } from "../parameters-style.js";
|
|
6
6
|
import "../../overflowableText/OverflowableText.js";
|
|
7
|
-
import "react";
|
|
8
|
-
import "react-hook-form";
|
|
9
|
-
import "../../../utils/types/equipmentType.js";
|
|
10
7
|
import "../../../utils/conversionUtils.js";
|
|
11
8
|
import "@mui/icons-material";
|
|
9
|
+
import "../../../utils/types/equipmentType.js";
|
|
12
10
|
import "../../../utils/yupConfig.js";
|
|
11
|
+
import "react";
|
|
12
|
+
import "react-hook-form";
|
|
13
13
|
import "localized-countries";
|
|
14
14
|
import "localized-countries/data/fr";
|
|
15
15
|
import "localized-countries/data/en";
|
|
@@ -3,11 +3,11 @@ import { Grid, LinearProgress, Tabs, Tab } from "@mui/material";
|
|
|
3
3
|
import { useState, useEffect } from "react";
|
|
4
4
|
import { FormattedMessage } from "react-intl";
|
|
5
5
|
import "../../overflowableText/OverflowableText.js";
|
|
6
|
-
import "react-hook-form";
|
|
7
|
-
import "../../../utils/types/equipmentType.js";
|
|
8
6
|
import "../../../utils/conversionUtils.js";
|
|
9
7
|
import "@mui/icons-material";
|
|
8
|
+
import "../../../utils/types/equipmentType.js";
|
|
10
9
|
import "../../../utils/yupConfig.js";
|
|
10
|
+
import "react-hook-form";
|
|
11
11
|
import { getAvailableComponentLibraries } from "../../../services/study.js";
|
|
12
12
|
import "localized-countries";
|
|
13
13
|
import "localized-countries/data/fr";
|
|
@@ -6,11 +6,11 @@ import "react/jsx-runtime";
|
|
|
6
6
|
import "react-intl";
|
|
7
7
|
import "@mui/material";
|
|
8
8
|
import "../../overflowableText/OverflowableText.js";
|
|
9
|
-
import "../../../utils/types/equipmentType.js";
|
|
10
9
|
import "../../../utils/conversionUtils.js";
|
|
11
10
|
import { snackWithFallback } from "../../../utils/error.js";
|
|
12
11
|
import "@mui/icons-material";
|
|
13
12
|
import { ElementType } from "../../../utils/types/elementType.js";
|
|
13
|
+
import "../../../utils/types/equipmentType.js";
|
|
14
14
|
import { updateParameter } from "../../../services/explore.js";
|
|
15
15
|
import { setStudyNetworkVisualizationParameters } from "../../../services/study.js";
|
|
16
16
|
import { getNetworkVisualizationsParameters } from "../../../services/study-config.js";
|
|
@@ -3,12 +3,12 @@ import "react/jsx-runtime";
|
|
|
3
3
|
import "react-intl";
|
|
4
4
|
import "@mui/material";
|
|
5
5
|
import "../../overflowableText/OverflowableText.js";
|
|
6
|
-
import "react";
|
|
7
|
-
import "react-hook-form";
|
|
8
|
-
import "../../../utils/types/equipmentType.js";
|
|
9
6
|
import "../../../utils/conversionUtils.js";
|
|
10
7
|
import "@mui/icons-material";
|
|
8
|
+
import "../../../utils/types/equipmentType.js";
|
|
11
9
|
import "../../../utils/yupConfig.js";
|
|
10
|
+
import "react";
|
|
11
|
+
import "react-hook-form";
|
|
12
12
|
import "localized-countries";
|
|
13
13
|
import "localized-countries/data/fr";
|
|
14
14
|
import "localized-countries/data/en";
|
|
@@ -2,14 +2,14 @@ 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 { EquipmentType } from "../../../utils/types/equipmentType.js";
|
|
8
5
|
import { FILTERS } from "../../../utils/constants/filterConstant.js";
|
|
9
6
|
import "../../../utils/conversionUtils.js";
|
|
10
7
|
import "@mui/icons-material";
|
|
11
8
|
import { ElementType } from "../../../utils/types/elementType.js";
|
|
9
|
+
import { EquipmentType } from "../../../utils/types/equipmentType.js";
|
|
12
10
|
import "../../../utils/yupConfig.js";
|
|
11
|
+
import "react";
|
|
12
|
+
import "react-hook-form";
|
|
13
13
|
import "localized-countries";
|
|
14
14
|
import "localized-countries/data/fr";
|
|
15
15
|
import "localized-countries/data/en";
|
|
@@ -2,13 +2,13 @@ import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
|
2
2
|
import { FormattedMessage } from "react-intl";
|
|
3
3
|
import { Grid, Box, LinearProgress } from "@mui/material";
|
|
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";
|
|
10
7
|
import { mergeSx } from "../../../utils/styles.js";
|
|
8
|
+
import "../../../utils/types/equipmentType.js";
|
|
11
9
|
import "../../../utils/yupConfig.js";
|
|
10
|
+
import "react";
|
|
11
|
+
import "react-hook-form";
|
|
12
12
|
import "localized-countries";
|
|
13
13
|
import "localized-countries/data/fr";
|
|
14
14
|
import "localized-countries/data/en";
|
|
@@ -4,11 +4,11 @@ import { useIntl } from "react-intl";
|
|
|
4
4
|
import { Info } from "@mui/icons-material";
|
|
5
5
|
import { parametersStyles } from "../parameters-style.js";
|
|
6
6
|
import "../../overflowableText/OverflowableText.js";
|
|
7
|
-
import "react";
|
|
8
|
-
import "react-hook-form";
|
|
9
|
-
import "../../../utils/types/equipmentType.js";
|
|
10
7
|
import "../../../utils/conversionUtils.js";
|
|
8
|
+
import "../../../utils/types/equipmentType.js";
|
|
11
9
|
import "../../../utils/yupConfig.js";
|
|
10
|
+
import "react";
|
|
11
|
+
import "react-hook-form";
|
|
12
12
|
import "localized-countries";
|
|
13
13
|
import "localized-countries/data/fr";
|
|
14
14
|
import "localized-countries/data/en";
|
|
@@ -3,12 +3,12 @@ import { Grid } from "@mui/material";
|
|
|
3
3
|
import { FormattedMessage } from "react-intl";
|
|
4
4
|
import { FLOW_FLOW_SENSITIVITY_VALUE_THRESHOLD, ANGLE_FLOW_SENSITIVITY_VALUE_THRESHOLD, FLOW_VOLTAGE_SENSITIVITY_VALUE_THRESHOLD } from "./constants.js";
|
|
5
5
|
import "../../overflowableText/OverflowableText.js";
|
|
6
|
-
import "react";
|
|
7
|
-
import "react-hook-form";
|
|
8
|
-
import "../../../utils/types/equipmentType.js";
|
|
9
6
|
import "../../../utils/conversionUtils.js";
|
|
10
7
|
import "@mui/icons-material";
|
|
8
|
+
import "../../../utils/types/equipmentType.js";
|
|
11
9
|
import "../../../utils/yupConfig.js";
|
|
10
|
+
import "react";
|
|
11
|
+
import "react-hook-form";
|
|
12
12
|
import "localized-countries";
|
|
13
13
|
import "localized-countries/data/fr";
|
|
14
14
|
import "localized-countries/data/en";
|
|
@@ -3,13 +3,13 @@ import { Box, Grid, LinearProgress } from "@mui/material";
|
|
|
3
3
|
import { FormattedMessage } from "react-intl";
|
|
4
4
|
import { parametersStyles } from "../parameters-style.js";
|
|
5
5
|
import "../../overflowableText/OverflowableText.js";
|
|
6
|
-
import "react";
|
|
7
|
-
import "react-hook-form";
|
|
8
|
-
import "../../../utils/types/equipmentType.js";
|
|
9
6
|
import "../../../utils/conversionUtils.js";
|
|
10
7
|
import "@mui/icons-material";
|
|
11
8
|
import { mergeSx } from "../../../utils/styles.js";
|
|
9
|
+
import "../../../utils/types/equipmentType.js";
|
|
12
10
|
import "../../../utils/yupConfig.js";
|
|
11
|
+
import "react";
|
|
12
|
+
import "react-hook-form";
|
|
13
13
|
import "localized-countries";
|
|
14
14
|
import "localized-countries/data/fr";
|
|
15
15
|
import "localized-countries/data/en";
|
|
@@ -9,8 +9,8 @@ import { ACTIVATED, MONITORED_BRANCHES, INJECTIONS, HVDC_LINES, PSTS, COUNT } fr
|
|
|
9
9
|
import "@hello-pangea/dnd";
|
|
10
10
|
import { MAX_ROWS_NUMBER } from "../../dnd-table/dnd-table.type.js";
|
|
11
11
|
import "../../overflowableText/OverflowableText.js";
|
|
12
|
-
import "../../../utils/types/equipmentType.js";
|
|
13
12
|
import "../../../utils/conversionUtils.js";
|
|
13
|
+
import "../../../utils/types/equipmentType.js";
|
|
14
14
|
import "../../../utils/yupConfig.js";
|
|
15
15
|
import "localized-countries";
|
|
16
16
|
import "localized-countries/data/fr";
|
|
@@ -2,12 +2,12 @@ import { jsxs, jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import { TableCell } 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";
|
|
@@ -11,8 +11,8 @@ import GridSection from "../../grid/grid-section.js";
|
|
|
11
11
|
import "react-intl";
|
|
12
12
|
import { FieldLabel } from "../../inputs/reactHookForm/utils/FieldLabel.js";
|
|
13
13
|
import "../../overflowableText/OverflowableText.js";
|
|
14
|
-
import "../../../utils/types/equipmentType.js";
|
|
15
14
|
import "../../../utils/conversionUtils.js";
|
|
15
|
+
import "../../../utils/types/equipmentType.js";
|
|
16
16
|
import "../../../utils/yupConfig.js";
|
|
17
17
|
import "localized-countries";
|
|
18
18
|
import "localized-countries/data/fr";
|
|
@@ -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";
|
|
@@ -6,11 +6,11 @@ import "react/jsx-runtime";
|
|
|
6
6
|
import "react-intl";
|
|
7
7
|
import "@mui/material";
|
|
8
8
|
import "../../overflowableText/OverflowableText.js";
|
|
9
|
-
import "../../../utils/types/equipmentType.js";
|
|
10
9
|
import "../../../utils/conversionUtils.js";
|
|
11
10
|
import { snackWithFallback } from "../../../utils/error.js";
|
|
12
11
|
import "@mui/icons-material";
|
|
13
12
|
import { ElementType } from "../../../utils/types/elementType.js";
|
|
13
|
+
import "../../../utils/types/equipmentType.js";
|
|
14
14
|
import { updateParameter } from "../../../services/explore.js";
|
|
15
15
|
import "localized-countries";
|
|
16
16
|
import "localized-countries/data/fr";
|
|
@@ -2,13 +2,13 @@ import { jsxs, jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import { Grid, Alert } from "@mui/material";
|
|
3
3
|
import { FormattedMessage } from "react-intl";
|
|
4
4
|
import "../../overflowableText/OverflowableText.js";
|
|
5
|
-
import "react";
|
|
6
|
-
import "react-hook-form";
|
|
7
|
-
import { EquipmentType } from "../../../utils/types/equipmentType.js";
|
|
8
5
|
import "../../../utils/conversionUtils.js";
|
|
9
6
|
import "@mui/icons-material";
|
|
10
7
|
import { ElementType } from "../../../utils/types/elementType.js";
|
|
8
|
+
import { EquipmentType } from "../../../utils/types/equipmentType.js";
|
|
11
9
|
import "../../../utils/yupConfig.js";
|
|
10
|
+
import "react";
|
|
11
|
+
import "react-hook-form";
|
|
12
12
|
import "localized-countries";
|
|
13
13
|
import "localized-countries/data/fr";
|
|
14
14
|
import "localized-countries/data/en";
|
|
@@ -6,12 +6,12 @@ import "react/jsx-runtime";
|
|
|
6
6
|
import "react-intl";
|
|
7
7
|
import "@mui/material";
|
|
8
8
|
import "../../overflowableText/OverflowableText.js";
|
|
9
|
-
import "../../../utils/types/equipmentType.js";
|
|
10
9
|
import { ID, FILTERS } from "../../../utils/constants/filterConstant.js";
|
|
11
10
|
import { isBlankOrEmpty } from "../../../utils/conversionUtils.js";
|
|
12
11
|
import { snackWithFallback } from "../../../utils/error.js";
|
|
13
12
|
import "@mui/icons-material";
|
|
14
13
|
import { ElementType } from "../../../utils/types/elementType.js";
|
|
14
|
+
import "../../../utils/types/equipmentType.js";
|
|
15
15
|
import { updateParameter } from "../../../services/explore.js";
|
|
16
16
|
import { updateVoltageInitParameters } from "../../../services/study.js";
|
|
17
17
|
import { getVoltageInitParameters } from "../../../services/voltage-init.js";
|
|
@@ -4,13 +4,13 @@ import "react/jsx-runtime";
|
|
|
4
4
|
import "react-intl";
|
|
5
5
|
import "@mui/material";
|
|
6
6
|
import "../../overflowableText/OverflowableText.js";
|
|
7
|
-
import "react";
|
|
8
|
-
import "react-hook-form";
|
|
9
|
-
import "../../../utils/types/equipmentType.js";
|
|
10
7
|
import { FILTER_NAME, FILTER_ID, ID, FILTERS } from "../../../utils/constants/filterConstant.js";
|
|
11
8
|
import "../../../utils/conversionUtils.js";
|
|
12
9
|
import "@mui/icons-material";
|
|
10
|
+
import "../../../utils/types/equipmentType.js";
|
|
13
11
|
import "../../../utils/yupConfig.js";
|
|
12
|
+
import "react";
|
|
13
|
+
import "react-hook-form";
|
|
14
14
|
import "localized-countries";
|
|
15
15
|
import "localized-countries/data/fr";
|
|
16
16
|
import "localized-countries/data/en";
|
|
@@ -3,12 +3,12 @@ import { Box, Grid, LinearProgress, Tabs, Tab } from "@mui/material";
|
|
|
3
3
|
import { FormattedMessage } from "react-intl";
|
|
4
4
|
import { getTabIndicatorStyle, getTabStyle } from "../parameters-style.js";
|
|
5
5
|
import "../../overflowableText/OverflowableText.js";
|
|
6
|
-
import "react";
|
|
7
|
-
import "react-hook-form";
|
|
8
|
-
import "../../../utils/types/equipmentType.js";
|
|
9
6
|
import "../../../utils/conversionUtils.js";
|
|
10
7
|
import "@mui/icons-material";
|
|
8
|
+
import "../../../utils/types/equipmentType.js";
|
|
11
9
|
import "../../../utils/yupConfig.js";
|
|
10
|
+
import "react";
|
|
11
|
+
import "react-hook-form";
|
|
12
12
|
import "localized-countries";
|
|
13
13
|
import "localized-countries/data/fr";
|
|
14
14
|
import "localized-countries/data/en";
|
package/dist/index.js
CHANGED
|
@@ -203,7 +203,7 @@ import { fetchDefaultSecurityAnalysisProvider, fetchSecurityAnalysisParameters,
|
|
|
203
203
|
import { exportFilter, getAvailableComponentLibraries, getStudyNetworkVisualizationsParameters, getStudyShortCircuitParameters, setStudyNetworkVisualizationParameters, updateVoltageInitParameters } from "./services/study.js";
|
|
204
204
|
import { getNetworkVisualizationsParameters } from "./services/study-config.js";
|
|
205
205
|
import { fetchCurrentAnnouncement, fetchUserDetails } from "./services/userAdmin.js";
|
|
206
|
-
import {
|
|
206
|
+
import { backendFetch, backendFetchFile, backendFetchJson, backendFetchText, getRequestParamFromList } from "./services/utils.js";
|
|
207
207
|
import { getVoltageInitParameters, getVoltageInitUrl } from "./services/voltage-init.js";
|
|
208
208
|
import { fetchShortCircuitParameters, getShortCircuitSpecificParametersDescription, updateShortCircuitParameters } from "./services/short-circuit-analysis.js";
|
|
209
209
|
import { equalsArray } from "./utils/algos.js";
|
|
@@ -223,6 +223,7 @@ import { copyToClipboard } from "./utils/navigator-clipboard.js";
|
|
|
223
223
|
import { NotificationsUrlKeys, PREFIX_CONFIG_NOTIFICATION_WS, PREFIX_DIRECTORY_NOTIFICATION_WS, PREFIX_STUDY_NOTIFICATION_WS } from "./utils/constants/notificationsProvider.js";
|
|
224
224
|
import { DARK_THEME, LIGHT_THEME, makeComposeClasses, mergeSx, toNestedGlobalSelectors } from "./utils/styles.js";
|
|
225
225
|
import { CustomError, formatMessageValues } from "./utils/types/CustomError.js";
|
|
226
|
+
import { NetworkTimeoutError } from "./utils/types/NetworkTimeoutError.js";
|
|
226
227
|
import { ElementType } from "./utils/types/elementType.js";
|
|
227
228
|
import { ALL_EQUIPMENTS, BASE_EQUIPMENTS, EquipmentType, ExtendedEquipmentType, HvdcType, OperatingStatus, SEARCH_EQUIPMENTS, TYPE_TAG_MAX_SIZE, VL_TAG_MAX_SIZE, equipmentStyles, getEquipmentsInfosForSearchBar } from "./utils/types/equipmentType.js";
|
|
228
229
|
import { Battery, BusBar, DanglingLine, Generator, Hvdc, LCC, Line, Load, SVC, ShuntCompensator, Substation, ThreeWindingTransfo, TwoWindingTransfo, VSC, VoltageLevel } from "./utils/types/equipmentTypes.js";
|
package/dist/services/index.js
CHANGED
|
@@ -8,11 +8,10 @@ import { fetchDefaultSecurityAnalysisProvider, fetchSecurityAnalysisParameters,
|
|
|
8
8
|
import { exportFilter, getAvailableComponentLibraries, getStudyNetworkVisualizationsParameters, getStudyShortCircuitParameters, setStudyNetworkVisualizationParameters, updateVoltageInitParameters } from "./study.js";
|
|
9
9
|
import { getNetworkVisualizationsParameters } from "./study-config.js";
|
|
10
10
|
import { fetchCurrentAnnouncement, fetchUserDetails } from "./userAdmin.js";
|
|
11
|
-
import {
|
|
11
|
+
import { backendFetch, backendFetchFile, backendFetchJson, backendFetchText, getRequestParamFromList } from "./utils.js";
|
|
12
12
|
import { getVoltageInitParameters, getVoltageInitUrl } from "./voltage-init.js";
|
|
13
13
|
import { fetchShortCircuitParameters, getShortCircuitSpecificParametersDescription, updateShortCircuitParameters } from "./short-circuit-analysis.js";
|
|
14
14
|
export {
|
|
15
|
-
NetworkTimeoutError,
|
|
16
15
|
PREFIX_STUDY_QUERIES,
|
|
17
16
|
PermissionType,
|
|
18
17
|
backendFetch,
|
package/dist/services/utils.d.ts
CHANGED
|
@@ -9,10 +9,6 @@ type FetchInitWithTimeout = RequestInit & {
|
|
|
9
9
|
/** If provided and no signal is set, use this as the timeout override (ms). */
|
|
10
10
|
timeoutMs?: number;
|
|
11
11
|
};
|
|
12
|
-
/** Custom error type thrown when AbortSignal.timeout triggers. */
|
|
13
|
-
export declare class NetworkTimeoutError extends Error {
|
|
14
|
-
constructor(messageKey?: string);
|
|
15
|
-
}
|
|
16
12
|
export declare const backendFetch: (url: string, init?: FetchInitWithTimeout, token?: string) => Promise<Response>;
|
|
17
13
|
export declare const backendFetchJson: (url: string, init?: FetchInitWithTimeout, token?: string) => Promise<any>;
|
|
18
14
|
export declare function backendFetchText(url: string, init?: FetchInitWithTimeout, token?: string): Promise<string>;
|
package/dist/services/utils.js
CHANGED
|
@@ -1,12 +1,7 @@
|
|
|
1
1
|
import { getUserToken } from "../redux/commonStore.js";
|
|
2
2
|
import { CustomError } from "../utils/types/CustomError.js";
|
|
3
|
+
import { NetworkTimeoutError } from "../utils/types/NetworkTimeoutError.js";
|
|
3
4
|
const DEFAULT_TIMEOUT_MS = 5e4;
|
|
4
|
-
class NetworkTimeoutError extends Error {
|
|
5
|
-
constructor(messageKey = "errors.network.timeout") {
|
|
6
|
-
super(messageKey);
|
|
7
|
-
this.name = "NetworkTimeoutError";
|
|
8
|
-
}
|
|
9
|
-
}
|
|
10
5
|
const parseError = (text) => {
|
|
11
6
|
try {
|
|
12
7
|
return JSON.parse(text);
|
|
@@ -39,15 +34,15 @@ const handleError = (response) => {
|
|
|
39
34
|
let customError;
|
|
40
35
|
if (errorJson?.businessErrorCode != null) {
|
|
41
36
|
throw new CustomError(
|
|
42
|
-
errorJson.
|
|
37
|
+
errorJson.detail,
|
|
43
38
|
errorJson.status,
|
|
44
39
|
errorJson.businessErrorCode,
|
|
45
40
|
errorJson.businessErrorValues
|
|
46
41
|
);
|
|
47
42
|
}
|
|
48
|
-
if (errorJson && errorJson.status && errorJson.error && errorJson.
|
|
43
|
+
if (errorJson && errorJson.status && errorJson.error && errorJson.detail) {
|
|
49
44
|
customError = new CustomError(
|
|
50
|
-
`${errorName + errorJson.status} ${errorJson.error}, message : ${errorJson.
|
|
45
|
+
`${errorName + errorJson.status} ${errorJson.error}, message : ${errorJson.detail}`,
|
|
51
46
|
errorJson.status
|
|
52
47
|
);
|
|
53
48
|
} else {
|
|
@@ -88,7 +83,6 @@ const getRequestParamFromList = (paramName, params = []) => {
|
|
|
88
83
|
return new URLSearchParams(params.map((param) => [paramName, param]));
|
|
89
84
|
};
|
|
90
85
|
export {
|
|
91
|
-
NetworkTimeoutError,
|
|
92
86
|
backendFetch,
|
|
93
87
|
backendFetchFile,
|
|
94
88
|
backendFetchJson,
|
|
@@ -43,4 +43,21 @@ export declare const businessErrorsEn: {
|
|
|
43
43
|
'useradmin.announcementInvalidPeriod': string;
|
|
44
44
|
'useradmin.announcementOverlap': string;
|
|
45
45
|
'filter.filterCycleDetected': string;
|
|
46
|
+
'computation.resultNotFound': string;
|
|
47
|
+
'computation.parametersNotFound': string;
|
|
48
|
+
'computation.invalidSortFormat': string;
|
|
49
|
+
'computation.invalidExportParams': string;
|
|
50
|
+
'computation.limitReductionConfigError': string;
|
|
51
|
+
'computation.runnerError': string;
|
|
52
|
+
'voltageInit.missingFilter': string;
|
|
53
|
+
'shortcircuit.busOutOfVoltage': string;
|
|
54
|
+
'shortcircuit.missingExtensionData': string;
|
|
55
|
+
'shortcircuit.inconsistentVoltageLevels': string;
|
|
56
|
+
'dynamicMapping.mappingNameNotProvided': string;
|
|
57
|
+
'dynamicSecurityAnalysis.providerNotFound': string;
|
|
58
|
+
'dynamicSecurityAnalysis.contingenciesNotFound': string;
|
|
59
|
+
'dynamicSecurityAnalysis.contingencyListEmpty': string;
|
|
60
|
+
'dynamicSimulation.providerNotFound': string;
|
|
61
|
+
'dynamicSimulation.mappingNotProvided': string;
|
|
62
|
+
'dynamicSimulation.mappingNotLastRuleWithEmptyFilterError': string;
|
|
46
63
|
};
|
|
@@ -7,7 +7,7 @@ const businessErrorsEn = {
|
|
|
7
7
|
"directory.someElementsAreMissing": "Some of the requested directory elements are missing.",
|
|
8
8
|
"directory.elementNotFound": "The requested directory element could not be found.",
|
|
9
9
|
"explore.permissionDenied": "You are not allowed to perform this action.",
|
|
10
|
-
"explore.maxElementsExceeded": "
|
|
10
|
+
"explore.maxElementsExceeded": "You have reached your user quota for cases and studies ({limit} cases and studies).",
|
|
11
11
|
"explore.incorrectCaseFile": "The provided case file is incorrect.",
|
|
12
12
|
"study.notFound": "Study was not found.",
|
|
13
13
|
"study.computationRunning": "The operation cannot be performed because a computation is running.",
|
|
@@ -20,7 +20,7 @@ const businessErrorsEn = {
|
|
|
20
20
|
"study.nodeNameAlreadyExist": "Node name already exists.",
|
|
21
21
|
"study.timeSeriesBadType": "Bad timeseries type.",
|
|
22
22
|
"study.noVoltageInitResultsForNode": "No voltage initialization results found.",
|
|
23
|
-
"study.maxNodeBuildsExceeded": "
|
|
23
|
+
"study.maxNodeBuildsExceeded": "You have reached your user quota for builds per study ({limit} builds)",
|
|
24
24
|
"study.rootNetworkDeleteForbidden": "Impossible to delete this root network.",
|
|
25
25
|
"study.maximumRootNetworkByStudyReached": "Maximum number of root network per study exceeded.",
|
|
26
26
|
"study.maximumTagLengthExceeded": "Tag length exceeded.",
|
|
@@ -36,7 +36,24 @@ const businessErrorsEn = {
|
|
|
36
36
|
"useradmin.groupAlreadyExists": "User group already exists.",
|
|
37
37
|
"useradmin.announcementInvalidPeriod": "The announcement has an invalid time period.",
|
|
38
38
|
"useradmin.announcementOverlap": "The announcement period overlaps with an existing one.",
|
|
39
|
-
"filter.filterCycleDetected": "Filter cycle detected: {filters}"
|
|
39
|
+
"filter.filterCycleDetected": "Filter cycle detected: {filters}",
|
|
40
|
+
"computation.resultNotFound": "Results not found.",
|
|
41
|
+
"computation.parametersNotFound": "Parameters not found.",
|
|
42
|
+
"computation.invalidSortFormat": "The sorting format is incorrect.",
|
|
43
|
+
"computation.invalidExportParams": "The export settings are incorrect.",
|
|
44
|
+
"computation.limitReductionConfigError": "The limit reductions configuration is incorrect.",
|
|
45
|
+
"computation.runnerError": "An error occurred during the computation.",
|
|
46
|
+
"voltageInit.missingFilter": "The configuration contains one or more filters that have been deleted.",
|
|
47
|
+
"shortcircuit.busOutOfVoltage": "Selected bus is out of voltage.",
|
|
48
|
+
"shortcircuit.missingExtensionData": "Missing short-circuit extension data.",
|
|
49
|
+
"shortcircuit.inconsistentVoltageLevels": "Some voltage levels have wrong isc values. Check out the logs to find which ones.",
|
|
50
|
+
"dynamicMapping.mappingNameNotProvided": "Mapping name not provided",
|
|
51
|
+
"dynamicSecurityAnalysis.providerNotFound": "Dynamic security analysis provider not found.",
|
|
52
|
+
"dynamicSecurityAnalysis.contingenciesNotFound": "No contingencies provided.",
|
|
53
|
+
"dynamicSecurityAnalysis.contingencyListEmpty": "Contingency list parameter must not be null or empty.",
|
|
54
|
+
"dynamicSimulation.providerNotFound": "Dynamic simulation provider not found.",
|
|
55
|
+
"dynamicSimulation.mappingNotProvided": "Dynamic simulation mapping not provided.",
|
|
56
|
+
"dynamicSimulation.mappingNotLastRuleWithEmptyFilterError": "Only last rule can have empty filter: type {equipmentType}, rule index {index}."
|
|
40
57
|
};
|
|
41
58
|
export {
|
|
42
59
|
businessErrorsEn
|
|
@@ -43,4 +43,21 @@ export declare const businessErrorsFr: {
|
|
|
43
43
|
'useradmin.announcementInvalidPeriod': string;
|
|
44
44
|
'useradmin.announcementOverlap': string;
|
|
45
45
|
'filter.filterCycleDetected': string;
|
|
46
|
+
'computation.resultNotFound': string;
|
|
47
|
+
'computation.parametersNotFound': string;
|
|
48
|
+
'computation.invalidSortFormat': string;
|
|
49
|
+
'computation.invalidExportParams': string;
|
|
50
|
+
'computation.limitReductionConfigError': string;
|
|
51
|
+
'computation.runnerError': string;
|
|
52
|
+
'voltageInit.missingFilter': string;
|
|
53
|
+
'shortcircuit.busOutOfVoltage': string;
|
|
54
|
+
'shortcircuit.missingExtensionData': string;
|
|
55
|
+
'shortcircuit.inconsistentVoltageLevels': string;
|
|
56
|
+
'dynamicMapping.mappingNameNotProvided': string;
|
|
57
|
+
'dynamicSecurityAnalysis.providerNotFound': string;
|
|
58
|
+
'dynamicSecurityAnalysis.contingenciesNotFound': string;
|
|
59
|
+
'dynamicSecurityAnalysis.contingencyListEmpty': string;
|
|
60
|
+
'dynamicSimulation.providerNotFound': string;
|
|
61
|
+
'dynamicSimulation.mappingNotProvided': string;
|
|
62
|
+
'dynamicSimulation.mappingNotLastRuleWithEmptyFilterError': string;
|
|
46
63
|
};
|
|
@@ -7,7 +7,7 @@ const businessErrorsFr = {
|
|
|
7
7
|
"directory.someElementsAreMissing": "Certains des éléments demandés sont manquants.",
|
|
8
8
|
"directory.elementNotFound": "L'élément du dossier demandé est introuvable.",
|
|
9
9
|
"explore.permissionDenied": "Vous n'êtes pas autorisé à effectuer cette action.",
|
|
10
|
-
"explore.maxElementsExceeded": "
|
|
10
|
+
"explore.maxElementsExceeded": "Vous avez atteint votre quota utilisateur en termes de situations et d'études ({limit} situations et études).",
|
|
11
11
|
"explore.incorrectCaseFile": "Le fichier réseau fourni est incorrect.",
|
|
12
12
|
"study.notFound": "Étude non trouvée.",
|
|
13
13
|
"study.computationRunning": "L'opération ne peut être menée car un calcul est en cours.",
|
|
@@ -20,7 +20,7 @@ const businessErrorsFr = {
|
|
|
20
20
|
"study.nodeNameAlreadyExist": "Ce nom de noeud existe déjà.",
|
|
21
21
|
"study.timeSeriesBadType": "Série temporelle de mauvais type.",
|
|
22
22
|
"study.noVoltageInitResultsForNode": "Pas de résultats pour l'initialisation du plan de tension.",
|
|
23
|
-
"study.maxNodeBuildsExceeded": "
|
|
23
|
+
"study.maxNodeBuildsExceeded": "Vous avez atteint votre quota utilisateur en termes de réalisation de nœud par étude ({limit} réalisations).",
|
|
24
24
|
"study.rootNetworkDeleteForbidden": "Impossible de supprimer ce réseau racine.",
|
|
25
25
|
"study.maximumRootNetworkByStudyReached": "Nombre maximal de réseau racine par étude atteint.",
|
|
26
26
|
"study.maximumTagLengthExceeded": "Taille maximale d'étiquette atteinte.",
|
|
@@ -36,7 +36,24 @@ const businessErrorsFr = {
|
|
|
36
36
|
"useradmin.groupAlreadyExists": "Le groupe d'utilisateurs existe déjà.",
|
|
37
37
|
"useradmin.announcementInvalidPeriod": "La période de l'annonce est invalide.",
|
|
38
38
|
"useradmin.announcementOverlap": "La période de l'annonce chevauche une autre annonce existante.",
|
|
39
|
-
"filter.filterCycleDetected": "Cycle de filtre détecté: {filters}"
|
|
39
|
+
"filter.filterCycleDetected": "Cycle de filtre détecté: {filters}",
|
|
40
|
+
"computation.resultNotFound": "Résultats non trouvés.",
|
|
41
|
+
"computation.parametersNotFound": "Paramètres non trouvés.",
|
|
42
|
+
"computation.invalidSortFormat": "Le format du tri est incorrect.",
|
|
43
|
+
"computation.invalidExportParams": "Les paramètres d'export sont incorrects.",
|
|
44
|
+
"computation.limitReductionConfigError": "La configuration des abattements est incorrect.",
|
|
45
|
+
"computation.runnerError": "Une erreur est survenue durant l'exécution du calcul.",
|
|
46
|
+
"voltageInit.missingFilter": "La configuration contient un ou des filtres qui ont été supprimés.",
|
|
47
|
+
"shortcircuit.busOutOfVoltage": "Bus sélectionné en dehors des limites de tension.",
|
|
48
|
+
"shortcircuit.missingExtensionData": "Données de l'extension court-circuit manquantes.",
|
|
49
|
+
"shortcircuit.inconsistentVoltageLevels": "Des postes ont des données Icc incohérentes. Vérifiez les logs pour déterminer lesquels.",
|
|
50
|
+
"dynamicMapping.mappingNameNotProvided": "Nom du mapping non fourni",
|
|
51
|
+
"dynamicSecurityAnalysis.providerNotFound": "Simulateur d'analyse de sécurité dynamique non trouvé.",
|
|
52
|
+
"dynamicSecurityAnalysis.contingenciesNotFound": "Aucun aléa fourni.",
|
|
53
|
+
"dynamicSecurityAnalysis.contingencyListEmpty": "La liste d'aléas fournie ne doit pas être nulle ou vide.",
|
|
54
|
+
"dynamicSimulation.providerNotFound": "Simulateur pour la simulation dynamique non trouvé.",
|
|
55
|
+
"dynamicSimulation.mappingNotProvided": "Mapping pour la simulation dynamique non fourni.",
|
|
56
|
+
"dynamicSimulation.mappingNotLastRuleWithEmptyFilterError": "Seule la dernière règle peut avoir un filtre vide : type {equipmentType}, indice de la règle : {index}."
|
|
40
57
|
};
|
|
41
58
|
export {
|
|
42
59
|
businessErrorsFr
|