@gridsuite/commons-ui 0.150.0 → 0.152.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/index.d.ts +1 -0
- package/dist/components/dialogs/elementSaveDialog/index.js +3 -1
- package/dist/components/dialogs/index.js +2 -0
- package/dist/components/filter/FilterForm.js +4 -4
- package/dist/components/filter/expert/ExpertFilterForm.js +4 -4
- package/dist/components/filter/explicitNaming/ExplicitNamingFilterForm.js +2 -2
- package/dist/components/index.js +2 -0
- package/dist/components/parameters/loadflow/load-flow-parameters-dialog.js +7 -7
- package/dist/components/parameters/network-visualizations/network-visualizations-parameters-dialog.js +5 -5
- package/dist/components/parameters/sensi/constants.d.ts +6 -1
- package/dist/components/parameters/sensi/constants.js +6 -2
- package/dist/components/parameters/sensi/sensitivity-analysis-parameters-factor-count.d.ts +8 -0
- package/dist/components/parameters/sensi/sensitivity-analysis-parameters-factor-count.js +53 -0
- package/dist/components/parameters/sensi/sensitivity-analysis-parameters-form.js +2 -3
- package/dist/components/parameters/sensi/sensitivity-analysis-parameters-inline.js +3 -3
- package/dist/components/parameters/sensi/sensitivity-parameters-selector.d.ts +5 -11
- package/dist/components/parameters/sensi/sensitivity-parameters-selector.js +64 -99
- package/dist/components/parameters/sensi/sensitivity-table.d.ts +2 -3
- package/dist/components/parameters/sensi/sensitivity-table.js +27 -37
- package/dist/components/parameters/sensi/table-cell.d.ts +1 -1
- package/dist/components/parameters/sensi/table-cell.js +2 -8
- package/dist/components/parameters/sensi/table-row.d.ts +2 -2
- package/dist/components/parameters/sensi/table-row.js +4 -6
- package/dist/components/parameters/sensi/use-sensitivity-analysis-parameters.d.ts +7 -10
- package/dist/components/parameters/sensi/use-sensitivity-analysis-parameters.js +67 -114
- package/dist/components/parameters/sensi/utils.d.ts +6 -15
- package/dist/components/parameters/sensi/utils.js +21 -4
- package/dist/components/parameters/short-circuit/short-circuit-parameters-dialog.js +6 -6
- package/dist/components/parameters/voltage-init/voltage-init-parameters-dialog.js +5 -5
- package/dist/hooks/use-create-row-data-sensi.js +1 -2
- package/dist/index.js +2 -0
- package/dist/services/sensitivity-analysis.d.ts +2 -2
- package/dist/services/sensitivity-analysis.js +8 -9
- package/dist/translations/en/businessErrorsEn.d.ts +1 -0
- package/dist/translations/en/businessErrorsEn.js +2 -1
- package/dist/translations/en/parameters.d.ts +3 -3
- package/dist/translations/en/parameters.js +3 -3
- package/dist/translations/fr/businessErrorsFr.d.ts +1 -0
- package/dist/translations/fr/businessErrorsFr.js +2 -1
- package/dist/translations/fr/parameters.d.ts +3 -3
- package/dist/translations/fr/parameters.js +3 -3
- package/dist/utils/types/sensitivity-analysis.type.d.ts +4 -7
- package/package.json +1 -1
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { CustomMuiDialog, unscrollableDialogStyles } from "./customMuiDialog/CustomMuiDialog.js";
|
|
2
2
|
import { DescriptionModificationDialog } from "./descriptionModificationDialog/DescriptionModificationDialog.js";
|
|
3
3
|
import { ElementSaveDialog } from "./elementSaveDialog/ElementSaveDialog.js";
|
|
4
|
+
import { initializeDirectory } from "./elementSaveDialog/utils.js";
|
|
4
5
|
import { ModifyElementSelection } from "./modifyElementSelection/ModifyElementSelection.js";
|
|
5
6
|
import { PopupConfirmationDialog } from "./popupConfirmationDialog/PopupConfirmationDialog.js";
|
|
6
7
|
export {
|
|
@@ -9,5 +10,6 @@ export {
|
|
|
9
10
|
ElementSaveDialog,
|
|
10
11
|
ModifyElementSelection,
|
|
11
12
|
PopupConfirmationDialog,
|
|
13
|
+
initializeDirectory,
|
|
12
14
|
unscrollableDialogStyles
|
|
13
15
|
};
|
|
@@ -7,15 +7,15 @@ import { FilterType } from "./constants/FilterConstants.js";
|
|
|
7
7
|
import { unscrollableDialogStyles } from "../dialogs/customMuiDialog/CustomMuiDialog.js";
|
|
8
8
|
import "../dialogs/descriptionModificationDialog/DescriptionModificationDialog.js";
|
|
9
9
|
import "../dialogs/elementSaveDialog/ElementSaveDialog.js";
|
|
10
|
+
import "../../utils/conversionUtils.js";
|
|
11
|
+
import "../../utils/types/equipmentType.js";
|
|
12
|
+
import "@mui/icons-material";
|
|
13
|
+
import "../../utils/yupConfig.js";
|
|
10
14
|
import "react";
|
|
11
15
|
import "react-intl";
|
|
12
16
|
import "react-hook-form";
|
|
13
|
-
import "@mui/icons-material";
|
|
14
17
|
import "../treeViewFinder/TreeViewFinder.js";
|
|
15
18
|
import "notistack";
|
|
16
|
-
import "../../utils/conversionUtils.js";
|
|
17
|
-
import "../../utils/types/equipmentType.js";
|
|
18
|
-
import "../../utils/yupConfig.js";
|
|
19
19
|
function FilterForm({
|
|
20
20
|
sourceFilterForExplicitNamingConversion,
|
|
21
21
|
creation,
|
|
@@ -14,14 +14,14 @@ import { CustomReactQueryBuilder } from "../../inputs/reactQueryBuilder/CustomRe
|
|
|
14
14
|
import { unscrollableDialogStyles } from "../../dialogs/customMuiDialog/CustomMuiDialog.js";
|
|
15
15
|
import "../../dialogs/descriptionModificationDialog/DescriptionModificationDialog.js";
|
|
16
16
|
import "../../dialogs/elementSaveDialog/ElementSaveDialog.js";
|
|
17
|
-
import "react-intl";
|
|
18
|
-
import "@mui/icons-material";
|
|
19
|
-
import "../../treeViewFinder/TreeViewFinder.js";
|
|
20
|
-
import "notistack";
|
|
21
17
|
import "../../../utils/conversionUtils.js";
|
|
22
18
|
import "../../../utils/types/equipmentType.js";
|
|
23
19
|
import { FieldType } from "../../../utils/types/fieldType.js";
|
|
20
|
+
import "@mui/icons-material";
|
|
24
21
|
import "../../../utils/yupConfig.js";
|
|
22
|
+
import "react-intl";
|
|
23
|
+
import "../../treeViewFinder/TreeViewFinder.js";
|
|
24
|
+
import "notistack";
|
|
25
25
|
import { useFormatLabelWithUnit } from "../../../hooks/useFormatLabelWithUnit.js";
|
|
26
26
|
import { filterStyles } from "../HeaderFilterForm.js";
|
|
27
27
|
import "../../overflowableText/OverflowableText.js";
|
|
@@ -21,12 +21,12 @@ import { exportFilter } from "../../../services/study.js";
|
|
|
21
21
|
import { unscrollableDialogStyles } from "../../dialogs/customMuiDialog/CustomMuiDialog.js";
|
|
22
22
|
import "../../dialogs/descriptionModificationDialog/DescriptionModificationDialog.js";
|
|
23
23
|
import "../../dialogs/elementSaveDialog/ElementSaveDialog.js";
|
|
24
|
-
import { FILTER_EQUIPMENTS_ATTRIBUTES } from "./ExplicitNamingFilterConstants.js";
|
|
25
|
-
import { filterStyles } from "../HeaderFilterForm.js";
|
|
26
24
|
import "../../../utils/conversionUtils.js";
|
|
27
25
|
import { snackWithFallback } from "../../../utils/error.js";
|
|
28
26
|
import "@mui/icons-material";
|
|
29
27
|
import "../../../utils/types/equipmentType.js";
|
|
28
|
+
import { FILTER_EQUIPMENTS_ATTRIBUTES } from "./ExplicitNamingFilterConstants.js";
|
|
29
|
+
import { filterStyles } from "../HeaderFilterForm.js";
|
|
30
30
|
import "../../overflowableText/OverflowableText.js";
|
|
31
31
|
import "localized-countries";
|
|
32
32
|
import "localized-countries/data/fr";
|
package/dist/components/index.js
CHANGED
|
@@ -24,6 +24,7 @@ import { BooleanCellRenderer, BooleanNullableCellRenderer, ContingencyCellRender
|
|
|
24
24
|
import { CustomMuiDialog, unscrollableDialogStyles } from "./dialogs/customMuiDialog/CustomMuiDialog.js";
|
|
25
25
|
import { DescriptionModificationDialog } from "./dialogs/descriptionModificationDialog/DescriptionModificationDialog.js";
|
|
26
26
|
import { ElementSaveDialog } from "./dialogs/elementSaveDialog/ElementSaveDialog.js";
|
|
27
|
+
import { initializeDirectory } from "./dialogs/elementSaveDialog/utils.js";
|
|
27
28
|
import { ModifyElementSelection } from "./dialogs/modifyElementSelection/ModifyElementSelection.js";
|
|
28
29
|
import { PopupConfirmationDialog } from "./dialogs/popupConfirmationDialog/PopupConfirmationDialog.js";
|
|
29
30
|
import { DirectoryItemSelector } from "./directoryItemSelector/DirectoryItemSelector.js";
|
|
@@ -522,6 +523,7 @@ export {
|
|
|
522
523
|
importExpertRules,
|
|
523
524
|
initializeAuthenticationDev,
|
|
524
525
|
initializeAuthenticationProd,
|
|
526
|
+
initializeDirectory,
|
|
525
527
|
intlInitialVoltageProfileMode,
|
|
526
528
|
intlPredefinedParametersOptions,
|
|
527
529
|
isFieldRequired,
|
|
@@ -2,19 +2,19 @@ import { jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import { CustomMuiDialog } from "../../dialogs/customMuiDialog/CustomMuiDialog.js";
|
|
3
3
|
import "../../dialogs/descriptionModificationDialog/DescriptionModificationDialog.js";
|
|
4
4
|
import "../../dialogs/elementSaveDialog/ElementSaveDialog.js";
|
|
5
|
+
import "../../../utils/conversionUtils.js";
|
|
6
|
+
import { ElementType } from "../../../utils/types/elementType.js";
|
|
7
|
+
import "../../../utils/types/equipmentType.js";
|
|
8
|
+
import { LANG_ENGLISH } from "../../../utils/langs.js";
|
|
9
|
+
import "@mui/icons-material";
|
|
10
|
+
import "../../../utils/yupConfig.js";
|
|
11
|
+
import { getLoadFlowDefaultLimitReductions, getLoadFlowSpecificParametersDescription, setLoadFlowParameters, fetchLoadFlowParameters, getDefaultLoadFlowProvider, getLoadFlowProviders } from "../../../services/loadflow.js";
|
|
5
12
|
import "react";
|
|
6
13
|
import "@mui/material";
|
|
7
14
|
import "react-intl";
|
|
8
15
|
import "react-hook-form";
|
|
9
|
-
import "@mui/icons-material";
|
|
10
|
-
import { ElementType } from "../../../utils/types/elementType.js";
|
|
11
16
|
import "../../treeViewFinder/TreeViewFinder.js";
|
|
12
17
|
import "notistack";
|
|
13
|
-
import "../../../utils/conversionUtils.js";
|
|
14
|
-
import "../../../utils/types/equipmentType.js";
|
|
15
|
-
import { LANG_ENGLISH } from "../../../utils/langs.js";
|
|
16
|
-
import "../../../utils/yupConfig.js";
|
|
17
|
-
import { getLoadFlowDefaultLimitReductions, getLoadFlowSpecificParametersDescription, setLoadFlowParameters, fetchLoadFlowParameters, getDefaultLoadFlowProvider, getLoadFlowProviders } from "../../../services/loadflow.js";
|
|
18
18
|
import { ComputingType } from "../common/computing-type.js";
|
|
19
19
|
import "localized-countries";
|
|
20
20
|
import "localized-countries/data/fr";
|
|
@@ -2,17 +2,17 @@ import { jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import { CustomMuiDialog } from "../../dialogs/customMuiDialog/CustomMuiDialog.js";
|
|
3
3
|
import "../../dialogs/descriptionModificationDialog/DescriptionModificationDialog.js";
|
|
4
4
|
import "../../dialogs/elementSaveDialog/ElementSaveDialog.js";
|
|
5
|
+
import "../../../utils/conversionUtils.js";
|
|
6
|
+
import { ElementType } from "../../../utils/types/elementType.js";
|
|
7
|
+
import "../../../utils/types/equipmentType.js";
|
|
8
|
+
import "@mui/icons-material";
|
|
9
|
+
import "../../../utils/yupConfig.js";
|
|
5
10
|
import "react";
|
|
6
11
|
import "@mui/material";
|
|
7
12
|
import "react-intl";
|
|
8
13
|
import "react-hook-form";
|
|
9
|
-
import "@mui/icons-material";
|
|
10
|
-
import { ElementType } from "../../../utils/types/elementType.js";
|
|
11
14
|
import "../../treeViewFinder/TreeViewFinder.js";
|
|
12
15
|
import "notistack";
|
|
13
|
-
import "../../../utils/conversionUtils.js";
|
|
14
|
-
import "../../../utils/types/equipmentType.js";
|
|
15
|
-
import "../../../utils/yupConfig.js";
|
|
16
16
|
import { NetworkVisualizationParametersForm } from "./network-visualizations-form.js";
|
|
17
17
|
import { useNetworkVisualizationParametersForm } from "./use-network-visualizations-parameters-form.js";
|
|
18
18
|
import { NameElementEditorForm } from "../common/name-element-editor/name-element-editor-form.js";
|
|
@@ -26,4 +26,9 @@ export declare const PARAMETER_SENSI_PST = "sensitivityPST";
|
|
|
26
26
|
export declare const PARAMETER_SENSI_NODES = "sensitivityNodes";
|
|
27
27
|
export declare const CONTAINER_ID = "containerId";
|
|
28
28
|
export declare const CONTAINER_NAME = "containerName";
|
|
29
|
-
export declare const
|
|
29
|
+
export declare const MAX_RESULTS_COUNT = 500000;
|
|
30
|
+
export declare const MAX_VARIABLES_COUNT = 5000;
|
|
31
|
+
export declare const DEFAULT_FACTOR_COUNT: {
|
|
32
|
+
resultCount: number;
|
|
33
|
+
variableCount: number;
|
|
34
|
+
};
|
|
@@ -20,20 +20,24 @@ const PARAMETER_SENSI_PST = "sensitivityPST";
|
|
|
20
20
|
const PARAMETER_SENSI_NODES = "sensitivityNodes";
|
|
21
21
|
const CONTAINER_ID = "containerId";
|
|
22
22
|
const CONTAINER_NAME = "containerName";
|
|
23
|
-
const
|
|
23
|
+
const MAX_RESULTS_COUNT = 5e5;
|
|
24
|
+
const MAX_VARIABLES_COUNT = 5e3;
|
|
25
|
+
const DEFAULT_FACTOR_COUNT = { resultCount: 0, variableCount: 0 };
|
|
24
26
|
export {
|
|
25
27
|
ACTIVATED,
|
|
26
28
|
ANGLE_FLOW_SENSITIVITY_VALUE_THRESHOLD,
|
|
27
29
|
CONTAINER_ID,
|
|
28
30
|
CONTAINER_NAME,
|
|
29
31
|
CONTINGENCIES,
|
|
30
|
-
|
|
32
|
+
DEFAULT_FACTOR_COUNT,
|
|
31
33
|
DISTRIBUTION_TYPE,
|
|
32
34
|
EQUIPMENTS_IN_VOLTAGE_REGULATION,
|
|
33
35
|
FLOW_FLOW_SENSITIVITY_VALUE_THRESHOLD,
|
|
34
36
|
FLOW_VOLTAGE_SENSITIVITY_VALUE_THRESHOLD,
|
|
35
37
|
HVDC_LINES,
|
|
36
38
|
INJECTIONS,
|
|
39
|
+
MAX_RESULTS_COUNT,
|
|
40
|
+
MAX_VARIABLES_COUNT,
|
|
37
41
|
MONITORED_BRANCHES,
|
|
38
42
|
PARAMETER_SENSI_HVDC,
|
|
39
43
|
PARAMETER_SENSI_INJECTION,
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
interface SensitivityAnalysisParametersFactorCountProps {
|
|
2
|
+
count: number;
|
|
3
|
+
maxCount: number;
|
|
4
|
+
messageId: string;
|
|
5
|
+
isLoading: boolean;
|
|
6
|
+
}
|
|
7
|
+
export declare function SensitivityAnalysisParametersFactorCount(props: SensitivityAnalysisParametersFactorCountProps): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Box, CircularProgress } from "@mui/material";
|
|
3
|
+
import { FormattedMessage } from "react-intl";
|
|
4
|
+
import { ErrorOutline } from "@mui/icons-material";
|
|
5
|
+
const styles = {
|
|
6
|
+
circularProgress: (theme) => ({
|
|
7
|
+
display: "flex",
|
|
8
|
+
marginRight: theme.spacing(1),
|
|
9
|
+
color: theme.palette.primary.main
|
|
10
|
+
}),
|
|
11
|
+
errorOutlineIcon: (theme) => ({
|
|
12
|
+
marginRight: theme.spacing(1),
|
|
13
|
+
color: theme.palette.error.main,
|
|
14
|
+
display: "flex"
|
|
15
|
+
}),
|
|
16
|
+
textInfo: (theme) => ({
|
|
17
|
+
color: theme.palette.primary.main,
|
|
18
|
+
display: "flex"
|
|
19
|
+
}),
|
|
20
|
+
textInitial: {
|
|
21
|
+
color: "grey"
|
|
22
|
+
},
|
|
23
|
+
textAlert: (theme) => ({
|
|
24
|
+
color: theme.palette.error.main,
|
|
25
|
+
display: "flex"
|
|
26
|
+
})
|
|
27
|
+
};
|
|
28
|
+
const renderLoadingState = () => {
|
|
29
|
+
return /* @__PURE__ */ jsx(Box, { sx: styles.textInfo, children: /* @__PURE__ */ jsx(CircularProgress, { size: "1em", sx: styles.circularProgress }) });
|
|
30
|
+
};
|
|
31
|
+
function SensitivityAnalysisParametersFactorCount(props) {
|
|
32
|
+
const { count, maxCount, messageId, isLoading } = props;
|
|
33
|
+
if (isLoading) return renderLoadingState();
|
|
34
|
+
const isOverMillion = count > 999999;
|
|
35
|
+
const isOverLimit = count > maxCount;
|
|
36
|
+
const isZero = count === 0;
|
|
37
|
+
const isAlert = isOverMillion || isOverLimit;
|
|
38
|
+
let sx = styles.textInfo;
|
|
39
|
+
if (isAlert) {
|
|
40
|
+
sx = styles.textAlert;
|
|
41
|
+
} else if (isZero) {
|
|
42
|
+
sx = styles.textInitial;
|
|
43
|
+
}
|
|
44
|
+
const displayCount = isOverMillion ? "999999" : count.toString();
|
|
45
|
+
const suffix = isOverMillion ? "+" : "";
|
|
46
|
+
return /* @__PURE__ */ jsxs(Box, { sx, children: [
|
|
47
|
+
isAlert && /* @__PURE__ */ jsx(ErrorOutline, { sx: styles.errorOutlineIcon }),
|
|
48
|
+
/* @__PURE__ */ jsx(FormattedMessage, { id: messageId, values: { count: displayCount, suffix } })
|
|
49
|
+
] });
|
|
50
|
+
}
|
|
51
|
+
export {
|
|
52
|
+
SensitivityAnalysisParametersFactorCount
|
|
53
|
+
};
|
|
@@ -108,9 +108,8 @@ function SensitivityAnalysisParametersForm({
|
|
|
108
108
|
SensitivityParametersSelector,
|
|
109
109
|
{
|
|
110
110
|
onFormChanged: sensitivityAnalysisMethods.onFormChanged,
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
analysisComputeComplexity: sensitivityAnalysisMethods.analysisComputeComplexity,
|
|
111
|
+
isLoading: sensitivityAnalysisMethods.isLoading,
|
|
112
|
+
factorsCount: sensitivityAnalysisMethods.factorsCount,
|
|
114
113
|
isDeveloperMode,
|
|
115
114
|
isStudyLinked: sensitivityAnalysisMethods.isStudyLinked
|
|
116
115
|
}
|
|
@@ -73,7 +73,7 @@ function SensitivityAnalysisParametersInline({
|
|
|
73
73
|
reset(sensitivityAnalysisMethods.fromSensitivityAnalysisParamsDataToFormValues(parameters), {
|
|
74
74
|
keepDefaultValues: true
|
|
75
75
|
});
|
|
76
|
-
sensitivityAnalysisMethods.
|
|
76
|
+
sensitivityAnalysisMethods.onFormChanged();
|
|
77
77
|
}).catch((error) => {
|
|
78
78
|
snackWithFallback(snackError, error, { headerId: "paramsRetrievingError" });
|
|
79
79
|
});
|
|
@@ -90,7 +90,7 @@ function SensitivityAnalysisParametersInline({
|
|
|
90
90
|
const clear = useCallback(() => {
|
|
91
91
|
reset(sensitivityAnalysisMethods.emptyFormData);
|
|
92
92
|
resetSensitivityAnalysisParameters();
|
|
93
|
-
sensitivityAnalysisMethods.
|
|
93
|
+
sensitivityAnalysisMethods.resetFactorsCount();
|
|
94
94
|
setOpenResetConfirmation(false);
|
|
95
95
|
}, [reset, sensitivityAnalysisMethods, resetSensitivityAnalysisParameters]);
|
|
96
96
|
const handleResetClick = useCallback(() => {
|
|
@@ -125,7 +125,7 @@ function SensitivityAnalysisParametersInline({
|
|
|
125
125
|
{
|
|
126
126
|
onClick: handleSubmit(sensitivityAnalysisMethods.onSaveInline),
|
|
127
127
|
variant: "outlined",
|
|
128
|
-
disabled: sensitivityAnalysisMethods.
|
|
128
|
+
disabled: sensitivityAnalysisMethods.isLoading || sensitivityAnalysisMethods.isMaxResultsReached || sensitivityAnalysisMethods.isMaxVariablesReached,
|
|
129
129
|
children: /* @__PURE__ */ jsx(FormattedMessage, { id: "validate" })
|
|
130
130
|
}
|
|
131
131
|
)
|
|
@@ -1,16 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
* Copyright (c) 2023, 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 { FactorsCount } from '../../../utils';
|
|
7
2
|
interface SensitivityParametersSelectorProps {
|
|
8
|
-
onFormChanged: (
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
analysisComputeComplexity: number;
|
|
3
|
+
onFormChanged: () => void;
|
|
4
|
+
isLoading: boolean;
|
|
5
|
+
factorsCount: FactorsCount;
|
|
12
6
|
isDeveloperMode: boolean;
|
|
13
7
|
isStudyLinked: boolean;
|
|
14
8
|
}
|
|
15
|
-
declare function SensitivityParametersSelector({ onFormChanged,
|
|
9
|
+
declare function SensitivityParametersSelector({ onFormChanged, isLoading, factorsCount, isDeveloperMode, isStudyLinked, }: Readonly<SensitivityParametersSelectorProps>): import("react/jsx-runtime").JSX.Element;
|
|
16
10
|
export default SensitivityParametersSelector;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { jsxs, jsx, Fragment } from "react/jsx-runtime";
|
|
2
|
-
import { useState, useCallback, useEffect
|
|
2
|
+
import { useState, useCallback, useEffect } from "react";
|
|
3
3
|
import { useIntl, FormattedMessage } from "react-intl";
|
|
4
|
-
import { Grid, Tabs, Tab
|
|
5
|
-
import { ErrorOutline } from "@mui/icons-material";
|
|
4
|
+
import { Grid, Box, Tabs, Tab } from "@mui/material";
|
|
6
5
|
import { SensiTabValues, SensiBranchesTabValues, SensiInjectionsSet, SensiInjection, SensiHvdcs, SensiPsts, SensiNodes, COLUMNS_DEFINITIONS_INJECTIONS_SET, COLUMNS_DEFINITIONS_INJECTIONS, COLUMNS_DEFINITIONS_HVDCS, COLUMNS_DEFINITIONS_PSTS, COLUMNS_DEFINITIONS_NODES } from "./columns-definitions.js";
|
|
7
6
|
import { SensitivityTable } from "./sensitivity-table.js";
|
|
8
7
|
import { TabPanel } from "../common/parameters.js";
|
|
9
8
|
import "../../../utils/conversionUtils.js";
|
|
10
9
|
import "../../../utils/types/equipmentType.js";
|
|
10
|
+
import "@mui/icons-material";
|
|
11
11
|
import "../../../utils/yupConfig.js";
|
|
12
12
|
import "localized-countries";
|
|
13
13
|
import "localized-countries/data/fr";
|
|
@@ -35,28 +35,9 @@ import "../../inputs/reactQueryBuilder/PropertyValueEditor.js";
|
|
|
35
35
|
import "react-querybuilder";
|
|
36
36
|
import "../common/widget/parameter-line-slider.js";
|
|
37
37
|
import "../common/limitreductions/columns-definitions.js";
|
|
38
|
+
import { SensitivityAnalysisParametersFactorCount } from "./sensitivity-analysis-parameters-factor-count.js";
|
|
39
|
+
import { MAX_VARIABLES_COUNT, MAX_RESULTS_COUNT } from "./constants.js";
|
|
38
40
|
const styles = {
|
|
39
|
-
circularProgress: (theme) => ({
|
|
40
|
-
display: "flex",
|
|
41
|
-
marginRight: theme.spacing(1),
|
|
42
|
-
color: theme.palette.primary.main
|
|
43
|
-
}),
|
|
44
|
-
errorOutlineIcon: (theme) => ({
|
|
45
|
-
marginRight: theme.spacing(1),
|
|
46
|
-
color: theme.palette.error.main,
|
|
47
|
-
display: "flex"
|
|
48
|
-
}),
|
|
49
|
-
textInfo: (theme) => ({
|
|
50
|
-
color: theme.palette.primary.main,
|
|
51
|
-
display: "flex"
|
|
52
|
-
}),
|
|
53
|
-
textInitial: {
|
|
54
|
-
color: "grey"
|
|
55
|
-
},
|
|
56
|
-
textAlert: (theme) => ({
|
|
57
|
-
color: theme.palette.error.main,
|
|
58
|
-
display: "flex"
|
|
59
|
-
}),
|
|
60
41
|
boxContent: {
|
|
61
42
|
display: "flex",
|
|
62
43
|
alignItems: "end",
|
|
@@ -68,9 +49,8 @@ const styles = {
|
|
|
68
49
|
};
|
|
69
50
|
function SensitivityParametersSelector({
|
|
70
51
|
onFormChanged,
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
analysisComputeComplexity,
|
|
52
|
+
isLoading,
|
|
53
|
+
factorsCount,
|
|
74
54
|
isDeveloperMode,
|
|
75
55
|
isStudyLinked
|
|
76
56
|
}) {
|
|
@@ -114,76 +94,71 @@ function SensitivityParametersSelector({
|
|
|
114
94
|
},
|
|
115
95
|
[intl]
|
|
116
96
|
);
|
|
117
|
-
const renderComputingEventLoading = () => {
|
|
118
|
-
return /* @__PURE__ */ jsxs(Box, { sx: styles.textInfo, children: [
|
|
119
|
-
/* @__PURE__ */ jsx(CircularProgress, { size: "1em", sx: styles.circularProgress }),
|
|
120
|
-
/* @__PURE__ */ jsx(FormattedMessage, { id: "loadingComputing" })
|
|
121
|
-
] });
|
|
122
|
-
};
|
|
123
97
|
useEffect(() => {
|
|
124
98
|
if (!isDeveloperMode) {
|
|
125
99
|
setTabValue(SensiTabValues.SensitivityBranches);
|
|
126
100
|
}
|
|
127
101
|
}, [isDeveloperMode]);
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
102
|
+
return /* @__PURE__ */ jsxs(Grid, { sx: { width: "100%" }, children: [
|
|
103
|
+
/* @__PURE__ */ jsxs(Box, { sx: { display: "flex", justifyContent: "space-between", alignItems: "center", width: "100%" }, children: [
|
|
104
|
+
/* @__PURE__ */ jsx(Tabs, { value: tabValue, onChange: handleTabChange, children: tabInfo.map((tab, index) => /* @__PURE__ */ jsx(
|
|
105
|
+
Tab,
|
|
106
|
+
{
|
|
107
|
+
label: /* @__PURE__ */ jsx(FormattedMessage, { id: tab.label }),
|
|
108
|
+
value: index,
|
|
109
|
+
sx: {
|
|
110
|
+
fontSize: 17,
|
|
111
|
+
fontWeight: "bold",
|
|
112
|
+
textTransform: "capitalize"
|
|
113
|
+
}
|
|
114
|
+
},
|
|
115
|
+
tab.label
|
|
116
|
+
)) }),
|
|
117
|
+
isStudyLinked && /* @__PURE__ */ jsxs(Box, { sx: { display: "flex", alignItems: "center", gap: 2 }, children: [
|
|
118
|
+
/* @__PURE__ */ jsxs(Box, { sx: { ...styles.boxContent, minWidth: 300 }, children: [
|
|
119
|
+
/* @__PURE__ */ jsx(
|
|
120
|
+
SensitivityAnalysisParametersFactorCount,
|
|
121
|
+
{
|
|
122
|
+
count: factorsCount.variableCount,
|
|
123
|
+
maxCount: MAX_VARIABLES_COUNT,
|
|
124
|
+
messageId: "sensitivityAnalysis.simulatedVariables",
|
|
125
|
+
isLoading
|
|
126
|
+
}
|
|
127
|
+
),
|
|
128
|
+
/* @__PURE__ */ jsx(FormattedMessage, { id: "sensitivityAnalysis.separator" }),
|
|
133
129
|
/* @__PURE__ */ jsx(
|
|
134
130
|
FormattedMessage,
|
|
135
131
|
{
|
|
136
|
-
id: "sensitivityAnalysis.
|
|
132
|
+
id: "sensitivityAnalysis.maximumFactorsCount",
|
|
137
133
|
values: {
|
|
138
|
-
|
|
134
|
+
maxFactorsCount: MAX_VARIABLES_COUNT.toLocaleString()
|
|
139
135
|
}
|
|
140
136
|
}
|
|
141
137
|
)
|
|
142
|
-
] })
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
return /* @__PURE__ */ jsx(Box, { sx: styles.textInitial, children: /* @__PURE__ */ jsx(
|
|
152
|
-
FormattedMessage,
|
|
153
|
-
{
|
|
154
|
-
id: "sensitivityAnalysis.simulatedComputations",
|
|
155
|
-
values: {
|
|
156
|
-
count: analysisComputeComplexity.toString()
|
|
138
|
+
] }),
|
|
139
|
+
/* @__PURE__ */ jsxs(Box, { sx: { ...styles.boxContent, minWidth: 300 }, children: [
|
|
140
|
+
/* @__PURE__ */ jsx(
|
|
141
|
+
SensitivityAnalysisParametersFactorCount,
|
|
142
|
+
{
|
|
143
|
+
count: factorsCount.resultCount,
|
|
144
|
+
maxCount: MAX_RESULTS_COUNT,
|
|
145
|
+
messageId: "sensitivityAnalysis.simulatedResults",
|
|
146
|
+
isLoading
|
|
157
147
|
}
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
}, [analysisComputeComplexity, launchLoader]);
|
|
173
|
-
return /* @__PURE__ */ jsxs(Grid, { sx: { width: "100%" }, children: [
|
|
174
|
-
/* @__PURE__ */ jsx(Tabs, { value: tabValue, onChange: handleTabChange, children: tabInfo.map((tab, index) => /* @__PURE__ */ jsx(
|
|
175
|
-
Tab,
|
|
176
|
-
{
|
|
177
|
-
label: /* @__PURE__ */ jsx(FormattedMessage, { id: tab.label }),
|
|
178
|
-
value: index,
|
|
179
|
-
sx: {
|
|
180
|
-
fontSize: 17,
|
|
181
|
-
fontWeight: "bold",
|
|
182
|
-
textTransform: "capitalize"
|
|
183
|
-
}
|
|
184
|
-
},
|
|
185
|
-
tab.label
|
|
186
|
-
)) }),
|
|
148
|
+
),
|
|
149
|
+
/* @__PURE__ */ jsx(FormattedMessage, { id: "sensitivityAnalysis.separator" }),
|
|
150
|
+
/* @__PURE__ */ jsx(
|
|
151
|
+
FormattedMessage,
|
|
152
|
+
{
|
|
153
|
+
id: "sensitivityAnalysis.maximumFactorsCount",
|
|
154
|
+
values: {
|
|
155
|
+
maxFactorsCount: MAX_RESULTS_COUNT.toLocaleString()
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
)
|
|
159
|
+
] })
|
|
160
|
+
] })
|
|
161
|
+
] }),
|
|
187
162
|
tabInfo.map((tab, index) => /* @__PURE__ */ jsxs(TabPanel, { value: tabValue, index, sx: { paddingTop: 1 }, children: [
|
|
188
163
|
tabValue === SensiTabValues.SensitivityBranches && tab.subTabs && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
189
164
|
/* @__PURE__ */ jsx(Tabs, { value: subTabValue, onChange: handleSubTabChange, children: tab.subTabs.map((subTab, subIndex) => /* @__PURE__ */ jsx(
|
|
@@ -198,11 +173,6 @@ function SensitivityParametersSelector({
|
|
|
198
173
|
},
|
|
199
174
|
subTab.label
|
|
200
175
|
)) }),
|
|
201
|
-
isStudyLinked && /* @__PURE__ */ jsxs(Box, { sx: styles.boxContent, children: [
|
|
202
|
-
ComputingEvent,
|
|
203
|
-
/* @__PURE__ */ jsx(FormattedMessage, { id: "sensitivityAnalysis.separator" }),
|
|
204
|
-
/* @__PURE__ */ jsx(FormattedMessage, { id: "sensitivityAnalysis.maximumSimulatedComputations" })
|
|
205
|
-
] }),
|
|
206
176
|
/* @__PURE__ */ jsx(TabPanel, { index: SensiBranchesTabValues.SensiInjectionsSet, value: subTabValue, children: /* @__PURE__ */ jsx(
|
|
207
177
|
SensitivityTable,
|
|
208
178
|
{
|
|
@@ -213,8 +183,7 @@ function SensitivityParametersSelector({
|
|
|
213
183
|
useFieldArrayOutput: useFieldArrayOutputInjectionsSet,
|
|
214
184
|
createRows: rowDataInjectionsSet,
|
|
215
185
|
tableHeight: 300,
|
|
216
|
-
onFormChanged
|
|
217
|
-
onChangeParams
|
|
186
|
+
onFormChanged
|
|
218
187
|
}
|
|
219
188
|
) }),
|
|
220
189
|
/* @__PURE__ */ jsx(TabPanel, { index: SensiBranchesTabValues.SensiInjection, value: subTabValue, children: /* @__PURE__ */ jsx(
|
|
@@ -225,8 +194,7 @@ function SensitivityParametersSelector({
|
|
|
225
194
|
useFieldArrayOutput: useFieldArrayOutputInjections,
|
|
226
195
|
createRows: rowDataInjections,
|
|
227
196
|
tableHeight: 300,
|
|
228
|
-
onFormChanged
|
|
229
|
-
onChangeParams
|
|
197
|
+
onFormChanged
|
|
230
198
|
}
|
|
231
199
|
) }),
|
|
232
200
|
/* @__PURE__ */ jsx(TabPanel, { index: SensiBranchesTabValues.SensiHVDC, value: subTabValue, children: /* @__PURE__ */ jsx(
|
|
@@ -237,8 +205,7 @@ function SensitivityParametersSelector({
|
|
|
237
205
|
useFieldArrayOutput: useFieldArrayOutputHvdc,
|
|
238
206
|
createRows: rowDataHvdc,
|
|
239
207
|
tableHeight: 300,
|
|
240
|
-
onFormChanged
|
|
241
|
-
onChangeParams
|
|
208
|
+
onFormChanged
|
|
242
209
|
}
|
|
243
210
|
) }),
|
|
244
211
|
/* @__PURE__ */ jsx(TabPanel, { index: SensiBranchesTabValues.SensiPST, value: subTabValue, children: /* @__PURE__ */ jsx(
|
|
@@ -249,8 +216,7 @@ function SensitivityParametersSelector({
|
|
|
249
216
|
useFieldArrayOutput: useFieldArrayOutputPst,
|
|
250
217
|
createRows: rowDataPst,
|
|
251
218
|
tableHeight: 300,
|
|
252
|
-
onFormChanged
|
|
253
|
-
onChangeParams
|
|
219
|
+
onFormChanged
|
|
254
220
|
}
|
|
255
221
|
) })
|
|
256
222
|
] }),
|
|
@@ -262,8 +228,7 @@ function SensitivityParametersSelector({
|
|
|
262
228
|
useFieldArrayOutput: useFieldArrayOutputNodes,
|
|
263
229
|
createRows: rowDataNodes,
|
|
264
230
|
tableHeight: 367,
|
|
265
|
-
onFormChanged
|
|
266
|
-
onChangeParams
|
|
231
|
+
onFormChanged
|
|
267
232
|
}
|
|
268
233
|
)
|
|
269
234
|
] }, tab.label))
|
|
@@ -8,8 +8,7 @@ interface SensitivityTableProps {
|
|
|
8
8
|
createRows: (a: number) => void;
|
|
9
9
|
disableAdd?: boolean;
|
|
10
10
|
disableDelete?: boolean;
|
|
11
|
-
onFormChanged: (
|
|
12
|
-
onChangeParams: (a: Record<string, any>, b: string, c: number) => void;
|
|
11
|
+
onFormChanged: () => void;
|
|
13
12
|
}
|
|
14
|
-
export declare function SensitivityTable({ arrayFormName, useFieldArrayOutput, columnsDefinition, tableHeight, createRows, disableAdd, disableDelete, onFormChanged,
|
|
13
|
+
export declare function SensitivityTable({ arrayFormName, useFieldArrayOutput, columnsDefinition, tableHeight, createRows, disableAdd, disableDelete, onFormChanged, }: Readonly<SensitivityTableProps>): import("react/jsx-runtime").JSX.Element;
|
|
15
14
|
export {};
|