@gridsuite/commons-ui 0.133.0 → 0.135.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/README.md +10 -0
- package/dist/components/authentication/utils/authService.js +6 -9
- package/dist/components/checkBoxList/CheckBoxList.js +1 -1
- package/dist/components/checkBoxList/CheckBoxListItem.js +3 -3
- package/dist/components/checkBoxList/CheckBoxListItemContent.js +3 -3
- package/dist/components/checkBoxList/CheckBoxListItems.js +4 -4
- package/dist/components/checkBoxList/DraggableCheckBoxListItem.js +5 -5
- package/dist/components/checkBoxList/DraggableCheckBoxListItemContent.js +1 -1
- package/dist/components/contingencyList/criteriaBased/criteriaBasedUtils.js +7 -7
- package/dist/components/csvDownloader/use-csv-export.js +1 -4
- package/dist/components/customAGGrid/customAggrid.js +2 -2
- package/dist/components/dialogs/customMuiDialog/CustomMuiDialog.js +2 -2
- package/dist/components/dialogs/descriptionModificationDialog/DescriptionModificationDialog.js +1 -2
- package/dist/components/dialogs/elementSaveDialog/ElementSaveDialog.js +6 -6
- package/dist/components/dialogs/elementSaveDialog/utils.js +1 -1
- package/dist/components/dialogs/modifyElementSelection/ModifyElementSelection.js +1 -1
- package/dist/components/directoryItemSelector/DirectoryItemSelector.js +3 -4
- package/dist/components/dnd-table/dnd-table-bottom-right-buttons.js +2 -3
- package/dist/components/dnd-table/dnd-table.js +7 -7
- package/dist/components/elementSearch/elementItem/EquipmentItem.js +6 -7
- package/dist/components/elementSearch/elementSearchDialog/ElementSearchDialog.js +1 -1
- package/dist/components/elementSearch/tagRenderer/TagRenderer.js +3 -4
- package/dist/components/filter/FilterCreationDialog.js +10 -10
- package/dist/components/filter/FilterForm.js +2 -2
- package/dist/components/filter/expert/ExpertFilterEditionDialog.js +1 -2
- package/dist/components/filter/expert/ExpertFilterForm.d.ts +0 -1
- package/dist/components/filter/expert/ExpertFilterForm.js +11 -21
- package/dist/components/filter/expert/expertFilterUtils.js +16 -24
- package/dist/components/filter/expert/index.js +1 -2
- package/dist/components/filter/explicitNaming/ExplicitNamingFilterEditionDialog.js +2 -4
- package/dist/components/filter/explicitNaming/ExplicitNamingFilterForm.js +11 -18
- package/dist/components/filter/index.js +1 -2
- package/dist/components/flatParameters/FlatParameters.js +2 -2
- package/dist/components/index.js +1 -2
- package/dist/components/inputs/SelectClearable.js +1 -1
- package/dist/components/inputs/reactHookForm/DirectoryItemsInput.js +44 -48
- package/dist/components/inputs/reactHookForm/agGridTable/CustomAgGridTable.js +3 -4
- package/dist/components/inputs/reactHookForm/agGridTable/csvUploader/CsvUploader.js +1 -1
- package/dist/components/inputs/reactHookForm/autocompleteInputs/AutocompleteInput.js +4 -4
- package/dist/components/inputs/reactHookForm/chip-items-input.js +3 -3
- package/dist/components/inputs/reactHookForm/errorManagement/ErrorInput.js +1 -2
- package/dist/components/inputs/reactHookForm/numbers/FloatInput.js +1 -1
- package/dist/components/inputs/reactHookForm/numbers/SliderInput.js +1 -1
- package/dist/components/inputs/reactHookForm/selectInputs/InputWithPopupConfirmation.js +2 -2
- package/dist/components/inputs/reactHookForm/selectInputs/SelectInput.js +3 -3
- package/dist/components/inputs/reactHookForm/tableInputs/table-numerical-input.js +4 -4
- package/dist/components/inputs/reactHookForm/tableInputs/table-text-input.js +3 -3
- package/dist/components/inputs/reactHookForm/text/ExpandingTextField.js +2 -2
- package/dist/components/inputs/reactHookForm/text/TextInput.js +5 -5
- package/dist/components/inputs/reactHookForm/text/UniqueNameInput.js +2 -2
- package/dist/components/inputs/reactHookForm/utils/SubmitButton.js +1 -1
- package/dist/components/inputs/reactHookForm/utils/functions.js +2 -3
- package/dist/components/inputs/reactQueryBuilder/OperatorSelector.js +2 -2
- package/dist/components/inputs/reactQueryBuilder/PropertyValueEditor.js +8 -9
- package/dist/components/inputs/reactQueryBuilder/TextValueEditor.js +1 -1
- package/dist/components/inputs/reactQueryBuilder/TranslatedValueEditor.js +1 -1
- package/dist/components/inputs/reactQueryBuilder/ValueEditor.js +2 -3
- package/dist/components/inputs/reactQueryBuilder/compositeRuleEditor/GroupValueEditor.js +12 -15
- package/dist/components/inputs/reactQueryBuilder/compositeRuleEditor/RuleValueEditor.js +3 -4
- package/dist/components/notifications/hooks/useListenerManager.js +2 -4
- package/dist/components/overflowableText/OverflowableText.js +4 -5
- package/dist/components/parameters/common/computing-type.d.ts +2 -1
- package/dist/components/parameters/common/computing-type.js +3 -0
- package/dist/components/parameters/common/limitreductions/columns-definitions.js +1 -1
- package/dist/components/parameters/common/limitreductions/limit-reductions-form-util.js +1 -1
- package/dist/components/parameters/common/widget/parameter-line-slider.js +5 -4
- package/dist/components/parameters/loadflow/load-flow-general-parameters.js +1 -1
- package/dist/components/parameters/loadflow/load-flow-parameters-content.js +1 -1
- package/dist/components/parameters/loadflow/load-flow-parameters-form.js +1 -1
- package/dist/components/parameters/loadflow/load-flow-parameters-utils.js +4 -3
- package/dist/components/parameters/loadflow/use-load-flow-parameters-form.js +34 -20
- package/dist/components/parameters/network-visualizations/map-parameters.js +13 -17
- package/dist/components/parameters/network-visualizations/network-area-diagram-parameters.js +1 -2
- package/dist/components/parameters/network-visualizations/network-visualizations-form.js +2 -2
- package/dist/components/parameters/network-visualizations/single-line-diagram-parameters.js +2 -3
- package/dist/components/parameters/security-analysis/security-analysis-parameters-form.js +2 -3
- package/dist/components/parameters/security-analysis/security-analysis-parameters-selector.js +3 -3
- package/dist/components/parameters/security-analysis/security-analysis-violations-hiding.js +1 -1
- package/dist/components/parameters/security-analysis/use-security-analysis-parameters-form.js +5 -5
- package/dist/components/parameters/sensi/sensitivity-analysis-parameters-form.js +1 -1
- package/dist/components/parameters/sensi/sensitivity-table.js +2 -3
- package/dist/components/parameters/sensi/use-sensitivity-analysis-parameters.js +42 -54
- package/dist/components/parameters/sensi/utils.js +16 -27
- package/dist/components/parameters/short-circuit/short-circuit-parameters-form.js +2 -2
- package/dist/components/parameters/short-circuit/short-circuit-parameters-inline.js +1 -1
- package/dist/components/parameters/voltage-init/use-voltage-init-parameters-form.js +1 -1
- package/dist/components/parameters/voltage-init/voltage-init-form-utils.js +47 -56
- package/dist/components/parameters/voltage-init/voltage-init-parameters-form.js +1 -1
- package/dist/components/parameters/voltage-init/voltage-init-parameters-inline.js +1 -1
- package/dist/components/snackbarProvider/SnackbarProvider.js +1 -4
- package/dist/components/topBar/TopBar.js +33 -36
- package/dist/components/topBar/UserInformationDialog.js +7 -8
- package/dist/components/topBar/UserSettingsDialog.js +1 -1
- package/dist/components/treeViewFinder/TreeViewFinder.js +13 -13
- package/dist/hooks/use-parameters-backend.js +5 -5
- package/dist/hooks/use-unique-name-validation.js +2 -3
- package/dist/hooks/useConfidentialityWarning.js +1 -1
- package/dist/hooks/usePredefinedProperties.js +1 -2
- package/dist/index.js +1 -2
- package/dist/redux/commonStore.js +1 -2
- package/dist/services/utils.js +3 -3
- package/dist/utils/types/equipmentType.js +9 -13
- package/package.json +19 -17
|
@@ -56,20 +56,21 @@ const useLoadFlowParametersForm = (parametersBackend, enableDeveloperMode, param
|
|
|
56
56
|
specificParamsDescriptions,
|
|
57
57
|
defaultLimitReductions
|
|
58
58
|
] = parametersBackend;
|
|
59
|
-
const [currentProvider, setCurrentProvider] = useState(params
|
|
59
|
+
const [currentProvider, setCurrentProvider] = useState(params?.provider);
|
|
60
60
|
const [selectedTab, setSelectedTab] = useState(TabValues.GENERAL);
|
|
61
|
+
const [limitReductionNumber, setLimitReductionNumber] = useState(0);
|
|
61
62
|
const [tabIndexesWithError, setTabIndexesWithError] = useState([]);
|
|
62
63
|
const { snackError } = useSnackMessage();
|
|
63
64
|
const handleTabChange = useCallback((event, newValue) => {
|
|
64
65
|
setSelectedTab(newValue);
|
|
65
66
|
}, []);
|
|
66
67
|
const specificParametersValues = useMemo(() => {
|
|
67
|
-
const specificParams = currentProvider ? specificParamsDescriptions
|
|
68
|
+
const specificParams = currentProvider ? specificParamsDescriptions?.[currentProvider] : void 0;
|
|
68
69
|
return getDefaultSpecificParamsValues(specificParams);
|
|
69
70
|
}, [currentProvider, specificParamsDescriptions]);
|
|
70
71
|
const specificParameters = useMemo(() => {
|
|
71
|
-
const specificParams = currentProvider ? specificParamsDescriptions
|
|
72
|
-
return specificParams
|
|
72
|
+
const specificParams = currentProvider ? specificParamsDescriptions?.[currentProvider] : void 0;
|
|
73
|
+
return specificParams?.map((param) => ({
|
|
73
74
|
name: param.name,
|
|
74
75
|
type: param.type,
|
|
75
76
|
label: param.label,
|
|
@@ -79,24 +80,21 @@ const useLoadFlowParametersForm = (parametersBackend, enableDeveloperMode, param
|
|
|
79
80
|
}));
|
|
80
81
|
}, [currentProvider, specificParamsDescriptions]);
|
|
81
82
|
const formSchema = useMemo(() => {
|
|
82
|
-
var _a;
|
|
83
83
|
return yup.object({
|
|
84
84
|
[PROVIDER]: yup.string().required(),
|
|
85
85
|
[PARAM_LIMIT_REDUCTION]: yup.number().nullable(),
|
|
86
86
|
...getCommonLoadFlowParametersFormSchema().fields,
|
|
87
|
-
...getLimitReductionsFormSchema(
|
|
88
|
-
(params == null ? void 0 : params.limitReductions) ? (_a = params.limitReductions[0]) == null ? void 0 : _a.temporaryLimitReductions.length : 0
|
|
89
|
-
).fields,
|
|
87
|
+
...getLimitReductionsFormSchema(limitReductionNumber).fields,
|
|
90
88
|
...getSpecificLoadFlowParametersFormSchema(specificParameters).fields
|
|
91
89
|
}).concat(getNameElementEditorSchema(name));
|
|
92
|
-
}, [name,
|
|
90
|
+
}, [name, limitReductionNumber, specificParameters]);
|
|
93
91
|
const formMethods = useForm({
|
|
94
92
|
defaultValues: {
|
|
95
93
|
...getNameElementEditorEmptyFormData(name, description),
|
|
96
94
|
[PROVIDER]: provider,
|
|
97
95
|
[PARAM_LIMIT_REDUCTION]: null,
|
|
98
96
|
[COMMON_PARAMETERS]: {
|
|
99
|
-
...params
|
|
97
|
+
...params?.commonParameters
|
|
100
98
|
},
|
|
101
99
|
[SPECIFIC_PARAMETERS]: {
|
|
102
100
|
...specificParametersValues
|
|
@@ -109,22 +107,22 @@ const useLoadFlowParametersForm = (parametersBackend, enableDeveloperMode, param
|
|
|
109
107
|
const watchProvider = watch("provider");
|
|
110
108
|
const toLimitReductions = useCallback(
|
|
111
109
|
(formLimits) => {
|
|
112
|
-
if (
|
|
110
|
+
if (formLimits?.length === 0) {
|
|
113
111
|
return [];
|
|
114
112
|
}
|
|
115
113
|
if (watchProvider === PARAM_PROVIDER_OPENLOADFLOW) {
|
|
116
|
-
if (!
|
|
114
|
+
if (!params?.limitReductions) {
|
|
117
115
|
return defaultLimitReductions.map(
|
|
118
116
|
(vlLimits, indexVl) => mapLimitReductions(vlLimits, formLimits, indexVl)
|
|
119
117
|
);
|
|
120
118
|
}
|
|
121
|
-
return params
|
|
119
|
+
return params?.limitReductions.map(
|
|
122
120
|
(vlLimits, indexVl) => mapLimitReductions(vlLimits, formLimits, indexVl)
|
|
123
121
|
);
|
|
124
122
|
}
|
|
125
123
|
return [];
|
|
126
124
|
},
|
|
127
|
-
[defaultLimitReductions, params
|
|
125
|
+
[defaultLimitReductions, params?.limitReductions, watchProvider]
|
|
128
126
|
);
|
|
129
127
|
const getSpecificParametersPerProvider = (formData, _specificParametersValues) => {
|
|
130
128
|
return Object.keys(formData[SPECIFIC_PARAMETERS]).reduce(
|
|
@@ -157,9 +155,9 @@ const useLoadFlowParametersForm = (parametersBackend, enableDeveloperMode, param
|
|
|
157
155
|
);
|
|
158
156
|
const toLoadFlowFormValues = useCallback(
|
|
159
157
|
(_params) => {
|
|
160
|
-
const specificParams = _params.provider ? specificParamsDescriptions
|
|
158
|
+
const specificParams = _params.provider ? specificParamsDescriptions?.[_params.provider] : void 0;
|
|
161
159
|
const specificParamsPerProvider = _params.specificParametersPerProvider[_params.provider];
|
|
162
|
-
const formatted = specificParams
|
|
160
|
+
const formatted = specificParams?.reduce((acc, param) => {
|
|
163
161
|
if (specificParamsPerProvider && Object.prototype.hasOwnProperty.call(specificParamsPerProvider, param.name)) {
|
|
164
162
|
if (param.type === ParameterType.BOOLEAN) {
|
|
165
163
|
acc[param.name] = specificParamsPerProvider[param.name] === "true";
|
|
@@ -197,10 +195,10 @@ const useLoadFlowParametersForm = (parametersBackend, enableDeveloperMode, param
|
|
|
197
195
|
const onValidationError = useCallback(
|
|
198
196
|
(errors) => {
|
|
199
197
|
const tabsInError = [];
|
|
200
|
-
if (
|
|
198
|
+
if (errors?.[LIMIT_REDUCTIONS_FORM] && TabValues.LIMIT_REDUCTIONS !== selectedTab) {
|
|
201
199
|
tabsInError.push(TabValues.LIMIT_REDUCTIONS);
|
|
202
200
|
}
|
|
203
|
-
if ((
|
|
201
|
+
if ((errors?.[SPECIFIC_PARAMETERS] || errors?.[COMMON_PARAMETERS] || errors?.[PROVIDER]) && TabValues.GENERAL !== selectedTab) {
|
|
204
202
|
tabsInError.push(TabValues.GENERAL);
|
|
205
203
|
}
|
|
206
204
|
setTabIndexesWithError(tabsInError);
|
|
@@ -241,12 +239,28 @@ const useLoadFlowParametersForm = (parametersBackend, enableDeveloperMode, param
|
|
|
241
239
|
reset(toLoadFlowFormValues(params));
|
|
242
240
|
}, [paramsLoaded, params, reset, specificParamsDescriptions, toLoadFlowFormValues]);
|
|
243
241
|
useEffect(() => {
|
|
244
|
-
if (watchProvider !== currentProvider) {
|
|
242
|
+
if (watchProvider && watchProvider !== currentProvider) {
|
|
245
243
|
setCurrentProvider(watchProvider);
|
|
246
244
|
setSpecificParameters(watchProvider, specificParamsDescriptions, formMethods);
|
|
247
245
|
setLimitReductions(watchProvider, defaultLimitReductions, formMethods);
|
|
246
|
+
if (watchProvider === PARAM_PROVIDER_OPENLOADFLOW) {
|
|
247
|
+
if (currentProvider) {
|
|
248
|
+
setLimitReductionNumber(defaultLimitReductions?.at(0)?.temporaryLimitReductions?.length ?? 0);
|
|
249
|
+
} else {
|
|
250
|
+
setLimitReductionNumber(params?.limitReductions?.at(0)?.temporaryLimitReductions?.length ?? 0);
|
|
251
|
+
}
|
|
252
|
+
} else {
|
|
253
|
+
setLimitReductionNumber(0);
|
|
254
|
+
}
|
|
248
255
|
}
|
|
249
|
-
}, [
|
|
256
|
+
}, [
|
|
257
|
+
currentProvider,
|
|
258
|
+
defaultLimitReductions,
|
|
259
|
+
formMethods,
|
|
260
|
+
params?.limitReductions,
|
|
261
|
+
specificParamsDescriptions,
|
|
262
|
+
watchProvider
|
|
263
|
+
]);
|
|
250
264
|
return {
|
|
251
265
|
formMethods,
|
|
252
266
|
formSchema,
|
|
@@ -37,26 +37,22 @@ import "../../inputs/reactQueryBuilder/PropertyValueEditor.js";
|
|
|
37
37
|
import "../common/widget/parameter-line-slider.js";
|
|
38
38
|
import "../common/limitreductions/columns-definitions.js";
|
|
39
39
|
function MapParameters() {
|
|
40
|
-
var _a;
|
|
41
40
|
const lineSwitch = (name, label) => /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
42
41
|
/* @__PURE__ */ jsx(Grid, { item: true, xs: 8, sx: parametersStyles.parameterName, children: /* @__PURE__ */ jsx(FormattedMessage, { id: label }) }),
|
|
43
42
|
/* @__PURE__ */ jsx(Grid, { item: true, container: true, xs: 4, sx: parametersStyles.controlItem, children: /* @__PURE__ */ jsx(SwitchInput, { name: `${NetworkVisualizationTabValues.MAP}.${name}` }) })
|
|
44
43
|
] });
|
|
45
|
-
const lineFlow = (name, label, options) => {
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
{
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
) })
|
|
58
|
-
] });
|
|
59
|
-
};
|
|
44
|
+
const lineFlow = (name, label, options) => /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
45
|
+
/* @__PURE__ */ jsx(Grid, { item: true, xs: 8, sx: parametersStyles.parameterName, children: /* @__PURE__ */ jsx(FormattedMessage, { id: label }) }),
|
|
46
|
+
/* @__PURE__ */ jsx(Grid, { item: true, xs: 4, sx: parametersStyles.controlItem, children: /* @__PURE__ */ jsx(
|
|
47
|
+
MuiSelectInput,
|
|
48
|
+
{
|
|
49
|
+
fullWidth: true,
|
|
50
|
+
name: `${NetworkVisualizationTabValues.MAP}.${name}`,
|
|
51
|
+
size: "small",
|
|
52
|
+
options: Object.values(options)?.map((option) => option)
|
|
53
|
+
}
|
|
54
|
+
) })
|
|
55
|
+
] });
|
|
60
56
|
const mapBaseMap = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
61
57
|
/* @__PURE__ */ jsx(Grid, { item: true, xs: 8, sx: parametersStyles.parameterName, children: /* @__PURE__ */ jsx(FormattedMessage, { id: MAP_BASE_MAP }) }),
|
|
62
58
|
/* @__PURE__ */ jsx(Grid, { item: true, xs: 4, sx: parametersStyles.controlItem, children: /* @__PURE__ */ jsx(
|
|
@@ -65,7 +61,7 @@ function MapParameters() {
|
|
|
65
61
|
fullWidth: true,
|
|
66
62
|
name: `${NetworkVisualizationTabValues.MAP}.${PARAM_MAP_BASEMAP}`,
|
|
67
63
|
size: "small",
|
|
68
|
-
options:
|
|
64
|
+
options: Object.values(INTL_MAP_BASE_MAP_OPTIONS)?.map((option) => option)
|
|
69
65
|
}
|
|
70
66
|
) })
|
|
71
67
|
] });
|
package/dist/components/parameters/network-visualizations/network-area-diagram-parameters.js
CHANGED
|
@@ -31,7 +31,6 @@ import "@react-querybuilder/material";
|
|
|
31
31
|
import "../../inputs/reactQueryBuilder/CustomReactQueryBuilder.js";
|
|
32
32
|
import "../../inputs/reactQueryBuilder/PropertyValueEditor.js";
|
|
33
33
|
function NetworkAreaDiagramParameters() {
|
|
34
|
-
var _a;
|
|
35
34
|
return /* @__PURE__ */ jsxs(
|
|
36
35
|
Grid,
|
|
37
36
|
{
|
|
@@ -48,7 +47,7 @@ function NetworkAreaDiagramParameters() {
|
|
|
48
47
|
fullWidth: true,
|
|
49
48
|
name: `${NetworkVisualizationTabValues.NETWORK_AREA_DIAGRAM}.${PARAM_NAD_POSITIONS_GENERATION_MODE}`,
|
|
50
49
|
size: "small",
|
|
51
|
-
options:
|
|
50
|
+
options: Object.values(NAD_POSITIONS_GENERATION_MODE)?.map((option) => option)
|
|
52
51
|
}
|
|
53
52
|
) })
|
|
54
53
|
]
|
|
@@ -59,7 +59,7 @@ function NetworkVisualizationParametersForm({
|
|
|
59
59
|
const componentLibraries = useGetAvailableComponentLibraries(user);
|
|
60
60
|
const { formMethods, formSchema, selectedTab, handleTabChange, paramsLoading } = networkVisuMethods;
|
|
61
61
|
return /* @__PURE__ */ jsx(CustomFormProvider, { validationSchema: formSchema, ...formMethods, removeOptional: true, children: /* @__PURE__ */ jsxs(Grid, { container: true, direction: "column", children: [
|
|
62
|
-
/* @__PURE__ */ jsx(Grid, { item: true, container: true, direction: "column", children: renderTitleFields
|
|
62
|
+
/* @__PURE__ */ jsx(Grid, { item: true, container: true, direction: "column", children: renderTitleFields?.() }),
|
|
63
63
|
paramsLoading ? /* @__PURE__ */ jsx(LinearProgress, {}) : /* @__PURE__ */ jsxs(Grid, { item: true, container: true, direction: "column", children: [
|
|
64
64
|
/* @__PURE__ */ jsxs(Tabs, { value: selectedTab, variant: "scrollable", onChange: handleTabChange, children: [
|
|
65
65
|
/* @__PURE__ */ jsx(Tab, { label: /* @__PURE__ */ jsx(FormattedMessage, { id: "Map" }), value: NetworkVisualizationTabValues.MAP }),
|
|
@@ -92,7 +92,7 @@ function NetworkVisualizationParametersForm({
|
|
|
92
92
|
position: "absolute",
|
|
93
93
|
bottom: "30px"
|
|
94
94
|
},
|
|
95
|
-
children: renderActions
|
|
95
|
+
children: renderActions?.()
|
|
96
96
|
}
|
|
97
97
|
)
|
|
98
98
|
] }) });
|
|
@@ -37,7 +37,6 @@ import "../common/widget/parameter-line-slider.js";
|
|
|
37
37
|
import "../common/limitreductions/columns-definitions.js";
|
|
38
38
|
import { INTL_SUBSTATION_LAYOUT_OPTIONS, SUBSTATION_LAYOUT, NetworkVisualizationTabValues, PARAM_SUBSTATION_LAYOUT, COMPONENT_LIBRARY, PARAM_COMPONENT_LIBRARY, DIAGONAL_LABEL, PARAM_DIAGONAL_LABEL, CENTER_LABEL, PARAM_CENTER_LABEL } from "./constants.js";
|
|
39
39
|
function SingleLineDiagramParameters({ componentLibraries }) {
|
|
40
|
-
var _a, _b;
|
|
41
40
|
const componentLibsRenderCache = useMemo(
|
|
42
41
|
() => Object.fromEntries(componentLibraries.filter(Boolean).map((libLabel) => [libLabel, libLabel])),
|
|
43
42
|
[componentLibraries]
|
|
@@ -57,7 +56,7 @@ function SingleLineDiagramParameters({ componentLibraries }) {
|
|
|
57
56
|
fullWidth: true,
|
|
58
57
|
name: `${NetworkVisualizationTabValues.SINGLE_LINE_DIAGRAM}.${PARAM_SUBSTATION_LAYOUT}`,
|
|
59
58
|
size: "small",
|
|
60
|
-
options:
|
|
59
|
+
options: Object.values(substationLayoutOptions)?.map((option) => option)
|
|
61
60
|
}
|
|
62
61
|
) })
|
|
63
62
|
] });
|
|
@@ -69,7 +68,7 @@ function SingleLineDiagramParameters({ componentLibraries }) {
|
|
|
69
68
|
fullWidth: true,
|
|
70
69
|
name: `${NetworkVisualizationTabValues.SINGLE_LINE_DIAGRAM}.${PARAM_COMPONENT_LIBRARY}`,
|
|
71
70
|
size: "small",
|
|
72
|
-
options:
|
|
71
|
+
options: Object.values(componentLibsRenderCache)?.map((option) => {
|
|
73
72
|
return { id: option, label: option };
|
|
74
73
|
})
|
|
75
74
|
}
|
|
@@ -55,7 +55,6 @@ function SecurityAnalysisParametersForm({
|
|
|
55
55
|
renderActions,
|
|
56
56
|
enableDeveloperMode
|
|
57
57
|
}) {
|
|
58
|
-
var _a;
|
|
59
58
|
return /* @__PURE__ */ jsx(
|
|
60
59
|
CustomFormProvider,
|
|
61
60
|
{
|
|
@@ -72,7 +71,7 @@ function SecurityAnalysisParametersForm({
|
|
|
72
71
|
width: "100%"
|
|
73
72
|
},
|
|
74
73
|
children: /* @__PURE__ */ jsxs(Box, { sx: styles.securityAnalysisParameters, children: [
|
|
75
|
-
renderTitleFields
|
|
74
|
+
renderTitleFields?.(),
|
|
76
75
|
securityAnalysisMethods.paramsLoaded ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
77
76
|
/* @__PURE__ */ jsxs(
|
|
78
77
|
Grid,
|
|
@@ -118,7 +117,7 @@ function SecurityAnalysisParametersForm({
|
|
|
118
117
|
SecurityAnalysisParametersSelector,
|
|
119
118
|
{
|
|
120
119
|
params: securityAnalysisMethods.params,
|
|
121
|
-
currentProvider:
|
|
120
|
+
currentProvider: securityAnalysisMethods.currentProvider?.trim(),
|
|
122
121
|
enableDeveloperMode,
|
|
123
122
|
defaultLimitReductions: securityAnalysisMethods.defaultLimitReductions
|
|
124
123
|
}
|
package/dist/components/parameters/security-analysis/security-analysis-parameters-selector.js
CHANGED
|
@@ -50,7 +50,7 @@ function SecurityAnalysisParametersSelector({
|
|
|
50
50
|
setTabSelected(newValue);
|
|
51
51
|
}, []);
|
|
52
52
|
const tabValue = useMemo(() => {
|
|
53
|
-
return tabSelected === TabValues.LimitReductions && !
|
|
53
|
+
return tabSelected === TabValues.LimitReductions && !params?.limitReductions ? TabValues.General : tabSelected;
|
|
54
54
|
}, [params, tabSelected]);
|
|
55
55
|
useEffect(() => {
|
|
56
56
|
if (currentProvider !== PARAM_PROVIDER_OPENLOADFLOW) {
|
|
@@ -59,7 +59,7 @@ function SecurityAnalysisParametersSelector({
|
|
|
59
59
|
}, [currentProvider]);
|
|
60
60
|
return /* @__PURE__ */ jsxs(Grid, { sx: { width: "100%" }, children: [
|
|
61
61
|
/* @__PURE__ */ jsx(Tabs, { value: tabValue, onChange: handleTabChange, children: TAB_INFO.filter((t) => enableDeveloperMode || !t.developerModeOnly).map(
|
|
62
|
-
(tab, index) => (tab.label !== TabValues[TabValues.LimitReductions] || currentProvider === PARAM_PROVIDER_OPENLOADFLOW &&
|
|
62
|
+
(tab, index) => (tab.label !== TabValues[TabValues.LimitReductions] || currentProvider === PARAM_PROVIDER_OPENLOADFLOW && params?.limitReductions) && /* @__PURE__ */ jsx(
|
|
63
63
|
Tab,
|
|
64
64
|
{
|
|
65
65
|
label: /* @__PURE__ */ jsx(FormattedMessage, { id: tab.label }),
|
|
@@ -74,7 +74,7 @@ function SecurityAnalysisParametersSelector({
|
|
|
74
74
|
) }),
|
|
75
75
|
TAB_INFO.filter((t) => enableDeveloperMode || !t.developerModeOnly).map((tab, index) => /* @__PURE__ */ jsxs(TabPanel, { value: tabValue, index, children: [
|
|
76
76
|
tabValue === TabValues.General && /* @__PURE__ */ jsx(ViolationsHidingParameters, {}),
|
|
77
|
-
tabValue === TabValues.LimitReductions && currentProvider === PARAM_PROVIDER_OPENLOADFLOW &&
|
|
77
|
+
tabValue === TabValues.LimitReductions && currentProvider === PARAM_PROVIDER_OPENLOADFLOW && params?.limitReductions && /* @__PURE__ */ jsx(Grid, { sx: { width: "100%" }, children: /* @__PURE__ */ jsx(LimitReductionsTableForm, { limits: params?.limitReductions ?? defaultLimitReductions }) })
|
|
78
78
|
] }, tab.label))
|
|
79
79
|
] });
|
|
80
80
|
}
|
|
@@ -128,7 +128,7 @@ function ViolationsHidingParameters() {
|
|
|
128
128
|
}
|
|
129
129
|
)
|
|
130
130
|
] }) }),
|
|
131
|
-
fieldsToShow
|
|
131
|
+
fieldsToShow?.map((item) => {
|
|
132
132
|
return /* @__PURE__ */ jsx(Grid, { item: true, xs: 16, xl: 6.25, children: /* @__PURE__ */ jsx(SecurityAnalysisFields, { ...item }) }, item.label);
|
|
133
133
|
})
|
|
134
134
|
] });
|
package/dist/components/parameters/security-analysis/use-security-analysis-parameters-form.js
CHANGED
|
@@ -41,7 +41,7 @@ import "../../filter/HeaderFilterForm.js";
|
|
|
41
41
|
import { getNameElementEditorEmptyFormData } from "../common/name-element-editor/name-element-editor-utils.js";
|
|
42
42
|
const useSecurityAnalysisParametersForm = (parametersBackend, parametersUuid, name, description) => {
|
|
43
43
|
const [providers, provider, , , , params, , updateParameters, , , defaultLimitReductions] = parametersBackend;
|
|
44
|
-
const [currentProvider, setCurrentProvider] = useState(params
|
|
44
|
+
const [currentProvider, setCurrentProvider] = useState(params?.provider);
|
|
45
45
|
const { snackError } = useSnackMessage();
|
|
46
46
|
const formattedProviders = useMemo(() => {
|
|
47
47
|
return Object.entries(providers).filter(([key]) => !key.includes("DynaFlow")).map(([key, value]) => ({
|
|
@@ -51,8 +51,8 @@ const useSecurityAnalysisParametersForm = (parametersBackend, parametersUuid, na
|
|
|
51
51
|
}, [providers]);
|
|
52
52
|
const paramsLoaded = useMemo(() => !!params && !!currentProvider, [currentProvider, params]);
|
|
53
53
|
const formSchema = useMemo(() => {
|
|
54
|
-
return getSAParametersFromSchema(name, params
|
|
55
|
-
}, [name, params
|
|
54
|
+
return getSAParametersFromSchema(name, params?.limitReductions);
|
|
55
|
+
}, [name, params?.limitReductions]);
|
|
56
56
|
const formMethods = useForm({
|
|
57
57
|
defaultValues: {
|
|
58
58
|
...getNameElementEditorEmptyFormData(name, description),
|
|
@@ -70,7 +70,7 @@ const useSecurityAnalysisParametersForm = (parametersBackend, parametersUuid, na
|
|
|
70
70
|
const watchProvider = watch("provider");
|
|
71
71
|
const toLimitReductions = useCallback(
|
|
72
72
|
(formLimits) => {
|
|
73
|
-
if (!
|
|
73
|
+
if (!params?.limitReductions) {
|
|
74
74
|
return [];
|
|
75
75
|
}
|
|
76
76
|
return params.limitReductions.map((vlLimits, indexVl) => {
|
|
@@ -87,7 +87,7 @@ const useSecurityAnalysisParametersForm = (parametersBackend, parametersUuid, na
|
|
|
87
87
|
return vlLNewLimits;
|
|
88
88
|
});
|
|
89
89
|
},
|
|
90
|
-
[params
|
|
90
|
+
[params?.limitReductions]
|
|
91
91
|
);
|
|
92
92
|
const formatNewParams = useCallback(
|
|
93
93
|
(formData) => {
|
|
@@ -64,7 +64,7 @@ function SensitivityAnalysisParametersForm({
|
|
|
64
64
|
validationSchema: sensitivityAnalysisMethods.formSchema,
|
|
65
65
|
...sensitivityAnalysisMethods.formMethods,
|
|
66
66
|
children: /* @__PURE__ */ jsxs(Box, { sx: styles.sensibilityAnalysisParameters, children: [
|
|
67
|
-
renderTitleFields
|
|
67
|
+
renderTitleFields?.(),
|
|
68
68
|
sensitivityAnalysisMethods.paramsLoaded ? /* @__PURE__ */ jsxs(Box, { sx: mergeSx(parametersStyles.scrollableGrid, { paddingTop: 0, maxHeight: "100%" }), children: [
|
|
69
69
|
/* @__PURE__ */ jsxs(
|
|
70
70
|
Grid,
|
|
@@ -53,11 +53,10 @@ function SensitivityTable({
|
|
|
53
53
|
}, [append, createRows, currentRows.length]);
|
|
54
54
|
const fetchCount = useCallback(
|
|
55
55
|
(providedArrayFormName, index, source) => {
|
|
56
|
-
var _a, _b, _c, _d;
|
|
57
56
|
const row = getValues(providedArrayFormName)[index];
|
|
58
57
|
const isActivated = row[ACTIVATED];
|
|
59
|
-
const hasMonitoredBranches =
|
|
60
|
-
const hasInjections =
|
|
58
|
+
const hasMonitoredBranches = row[MONITORED_BRANCHES]?.length > 0;
|
|
59
|
+
const hasInjections = row[INJECTIONS]?.length > 0 || row[HVDC_LINES]?.length > 0 || row[PSTS]?.length > 0;
|
|
61
60
|
if (source === "switch" && hasMonitoredBranches && hasInjections) {
|
|
62
61
|
if (isActivated) {
|
|
63
62
|
onChangeParams(row, providedArrayFormName, index);
|
|
@@ -115,10 +115,7 @@ const useSensitivityAnalysisParametersForm = ({
|
|
|
115
115
|
const tabToCheck = values[tab];
|
|
116
116
|
if (tabToCheck) {
|
|
117
117
|
const count = tabToCheck.filter((entry) => entry[ACTIVATED]).filter((entry) => entry[MONITORED_BRANCHES].length > 0).filter(
|
|
118
|
-
(entry) =>
|
|
119
|
-
var _a, _b, _c;
|
|
120
|
-
return ((_a = entry[INJECTIONS]) == null ? void 0 : _a.length) > 0 || ((_b = entry[PSTS]) == null ? void 0 : _b.length) > 0 || ((_c = entry[HVDC_LINES]) == null ? void 0 : _c.length) > 0;
|
|
121
|
-
}
|
|
118
|
+
(entry) => entry[INJECTIONS]?.length > 0 || entry[PSTS]?.length > 0 || entry[HVDC_LINES]?.length > 0
|
|
122
119
|
).map((entry) => entry[COUNT]).reduce((a, b) => a + b, 0);
|
|
123
120
|
totalResultCount += count;
|
|
124
121
|
}
|
|
@@ -170,140 +167,134 @@ const useSensitivityAnalysisParametersForm = ({
|
|
|
170
167
|
);
|
|
171
168
|
const fromSensitivityAnalysisParamsDataToFormValues = useCallback(
|
|
172
169
|
(parameters) => {
|
|
173
|
-
var _a, _b, _c, _d, _e;
|
|
174
170
|
const values = {
|
|
175
171
|
[PROVIDER]: parameters[PROVIDER],
|
|
176
172
|
[FLOW_FLOW_SENSITIVITY_VALUE_THRESHOLD]: parameters.flowFlowSensitivityValueThreshold,
|
|
177
173
|
[ANGLE_FLOW_SENSITIVITY_VALUE_THRESHOLD]: parameters.angleFlowSensitivityValueThreshold,
|
|
178
174
|
[FLOW_VOLTAGE_SENSITIVITY_VALUE_THRESHOLD]: parameters.flowVoltageSensitivityValueThreshold,
|
|
179
|
-
[PARAMETER_SENSI_INJECTIONS_SET]:
|
|
180
|
-
var _a2, _b2, _c2;
|
|
175
|
+
[PARAMETER_SENSI_INJECTIONS_SET]: parameters.sensitivityInjectionsSet?.map((sensiInjectionsSet) => {
|
|
181
176
|
return {
|
|
182
|
-
[MONITORED_BRANCHES]:
|
|
177
|
+
[MONITORED_BRANCHES]: sensiInjectionsSet[MONITORED_BRANCHES]?.map((sensiInjection) => {
|
|
183
178
|
return {
|
|
184
179
|
[FieldConstants.ID]: sensiInjection[CONTAINER_ID],
|
|
185
180
|
[FieldConstants.NAME]: sensiInjection[CONTAINER_NAME]
|
|
186
181
|
};
|
|
187
|
-
})
|
|
188
|
-
[INJECTIONS]:
|
|
182
|
+
}) ?? [],
|
|
183
|
+
[INJECTIONS]: sensiInjectionsSet[INJECTIONS]?.map((sensiInjection) => {
|
|
189
184
|
return {
|
|
190
185
|
[FieldConstants.ID]: sensiInjection[CONTAINER_ID],
|
|
191
186
|
[FieldConstants.NAME]: sensiInjection[CONTAINER_NAME]
|
|
192
187
|
};
|
|
193
|
-
})
|
|
188
|
+
}) ?? [],
|
|
194
189
|
[DISTRIBUTION_TYPE]: sensiInjectionsSet[DISTRIBUTION_TYPE],
|
|
195
|
-
[CONTINGENCIES]:
|
|
190
|
+
[CONTINGENCIES]: sensiInjectionsSet[CONTINGENCIES]?.map((sensiInjection) => {
|
|
196
191
|
return {
|
|
197
192
|
[FieldConstants.ID]: sensiInjection[CONTAINER_ID],
|
|
198
193
|
[FieldConstants.NAME]: sensiInjection[CONTAINER_NAME]
|
|
199
194
|
};
|
|
200
|
-
})
|
|
195
|
+
}) ?? [],
|
|
201
196
|
[ACTIVATED]: sensiInjectionsSet[ACTIVATED] ?? false,
|
|
202
197
|
[COUNT]: 0
|
|
203
198
|
};
|
|
204
|
-
})
|
|
205
|
-
[PARAMETER_SENSI_INJECTION]:
|
|
206
|
-
var _a2, _b2, _c2;
|
|
199
|
+
}) ?? [],
|
|
200
|
+
[PARAMETER_SENSI_INJECTION]: parameters.sensitivityInjection?.map((sensiInjections) => {
|
|
207
201
|
return {
|
|
208
|
-
[MONITORED_BRANCHES]:
|
|
202
|
+
[MONITORED_BRANCHES]: sensiInjections[MONITORED_BRANCHES]?.map((sensiInjection) => {
|
|
209
203
|
return {
|
|
210
204
|
[FieldConstants.ID]: sensiInjection[CONTAINER_ID],
|
|
211
205
|
[FieldConstants.NAME]: sensiInjection[CONTAINER_NAME]
|
|
212
206
|
};
|
|
213
|
-
})
|
|
214
|
-
[INJECTIONS]:
|
|
207
|
+
}) ?? [],
|
|
208
|
+
[INJECTIONS]: sensiInjections[INJECTIONS]?.map((sensiInjection) => {
|
|
215
209
|
return {
|
|
216
210
|
[FieldConstants.ID]: sensiInjection[CONTAINER_ID],
|
|
217
211
|
[FieldConstants.NAME]: sensiInjection[CONTAINER_NAME]
|
|
218
212
|
};
|
|
219
|
-
})
|
|
220
|
-
[CONTINGENCIES]:
|
|
213
|
+
}) ?? [],
|
|
214
|
+
[CONTINGENCIES]: sensiInjections[CONTINGENCIES]?.map((sensiInjection) => {
|
|
221
215
|
return {
|
|
222
216
|
[FieldConstants.ID]: sensiInjection[CONTAINER_ID],
|
|
223
217
|
[FieldConstants.NAME]: sensiInjection[CONTAINER_NAME]
|
|
224
218
|
};
|
|
225
|
-
})
|
|
219
|
+
}) ?? [],
|
|
226
220
|
[ACTIVATED]: sensiInjections[ACTIVATED] ?? false,
|
|
227
221
|
[COUNT]: 0
|
|
228
222
|
};
|
|
229
|
-
})
|
|
230
|
-
[PARAMETER_SENSI_HVDC]:
|
|
231
|
-
var _a2, _b2, _c2;
|
|
223
|
+
}) ?? [],
|
|
224
|
+
[PARAMETER_SENSI_HVDC]: parameters.sensitivityHVDC?.map((sensiInjectionsSet) => {
|
|
232
225
|
return {
|
|
233
|
-
[MONITORED_BRANCHES]:
|
|
226
|
+
[MONITORED_BRANCHES]: sensiInjectionsSet[MONITORED_BRANCHES]?.map((sensiInjection) => {
|
|
234
227
|
return {
|
|
235
228
|
[FieldConstants.ID]: sensiInjection[CONTAINER_ID],
|
|
236
229
|
[FieldConstants.NAME]: sensiInjection[CONTAINER_NAME]
|
|
237
230
|
};
|
|
238
|
-
})
|
|
239
|
-
[HVDC_LINES]:
|
|
231
|
+
}) ?? [],
|
|
232
|
+
[HVDC_LINES]: sensiInjectionsSet[HVDC_LINES]?.map((sensiInjection) => {
|
|
240
233
|
return {
|
|
241
234
|
[FieldConstants.ID]: sensiInjection[CONTAINER_ID],
|
|
242
235
|
[FieldConstants.NAME]: sensiInjection[CONTAINER_NAME]
|
|
243
236
|
};
|
|
244
|
-
})
|
|
237
|
+
}) ?? [],
|
|
245
238
|
[SENSITIVITY_TYPE]: sensiInjectionsSet[SENSITIVITY_TYPE],
|
|
246
|
-
[CONTINGENCIES]:
|
|
239
|
+
[CONTINGENCIES]: sensiInjectionsSet[CONTINGENCIES]?.map((sensiInjection) => {
|
|
247
240
|
return {
|
|
248
241
|
[FieldConstants.ID]: sensiInjection[CONTAINER_ID],
|
|
249
242
|
[FieldConstants.NAME]: sensiInjection[CONTAINER_NAME]
|
|
250
243
|
};
|
|
251
|
-
})
|
|
244
|
+
}) ?? [],
|
|
252
245
|
[ACTIVATED]: sensiInjectionsSet[ACTIVATED] ?? false,
|
|
253
246
|
[COUNT]: 0
|
|
254
247
|
};
|
|
255
|
-
})
|
|
256
|
-
[PARAMETER_SENSI_PST]:
|
|
257
|
-
var _a2, _b2, _c2;
|
|
248
|
+
}) ?? [],
|
|
249
|
+
[PARAMETER_SENSI_PST]: parameters.sensitivityPST?.map((sensiInjectionsSet) => {
|
|
258
250
|
return {
|
|
259
|
-
[MONITORED_BRANCHES]:
|
|
251
|
+
[MONITORED_BRANCHES]: sensiInjectionsSet[MONITORED_BRANCHES]?.map((sensiInjection) => {
|
|
260
252
|
return {
|
|
261
253
|
[FieldConstants.ID]: sensiInjection[CONTAINER_ID],
|
|
262
254
|
[FieldConstants.NAME]: sensiInjection[CONTAINER_NAME]
|
|
263
255
|
};
|
|
264
|
-
})
|
|
265
|
-
[PSTS]:
|
|
256
|
+
}) ?? [],
|
|
257
|
+
[PSTS]: sensiInjectionsSet[PSTS]?.map((sensiInjection) => {
|
|
266
258
|
return {
|
|
267
259
|
[FieldConstants.ID]: sensiInjection[CONTAINER_ID],
|
|
268
260
|
[FieldConstants.NAME]: sensiInjection[CONTAINER_NAME]
|
|
269
261
|
};
|
|
270
|
-
})
|
|
262
|
+
}) ?? [],
|
|
271
263
|
[SENSITIVITY_TYPE]: sensiInjectionsSet[SENSITIVITY_TYPE],
|
|
272
|
-
[CONTINGENCIES]:
|
|
264
|
+
[CONTINGENCIES]: sensiInjectionsSet[CONTINGENCIES]?.map((sensiInjection) => {
|
|
273
265
|
return {
|
|
274
266
|
[FieldConstants.ID]: sensiInjection[CONTAINER_ID],
|
|
275
267
|
[FieldConstants.NAME]: sensiInjection[CONTAINER_NAME]
|
|
276
268
|
};
|
|
277
|
-
})
|
|
269
|
+
}) ?? [],
|
|
278
270
|
[ACTIVATED]: sensiInjectionsSet[ACTIVATED] ?? false,
|
|
279
271
|
[COUNT]: 0
|
|
280
272
|
};
|
|
281
|
-
})
|
|
282
|
-
[PARAMETER_SENSI_NODES]:
|
|
283
|
-
var _a2, _b2, _c2;
|
|
273
|
+
}) ?? [],
|
|
274
|
+
[PARAMETER_SENSI_NODES]: parameters.sensitivityNodes?.map((sensiInjectionsSet) => {
|
|
284
275
|
return {
|
|
285
|
-
[SUPERVISED_VOLTAGE_LEVELS]:
|
|
276
|
+
[SUPERVISED_VOLTAGE_LEVELS]: sensiInjectionsSet[SUPERVISED_VOLTAGE_LEVELS]?.map((sensiInjection) => {
|
|
286
277
|
return {
|
|
287
278
|
[FieldConstants.ID]: sensiInjection[CONTAINER_ID],
|
|
288
279
|
[FieldConstants.NAME]: sensiInjection[CONTAINER_NAME]
|
|
289
280
|
};
|
|
290
|
-
})
|
|
291
|
-
[EQUIPMENTS_IN_VOLTAGE_REGULATION]:
|
|
281
|
+
}) ?? [],
|
|
282
|
+
[EQUIPMENTS_IN_VOLTAGE_REGULATION]: sensiInjectionsSet[EQUIPMENTS_IN_VOLTAGE_REGULATION]?.map((sensiInjection) => {
|
|
292
283
|
return {
|
|
293
284
|
[FieldConstants.ID]: sensiInjection[CONTAINER_ID],
|
|
294
285
|
[FieldConstants.NAME]: sensiInjection[CONTAINER_NAME]
|
|
295
286
|
};
|
|
296
|
-
})
|
|
297
|
-
[CONTINGENCIES]:
|
|
287
|
+
}) ?? [],
|
|
288
|
+
[CONTINGENCIES]: sensiInjectionsSet[CONTINGENCIES]?.map((sensiInjection) => {
|
|
298
289
|
return {
|
|
299
290
|
[FieldConstants.ID]: sensiInjection[CONTAINER_ID],
|
|
300
291
|
[FieldConstants.NAME]: sensiInjection[CONTAINER_NAME]
|
|
301
292
|
};
|
|
302
|
-
})
|
|
293
|
+
}) ?? [],
|
|
303
294
|
[ACTIVATED]: sensiInjectionsSet[ACTIVATED] ?? false,
|
|
304
295
|
[COUNT]: 0
|
|
305
296
|
};
|
|
306
|
-
})
|
|
297
|
+
}) ?? []
|
|
307
298
|
};
|
|
308
299
|
return values;
|
|
309
300
|
},
|
|
@@ -319,10 +310,7 @@ const useSensitivityAnalysisParametersForm = ({
|
|
|
319
310
|
index
|
|
320
311
|
}));
|
|
321
312
|
const filteredInitEntries = entries.filter(
|
|
322
|
-
(entry) =>
|
|
323
|
-
var _a, _b, _c;
|
|
324
|
-
return entry[ACTIVATED] && entry[MONITORED_BRANCHES].length > 0 && (((_a = entry[INJECTIONS]) == null ? void 0 : _a.length) > 0 || ((_b = entry[PSTS]) == null ? void 0 : _b.length) > 0 || ((_c = entry[HVDC_LINES]) == null ? void 0 : _c.length) > 0);
|
|
325
|
-
}
|
|
313
|
+
(entry) => entry[ACTIVATED] && entry[MONITORED_BRANCHES].length > 0 && (entry[INJECTIONS]?.length > 0 || entry[PSTS]?.length > 0 || entry[HVDC_LINES]?.length > 0)
|
|
326
314
|
);
|
|
327
315
|
filteredInitEntries.forEach((entry) => {
|
|
328
316
|
const originalIndex = entriesWithIndices.findIndex((obj) => obj.entry === entry);
|