@gridsuite/commons-ui 0.143.0 → 0.145.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/hooks/useModificationLabelComputer.js +10 -0
- package/dist/index.js +3 -1
- package/dist/services/index.js +2 -2
- package/dist/services/utils.d.ts +2 -10
- package/dist/services/utils.js +18 -30
- 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/CustomError.d.ts +2 -2
- 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";
|
|
@@ -57,6 +57,16 @@ const useModificationLabelComputer = () => {
|
|
|
57
57
|
case MODIFICATION_TYPES.CREATE_VOLTAGE_LEVEL_SECTION.type:
|
|
58
58
|
case MODIFICATION_TYPES.MOVE_VOLTAGE_LEVEL_FEEDER_BAYS.type:
|
|
59
59
|
return modificationMetadata.voltageLevelId;
|
|
60
|
+
case MODIFICATION_TYPES.VOLTAGE_INIT_MODIFICATION.type:
|
|
61
|
+
if (modificationMetadata.rootNetworkName && modificationMetadata.nodeName && modificationMetadata.computationDate) {
|
|
62
|
+
const computedDateFormatted = new Intl.DateTimeFormat(intl.locale, {
|
|
63
|
+
dateStyle: "long",
|
|
64
|
+
timeStyle: "long",
|
|
65
|
+
hour12: false
|
|
66
|
+
}).format(new Date(modificationMetadata.computationDate));
|
|
67
|
+
return `: ${modificationMetadata.rootNetworkName} / ${modificationMetadata.nodeName} / ${computedDateFormatted}`;
|
|
68
|
+
}
|
|
69
|
+
return "";
|
|
60
70
|
default:
|
|
61
71
|
return modificationMetadata.equipmentId || "";
|
|
62
72
|
}
|
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, convertToCustomError, 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";
|
|
@@ -708,6 +709,7 @@ export {
|
|
|
708
709
|
componentsFr,
|
|
709
710
|
convertInputValue,
|
|
710
711
|
convertOutputValue,
|
|
712
|
+
convertToCustomError,
|
|
711
713
|
copyToClipboard,
|
|
712
714
|
countRules,
|
|
713
715
|
createFilter,
|
package/dist/services/index.js
CHANGED
|
@@ -8,17 +8,17 @@ 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, convertToCustomError, 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,
|
|
19
18
|
backendFetchFile,
|
|
20
19
|
backendFetchJson,
|
|
21
20
|
backendFetchText,
|
|
21
|
+
convertToCustomError,
|
|
22
22
|
createFilter,
|
|
23
23
|
createParameter,
|
|
24
24
|
elementAlreadyExists,
|
package/dist/services/utils.d.ts
CHANGED
|
@@ -1,18 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
* Copyright (c) 2024, RTE (http://www.rte-france.com)
|
|
3
|
-
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
4
|
-
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
5
|
-
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
6
|
-
*/
|
|
1
|
+
import { CustomError } from '../utils/types/CustomError';
|
|
7
2
|
/** Optional convenience: allow per-call timeout override without crafting a signal manually. */
|
|
8
3
|
type FetchInitWithTimeout = RequestInit & {
|
|
9
4
|
/** If provided and no signal is set, use this as the timeout override (ms). */
|
|
10
5
|
timeoutMs?: number;
|
|
11
6
|
};
|
|
12
|
-
|
|
13
|
-
export declare class NetworkTimeoutError extends Error {
|
|
14
|
-
constructor(messageKey?: string);
|
|
15
|
-
}
|
|
7
|
+
export declare const convertToCustomError: (response: string) => CustomError;
|
|
16
8
|
export declare const backendFetch: (url: string, init?: FetchInitWithTimeout, token?: string) => Promise<Response>;
|
|
17
9
|
export declare const backendFetchJson: (url: string, init?: FetchInitWithTimeout, token?: string) => Promise<any>;
|
|
18
10
|
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);
|
|
@@ -32,31 +27,24 @@ const prepareRequest = (init, token) => {
|
|
|
32
27
|
initWithSignal.headers.append("Authorization", `Bearer ${tokenCopy}`);
|
|
33
28
|
return initWithSignal;
|
|
34
29
|
};
|
|
30
|
+
const convertToCustomError = (response) => {
|
|
31
|
+
const errorJson = parseError(response);
|
|
32
|
+
if (errorJson?.businessErrorCode) {
|
|
33
|
+
return new CustomError(
|
|
34
|
+
`Server error: ${errorJson.detail}`,
|
|
35
|
+
errorJson.status,
|
|
36
|
+
errorJson.businessErrorCode,
|
|
37
|
+
errorJson.businessErrorValues
|
|
38
|
+
);
|
|
39
|
+
}
|
|
40
|
+
if (errorJson?.detail) {
|
|
41
|
+
return new CustomError(`Server error: ${errorJson.detail}`, errorJson.status);
|
|
42
|
+
}
|
|
43
|
+
return new CustomError(errorJson);
|
|
44
|
+
};
|
|
35
45
|
const handleError = (response) => {
|
|
36
46
|
return response.text().then((text) => {
|
|
37
|
-
|
|
38
|
-
const errorJson = parseError(text);
|
|
39
|
-
let customError;
|
|
40
|
-
if (errorJson?.businessErrorCode != null) {
|
|
41
|
-
throw new CustomError(
|
|
42
|
-
errorJson.message,
|
|
43
|
-
errorJson.status,
|
|
44
|
-
errorJson.businessErrorCode,
|
|
45
|
-
errorJson.businessErrorValues
|
|
46
|
-
);
|
|
47
|
-
}
|
|
48
|
-
if (errorJson && errorJson.status && errorJson.error && errorJson.message) {
|
|
49
|
-
customError = new CustomError(
|
|
50
|
-
`${errorName + errorJson.status} ${errorJson.error}, message : ${errorJson.message}`,
|
|
51
|
-
errorJson.status
|
|
52
|
-
);
|
|
53
|
-
} else {
|
|
54
|
-
customError = new CustomError(
|
|
55
|
-
`${errorName + response.status} ${response.statusText}, message : ${text}`,
|
|
56
|
-
response.status
|
|
57
|
-
);
|
|
58
|
-
}
|
|
59
|
-
throw customError;
|
|
47
|
+
throw convertToCustomError(text);
|
|
60
48
|
});
|
|
61
49
|
};
|
|
62
50
|
const handleTimeoutError = (error) => {
|
|
@@ -88,10 +76,10 @@ const getRequestParamFromList = (paramName, params = []) => {
|
|
|
88
76
|
return new URLSearchParams(params.map((param) => [paramName, param]));
|
|
89
77
|
};
|
|
90
78
|
export {
|
|
91
|
-
NetworkTimeoutError,
|
|
92
79
|
backendFetch,
|
|
93
80
|
backendFetchFile,
|
|
94
81
|
backendFetchJson,
|
|
95
82
|
backendFetchText,
|
|
83
|
+
convertToCustomError,
|
|
96
84
|
getRequestParamFromList
|
|
97
85
|
};
|
|
@@ -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
|
};
|