@gridsuite/commons-ui 0.246.0 → 0.247.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/composite/filter/expert/expertFilterConstants.js +12 -0
- package/dist/components/index.js +2 -0
- package/dist/components/ui/index.js +2 -0
- package/dist/components/ui/reactHookForm/index.js +2 -0
- package/dist/components/ui/reactHookForm/utils/CancelButton.d.ts +1 -1
- package/dist/components/ui/reactHookForm/utils/CancelButton.js +3 -4
- package/dist/components/ui/reactHookForm/utils/CloseButton.d.ts +2 -0
- package/dist/components/ui/reactHookForm/utils/CloseButton.js +9 -0
- package/dist/components/ui/reactHookForm/utils/index.d.ts +1 -0
- package/dist/components/ui/reactHookForm/utils/index.js +2 -0
- package/dist/features/index.js +2 -1
- package/dist/features/parameters/common/constants.d.ts +1 -0
- package/dist/features/parameters/common/constants.js +2 -0
- package/dist/features/parameters/common/index.js +2 -1
- package/dist/features/parameters/common/parameter-field.d.ts +2 -1
- package/dist/features/parameters/common/parameter-field.js +25 -6
- package/dist/features/parameters/index.js +2 -1
- package/dist/features/parameters/loadflow/load-flow-advanced-parameters.d.ts +5 -0
- package/dist/features/parameters/loadflow/load-flow-advanced-parameters.js +111 -0
- package/dist/features/parameters/loadflow/load-flow-general-parameters.d.ts +7 -6
- package/dist/features/parameters/loadflow/load-flow-general-parameters.js +8 -93
- package/dist/features/parameters/loadflow/load-flow-parameters-content.d.ts +1 -1
- package/dist/features/parameters/loadflow/load-flow-parameters-content.js +6 -2
- package/dist/features/parameters/loadflow/load-flow-parameters-form.js +2 -1
- package/dist/features/parameters/loadflow/load-flow-parameters-header.d.ts +2 -1
- package/dist/features/parameters/loadflow/load-flow-parameters-header.js +21 -1
- package/dist/features/parameters/loadflow/load-flow-parameters-type.d.ts +2 -1
- package/dist/features/parameters/loadflow/load-flow-parameters-utils.d.ts +22 -8
- package/dist/features/parameters/loadflow/load-flow-parameters-utils.js +39 -5
- package/dist/features/parameters/loadflow/load-flow-provider-specific-parameters.d.ts +7 -0
- package/dist/features/parameters/loadflow/load-flow-provider-specific-parameters.js +47 -0
- package/dist/features/parameters/loadflow/use-load-flow-parameters-form.js +28 -6
- package/dist/features/parameters/security-analysis/security-analysis-parameters-selector.js +1 -0
- package/dist/features/process-configs/security-analysis/update-sa-process-config.js +1 -0
- package/dist/features/topBar/AboutDialog.js +3 -2
- package/dist/features/topBar/UserInformationDialog.js +2 -2
- package/dist/features/topBar/UserSettingsDialog.js +3 -2
- package/dist/index.js +4 -1
- package/dist/translations/en/commonButtonEn.d.ts +1 -0
- package/dist/translations/en/commonButtonEn.js +1 -0
- package/dist/translations/en/parameters.d.ts +3 -2
- package/dist/translations/en/parameters.js +4 -3
- package/dist/translations/en/topBarEn.d.ts +0 -1
- package/dist/translations/en/topBarEn.js +1 -2
- package/dist/translations/fr/commonButtonFr.d.ts +1 -0
- package/dist/translations/fr/commonButtonFr.js +1 -0
- package/dist/translations/fr/parameters.d.ts +3 -2
- package/dist/translations/fr/parameters.js +4 -3
- package/dist/translations/fr/topBarFr.d.ts +0 -1
- package/dist/translations/fr/topBarFr.js +1 -2
- package/dist/utils/types/equipmentType.js +7 -0
- package/dist/utils/types/parameters.type.d.ts +1 -0
- package/package.json +1 -1
|
@@ -43,7 +43,8 @@ function LoadFlowParametersHeader({
|
|
|
43
43
|
selectedTab,
|
|
44
44
|
handleTabChange,
|
|
45
45
|
tabIndexesWithError,
|
|
46
|
-
formattedProviders
|
|
46
|
+
formattedProviders,
|
|
47
|
+
disableSpecificProviderParams
|
|
47
48
|
}) {
|
|
48
49
|
return /* @__PURE__ */ jsxs(Stack, { children: [
|
|
49
50
|
/* @__PURE__ */ jsx(ProviderParam, { options: formattedProviders, id: "Lf" }),
|
|
@@ -65,6 +66,25 @@ function LoadFlowParametersHeader({
|
|
|
65
66
|
sx: getTabStyle(tabIndexesWithError, TabValues.LIMIT_REDUCTIONS),
|
|
66
67
|
"data-testid": "LfLimitReductionsTab"
|
|
67
68
|
}
|
|
69
|
+
),
|
|
70
|
+
/* @__PURE__ */ jsx(
|
|
71
|
+
Tab,
|
|
72
|
+
{
|
|
73
|
+
label: /* @__PURE__ */ jsx(FormattedMessage, { id: TabValues.ADVANCED }),
|
|
74
|
+
value: TabValues.ADVANCED,
|
|
75
|
+
sx: getTabStyle(tabIndexesWithError, TabValues.ADVANCED),
|
|
76
|
+
"data-testid": "LfAdvancedTab"
|
|
77
|
+
}
|
|
78
|
+
),
|
|
79
|
+
/* @__PURE__ */ jsx(
|
|
80
|
+
Tab,
|
|
81
|
+
{
|
|
82
|
+
label: /* @__PURE__ */ jsx(FormattedMessage, { id: TabValues.PROVIDER_SPECIFIC }),
|
|
83
|
+
value: TabValues.PROVIDER_SPECIFIC,
|
|
84
|
+
sx: getTabStyle(tabIndexesWithError, TabValues.PROVIDER_SPECIFIC),
|
|
85
|
+
"data-testid": "LfProviderSpecificTab",
|
|
86
|
+
disabled: disableSpecificProviderParams
|
|
87
|
+
}
|
|
68
88
|
)
|
|
69
89
|
] })
|
|
70
90
|
] });
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { UUID } from 'node:crypto';
|
|
2
2
|
import { ILimitReductionsByVoltageLevel } from '../common';
|
|
3
3
|
import { SpecificParametersPerProvider } from '../../../utils';
|
|
4
|
+
export type ParameterValue = boolean | string | string[] | number;
|
|
4
5
|
export interface LoadFlowParametersInfos {
|
|
5
6
|
uuid?: UUID;
|
|
6
7
|
provider: string;
|
|
7
8
|
limitReduction: number;
|
|
8
|
-
commonParameters: Record<string,
|
|
9
|
+
commonParameters: Record<string, ParameterValue>;
|
|
9
10
|
specificParametersPerProvider: SpecificParametersPerProvider;
|
|
10
11
|
limitReductions: ILimitReductionsByVoltageLevel[];
|
|
11
12
|
}
|
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import { UseFormReturn } from 'react-hook-form';
|
|
2
2
|
import { ILimitReductionsByVoltageLevel } from '../common';
|
|
3
|
+
import { ParameterValue } from './load-flow-parameters-type';
|
|
3
4
|
import * as yup from 'yup';
|
|
4
5
|
export declare enum TabValues {
|
|
5
6
|
GENERAL = "General",
|
|
7
|
+
ADVANCED = "Advanced",
|
|
8
|
+
PROVIDER_SPECIFIC = "ProviderSpecific",
|
|
6
9
|
LIMIT_REDUCTIONS = "LimitReductions"
|
|
7
10
|
}
|
|
8
11
|
export declare const getBasicLoadFlowParametersFormSchema: () => yup.ObjectSchema<{
|
|
@@ -20,7 +23,7 @@ export declare const getBasicLoadFlowParametersFormSchema: () => yup.ObjectSchem
|
|
|
20
23
|
componentMode: undefined;
|
|
21
24
|
hvdcAcEmulation: undefined;
|
|
22
25
|
}, "">;
|
|
23
|
-
export declare const
|
|
26
|
+
export declare const getAdvancedLoadFlowParametersFormSchemaFields: () => yup.ObjectSchema<{
|
|
24
27
|
voltageInitMode: string;
|
|
25
28
|
useReactiveLimits: NonNullable<boolean | undefined>;
|
|
26
29
|
twtSplitShuntAdmittance: NonNullable<boolean | undefined>;
|
|
@@ -49,6 +52,19 @@ export declare const getCommonLoadFlowParametersFormSchema: () => yup.ObjectSche
|
|
|
49
52
|
countriesToBalance?: unknown;
|
|
50
53
|
componentMode?: unknown;
|
|
51
54
|
hvdcAcEmulation?: unknown;
|
|
55
|
+
};
|
|
56
|
+
}, yup.AnyObject, {
|
|
57
|
+
commonParameters: {
|
|
58
|
+
phaseShifterRegulationOn: undefined;
|
|
59
|
+
dc: undefined;
|
|
60
|
+
balanceType: undefined;
|
|
61
|
+
countriesToBalance: undefined;
|
|
62
|
+
componentMode: undefined;
|
|
63
|
+
hvdcAcEmulation: undefined;
|
|
64
|
+
};
|
|
65
|
+
}, "">;
|
|
66
|
+
export declare const getAdvancedLoadFlowParametersFormSchema: () => yup.ObjectSchema<{
|
|
67
|
+
advancedParameters: {
|
|
52
68
|
voltageInitMode?: unknown;
|
|
53
69
|
useReactiveLimits?: unknown;
|
|
54
70
|
twtSplitShuntAdmittance?: unknown;
|
|
@@ -60,7 +76,7 @@ export declare const getCommonLoadFlowParametersFormSchema: () => yup.ObjectSche
|
|
|
60
76
|
dcPowerFactor?: unknown;
|
|
61
77
|
};
|
|
62
78
|
}, yup.AnyObject, {
|
|
63
|
-
|
|
79
|
+
advancedParameters: {
|
|
64
80
|
voltageInitMode: undefined;
|
|
65
81
|
useReactiveLimits: undefined;
|
|
66
82
|
twtSplitShuntAdmittance: undefined;
|
|
@@ -70,13 +86,11 @@ export declare const getCommonLoadFlowParametersFormSchema: () => yup.ObjectSche
|
|
|
70
86
|
shuntCompensatorVoltageControlOn: undefined;
|
|
71
87
|
dcUseTransformerRatio: undefined;
|
|
72
88
|
dcPowerFactor: undefined;
|
|
73
|
-
phaseShifterRegulationOn: undefined;
|
|
74
|
-
dc: undefined;
|
|
75
|
-
balanceType: undefined;
|
|
76
|
-
countriesToBalance: undefined;
|
|
77
|
-
componentMode: undefined;
|
|
78
|
-
hvdcAcEmulation: undefined;
|
|
79
89
|
};
|
|
80
90
|
}, "">;
|
|
81
91
|
export declare const setLimitReductions: (provider: string, defaultLimitReductions: ILimitReductionsByVoltageLevel[], formMethods: UseFormReturn) => void;
|
|
82
92
|
export declare const mapLimitReductions: (vlLimits: ILimitReductionsByVoltageLevel, formLimits: Record<string, unknown>[], indexVl: number) => ILimitReductionsByVoltageLevel;
|
|
93
|
+
export declare function splitCommonParameters(commonParameters?: Record<string, ParameterValue>): {
|
|
94
|
+
advancedParameters: Record<string, ParameterValue>;
|
|
95
|
+
commonParameters: Record<string, ParameterValue>;
|
|
96
|
+
};
|
|
@@ -30,7 +30,7 @@ import "mui-nested-menu";
|
|
|
30
30
|
import "react-resizable-panels";
|
|
31
31
|
import "react-papaparse";
|
|
32
32
|
import "../common/parameter-layout/parameter-layout-provider.js";
|
|
33
|
-
import { COMMON_PARAMETERS } from "../common/constants.js";
|
|
33
|
+
import { ADVANCED_PARAMETERS, COMMON_PARAMETERS } from "../common/constants.js";
|
|
34
34
|
import "../common/widget/parameter-line-slider.js";
|
|
35
35
|
import { IST_FORM, LIMIT_DURATION_FORM, LIMIT_REDUCTIONS_FORM, toFormValuesLimitReductions } from "../common/limitreductions/columns-definitions.js";
|
|
36
36
|
import "../common/contingency-table/contingency-table.js";
|
|
@@ -38,8 +38,11 @@ import "../common/contingency-table/columns-definitions.js";
|
|
|
38
38
|
import "@hookform/resolvers/yup";
|
|
39
39
|
import "../../../components/composite/filter/HeaderFilterForm.js";
|
|
40
40
|
import { DC_POWER_FACTOR, DC_USE_TRANSFORMER_RATIO, SHUNT_COMPENSATOR_VOLTAGE_CONTROL_ON, DISTRIBUTED_SLACK, WRITE_SLACK_BUS, READ_SLACK_BUS, TWT_SPLIT_SHUNT_ADMITTANCE, USE_REACTIVE_LIMITS, VOLTAGE_INIT_MODE, HVDC_AC_EMULATION, CONNECTED_MODE, COUNTRIES_TO_BALANCE, BALANCE_TYPE, DC, PHASE_SHIFTER_REGULATION_ON, PARAM_PROVIDER_OPENLOADFLOW, PARAM_LIMIT_REDUCTION, DEFAULT_LIMIT_REDUCTION_VALUE } from "./constants.js";
|
|
41
|
+
import { advancedParams } from "./load-flow-advanced-parameters.js";
|
|
41
42
|
var TabValues = /* @__PURE__ */ ((TabValues2) => {
|
|
42
43
|
TabValues2["GENERAL"] = "General";
|
|
44
|
+
TabValues2["ADVANCED"] = "Advanced";
|
|
45
|
+
TabValues2["PROVIDER_SPECIFIC"] = "ProviderSpecific";
|
|
43
46
|
TabValues2["LIMIT_REDUCTIONS"] = "LimitReductions";
|
|
44
47
|
return TabValues2;
|
|
45
48
|
})(TabValues || {});
|
|
@@ -53,7 +56,7 @@ const getBasicLoadFlowParametersFormSchema = () => {
|
|
|
53
56
|
[HVDC_AC_EMULATION]: yup.boolean().required()
|
|
54
57
|
});
|
|
55
58
|
};
|
|
56
|
-
const
|
|
59
|
+
const getAdvancedLoadFlowParametersFormSchemaFields = () => {
|
|
57
60
|
return yup.object().shape({
|
|
58
61
|
[VOLTAGE_INIT_MODE]: yup.string().required(),
|
|
59
62
|
[USE_REACTIVE_LIMITS]: yup.boolean().required(),
|
|
@@ -69,8 +72,14 @@ const getAdvancedLoadFlowParametersFormSchema = () => {
|
|
|
69
72
|
const getCommonLoadFlowParametersFormSchema = () => {
|
|
70
73
|
return yup.object().shape({
|
|
71
74
|
[COMMON_PARAMETERS]: yup.object().shape({
|
|
72
|
-
...getBasicLoadFlowParametersFormSchema().fields
|
|
73
|
-
|
|
75
|
+
...getBasicLoadFlowParametersFormSchema().fields
|
|
76
|
+
})
|
|
77
|
+
});
|
|
78
|
+
};
|
|
79
|
+
const getAdvancedLoadFlowParametersFormSchema = () => {
|
|
80
|
+
return yup.object().shape({
|
|
81
|
+
[ADVANCED_PARAMETERS]: yup.object().shape({
|
|
82
|
+
...getAdvancedLoadFlowParametersFormSchemaFields().fields
|
|
74
83
|
})
|
|
75
84
|
});
|
|
76
85
|
};
|
|
@@ -100,11 +109,36 @@ const mapLimitReductions = (vlLimits, formLimits, indexVl) => {
|
|
|
100
109
|
});
|
|
101
110
|
return vlLNewLimits;
|
|
102
111
|
};
|
|
112
|
+
function splitCommonParameters(commonParameters) {
|
|
113
|
+
if (!commonParameters) {
|
|
114
|
+
return {
|
|
115
|
+
advancedParameters: {},
|
|
116
|
+
commonParameters: {}
|
|
117
|
+
};
|
|
118
|
+
}
|
|
119
|
+
const advancedParamNames = new Set(advancedParams.map((param) => param.name));
|
|
120
|
+
return Object.entries(commonParameters).reduce(
|
|
121
|
+
(acc, [key, value]) => {
|
|
122
|
+
if (advancedParamNames.has(key)) {
|
|
123
|
+
acc.advancedParameters[key] = value;
|
|
124
|
+
} else {
|
|
125
|
+
acc.commonParameters[key] = value;
|
|
126
|
+
}
|
|
127
|
+
return acc;
|
|
128
|
+
},
|
|
129
|
+
{
|
|
130
|
+
advancedParameters: {},
|
|
131
|
+
commonParameters: {}
|
|
132
|
+
}
|
|
133
|
+
);
|
|
134
|
+
}
|
|
103
135
|
export {
|
|
104
136
|
TabValues,
|
|
105
137
|
getAdvancedLoadFlowParametersFormSchema,
|
|
138
|
+
getAdvancedLoadFlowParametersFormSchemaFields,
|
|
106
139
|
getBasicLoadFlowParametersFormSchema,
|
|
107
140
|
getCommonLoadFlowParametersFormSchema,
|
|
108
141
|
mapLimitReductions,
|
|
109
|
-
setLimitReductions
|
|
142
|
+
setLimitReductions,
|
|
143
|
+
splitCommonParameters
|
|
110
144
|
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { SpecificParameterInfos } from '../../../utils';
|
|
2
|
+
interface LoadFlowProviderSpecificParametersProps {
|
|
3
|
+
specificParameters?: SpecificParameterInfos[];
|
|
4
|
+
}
|
|
5
|
+
declare function LoadFlowProviderSpecificParameters({ specificParameters }: Readonly<LoadFlowProviderSpecificParametersProps>): import("react").JSX.Element;
|
|
6
|
+
declare const _default: import('react').MemoExoticComponent<typeof LoadFlowProviderSpecificParameters>;
|
|
7
|
+
export default _default;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { jsx, Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { memo, createElement } from "react";
|
|
3
|
+
import ParameterField from "../common/parameter-field.js";
|
|
4
|
+
import "@mui/material";
|
|
5
|
+
import "@mui/icons-material";
|
|
6
|
+
import "react-intl";
|
|
7
|
+
import "../../../components/ui/overflowableText/OverflowableText.js";
|
|
8
|
+
import "../../../utils/conversionUtils.js";
|
|
9
|
+
import "../../../utils/types/equipmentType.js";
|
|
10
|
+
import "react-hook-form";
|
|
11
|
+
import "localized-countries";
|
|
12
|
+
import "localized-countries/data/fr";
|
|
13
|
+
import "localized-countries/data/en";
|
|
14
|
+
import "notistack";
|
|
15
|
+
import "../../../components/ui/reactHookForm/provider/CustomFormProvider.js";
|
|
16
|
+
import "yup";
|
|
17
|
+
import "../../../components/ui/treeViewFinder/TreeViewFinder.js";
|
|
18
|
+
import "../../../components/ui/reactHookForm/numbers/RangeInput.js";
|
|
19
|
+
import "@material-symbols/svg-400/outlined/left_panel_open.svg?react";
|
|
20
|
+
import "@material-symbols/svg-400/outlined/arrows_output.svg?react";
|
|
21
|
+
import "@material-symbols/svg-400/outlined/arrows_input.svg?react";
|
|
22
|
+
import "@material-symbols/svg-400/outlined/left_panel_close.svg?react";
|
|
23
|
+
import "@material-symbols/svg-400/outlined/add_notes.svg?react";
|
|
24
|
+
import "../../../components/ui/dialogs/descriptionModificationDialog/DescriptionModificationDialog.js";
|
|
25
|
+
import "../../../components/ui/reactHookForm/expandableInput/ExpandableInput.js";
|
|
26
|
+
import "../../../components/ui/reactHookForm/directory-item-input/directory-item-utils.js";
|
|
27
|
+
import "@hello-pangea/dnd";
|
|
28
|
+
import "../../../components/ui/dialogs/elementSaveDialog/ElementSaveDialog.js";
|
|
29
|
+
import "../../../components/ui/snackbarProvider/SnackbarProvider.js";
|
|
30
|
+
import "mui-nested-menu";
|
|
31
|
+
import "react-resizable-panels";
|
|
32
|
+
import "react-papaparse";
|
|
33
|
+
import "../common/parameter-layout/parameter-layout-provider.js";
|
|
34
|
+
import { SPECIFIC_PARAMETERS } from "../common/constants.js";
|
|
35
|
+
import "../common/widget/parameter-line-slider.js";
|
|
36
|
+
import "../common/limitreductions/columns-definitions.js";
|
|
37
|
+
import "../common/contingency-table/contingency-table.js";
|
|
38
|
+
import "../common/contingency-table/columns-definitions.js";
|
|
39
|
+
import "@hookform/resolvers/yup";
|
|
40
|
+
import "../../../components/composite/filter/HeaderFilterForm.js";
|
|
41
|
+
function LoadFlowProviderSpecificParameters({ specificParameters }) {
|
|
42
|
+
return /* @__PURE__ */ jsx(Fragment, { children: specificParameters?.map((item) => /* @__PURE__ */ createElement(ParameterField, { id: SPECIFIC_PARAMETERS, ...item, key: item.name })) });
|
|
43
|
+
}
|
|
44
|
+
const LoadFlowProviderSpecificParameters$1 = memo(LoadFlowProviderSpecificParameters);
|
|
45
|
+
export {
|
|
46
|
+
LoadFlowProviderSpecificParameters$1 as default
|
|
47
|
+
};
|
|
@@ -2,7 +2,7 @@ import { useForm } from "react-hook-form";
|
|
|
2
2
|
import { yupResolver } from "@hookform/resolvers/yup";
|
|
3
3
|
import { useState, useRef, useCallback, useMemo, useEffect, useEffectEvent } from "react";
|
|
4
4
|
import * as yup from "yup";
|
|
5
|
-
import { TabValues, getCommonLoadFlowParametersFormSchema, mapLimitReductions, setLimitReductions } from "./load-flow-parameters-utils.js";
|
|
5
|
+
import { TabValues, getAdvancedLoadFlowParametersFormSchema, getCommonLoadFlowParametersFormSchema, splitCommonParameters, mapLimitReductions, setLimitReductions } from "./load-flow-parameters-utils.js";
|
|
6
6
|
import "react/jsx-runtime";
|
|
7
7
|
import "@mui/material";
|
|
8
8
|
import "@mui/icons-material";
|
|
@@ -36,7 +36,7 @@ import "mui-nested-menu";
|
|
|
36
36
|
import "react-resizable-panels";
|
|
37
37
|
import "react-papaparse";
|
|
38
38
|
import "../common/parameter-layout/parameter-layout-provider.js";
|
|
39
|
-
import { PROVIDER, SPECIFIC_PARAMETERS, COMMON_PARAMETERS, VERSION_PARAMETER } from "../common/constants.js";
|
|
39
|
+
import { PROVIDER, SPECIFIC_PARAMETERS, ADVANCED_PARAMETERS, COMMON_PARAMETERS, VERSION_PARAMETER } from "../common/constants.js";
|
|
40
40
|
import "../common/widget/parameter-line-slider.js";
|
|
41
41
|
import { getLimitReductionsFormSchema, LIMIT_REDUCTIONS_FORM, toFormValuesLimitReductions } from "../common/limitreductions/columns-definitions.js";
|
|
42
42
|
import "../common/contingency-table/contingency-table.js";
|
|
@@ -66,17 +66,25 @@ const useLoadFlowParametersForm = (parametersBackend, isDeveloperMode, parameter
|
|
|
66
66
|
[PROVIDER]: yup.string().required(),
|
|
67
67
|
[PARAM_LIMIT_REDUCTION]: yup.number().nullable(),
|
|
68
68
|
...getCommonLoadFlowParametersFormSchema().fields,
|
|
69
|
+
...getAdvancedLoadFlowParametersFormSchema().fields,
|
|
69
70
|
...getLimitReductionsFormSchema(limitReductionNumber).fields,
|
|
70
71
|
...getSpecificParametersFormSchema(specificParametersDescriptionForProvider).fields
|
|
71
72
|
}).concat(getNameElementEditorSchema(name));
|
|
72
73
|
}, [name, limitReductionNumber, specificParametersDescriptionForProvider]);
|
|
74
|
+
const { advancedParameters, commonParameters } = useMemo(
|
|
75
|
+
() => splitCommonParameters(params?.commonParameters),
|
|
76
|
+
[params?.commonParameters]
|
|
77
|
+
);
|
|
73
78
|
const formMethods = useForm({
|
|
74
79
|
defaultValues: {
|
|
75
80
|
...getNameElementEditorEmptyFormData(name, description),
|
|
76
81
|
[PROVIDER]: params?.provider,
|
|
77
82
|
[PARAM_LIMIT_REDUCTION]: null,
|
|
78
83
|
[COMMON_PARAMETERS]: {
|
|
79
|
-
...
|
|
84
|
+
...commonParameters
|
|
85
|
+
},
|
|
86
|
+
[ADVANCED_PARAMETERS]: {
|
|
87
|
+
...advancedParameters
|
|
80
88
|
},
|
|
81
89
|
[SPECIFIC_PARAMETERS]: {
|
|
82
90
|
...specificParametersDefaultValues
|
|
@@ -122,7 +130,8 @@ const useLoadFlowParametersForm = (parametersBackend, isDeveloperMode, parameter
|
|
|
122
130
|
commonParameters: {
|
|
123
131
|
[VERSION_PARAMETER]: formData[COMMON_PARAMETERS][VERSION_PARAMETER],
|
|
124
132
|
// PowSyBl requires that "version" appears first
|
|
125
|
-
...formData[COMMON_PARAMETERS]
|
|
133
|
+
...formData[COMMON_PARAMETERS],
|
|
134
|
+
...formData[ADVANCED_PARAMETERS]
|
|
126
135
|
},
|
|
127
136
|
specificParametersPerProvider: specificParametersDefaultValues ? {
|
|
128
137
|
[formData.provider]: getAllSpecificParametersValues(
|
|
@@ -139,11 +148,17 @@ const useLoadFlowParametersForm = (parametersBackend, isDeveloperMode, parameter
|
|
|
139
148
|
(_params) => {
|
|
140
149
|
const specificParamsListForCurrentProvider = _params.specificParametersPerProvider[_params.provider];
|
|
141
150
|
const specificParametersForLoadedProvider = specificParamsDescription?.[_params.provider] ?? [];
|
|
151
|
+
const { advancedParameters: advancedParams, commonParameters: commonParams } = splitCommonParameters(
|
|
152
|
+
_params.commonParameters
|
|
153
|
+
);
|
|
142
154
|
return {
|
|
143
155
|
[PROVIDER]: _params.provider,
|
|
144
156
|
[PARAM_LIMIT_REDUCTION]: _params.limitReduction,
|
|
145
157
|
[COMMON_PARAMETERS]: {
|
|
146
|
-
...
|
|
158
|
+
...commonParams
|
|
159
|
+
},
|
|
160
|
+
[ADVANCED_PARAMETERS]: {
|
|
161
|
+
...advancedParams
|
|
147
162
|
},
|
|
148
163
|
[SPECIFIC_PARAMETERS]: {
|
|
149
164
|
...formatSpecificParameters(
|
|
@@ -166,12 +181,19 @@ const useLoadFlowParametersForm = (parametersBackend, isDeveloperMode, parameter
|
|
|
166
181
|
const onValidationError = useCallback(
|
|
167
182
|
(errors) => {
|
|
168
183
|
const tabsInError = [];
|
|
184
|
+
console.log("ERRORS", errors);
|
|
169
185
|
if (errors?.[LIMIT_REDUCTIONS_FORM] && TabValues.LIMIT_REDUCTIONS !== selectedTab) {
|
|
170
186
|
tabsInError.push(TabValues.LIMIT_REDUCTIONS);
|
|
171
187
|
}
|
|
172
|
-
if (
|
|
188
|
+
if (errors?.[COMMON_PARAMETERS] && TabValues.GENERAL !== selectedTab) {
|
|
173
189
|
tabsInError.push(TabValues.GENERAL);
|
|
174
190
|
}
|
|
191
|
+
if (errors?.[SPECIFIC_PARAMETERS] && TabValues.PROVIDER_SPECIFIC !== selectedTab) {
|
|
192
|
+
tabsInError.push(TabValues.PROVIDER_SPECIFIC);
|
|
193
|
+
}
|
|
194
|
+
if (errors?.[ADVANCED_PARAMETERS] && TabValues.ADVANCED !== selectedTab) {
|
|
195
|
+
tabsInError.push(TabValues.ADVANCED);
|
|
196
|
+
}
|
|
175
197
|
setTabIndexesWithError(tabsInError);
|
|
176
198
|
},
|
|
177
199
|
[selectedTab]
|
|
@@ -40,6 +40,7 @@ import "@hookform/resolvers/yup";
|
|
|
40
40
|
import "../../../components/composite/filter/HeaderFilterForm.js";
|
|
41
41
|
import { PARAM_PROVIDER_OPENLOADFLOW } from "../loadflow/constants.js";
|
|
42
42
|
import "../loadflow/load-flow-parameters-context.js";
|
|
43
|
+
import "../loadflow/load-flow-advanced-parameters.js";
|
|
43
44
|
import "../loadflow/load-flow-parameters-content.js";
|
|
44
45
|
import { ViolationsHidingParameters } from "./security-analysis-violations-hiding.js";
|
|
45
46
|
function SecurityAnalysisParametersSelector({
|
|
@@ -42,6 +42,7 @@ import "@hookform/resolvers/yup";
|
|
|
42
42
|
import { NameElementEditorForm } from "../../parameters/common/name-element-editor/name-element-editor-form.js";
|
|
43
43
|
import "../../parameters/network-visualizations/constants.js";
|
|
44
44
|
import "../../parameters/loadflow/load-flow-parameters-context.js";
|
|
45
|
+
import "../../parameters/loadflow/load-flow-advanced-parameters.js";
|
|
45
46
|
import "../../parameters/loadflow/load-flow-parameters-content.js";
|
|
46
47
|
import "../../parameters/short-circuit/short-circuit-parameters-content.js";
|
|
47
48
|
import "react-dom";
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { jsxs, jsx, Fragment } from "react/jsx-runtime";
|
|
2
2
|
import { useState, useEffect, useCallback } from "react";
|
|
3
|
-
import { useTheme, Dialog, DialogTitle, Collapse, Alert, Box, Fade, CircularProgress, Typography, DialogContent, Accordion, AccordionSummary, AccordionDetails, Grid2, DialogActions,
|
|
3
|
+
import { useTheme, Dialog, DialogTitle, Collapse, Alert, Box, Fade, CircularProgress, Typography, DialogContent, Accordion, AccordionSummary, AccordionDetails, Grid2, DialogActions, useMediaQuery, Zoom, Stack, tooltipClasses } from "@mui/material";
|
|
4
4
|
import { LoadingButton } from "@mui/lab";
|
|
5
5
|
import { Refresh, Gavel, ExpandMore, Apps, QuestionMark, DnsOutlined, WidgetsOutlined } from "@mui/icons-material";
|
|
6
6
|
import { FormattedMessage } from "react-intl";
|
|
7
7
|
import { CustomTooltip } from "../../components/ui/tooltip/CustomTooltip.js";
|
|
8
8
|
import { LogoText } from "./GridLogo.js";
|
|
9
9
|
import { mergeSx } from "../../utils/styles.js";
|
|
10
|
+
import { CloseButton } from "../../components/ui/reactHookForm/utils/CloseButton.js";
|
|
10
11
|
const styles = {
|
|
11
12
|
general: {
|
|
12
13
|
".MuiAccordion-root": {
|
|
@@ -336,7 +337,7 @@ function AboutDialog({
|
|
|
336
337
|
) }) })
|
|
337
338
|
] })
|
|
338
339
|
] }) }),
|
|
339
|
-
/* @__PURE__ */ jsx(DialogActions, { children: /* @__PURE__ */ jsx(
|
|
340
|
+
/* @__PURE__ */ jsx(DialogActions, { children: /* @__PURE__ */ jsx(CloseButton, { color: "primary", onClick: handleClose, autoFocus: true }) })
|
|
340
341
|
]
|
|
341
342
|
}
|
|
342
343
|
);
|
|
@@ -2,8 +2,8 @@ import { jsxs, jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import { Dialog, DialogTitle, DialogContent, Grid2, Typography, Box, DialogActions } from "@mui/material";
|
|
3
3
|
import { FormattedMessage } from "react-intl";
|
|
4
4
|
import { useState, useEffect, Fragment } from "react";
|
|
5
|
-
import { CancelButton } from "../../components/ui/reactHookForm/utils/CancelButton.js";
|
|
6
5
|
import { fetchUserDetails } from "../../services/userAdmin.js";
|
|
6
|
+
import { CloseButton } from "../../components/ui/reactHookForm/utils/CloseButton.js";
|
|
7
7
|
const styles = {
|
|
8
8
|
DialogTitle: { fontSize: "1.5rem" },
|
|
9
9
|
DialogContent: { marginTop: "10px" },
|
|
@@ -92,7 +92,7 @@ function UserInformationDialog({ openDialog, userProfile, onClose }) {
|
|
|
92
92
|
] })
|
|
93
93
|
] })
|
|
94
94
|
] }),
|
|
95
|
-
/* @__PURE__ */ jsx(DialogActions, { children: /* @__PURE__ */ jsx(
|
|
95
|
+
/* @__PURE__ */ jsx(DialogActions, { children: /* @__PURE__ */ jsx(CloseButton, { color: "primary", onClick: onClose, autoFocus: true }) })
|
|
96
96
|
] });
|
|
97
97
|
}
|
|
98
98
|
export {
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
2
|
import { useCallback } from "react";
|
|
3
3
|
import { FormattedMessage } from "react-intl";
|
|
4
|
-
import { Dialog, DialogTitle, DialogContent, Box, Switch, Alert, DialogActions
|
|
4
|
+
import { Dialog, DialogTitle, DialogContent, Box, Switch, Alert, DialogActions } from "@mui/material";
|
|
5
|
+
import { CloseButton } from "../../components/ui/reactHookForm/utils/CloseButton.js";
|
|
5
6
|
const styles = {
|
|
6
7
|
parameterName: (theme) => ({
|
|
7
8
|
fontWeight: "bold",
|
|
@@ -43,7 +44,7 @@ function UserSettingsDialog({ openDialog, onClose, developerMode, onDeveloperMod
|
|
|
43
44
|
] }),
|
|
44
45
|
developerMode && /* @__PURE__ */ jsx(Alert, { severity: "warning", children: /* @__PURE__ */ jsx(FormattedMessage, { id: "user-settings-dialog/warning-developer-mode" }) })
|
|
45
46
|
] }),
|
|
46
|
-
/* @__PURE__ */ jsx(DialogActions, { children: /* @__PURE__ */ jsx(
|
|
47
|
+
/* @__PURE__ */ jsx(DialogActions, { children: /* @__PURE__ */ jsx(CloseButton, { color: "primary", onClick: handleClose, autoFocus: true }) })
|
|
47
48
|
] });
|
|
48
49
|
}
|
|
49
50
|
export {
|
package/dist/index.js
CHANGED
|
@@ -37,6 +37,7 @@ import { TextInput } from "./components/ui/reactHookForm/text/TextInput.js";
|
|
|
37
37
|
import { UniqueNameInput } from "./components/ui/reactHookForm/text/UniqueNameInput.js";
|
|
38
38
|
import { DescriptionInput } from "./components/ui/reactHookForm/text/DescriptionInput.js";
|
|
39
39
|
import { CancelButton } from "./components/ui/reactHookForm/utils/CancelButton.js";
|
|
40
|
+
import { CloseButton } from "./components/ui/reactHookForm/utils/CloseButton.js";
|
|
40
41
|
import { FieldLabel } from "./components/ui/reactHookForm/utils/FieldLabel.js";
|
|
41
42
|
import { SubmitButton } from "./components/ui/reactHookForm/utils/SubmitButton.js";
|
|
42
43
|
import { TextFieldWithAdornment } from "./components/ui/reactHookForm/utils/TextFieldWithAdornment.js";
|
|
@@ -178,7 +179,7 @@ import { TopBar } from "./features/topBar/TopBar.js";
|
|
|
178
179
|
import { ParameterLayout } from "./features/parameters/common/parameter-layout/parameter-layout.js";
|
|
179
180
|
import { ParameterLayoutProvider, useParameterLayoutContext } from "./features/parameters/common/parameter-layout/parameter-layout-provider.js";
|
|
180
181
|
import { formatComputingTypeLabel, isValidComputingType } from "./features/parameters/common/computing-type.js";
|
|
181
|
-
import { COMMON_PARAMETERS, CONTINGENCIES, CONTINGENCY_LISTS, CONTINGENCY_LISTS_INFOS, PARAM_SA_FLOW_PROPORTIONAL_THRESHOLD, PARAM_SA_HIGH_VOLTAGE_ABSOLUTE_THRESHOLD, PARAM_SA_HIGH_VOLTAGE_PROPORTIONAL_THRESHOLD, PARAM_SA_LOW_VOLTAGE_ABSOLUTE_THRESHOLD, PARAM_SA_LOW_VOLTAGE_PROPORTIONAL_THRESHOLD, PARAM_SA_PROVIDER, PROVIDER, SPECIFIC_PARAMETERS, VERSION_PARAMETER, VOLTAGE_LEVEL } from "./features/parameters/common/constants.js";
|
|
182
|
+
import { ADVANCED_PARAMETERS, COMMON_PARAMETERS, CONTINGENCIES, CONTINGENCY_LISTS, CONTINGENCY_LISTS_INFOS, PARAM_SA_FLOW_PROPORTIONAL_THRESHOLD, PARAM_SA_HIGH_VOLTAGE_ABSOLUTE_THRESHOLD, PARAM_SA_HIGH_VOLTAGE_PROPORTIONAL_THRESHOLD, PARAM_SA_LOW_VOLTAGE_ABSOLUTE_THRESHOLD, PARAM_SA_LOW_VOLTAGE_PROPORTIONAL_THRESHOLD, PARAM_SA_PROVIDER, PROVIDER, SPECIFIC_PARAMETERS, VERSION_PARAMETER, VOLTAGE_LEVEL } from "./features/parameters/common/constants.js";
|
|
182
183
|
import { LineSeparator } from "./features/parameters/common/line-separator.js";
|
|
183
184
|
import { LabelledButton, SwitchWithLabel, TabPanel } from "./features/parameters/common/parameters.js";
|
|
184
185
|
import { CreateParameterDialog } from "./features/parameters/common/parameters-creation-dialog.js";
|
|
@@ -503,6 +504,7 @@ import { processConfigFr } from "./translations/fr/processConfigFr.js";
|
|
|
503
504
|
export {
|
|
504
505
|
ACCURACY,
|
|
505
506
|
ACTIVE,
|
|
507
|
+
ADVANCED_PARAMETERS,
|
|
506
508
|
ALL_EQUIPMENTS,
|
|
507
509
|
AMPERE,
|
|
508
510
|
APPLICABILITY,
|
|
@@ -586,6 +588,7 @@ export {
|
|
|
586
588
|
CheckboxInput,
|
|
587
589
|
CheckboxNullableInput,
|
|
588
590
|
ChipItemsInput,
|
|
591
|
+
CloseButton,
|
|
589
592
|
ColumnTypes,
|
|
590
593
|
CombinatorSelector,
|
|
591
594
|
CombinatorType,
|
|
@@ -15,8 +15,7 @@ export declare const parametersEn: {
|
|
|
15
15
|
descLfDcValues: string;
|
|
16
16
|
resetToDefault: string;
|
|
17
17
|
resetParamsConfirmation: string;
|
|
18
|
-
|
|
19
|
-
showSpecificParameters: string;
|
|
18
|
+
ProviderSpecific: string;
|
|
20
19
|
save: string;
|
|
21
20
|
saveParameters: string;
|
|
22
21
|
'settings.button.chooseSettings': string;
|
|
@@ -50,6 +49,7 @@ export declare const parametersEn: {
|
|
|
50
49
|
descLfCountries: string;
|
|
51
50
|
descLfAllCountries: string;
|
|
52
51
|
descLfCountriesToBalance: string;
|
|
52
|
+
inputLabelLfCountriesToBalance: string;
|
|
53
53
|
editParameters: string;
|
|
54
54
|
RealPercentage: string;
|
|
55
55
|
General: string;
|
|
@@ -64,6 +64,7 @@ export declare const parametersEn: {
|
|
|
64
64
|
VoltageRangeInterval: string;
|
|
65
65
|
leftOpenBracket: string;
|
|
66
66
|
rightOpenBracket: string;
|
|
67
|
+
Advanced: string;
|
|
67
68
|
Provider: string;
|
|
68
69
|
LimitReduction: string;
|
|
69
70
|
Default: string;
|
|
@@ -9,8 +9,7 @@ const parametersEn = {
|
|
|
9
9
|
descLfDcValues: "DC Values",
|
|
10
10
|
resetToDefault: "Reset All",
|
|
11
11
|
resetParamsConfirmation: "Do you really want to reset these parameters ?",
|
|
12
|
-
|
|
13
|
-
showSpecificParameters: "Specific settings",
|
|
12
|
+
ProviderSpecific: "Provider specific",
|
|
14
13
|
save: "Save",
|
|
15
14
|
saveParameters: "Save parameters",
|
|
16
15
|
"settings.button.chooseSettings": "Choose parameters",
|
|
@@ -43,7 +42,8 @@ const parametersEn = {
|
|
|
43
42
|
descLfBalanceTypeConformLoad: "conform load",
|
|
44
43
|
descLfCountries: "Countries",
|
|
45
44
|
descLfAllCountries: "All countries",
|
|
46
|
-
descLfCountriesToBalance: "
|
|
45
|
+
descLfCountriesToBalance: "Balancing countries",
|
|
46
|
+
inputLabelLfCountriesToBalance: "Countries participating in balancing",
|
|
47
47
|
editParameters: "Edit parameters",
|
|
48
48
|
RealPercentage: "This value must be between 0 and 1",
|
|
49
49
|
General: "General",
|
|
@@ -58,6 +58,7 @@ const parametersEn = {
|
|
|
58
58
|
VoltageRangeInterval: "Voltage interval ({lowBound} kV, {highBound} kV]",
|
|
59
59
|
leftOpenBracket: "(",
|
|
60
60
|
rightOpenBracket: ")",
|
|
61
|
+
Advanced: "Advanced",
|
|
61
62
|
Provider: "Provider",
|
|
62
63
|
LimitReduction: "Limit reduction",
|
|
63
64
|
Default: "Default",
|
|
@@ -48,8 +48,7 @@ const topBarEn = {
|
|
|
48
48
|
"user-information-dialog/number-of-dynamicMargin-per-study": "Number of dynamic margin",
|
|
49
49
|
"user-settings-dialog/title": "User settings",
|
|
50
50
|
"user-settings-dialog/label-developer-mode": "Developer mode",
|
|
51
|
-
"user-settings-dialog/warning-developer-mode": "Some of the features are not complete, so they may not work as expected. To hide these features, disable developer mode."
|
|
52
|
-
"user-settings-dialog/close": "Close"
|
|
51
|
+
"user-settings-dialog/warning-developer-mode": "Some of the features are not complete, so they may not work as expected. To hide these features, disable developer mode."
|
|
53
52
|
};
|
|
54
53
|
export {
|
|
55
54
|
topBarEn
|
|
@@ -15,8 +15,7 @@ export declare const parametersFr: {
|
|
|
15
15
|
descLfDcValues: string;
|
|
16
16
|
resetToDefault: string;
|
|
17
17
|
resetParamsConfirmation: string;
|
|
18
|
-
|
|
19
|
-
showSpecificParameters: string;
|
|
18
|
+
ProviderSpecific: string;
|
|
20
19
|
save: string;
|
|
21
20
|
saveParameters: string;
|
|
22
21
|
'settings.button.chooseSettings': string;
|
|
@@ -50,6 +49,7 @@ export declare const parametersFr: {
|
|
|
50
49
|
descLfCountries: string;
|
|
51
50
|
descLfAllCountries: string;
|
|
52
51
|
descLfCountriesToBalance: string;
|
|
52
|
+
inputLabelLfCountriesToBalance: string;
|
|
53
53
|
editParameters: string;
|
|
54
54
|
RealPercentage: string;
|
|
55
55
|
General: string;
|
|
@@ -64,6 +64,7 @@ export declare const parametersFr: {
|
|
|
64
64
|
VoltageRangeInterval: string;
|
|
65
65
|
leftOpenBracket: string;
|
|
66
66
|
rightOpenBracket: string;
|
|
67
|
+
Advanced: string;
|
|
67
68
|
Provider: string;
|
|
68
69
|
LimitReduction: string;
|
|
69
70
|
Default: string;
|
|
@@ -9,8 +9,7 @@ const parametersFr = {
|
|
|
9
9
|
descLfDcValues: "DC",
|
|
10
10
|
resetToDefault: "Tout réinitialiser ",
|
|
11
11
|
resetParamsConfirmation: "Souhaitez vous réellement réinitialiser ces paramètres ?",
|
|
12
|
-
|
|
13
|
-
showSpecificParameters: "Paramètres spécifiques",
|
|
12
|
+
ProviderSpecific: "Spécifique au simulateur",
|
|
14
13
|
save: "Enregistrer",
|
|
15
14
|
saveParameters: "Enregistrer des paramètres",
|
|
16
15
|
"settings.button.chooseSettings": "Sélectionner",
|
|
@@ -43,7 +42,8 @@ const parametersFr = {
|
|
|
43
42
|
descLfBalanceTypeConformLoad: "part variable de la consommation",
|
|
44
43
|
descLfCountries: "Pays",
|
|
45
44
|
descLfAllCountries: "Tous les pays",
|
|
46
|
-
descLfCountriesToBalance: "Pays
|
|
45
|
+
descLfCountriesToBalance: "Pays réglant",
|
|
46
|
+
inputLabelLfCountriesToBalance: "Pays participant à la compensation",
|
|
47
47
|
editParameters: "Éditer les paramètres",
|
|
48
48
|
RealPercentage: "Cette valeur doit être comprise entre 0 et 1",
|
|
49
49
|
General: "Général",
|
|
@@ -58,6 +58,7 @@ const parametersFr = {
|
|
|
58
58
|
VoltageRangeInterval: "Plage de tension ]{lowBound} kV; {highBound} kV]",
|
|
59
59
|
leftOpenBracket: "]",
|
|
60
60
|
rightOpenBracket: "[",
|
|
61
|
+
Advanced: "Avancés",
|
|
61
62
|
Provider: "Simulateur",
|
|
62
63
|
LimitReduction: "Abattement des seuils",
|
|
63
64
|
Default: "Défaut",
|