@gridsuite/commons-ui 0.170.0 → 0.172.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/index.js +6 -1
- package/dist/components/inputs/reactHookForm/selectInputs/CountriesInput.js +13 -10
- package/dist/components/parameters/common/contingency-table/contingency-table.d.ts +4 -2
- package/dist/components/parameters/common/contingency-table/contingency-table.js +22 -11
- package/dist/components/parameters/common/contingency-table/types.d.ts +4 -0
- package/dist/components/parameters/common/parameters.js +1 -1
- package/dist/components/parameters/dynamic-margin-calculation/dynamic-margin-calculation-inline.js +5 -5
- package/dist/components/parameters/index.js +6 -1
- package/dist/components/parameters/loadflow/load-flow-parameters-dialog.js +8 -15
- package/dist/components/parameters/loadflow/load-flow-parameters-form.js +2 -2
- package/dist/components/parameters/loadflow/load-flow-parameters-inline.js +2 -4
- package/dist/components/parameters/loadflow/use-load-flow-parameters-form.d.ts +2 -3
- package/dist/components/parameters/loadflow/use-load-flow-parameters-form.js +33 -43
- package/dist/components/parameters/security-analysis/security-analysis-parameters-dialog.js +7 -9
- package/dist/components/parameters/security-analysis/security-analysis-parameters-form.d.ts +4 -2
- package/dist/components/parameters/security-analysis/security-analysis-parameters-form.js +5 -3
- package/dist/components/parameters/security-analysis/security-analysis-parameters-inline.d.ts +4 -2
- package/dist/components/parameters/security-analysis/security-analysis-parameters-inline.js +5 -4
- package/dist/components/parameters/security-analysis/use-security-analysis-parameters-form.d.ts +1 -3
- package/dist/components/parameters/security-analysis/use-security-analysis-parameters-form.js +10 -11
- package/dist/components/parameters/sensi/sensitivity-analysis-parameters-dialog.js +6 -7
- package/dist/components/parameters/sensi/use-sensitivity-analysis-parameters.js +1 -1
- package/dist/components/parameters/short-circuit/constants.d.ts +5 -0
- package/dist/components/parameters/short-circuit/constants.js +10 -0
- package/dist/components/parameters/short-circuit/index.js +6 -1
- package/dist/components/parameters/short-circuit/short-circuit-general-tab-panel.d.ts +10 -0
- package/dist/components/parameters/short-circuit/short-circuit-general-tab-panel.js +206 -0
- package/dist/components/parameters/short-circuit/short-circuit-parameters-content.d.ts +7 -0
- package/dist/components/parameters/short-circuit/short-circuit-parameters-content.js +108 -0
- package/dist/components/parameters/short-circuit/short-circuit-parameters-dialog.js +7 -14
- package/dist/components/parameters/short-circuit/short-circuit-parameters-form.js +33 -30
- package/dist/components/parameters/short-circuit/short-circuit-parameters-inline.js +1 -1
- package/dist/components/parameters/short-circuit/short-circuit-parameters-utils.d.ts +5 -0
- package/dist/components/parameters/short-circuit/short-circuit-parameters-utils.js +72 -25
- package/dist/components/parameters/short-circuit/short-circuit-power-electronics-tab-panel.d.ts +2 -0
- package/dist/components/parameters/short-circuit/short-circuit-power-electronics-tab-panel.js +95 -0
- package/dist/components/parameters/short-circuit/short-circuit-study-area-tab-panel.d.ts +2 -0
- package/dist/components/parameters/short-circuit/short-circuit-study-area-tab-panel.js +143 -0
- package/dist/components/parameters/short-circuit/use-short-circuit-parameters-form.d.ts +5 -1
- package/dist/components/parameters/short-circuit/use-short-circuit-parameters-form.js +34 -14
- package/dist/hooks/use-parameters-backend.d.ts +2 -3
- package/dist/hooks/use-parameters-backend.js +33 -110
- package/dist/index.js +8 -6
- package/dist/services/directory.js +1 -1
- package/dist/services/explore.js +1 -1
- package/dist/services/index.js +2 -5
- package/dist/services/loadflow.d.ts +0 -1
- package/dist/services/loadflow.js +1 -8
- package/dist/services/security-analysis.d.ts +0 -2
- package/dist/services/security-analysis.js +2 -23
- package/dist/services/sensitivity-analysis.d.ts +0 -1
- package/dist/services/sensitivity-analysis.js +1 -8
- package/dist/translations/en/parameters.d.ts +10 -8
- package/dist/translations/en/parameters.js +10 -8
- package/dist/translations/fr/parameters.d.ts +10 -9
- package/dist/translations/fr/parameters.js +10 -9
- package/dist/utils/constants/adornments.js +1 -1
- package/dist/utils/types/parameters.type.d.ts +16 -13
- package/package.json +1 -1
- package/dist/components/parameters/short-circuit/short-circuit-fields.d.ts +0 -10
- package/dist/components/parameters/short-circuit/short-circuit-fields.js +0 -276
package/dist/components/index.js
CHANGED
|
@@ -160,7 +160,7 @@ import { NetworkVisualizationsParametersEditionDialog } from "./parameters/netwo
|
|
|
160
160
|
import { BALANCE_TYPE, CONNECTED_MODE, COUNTRIES_TO_BALANCE, DC, DC_POWER_FACTOR, DC_USE_TRANSFORMER_RATIO, DEFAULT_LIMIT_REDUCTION_VALUE, DISTRIBUTED_SLACK, HVDC_AC_EMULATION, MAX_VALUE_ALLOWED_FOR_LIMIT_REDUCTION, MIN_VALUE_ALLOWED_FOR_LIMIT_REDUCTION, PARAM_LIMIT_REDUCTION, PARAM_PROVIDER_OPENLOADFLOW, PHASE_SHIFTER_REGULATION_ON, READ_SLACK_BUS, SHUNT_COMPENSATOR_VOLTAGE_CONTROL_ON, TWT_SPLIT_SHUNT_ADMITTANCE, USE_REACTIVE_LIMITS, VOLTAGE_INIT_MODE, WRITE_SLACK_BUS, alertThresholdMarks } from "./parameters/loadflow/constants.js";
|
|
161
161
|
import { LoadFlowParametersInline } from "./parameters/loadflow/load-flow-parameters-inline.js";
|
|
162
162
|
import { LoadFlowParametersEditionDialog } from "./parameters/loadflow/load-flow-parameters-dialog.js";
|
|
163
|
-
import { InitialVoltage, PredefinedParameters, SHORT_CIRCUIT_INITIAL_VOLTAGE_PROFILE_MODE, SHORT_CIRCUIT_MODEL_POWER_ELECTRONICS, SHORT_CIRCUIT_ONLY_STARTED_GENERATORS_IN_CALCULATION_CLUSTER, SHORT_CIRCUIT_POWER_ELECTRONICS_CLUSTERS, SHORT_CIRCUIT_POWER_ELECTRONICS_MATERIALS, SHORT_CIRCUIT_PREDEFINED_PARAMS, SHORT_CIRCUIT_VOLTAGE_RANGES, SHORT_CIRCUIT_WITH_FEEDER_RESULT, SHORT_CIRCUIT_WITH_LOADS, SHORT_CIRCUIT_WITH_NEUTRAL_POSITION, SHORT_CIRCUIT_WITH_SHUNT_COMPENSATORS, SHORT_CIRCUIT_WITH_VSC_CONVERTER_STATIONS, intlInitialVoltageProfileMode, intlPredefinedParametersOptions, onlyStartedGeneratorsOptions } from "./parameters/short-circuit/constants.js";
|
|
163
|
+
import { InitialVoltage, NODE_CLUSTER, NODE_CLUSTER_FILTER_IDS, PredefinedParameters, SHORT_CIRCUIT_INITIAL_VOLTAGE_PROFILE_MODE, SHORT_CIRCUIT_MODEL_POWER_ELECTRONICS, SHORT_CIRCUIT_ONLY_STARTED_GENERATORS_IN_CALCULATION_CLUSTER, SHORT_CIRCUIT_ONLY_STARTED_GENERATORS_OUTSIDE_CALCULATION_CLUSTER, SHORT_CIRCUIT_POWER_ELECTRONICS_CLUSTERS, SHORT_CIRCUIT_POWER_ELECTRONICS_MATERIALS, SHORT_CIRCUIT_PREDEFINED_PARAMS, SHORT_CIRCUIT_VOLTAGE_RANGES, SHORT_CIRCUIT_WITH_FEEDER_RESULT, SHORT_CIRCUIT_WITH_LOADS, SHORT_CIRCUIT_WITH_NEUTRAL_POSITION, SHORT_CIRCUIT_WITH_SHUNT_COMPENSATORS, SHORT_CIRCUIT_WITH_VSC_CONVERTER_STATIONS, STARTED_GENERATORS_IN_CALCULATION_CLUSTER_THRESHOLD, STARTED_GENERATORS_OUTSIDE_CALCULATION_CLUSTER_THRESHOLD, intlInitialVoltageProfileMode, intlPredefinedParametersOptions, onlyStartedGeneratorsOptions } from "./parameters/short-circuit/constants.js";
|
|
164
164
|
import { ShortCircuitParametersInLine } from "./parameters/short-circuit/short-circuit-parameters-inline.js";
|
|
165
165
|
import { ShortCircuitParametersEditionDialog } from "./parameters/short-circuit/short-circuit-parameters-dialog.js";
|
|
166
166
|
import { DEFAULT_GENERAL_APPLY_MODIFICATIONS, DEFAULT_REACTIVE_SLACKS_THRESHOLD, DEFAULT_SHUNT_COMPENSATOR_ACTIVATION_THRESHOLD, DEFAULT_UPDATE_BUS_VOLTAGE, GENERAL, GENERAL_APPLY_MODIFICATIONS, GENERATORS_SELECTION_TYPE, HIGH_VOLTAGE_LIMIT, LEG_SIDE, LOW_VOLTAGE_LIMIT, PRIORITY, RATIO_TAP_CHANGER_POSITION, RATIO_TAP_CHANGER_TARGET_V, REACTIVE_SLACKS_THRESHOLD, SELECTION_TYPE, SHUNT_COMPENSATORS_SELECTION_TYPE, SHUNT_COMPENSATOR_ACTIVATION_THRESHOLD, TRANSFORMERS_SELECTION_TYPE, UPDATE_BUS_VOLTAGE, VARIABLE_Q_GENERATORS, VARIABLE_SHUNT_COMPENSATORS, VARIABLE_TRANSFORMERS, VOLTAGE_LIMITS_DEFAULT, VOLTAGE_LIMITS_MODIFICATION, VoltageInitTabValues } from "./parameters/voltage-init/constants.js";
|
|
@@ -373,6 +373,8 @@ export {
|
|
|
373
373
|
NAD_POSITIONS_GENERATION_MODE,
|
|
374
374
|
NAD_POSITIONS_GENERATION_MODE_LABEL,
|
|
375
375
|
NAME,
|
|
376
|
+
NODE_CLUSTER,
|
|
377
|
+
NODE_CLUSTER_FILTER_IDS,
|
|
376
378
|
NO_ITEM_SELECTION_FOR_COPY,
|
|
377
379
|
NadPositionsGenerationMode,
|
|
378
380
|
NetworkModificationNameCellRenderer,
|
|
@@ -446,6 +448,7 @@ export {
|
|
|
446
448
|
SHORT_CIRCUIT_INITIAL_VOLTAGE_PROFILE_MODE,
|
|
447
449
|
SHORT_CIRCUIT_MODEL_POWER_ELECTRONICS,
|
|
448
450
|
SHORT_CIRCUIT_ONLY_STARTED_GENERATORS_IN_CALCULATION_CLUSTER,
|
|
451
|
+
SHORT_CIRCUIT_ONLY_STARTED_GENERATORS_OUTSIDE_CALCULATION_CLUSTER,
|
|
449
452
|
SHORT_CIRCUIT_POWER_ELECTRONICS_CLUSTERS,
|
|
450
453
|
SHORT_CIRCUIT_POWER_ELECTRONICS_MATERIALS,
|
|
451
454
|
SHORT_CIRCUIT_PREDEFINED_PARAMS,
|
|
@@ -460,6 +463,8 @@ export {
|
|
|
460
463
|
SHUNT_COMPENSATOR_TYPE_OPTIONS,
|
|
461
464
|
SHUNT_COMPENSATOR_VOLTAGE_CONTROL_ON,
|
|
462
465
|
SPECIFIC_PARAMETERS,
|
|
466
|
+
STARTED_GENERATORS_IN_CALCULATION_CLUSTER_THRESHOLD,
|
|
467
|
+
STARTED_GENERATORS_OUTSIDE_CALCULATION_CLUSTER_THRESHOLD,
|
|
463
468
|
START_TIME,
|
|
464
469
|
STOP_TIME,
|
|
465
470
|
SUBSTATION_LAYOUT,
|
|
@@ -26,16 +26,19 @@ function CountriesInput({ name, label, dataTestId }) {
|
|
|
26
26
|
getOptionLabel: translateOption,
|
|
27
27
|
fullWidth: true,
|
|
28
28
|
multiple: true,
|
|
29
|
-
renderTags: (val, getTagsProps) => val.map((code, index) =>
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
29
|
+
renderTags: (val, getTagsProps) => val.map((code, index) => {
|
|
30
|
+
const { key, ...tagProps } = getTagsProps({ index });
|
|
31
|
+
return /* @__PURE__ */ jsx(
|
|
32
|
+
Chip,
|
|
33
|
+
{
|
|
34
|
+
"data-testid": `${dataTestId}.${code}`,
|
|
35
|
+
size: "small",
|
|
36
|
+
label: translate(code),
|
|
37
|
+
...tagProps
|
|
38
|
+
},
|
|
39
|
+
key ?? code
|
|
40
|
+
);
|
|
41
|
+
})
|
|
39
42
|
}
|
|
40
43
|
);
|
|
41
44
|
}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { UUID } from 'node:crypto';
|
|
2
|
-
|
|
2
|
+
import { ContingencyCount } from './types';
|
|
3
|
+
export declare function ContingencyTable({ showContingencyCount, fetchContingencyCount, isBuiltCurrentNode, }: Readonly<{
|
|
3
4
|
showContingencyCount: boolean;
|
|
4
|
-
fetchContingencyCount?: (contingencyLists: UUID[] | null) => Promise<
|
|
5
|
+
fetchContingencyCount?: (contingencyLists: UUID[] | null) => Promise<ContingencyCount>;
|
|
6
|
+
isBuiltCurrentNode?: boolean;
|
|
5
7
|
}>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -18,10 +18,11 @@ import { CONTINGENCY_LISTS_INFOS, CONTINGENCY_LISTS } from "../constants.js";
|
|
|
18
18
|
import { ParamContingencyLists, COLUMNS_DEFINITIONS_CONTINGENCY_LISTS_INFOS } from "./columns-definitions.js";
|
|
19
19
|
function ContingencyTable({
|
|
20
20
|
showContingencyCount = false,
|
|
21
|
-
fetchContingencyCount
|
|
21
|
+
fetchContingencyCount,
|
|
22
|
+
isBuiltCurrentNode
|
|
22
23
|
}) {
|
|
23
24
|
const intl = useIntl();
|
|
24
|
-
const [simulatedContingencyCount, setSimulatedContingencyCount] = useState(
|
|
25
|
+
const [simulatedContingencyCount, setSimulatedContingencyCount] = useState(null);
|
|
25
26
|
const [rowData, useFieldArrayOutput] = useCreateRowData(ParamContingencyLists);
|
|
26
27
|
const contingencyListsInfos = useWatch({ name: CONTINGENCY_LISTS_INFOS });
|
|
27
28
|
const getColumnsDefinition = useCallback(
|
|
@@ -51,6 +52,24 @@ function ContingencyTable({
|
|
|
51
52
|
});
|
|
52
53
|
}
|
|
53
54
|
}, [contingencyListsInfos, fetchContingencyCount, showContingencyCount]);
|
|
55
|
+
const renderContingencyCount = () => {
|
|
56
|
+
if (!isBuiltCurrentNode) {
|
|
57
|
+
return /* @__PURE__ */ jsx(Alert, { variant: "standard", severity: "warning", sx: { color: "text.primary" }, children: /* @__PURE__ */ jsx(FormattedMessage, { id: "contingencyCountImpossibleOnUnbuiltNode" }) });
|
|
58
|
+
}
|
|
59
|
+
if (simulatedContingencyCount?.contingencies === 0 && simulatedContingencyCount.notFoundElements === 0) {
|
|
60
|
+
return /* @__PURE__ */ jsx(Alert, { variant: "standard", severity: "error", sx: { color: "text.primary" }, children: /* @__PURE__ */ jsx(FormattedMessage, { id: "noContingency" }) });
|
|
61
|
+
}
|
|
62
|
+
return /* @__PURE__ */ jsx(Alert, { variant: "standard", icon: false, severity: "info", sx: { color: "text.primary" }, children: /* @__PURE__ */ jsx(
|
|
63
|
+
FormattedMessage,
|
|
64
|
+
{
|
|
65
|
+
id: "xContingenciesWillBeSimulatedAndYNotFound",
|
|
66
|
+
values: {
|
|
67
|
+
x: simulatedContingencyCount?.contingencies ?? "...",
|
|
68
|
+
y: simulatedContingencyCount?.notFoundElements ?? "..."
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
) });
|
|
72
|
+
};
|
|
54
73
|
return /* @__PURE__ */ jsxs(Stack, { spacing: 0, sx: { width: "100%" }, children: [
|
|
55
74
|
/* @__PURE__ */ jsx(
|
|
56
75
|
ParameterTable,
|
|
@@ -65,15 +84,7 @@ function ContingencyTable({
|
|
|
65
84
|
isValidParameterRow: (row) => row[CONTINGENCY_LISTS]?.length > 0
|
|
66
85
|
}
|
|
67
86
|
),
|
|
68
|
-
showContingencyCount &&
|
|
69
|
-
FormattedMessage,
|
|
70
|
-
{
|
|
71
|
-
id: "xContingenciesWillBeSimulated",
|
|
72
|
-
values: {
|
|
73
|
-
x: simulatedContingencyCount ?? "..."
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
) })
|
|
87
|
+
showContingencyCount && renderContingencyCount()
|
|
77
88
|
] });
|
|
78
89
|
}
|
|
79
90
|
export {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
2
2
|
import { FormattedMessage } from "react-intl";
|
|
3
|
-
import {
|
|
3
|
+
import { Typography, Box, Button, Grid, Switch } from "@mui/material";
|
|
4
4
|
import { parametersStyles } from "../parameters-style.js";
|
|
5
5
|
function LabelledButton({ callback, label, ...props }) {
|
|
6
6
|
return /* @__PURE__ */ jsx(Button, { onClick: callback, ...props, children: /* @__PURE__ */ jsx(FormattedMessage, { id: label }) });
|
package/dist/components/parameters/dynamic-margin-calculation/dynamic-margin-calculation-inline.js
CHANGED
|
@@ -50,7 +50,7 @@ function DynamicMarginCalculationInline({
|
|
|
50
50
|
parametersBackend,
|
|
51
51
|
setHaveDirtyFields
|
|
52
52
|
}) {
|
|
53
|
-
const
|
|
53
|
+
const { providers, params, updateParameters, resetParameters } = parametersBackend;
|
|
54
54
|
const dynamicMarginCalculationMethods = useDynamicMarginCalculationParametersForm({
|
|
55
55
|
providers,
|
|
56
56
|
params,
|
|
@@ -71,14 +71,14 @@ function DynamicMarginCalculationInline({
|
|
|
71
71
|
setOpenResetConfirmation(false);
|
|
72
72
|
}, []);
|
|
73
73
|
const handleReset = useCallback(() => {
|
|
74
|
-
|
|
74
|
+
resetParameters();
|
|
75
75
|
setOpenResetConfirmation(false);
|
|
76
|
-
}, [
|
|
76
|
+
}, [resetParameters]);
|
|
77
77
|
const onSubmit = useCallback(
|
|
78
78
|
(formData) => {
|
|
79
|
-
|
|
79
|
+
updateParameters(toParamsInfos(formData));
|
|
80
80
|
},
|
|
81
|
-
[
|
|
81
|
+
[updateParameters]
|
|
82
82
|
);
|
|
83
83
|
const handleLoadParameter = useCallback(
|
|
84
84
|
(newParams) => {
|
|
@@ -23,7 +23,7 @@ import { NetworkVisualizationsParametersEditionDialog } from "./network-visualiz
|
|
|
23
23
|
import { BALANCE_TYPE, CONNECTED_MODE, COUNTRIES_TO_BALANCE, DC, DC_POWER_FACTOR, DC_USE_TRANSFORMER_RATIO, DEFAULT_LIMIT_REDUCTION_VALUE, DISTRIBUTED_SLACK, HVDC_AC_EMULATION, MAX_VALUE_ALLOWED_FOR_LIMIT_REDUCTION, MIN_VALUE_ALLOWED_FOR_LIMIT_REDUCTION, PARAM_LIMIT_REDUCTION, PARAM_PROVIDER_OPENLOADFLOW, PHASE_SHIFTER_REGULATION_ON, READ_SLACK_BUS, SHUNT_COMPENSATOR_VOLTAGE_CONTROL_ON, TWT_SPLIT_SHUNT_ADMITTANCE, USE_REACTIVE_LIMITS, VOLTAGE_INIT_MODE, WRITE_SLACK_BUS, alertThresholdMarks } from "./loadflow/constants.js";
|
|
24
24
|
import { LoadFlowParametersInline } from "./loadflow/load-flow-parameters-inline.js";
|
|
25
25
|
import { LoadFlowParametersEditionDialog } from "./loadflow/load-flow-parameters-dialog.js";
|
|
26
|
-
import { InitialVoltage, PredefinedParameters, SHORT_CIRCUIT_INITIAL_VOLTAGE_PROFILE_MODE, SHORT_CIRCUIT_MODEL_POWER_ELECTRONICS, SHORT_CIRCUIT_ONLY_STARTED_GENERATORS_IN_CALCULATION_CLUSTER, SHORT_CIRCUIT_POWER_ELECTRONICS_CLUSTERS, SHORT_CIRCUIT_POWER_ELECTRONICS_MATERIALS, SHORT_CIRCUIT_PREDEFINED_PARAMS, SHORT_CIRCUIT_VOLTAGE_RANGES, SHORT_CIRCUIT_WITH_FEEDER_RESULT, SHORT_CIRCUIT_WITH_LOADS, SHORT_CIRCUIT_WITH_NEUTRAL_POSITION, SHORT_CIRCUIT_WITH_SHUNT_COMPENSATORS, SHORT_CIRCUIT_WITH_VSC_CONVERTER_STATIONS, intlInitialVoltageProfileMode, intlPredefinedParametersOptions, onlyStartedGeneratorsOptions } from "./short-circuit/constants.js";
|
|
26
|
+
import { InitialVoltage, NODE_CLUSTER, NODE_CLUSTER_FILTER_IDS, PredefinedParameters, SHORT_CIRCUIT_INITIAL_VOLTAGE_PROFILE_MODE, SHORT_CIRCUIT_MODEL_POWER_ELECTRONICS, SHORT_CIRCUIT_ONLY_STARTED_GENERATORS_IN_CALCULATION_CLUSTER, SHORT_CIRCUIT_ONLY_STARTED_GENERATORS_OUTSIDE_CALCULATION_CLUSTER, SHORT_CIRCUIT_POWER_ELECTRONICS_CLUSTERS, SHORT_CIRCUIT_POWER_ELECTRONICS_MATERIALS, SHORT_CIRCUIT_PREDEFINED_PARAMS, SHORT_CIRCUIT_VOLTAGE_RANGES, SHORT_CIRCUIT_WITH_FEEDER_RESULT, SHORT_CIRCUIT_WITH_LOADS, SHORT_CIRCUIT_WITH_NEUTRAL_POSITION, SHORT_CIRCUIT_WITH_SHUNT_COMPENSATORS, SHORT_CIRCUIT_WITH_VSC_CONVERTER_STATIONS, STARTED_GENERATORS_IN_CALCULATION_CLUSTER_THRESHOLD, STARTED_GENERATORS_OUTSIDE_CALCULATION_CLUSTER_THRESHOLD, intlInitialVoltageProfileMode, intlPredefinedParametersOptions, onlyStartedGeneratorsOptions } from "./short-circuit/constants.js";
|
|
27
27
|
import { ShortCircuitParametersInLine } from "./short-circuit/short-circuit-parameters-inline.js";
|
|
28
28
|
import { ShortCircuitParametersEditionDialog } from "./short-circuit/short-circuit-parameters-dialog.js";
|
|
29
29
|
import { DEFAULT_GENERAL_APPLY_MODIFICATIONS, DEFAULT_REACTIVE_SLACKS_THRESHOLD, DEFAULT_SHUNT_COMPENSATOR_ACTIVATION_THRESHOLD, DEFAULT_UPDATE_BUS_VOLTAGE, GENERAL, GENERAL_APPLY_MODIFICATIONS, GENERATORS_SELECTION_TYPE, HIGH_VOLTAGE_LIMIT, LEG_SIDE, LOW_VOLTAGE_LIMIT, PRIORITY, RATIO_TAP_CHANGER_POSITION, RATIO_TAP_CHANGER_TARGET_V, REACTIVE_SLACKS_THRESHOLD, SELECTION_TYPE, SHUNT_COMPENSATORS_SELECTION_TYPE, SHUNT_COMPENSATOR_ACTIVATION_THRESHOLD, TRANSFORMERS_SELECTION_TYPE, UPDATE_BUS_VOLTAGE, VARIABLE_Q_GENERATORS, VARIABLE_SHUNT_COMPENSATORS, VARIABLE_TRANSFORMERS, VOLTAGE_LIMITS_DEFAULT, VOLTAGE_LIMITS_MODIFICATION, VoltageInitTabValues } from "./voltage-init/constants.js";
|
|
@@ -119,6 +119,8 @@ export {
|
|
|
119
119
|
MONITORED_VOLTAGE_LEVELS_EQUIPMENT_TYPES,
|
|
120
120
|
NAD_POSITIONS_GENERATION_MODE,
|
|
121
121
|
NAD_POSITIONS_GENERATION_MODE_LABEL,
|
|
122
|
+
NODE_CLUSTER,
|
|
123
|
+
NODE_CLUSTER_FILTER_IDS,
|
|
122
124
|
NadPositionsGenerationMode,
|
|
123
125
|
NetworkVisualizationParametersInline,
|
|
124
126
|
NetworkVisualizationTabValues,
|
|
@@ -163,6 +165,7 @@ export {
|
|
|
163
165
|
SHORT_CIRCUIT_INITIAL_VOLTAGE_PROFILE_MODE,
|
|
164
166
|
SHORT_CIRCUIT_MODEL_POWER_ELECTRONICS,
|
|
165
167
|
SHORT_CIRCUIT_ONLY_STARTED_GENERATORS_IN_CALCULATION_CLUSTER,
|
|
168
|
+
SHORT_CIRCUIT_ONLY_STARTED_GENERATORS_OUTSIDE_CALCULATION_CLUSTER,
|
|
166
169
|
SHORT_CIRCUIT_POWER_ELECTRONICS_CLUSTERS,
|
|
167
170
|
SHORT_CIRCUIT_POWER_ELECTRONICS_MATERIALS,
|
|
168
171
|
SHORT_CIRCUIT_PREDEFINED_PARAMS,
|
|
@@ -176,6 +179,8 @@ export {
|
|
|
176
179
|
SHUNT_COMPENSATOR_ACTIVATION_THRESHOLD,
|
|
177
180
|
SHUNT_COMPENSATOR_VOLTAGE_CONTROL_ON,
|
|
178
181
|
SPECIFIC_PARAMETERS,
|
|
182
|
+
STARTED_GENERATORS_IN_CALCULATION_CLUSTER_THRESHOLD,
|
|
183
|
+
STARTED_GENERATORS_OUTSIDE_CALCULATION_CLUSTER_THRESHOLD,
|
|
179
184
|
START_TIME,
|
|
180
185
|
STOP_TIME,
|
|
181
186
|
SUBSTATION_LAYOUT,
|
|
@@ -8,7 +8,7 @@ import "../../../utils/types/equipmentType.js";
|
|
|
8
8
|
import { LANG_ENGLISH } from "../../../utils/langs.js";
|
|
9
9
|
import "@mui/icons-material";
|
|
10
10
|
import "../../../utils/yupConfig.js";
|
|
11
|
-
import { getLoadFlowDefaultLimitReductions,
|
|
11
|
+
import { getLoadFlowDefaultLimitReductions, getLoadFlowProviders, fetchLoadFlowParameters, setLoadFlowParameters, getLoadFlowSpecificParametersDescription } from "../../../services/loadflow.js";
|
|
12
12
|
import "react";
|
|
13
13
|
import "@mui/material";
|
|
14
14
|
import "react-intl";
|
|
@@ -57,20 +57,13 @@ function LoadFlowParametersEditionDialog({
|
|
|
57
57
|
language = LANG_ENGLISH,
|
|
58
58
|
isDeveloperMode = false
|
|
59
59
|
}) {
|
|
60
|
-
const parametersBackend = useParametersBackend(
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
getDefaultLoadFlowProvider,
|
|
68
|
-
null,
|
|
69
|
-
fetchLoadFlowParameters,
|
|
70
|
-
setLoadFlowParameters,
|
|
71
|
-
getLoadFlowSpecificParametersDescription,
|
|
72
|
-
getLoadFlowDefaultLimitReductions
|
|
73
|
-
);
|
|
60
|
+
const parametersBackend = useParametersBackend(user, id, ComputingType.LOAD_FLOW, OptionalServicesStatus.Up, {
|
|
61
|
+
backendFetchProviders: getLoadFlowProviders,
|
|
62
|
+
backendFetchParameters: fetchLoadFlowParameters,
|
|
63
|
+
backendUpdateParameters: setLoadFlowParameters,
|
|
64
|
+
backendFetchSpecificParametersDescription: getLoadFlowSpecificParametersDescription,
|
|
65
|
+
backendFetchDefaultLimitReductions: getLoadFlowDefaultLimitReductions
|
|
66
|
+
});
|
|
74
67
|
const loadflowMethods = useLoadFlowParametersForm(parametersBackend, isDeveloperMode, id, name, description);
|
|
75
68
|
const {
|
|
76
69
|
formState: { errors, dirtyFields }
|
|
@@ -74,7 +74,7 @@ function LoadFlowParametersForm({
|
|
|
74
74
|
formattedProviders,
|
|
75
75
|
specificParametersDescriptionForProvider,
|
|
76
76
|
params,
|
|
77
|
-
|
|
77
|
+
watchProvider,
|
|
78
78
|
defaultLimitReductions,
|
|
79
79
|
paramsLoaded
|
|
80
80
|
} = loadflowMethods;
|
|
@@ -94,7 +94,7 @@ function LoadFlowParametersForm({
|
|
|
94
94
|
LoadFlowParametersContent,
|
|
95
95
|
{
|
|
96
96
|
selectedTab,
|
|
97
|
-
currentProvider:
|
|
97
|
+
currentProvider: watchProvider ?? "",
|
|
98
98
|
specificParameters: specificParametersDescriptionForProvider,
|
|
99
99
|
params,
|
|
100
100
|
defaultLimitReductions
|
|
@@ -55,7 +55,7 @@ function LoadFlowParametersInline({
|
|
|
55
55
|
setHaveDirtyFields,
|
|
56
56
|
isDeveloperMode
|
|
57
57
|
}) {
|
|
58
|
-
const
|
|
58
|
+
const { resetParameters } = parametersBackend;
|
|
59
59
|
const loadflowMethods = useLoadFlowParametersForm(parametersBackend, isDeveloperMode, null, null, null);
|
|
60
60
|
const intl = useIntl();
|
|
61
61
|
const [openCreateParameterDialog, setOpenCreateParameterDialog] = useState(false);
|
|
@@ -64,9 +64,8 @@ function LoadFlowParametersInline({
|
|
|
64
64
|
const { snackError } = useSnackMessage();
|
|
65
65
|
const executeResetAction = useCallback(() => {
|
|
66
66
|
resetParameters();
|
|
67
|
-
resetProvider();
|
|
68
67
|
setOpenResetConfirmation(false);
|
|
69
|
-
}, [resetParameters
|
|
68
|
+
}, [resetParameters]);
|
|
70
69
|
const handleResetAllClick = useCallback(() => {
|
|
71
70
|
setOpenResetConfirmation(true);
|
|
72
71
|
}, []);
|
|
@@ -79,7 +78,6 @@ function LoadFlowParametersInline({
|
|
|
79
78
|
if (newParams && newParams.length > 0) {
|
|
80
79
|
setOpenSelectParameterDialog(false);
|
|
81
80
|
fetchLoadFlowParameters(newParams[0].id).then((parameters) => {
|
|
82
|
-
loadflowMethods.setCurrentProvider(parameters.provider);
|
|
83
81
|
console.info(`loading the following loadflow parameters : ${parameters.uuid}`);
|
|
84
82
|
reset(loadflowMethods.toLoadFlowFormValues(parameters), {
|
|
85
83
|
keepDefaultValues: true
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { FieldErrors, UseFormReturn } from 'react-hook-form';
|
|
2
|
-
import {
|
|
2
|
+
import { SyntheticEvent } from 'react';
|
|
3
3
|
import { ObjectSchema } from 'yup';
|
|
4
4
|
import { UUID } from 'node:crypto';
|
|
5
5
|
import { TabValues } from './load-flow-parameters-utils';
|
|
@@ -22,8 +22,7 @@ export interface UseLoadFlowParametersFormReturn {
|
|
|
22
22
|
toLoadFlowFormValues: (_params: LoadFlowParametersInfos) => any;
|
|
23
23
|
formatNewParams: (formData: Record<string, any>) => LoadFlowParametersInfos;
|
|
24
24
|
params: LoadFlowParametersInfos | null;
|
|
25
|
-
|
|
26
|
-
setCurrentProvider: Dispatch<SetStateAction<string | undefined>>;
|
|
25
|
+
watchProvider: string | undefined;
|
|
27
26
|
paramsLoaded: boolean;
|
|
28
27
|
onValidationError: (errors: FieldErrors) => void;
|
|
29
28
|
onSaveInline: (formData: Record<string, any>) => void;
|
|
@@ -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,
|
|
3
|
+
import { useState, useRef, useCallback, useMemo, useEffect, useEffectEvent } 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/constants.js";
|
|
6
6
|
import "react/jsx-runtime";
|
|
@@ -47,30 +47,18 @@ import "../../filter/HeaderFilterForm.js";
|
|
|
47
47
|
import { getNameElementEditorSchema, getNameElementEditorEmptyFormData } from "../common/name-element-editor/name-element-editor-utils.js";
|
|
48
48
|
import { getDefaultSpecificParamsValues, getSpecificParametersFormSchema, getAllSpecificParametersValues, formatSpecificParameters, setSpecificParameters } from "../common/utils.js";
|
|
49
49
|
const useLoadFlowParametersForm = (parametersBackend, isDeveloperMode, parametersUuid, name, description) => {
|
|
50
|
-
const
|
|
51
|
-
providers,
|
|
52
|
-
provider,
|
|
53
|
-
,
|
|
54
|
-
,
|
|
55
|
-
,
|
|
56
|
-
params,
|
|
57
|
-
,
|
|
58
|
-
updateParameters,
|
|
59
|
-
,
|
|
60
|
-
specificParamsDescriptions,
|
|
61
|
-
defaultLimitReductions
|
|
62
|
-
] = parametersBackend;
|
|
63
|
-
const [currentProvider, setCurrentProvider] = useState(params?.provider);
|
|
50
|
+
const { providers, params, updateParameters, specificParamsDescription, defaultLimitReductions } = parametersBackend;
|
|
64
51
|
const [selectedTab, setSelectedTab] = useState(TabValues.GENERAL);
|
|
65
52
|
const [limitReductionNumber, setLimitReductionNumber] = useState(0);
|
|
66
53
|
const [tabIndexesWithError, setTabIndexesWithError] = useState([]);
|
|
54
|
+
const [specificParametersDescriptionForProvider, setSpecificParametersDescriptionForProvider] = useState(() => {
|
|
55
|
+
return params?.provider && specificParamsDescription ? specificParamsDescription[params.provider] : [];
|
|
56
|
+
});
|
|
67
57
|
const { snackError } = useSnackMessage();
|
|
58
|
+
const previousWatchProviderRef = useRef(void 0);
|
|
68
59
|
const handleTabChange = useCallback((event, newValue) => {
|
|
69
60
|
setSelectedTab(newValue);
|
|
70
61
|
}, []);
|
|
71
|
-
const specificParametersDescriptionForProvider = useMemo(() => {
|
|
72
|
-
return currentProvider && specificParamsDescriptions ? specificParamsDescriptions[currentProvider] : [];
|
|
73
|
-
}, [currentProvider, specificParamsDescriptions]);
|
|
74
62
|
const specificParametersDefaultValues = useMemo(() => {
|
|
75
63
|
return getDefaultSpecificParamsValues(specificParametersDescriptionForProvider);
|
|
76
64
|
}, [specificParametersDescriptionForProvider]);
|
|
@@ -86,7 +74,7 @@ const useLoadFlowParametersForm = (parametersBackend, isDeveloperMode, parameter
|
|
|
86
74
|
const formMethods = useForm({
|
|
87
75
|
defaultValues: {
|
|
88
76
|
...getNameElementEditorEmptyFormData(name, description),
|
|
89
|
-
[PROVIDER]: provider,
|
|
77
|
+
[PROVIDER]: params?.provider,
|
|
90
78
|
[PARAM_LIMIT_REDUCTION]: null,
|
|
91
79
|
[COMMON_PARAMETERS]: {
|
|
92
80
|
...params?.commonParameters
|
|
@@ -100,6 +88,14 @@ const useLoadFlowParametersForm = (parametersBackend, isDeveloperMode, parameter
|
|
|
100
88
|
});
|
|
101
89
|
const { watch, reset } = formMethods;
|
|
102
90
|
const watchProvider = watch(PROVIDER);
|
|
91
|
+
useEffect(() => {
|
|
92
|
+
const provider = watchProvider ?? params?.provider;
|
|
93
|
+
if (!provider || !specificParamsDescription) {
|
|
94
|
+
setSpecificParametersDescriptionForProvider([]);
|
|
95
|
+
return;
|
|
96
|
+
}
|
|
97
|
+
setSpecificParametersDescriptionForProvider(specificParamsDescription[provider] ?? []);
|
|
98
|
+
}, [watchProvider, params?.provider, specificParamsDescription]);
|
|
103
99
|
const toLimitReductions = useCallback(
|
|
104
100
|
(formLimits) => {
|
|
105
101
|
if (formLimits?.length === 0) {
|
|
@@ -143,6 +139,7 @@ const useLoadFlowParametersForm = (parametersBackend, isDeveloperMode, parameter
|
|
|
143
139
|
const toLoadFlowFormValues = useCallback(
|
|
144
140
|
(_params) => {
|
|
145
141
|
const specificParamsListForCurrentProvider = _params.specificParametersPerProvider[_params.provider];
|
|
142
|
+
const specificParametersForLoadedProvider = specificParamsDescription?.[_params.provider] ?? [];
|
|
146
143
|
return {
|
|
147
144
|
[PROVIDER]: _params.provider,
|
|
148
145
|
[PARAM_LIMIT_REDUCTION]: _params.limitReduction,
|
|
@@ -151,16 +148,16 @@ const useLoadFlowParametersForm = (parametersBackend, isDeveloperMode, parameter
|
|
|
151
148
|
},
|
|
152
149
|
[SPECIFIC_PARAMETERS]: {
|
|
153
150
|
...formatSpecificParameters(
|
|
154
|
-
|
|
151
|
+
specificParametersForLoadedProvider,
|
|
155
152
|
specificParamsListForCurrentProvider
|
|
156
153
|
)
|
|
157
154
|
},
|
|
158
155
|
...toFormValuesLimitReductions(_params.limitReductions)
|
|
159
156
|
};
|
|
160
157
|
},
|
|
161
|
-
[
|
|
158
|
+
[specificParamsDescription]
|
|
162
159
|
);
|
|
163
|
-
const paramsLoaded = useMemo(() => !!params && !!
|
|
160
|
+
const paramsLoaded = useMemo(() => !!params && !!watchProvider, [watchProvider, params]);
|
|
164
161
|
const formattedProviders = useMemo(() => {
|
|
165
162
|
return Object.entries(providers).filter(([key]) => !key.includes("DynaFlow") || isDeveloperMode).map(([key, value]) => ({
|
|
166
163
|
id: key,
|
|
@@ -214,28 +211,22 @@ const useLoadFlowParametersForm = (parametersBackend, isDeveloperMode, parameter
|
|
|
214
211
|
resetForm(params);
|
|
215
212
|
}, [paramsLoaded, params]);
|
|
216
213
|
useEffect(() => {
|
|
217
|
-
if (watchProvider
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
setLimitReductionNumber(params?.limitReductions?.at(0)?.temporaryLimitReductions?.length ?? 0);
|
|
226
|
-
}
|
|
214
|
+
if (!watchProvider || watchProvider === previousWatchProviderRef.current) {
|
|
215
|
+
return;
|
|
216
|
+
}
|
|
217
|
+
setSpecificParameters(watchProvider, specificParamsDescription, formMethods);
|
|
218
|
+
setLimitReductions(watchProvider, defaultLimitReductions, formMethods);
|
|
219
|
+
if (watchProvider === PARAM_PROVIDER_OPENLOADFLOW) {
|
|
220
|
+
if (previousWatchProviderRef.current) {
|
|
221
|
+
setLimitReductionNumber(defaultLimitReductions?.at(0)?.temporaryLimitReductions?.length ?? 0);
|
|
227
222
|
} else {
|
|
228
|
-
setLimitReductionNumber(0);
|
|
223
|
+
setLimitReductionNumber(params?.limitReductions?.at(0)?.temporaryLimitReductions?.length ?? 0);
|
|
229
224
|
}
|
|
225
|
+
} else {
|
|
226
|
+
setLimitReductionNumber(0);
|
|
230
227
|
}
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
defaultLimitReductions,
|
|
234
|
-
formMethods,
|
|
235
|
-
params?.limitReductions,
|
|
236
|
-
specificParamsDescriptions,
|
|
237
|
-
watchProvider
|
|
238
|
-
]);
|
|
228
|
+
previousWatchProviderRef.current = watchProvider;
|
|
229
|
+
}, [defaultLimitReductions, formMethods, params?.limitReductions, specificParamsDescription, watchProvider]);
|
|
239
230
|
return {
|
|
240
231
|
formMethods,
|
|
241
232
|
formSchema,
|
|
@@ -248,8 +239,7 @@ const useLoadFlowParametersForm = (parametersBackend, isDeveloperMode, parameter
|
|
|
248
239
|
toLoadFlowFormValues,
|
|
249
240
|
formatNewParams,
|
|
250
241
|
params,
|
|
251
|
-
|
|
252
|
-
setCurrentProvider,
|
|
242
|
+
watchProvider,
|
|
253
243
|
paramsLoaded,
|
|
254
244
|
onValidationError,
|
|
255
245
|
onSaveInline,
|
|
@@ -6,7 +6,7 @@ import { ElementType } from "../../../utils/types/elementType.js";
|
|
|
6
6
|
import "../../../utils/types/equipmentType.js";
|
|
7
7
|
import "@mui/icons-material";
|
|
8
8
|
import "../../../utils/yupConfig.js";
|
|
9
|
-
import { getSecurityAnalysisDefaultLimitReductions,
|
|
9
|
+
import { getSecurityAnalysisDefaultLimitReductions, fetchSecurityAnalysisProviders, fetchSecurityAnalysisParameters, updateSecurityAnalysisParameters } from "../../../services/security-analysis.js";
|
|
10
10
|
import "@mui/material";
|
|
11
11
|
import "localized-countries";
|
|
12
12
|
import "localized-countries/data/fr";
|
|
@@ -60,14 +60,12 @@ function SecurityAnalysisParametersDialog({
|
|
|
60
60
|
id,
|
|
61
61
|
ComputingType.SECURITY_ANALYSIS,
|
|
62
62
|
OptionalServicesStatus.Up,
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
void 0,
|
|
70
|
-
getSecurityAnalysisDefaultLimitReductions
|
|
63
|
+
{
|
|
64
|
+
backendFetchProviders: fetchSecurityAnalysisProviders,
|
|
65
|
+
backendFetchParameters: fetchSecurityAnalysisParameters,
|
|
66
|
+
backendUpdateParameters: updateSecurityAnalysisParameters,
|
|
67
|
+
backendFetchDefaultLimitReductions: getSecurityAnalysisDefaultLimitReductions
|
|
68
|
+
}
|
|
71
69
|
);
|
|
72
70
|
const securityAnalysisMethods = useSecurityAnalysisParametersForm(parametersBackend, id, name, description);
|
|
73
71
|
const {
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
2
|
import { UUID } from 'node:crypto';
|
|
3
3
|
import { UseSecurityAnalysisParametersFormReturn } from './use-security-analysis-parameters-form';
|
|
4
|
-
|
|
4
|
+
import { ContingencyCount } from '../common/contingency-table/types';
|
|
5
|
+
export declare function SecurityAnalysisParametersForm({ securityAnalysisMethods, showContingencyCount, fetchContingencyCount, isBuiltCurrentNode, renderTitleFields, renderActions, isDeveloperMode, }: Readonly<{
|
|
5
6
|
securityAnalysisMethods: UseSecurityAnalysisParametersFormReturn;
|
|
6
|
-
fetchContingencyCount?: (contingencyListIds: UUID[] | null) => Promise<number>;
|
|
7
7
|
showContingencyCount: boolean;
|
|
8
|
+
fetchContingencyCount?: (contingencyListIds: UUID[] | null) => Promise<ContingencyCount>;
|
|
9
|
+
isBuiltCurrentNode?: boolean;
|
|
8
10
|
renderTitleFields?: () => ReactNode;
|
|
9
11
|
renderActions?: () => ReactNode;
|
|
10
12
|
isDeveloperMode: boolean;
|
|
@@ -57,8 +57,9 @@ const styles = {
|
|
|
57
57
|
};
|
|
58
58
|
function SecurityAnalysisParametersForm({
|
|
59
59
|
securityAnalysisMethods,
|
|
60
|
-
fetchContingencyCount,
|
|
61
60
|
showContingencyCount,
|
|
61
|
+
fetchContingencyCount,
|
|
62
|
+
isBuiltCurrentNode,
|
|
62
63
|
renderTitleFields,
|
|
63
64
|
renderActions,
|
|
64
65
|
isDeveloperMode
|
|
@@ -126,7 +127,8 @@ function SecurityAnalysisParametersForm({
|
|
|
126
127
|
ContingencyTable,
|
|
127
128
|
{
|
|
128
129
|
showContingencyCount,
|
|
129
|
-
fetchContingencyCount
|
|
130
|
+
fetchContingencyCount,
|
|
131
|
+
isBuiltCurrentNode
|
|
130
132
|
}
|
|
131
133
|
) }),
|
|
132
134
|
/* @__PURE__ */ jsx(Grid, { container: true, paddingTop: 4, paddingBottom: 2, children: /* @__PURE__ */ jsx(LineSeparator, {}) }),
|
|
@@ -134,7 +136,7 @@ function SecurityAnalysisParametersForm({
|
|
|
134
136
|
SecurityAnalysisParametersSelector,
|
|
135
137
|
{
|
|
136
138
|
params: securityAnalysisMethods.params,
|
|
137
|
-
currentProvider: securityAnalysisMethods.
|
|
139
|
+
currentProvider: securityAnalysisMethods.watchProvider?.trim(),
|
|
138
140
|
isDeveloperMode,
|
|
139
141
|
defaultLimitReductions: securityAnalysisMethods.defaultLimitReductions
|
|
140
142
|
}
|
package/dist/components/parameters/security-analysis/security-analysis-parameters-inline.d.ts
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { UUID } from 'node:crypto';
|
|
2
2
|
import { UseParametersBackendReturnProps } from '../../../utils';
|
|
3
3
|
import { ComputingType } from '../common';
|
|
4
|
-
|
|
4
|
+
import { ContingencyCount } from '../common/contingency-table/types';
|
|
5
|
+
export declare function SecurityAnalysisParametersInline({ studyUuid, parametersBackend, fetchContingencyCount, isBuiltCurrentNode, setHaveDirtyFields, isDeveloperMode, }: Readonly<{
|
|
5
6
|
studyUuid: UUID | null;
|
|
6
7
|
parametersBackend: UseParametersBackendReturnProps<ComputingType.SECURITY_ANALYSIS>;
|
|
7
|
-
fetchContingencyCount: (contingencyListIds: UUID[] | null) => Promise<
|
|
8
|
+
fetchContingencyCount: (contingencyListIds: UUID[] | null) => Promise<ContingencyCount>;
|
|
9
|
+
isBuiltCurrentNode: boolean;
|
|
8
10
|
setHaveDirtyFields: (isDirty: boolean) => void;
|
|
9
11
|
isDeveloperMode: boolean;
|
|
10
12
|
}>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -52,11 +52,12 @@ function SecurityAnalysisParametersInline({
|
|
|
52
52
|
studyUuid,
|
|
53
53
|
parametersBackend,
|
|
54
54
|
fetchContingencyCount,
|
|
55
|
+
isBuiltCurrentNode,
|
|
55
56
|
setHaveDirtyFields,
|
|
56
57
|
isDeveloperMode
|
|
57
58
|
}) {
|
|
58
59
|
const securityAnalysisMethods = useSecurityAnalysisParametersForm(parametersBackend, null, null, null);
|
|
59
|
-
const
|
|
60
|
+
const { resetParameters } = parametersBackend;
|
|
60
61
|
const intl = useIntl();
|
|
61
62
|
const [openCreateParameterDialog, setOpenCreateParameterDialog] = useState(false);
|
|
62
63
|
const [openSelectParameterDialog, setOpenSelectParameterDialog] = useState(false);
|
|
@@ -65,9 +66,8 @@ function SecurityAnalysisParametersInline({
|
|
|
65
66
|
const { handleSubmit, formState, reset, getValues } = securityAnalysisMethods.formMethods;
|
|
66
67
|
const executeResetAction = useCallback(() => {
|
|
67
68
|
resetParameters();
|
|
68
|
-
resetProvider();
|
|
69
69
|
setOpenResetConfirmation(false);
|
|
70
|
-
}, [resetParameters
|
|
70
|
+
}, [resetParameters]);
|
|
71
71
|
const handleResetAllClick = useCallback(() => {
|
|
72
72
|
setOpenResetConfirmation(true);
|
|
73
73
|
}, []);
|
|
@@ -98,8 +98,9 @@ function SecurityAnalysisParametersInline({
|
|
|
98
98
|
SecurityAnalysisParametersForm,
|
|
99
99
|
{
|
|
100
100
|
securityAnalysisMethods,
|
|
101
|
-
fetchContingencyCount,
|
|
102
101
|
showContingencyCount: true,
|
|
102
|
+
fetchContingencyCount,
|
|
103
|
+
isBuiltCurrentNode,
|
|
103
104
|
isDeveloperMode,
|
|
104
105
|
renderActions: () => {
|
|
105
106
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
package/dist/components/parameters/security-analysis/use-security-analysis-parameters-form.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { UseFormReturn } from 'react-hook-form';
|
|
2
2
|
import { ObjectSchema } from 'yup';
|
|
3
|
-
import { Dispatch, SetStateAction } from 'react';
|
|
4
3
|
import { UUID } from 'node:crypto';
|
|
5
4
|
import { UseParametersBackendReturnProps } from '../../../utils';
|
|
6
5
|
import { ComputingType, ILimitReductionsByVoltageLevel } from '../common';
|
|
@@ -16,8 +15,7 @@ export interface UseSecurityAnalysisParametersFormReturn {
|
|
|
16
15
|
toFormValueSaParameters: (_params: SAParameters) => any;
|
|
17
16
|
formatNewParams: (formData: Record<string, any>) => SAParameters;
|
|
18
17
|
params: SAParameters | null;
|
|
19
|
-
|
|
20
|
-
setCurrentProvider: Dispatch<SetStateAction<string | undefined>>;
|
|
18
|
+
watchProvider: string | undefined;
|
|
21
19
|
paramsLoaded: boolean;
|
|
22
20
|
onSaveInline: (formData: Record<string, any>) => void;
|
|
23
21
|
onSaveDialog: (formData: Record<string, any>) => void;
|