@gridsuite/commons-ui 0.132.0 → 0.134.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/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 +23 -13
- package/dist/components/filter/FilterForm.js +2 -2
- package/dist/components/filter/expert/ExpertFilterEditionDialog.js +13 -6
- package/dist/components/filter/expert/ExpertFilterForm.d.ts +0 -1
- package/dist/components/filter/expert/ExpertFilterForm.js +11 -21
- package/dist/components/filter/expert/expertFilterConstants.d.ts +13 -12
- package/dist/components/filter/expert/expertFilterConstants.js +17 -48
- package/dist/components/filter/expert/expertFilterUtils.js +21 -25
- 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/filter/utils/filterApi.js +14 -6
- package/dist/components/flatParameters/FlatParameters.js +2 -2
- package/dist/components/index.js +1 -4
- package/dist/components/inputs/SelectClearable.js +1 -1
- package/dist/components/inputs/index.js +0 -2
- 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/index.js +0 -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/reactHookForm/utils/index.d.ts +0 -1
- package/dist/components/inputs/reactHookForm/utils/index.js +0 -2
- 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/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 +3 -3
- package/dist/components/parameters/loadflow/use-load-flow-parameters-form.js +15 -16
- 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 +9 -5
- package/dist/redux/commonStore.js +1 -2
- package/dist/services/businessErrorCode.d.ts +11 -0
- package/dist/services/businessErrorCode.js +10 -0
- package/dist/services/index.d.ts +1 -0
- package/dist/services/index.js +2 -0
- package/dist/services/utils.js +13 -7
- package/dist/translations/en/businessErrorsEn.d.ts +28 -0
- package/dist/translations/en/businessErrorsEn.js +25 -0
- package/dist/translations/en/equipmentsEn.d.ts +1 -0
- package/dist/translations/en/equipmentsEn.js +2 -1
- package/dist/translations/en/index.d.ts +1 -0
- package/dist/translations/en/index.js +2 -0
- package/dist/translations/fr/businessErrorsFr.d.ts +28 -0
- package/dist/translations/fr/businessErrorsFr.js +25 -0
- package/dist/translations/fr/equipmentsFr.d.ts +1 -0
- package/dist/translations/fr/equipmentsFr.js +2 -1
- package/dist/translations/fr/index.d.ts +1 -0
- package/dist/translations/fr/index.js +2 -0
- package/dist/utils/index.js +2 -1
- package/dist/utils/types/equipmentType.d.ts +162 -8
- package/dist/utils/types/equipmentType.js +126 -22
- package/dist/utils/types/index.js +2 -1
- package/package.json +6 -6
- package/dist/components/inputs/reactHookForm/utils/RefreshButton.d.ts +0 -2
- package/dist/components/inputs/reactHookForm/utils/RefreshButton.js +0 -9
|
@@ -12,13 +12,13 @@ function PropertyValueEditor(props) {
|
|
|
12
12
|
const { equipmentType, valueEditorProps } = props;
|
|
13
13
|
const valid = useValid(valueEditorProps);
|
|
14
14
|
const intl = useIntl();
|
|
15
|
-
const { propertyName, propertyOperator, propertyValues } =
|
|
15
|
+
const { propertyName, propertyOperator, propertyValues } = valueEditorProps?.value ?? {};
|
|
16
16
|
const [equipmentPredefinedProps] = usePredefinedProperties(equipmentType);
|
|
17
17
|
const predefinedNames = useMemo(() => {
|
|
18
18
|
return Object.keys(equipmentPredefinedProps ?? {}).sort();
|
|
19
19
|
}, [equipmentPredefinedProps]);
|
|
20
20
|
const predefinedValues = useMemo(() => {
|
|
21
|
-
const predefinedForName = equipmentPredefinedProps
|
|
21
|
+
const predefinedForName = equipmentPredefinedProps?.[propertyName];
|
|
22
22
|
if (!predefinedForName) {
|
|
23
23
|
return [];
|
|
24
24
|
}
|
|
@@ -26,10 +26,9 @@ function PropertyValueEditor(props) {
|
|
|
26
26
|
}, [equipmentPredefinedProps, propertyName]);
|
|
27
27
|
const onChange = useCallback(
|
|
28
28
|
(field, value) => {
|
|
29
|
-
var _a, _b;
|
|
30
29
|
let updatedValue = {
|
|
31
|
-
...valueEditorProps
|
|
32
|
-
[FieldConstants.PROPERTY_OPERATOR]:
|
|
30
|
+
...valueEditorProps?.value,
|
|
31
|
+
[FieldConstants.PROPERTY_OPERATOR]: valueEditorProps?.value?.propertyOperator ?? PROPERTY_VALUE_OPERATORS[0].customName,
|
|
33
32
|
[field]: value
|
|
34
33
|
};
|
|
35
34
|
if (field === FieldConstants.PROPERTY_NAME) {
|
|
@@ -38,7 +37,7 @@ function PropertyValueEditor(props) {
|
|
|
38
37
|
[FieldConstants.PROPERTY_VALUES]: []
|
|
39
38
|
};
|
|
40
39
|
}
|
|
41
|
-
|
|
40
|
+
valueEditorProps?.handleOnChange?.(updatedValue);
|
|
42
41
|
},
|
|
43
42
|
[valueEditorProps]
|
|
44
43
|
);
|
|
@@ -64,7 +63,7 @@ function PropertyValueEditor(props) {
|
|
|
64
63
|
{
|
|
65
64
|
value: propertyOperator ?? PROPERTY_VALUE_OPERATORS[0].customName,
|
|
66
65
|
size: "small",
|
|
67
|
-
title: valueEditorProps
|
|
66
|
+
title: valueEditorProps?.title,
|
|
68
67
|
error: !valid,
|
|
69
68
|
onChange: (event) => {
|
|
70
69
|
onChange(FieldConstants.PROPERTY_OPERATOR, event.target.value);
|
|
@@ -77,14 +76,14 @@ function PropertyValueEditor(props) {
|
|
|
77
76
|
{
|
|
78
77
|
value: propertyValues ?? [],
|
|
79
78
|
options: predefinedValues ?? [],
|
|
80
|
-
title: valueEditorProps
|
|
79
|
+
title: valueEditorProps?.title,
|
|
81
80
|
multiple: true,
|
|
82
81
|
renderInput: (params) => /* @__PURE__ */ jsx(
|
|
83
82
|
TextField,
|
|
84
83
|
{
|
|
85
84
|
...params,
|
|
86
85
|
error: !valid,
|
|
87
|
-
placeholder:
|
|
86
|
+
placeholder: propertyValues?.length > 0 ? "" : intl.formatMessage({ id: "valuesList" })
|
|
88
87
|
}
|
|
89
88
|
),
|
|
90
89
|
freeSolo: true,
|
|
@@ -28,7 +28,7 @@ function TextValueEditor(props) {
|
|
|
28
28
|
{
|
|
29
29
|
...params,
|
|
30
30
|
error: !valid,
|
|
31
|
-
placeholder:
|
|
31
|
+
placeholder: value?.length > 0 ? "" : intl.formatMessage({ id: "valuesList" })
|
|
32
32
|
}
|
|
33
33
|
),
|
|
34
34
|
size: "small",
|
|
@@ -9,7 +9,7 @@ function TranslatedValueEditor(props) {
|
|
|
9
9
|
const intl = useIntl();
|
|
10
10
|
const { values, value, handleOnChange, title } = props;
|
|
11
11
|
const translatedValues = useMemo(() => {
|
|
12
|
-
return values
|
|
12
|
+
return values?.map((v) => {
|
|
13
13
|
return {
|
|
14
14
|
name: v.name,
|
|
15
15
|
label: intl.formatMessage({ id: v.label })
|
|
@@ -31,9 +31,8 @@ function ValueEditor(props) {
|
|
|
31
31
|
const { getValues } = formContext;
|
|
32
32
|
const itemFilter = useCallback(
|
|
33
33
|
(filterValue) => {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
return field === FieldType.ID && ((_a = filterValue == null ? void 0 : filterValue.specificMetadata) == null ? void 0 : _a.equipmentType) === getValues(FieldConstants.EQUIPMENT_TYPE) || (field === FieldType.VOLTAGE_LEVEL_ID || field === FieldType.VOLTAGE_LEVEL_ID_1 || field === FieldType.VOLTAGE_LEVEL_ID_2 || field === FieldType.VOLTAGE_LEVEL_ID_3) && ((_b = filterValue == null ? void 0 : filterValue.specificMetadata) == null ? void 0 : _b.equipmentType) === VoltageLevel.type || (field === FieldType.SUBSTATION_ID || field === FieldType.SUBSTATION_ID_1 || field === FieldType.SUBSTATION_ID_2) && ((_c = filterValue == null ? void 0 : filterValue.specificMetadata) == null ? void 0 : _c.equipmentType) === Substation.type;
|
|
34
|
+
if (filterValue?.type === ElementType.FILTER) {
|
|
35
|
+
return field === FieldType.ID && filterValue?.specificMetadata?.equipmentType === getValues(FieldConstants.EQUIPMENT_TYPE) || (field === FieldType.VOLTAGE_LEVEL_ID || field === FieldType.VOLTAGE_LEVEL_ID_1 || field === FieldType.VOLTAGE_LEVEL_ID_2 || field === FieldType.VOLTAGE_LEVEL_ID_3) && filterValue?.specificMetadata?.equipmentType === VoltageLevel.type || (field === FieldType.SUBSTATION_ID || field === FieldType.SUBSTATION_ID_1 || field === FieldType.SUBSTATION_ID_2) && filterValue?.specificMetadata?.equipmentType === Substation.type;
|
|
37
36
|
}
|
|
38
37
|
return true;
|
|
39
38
|
},
|
|
@@ -21,7 +21,7 @@ function GroupValueEditor(props) {
|
|
|
21
21
|
...value,
|
|
22
22
|
combinator,
|
|
23
23
|
rules: {
|
|
24
|
-
...value
|
|
24
|
+
...value?.rules,
|
|
25
25
|
[field]: rule
|
|
26
26
|
}
|
|
27
27
|
};
|
|
@@ -29,20 +29,17 @@ function GroupValueEditor(props) {
|
|
|
29
29
|
},
|
|
30
30
|
[handleOnChange, combinator, value]
|
|
31
31
|
);
|
|
32
|
-
return /* @__PURE__ */ jsx(Grid, { container: true, direction: "column", sx: styles.group, paddingLeft: 1, paddingRight: 1, paddingBottom: 1, children: children && Object.values(children).map((fieldData) =>
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
}
|
|
44
|
-
);
|
|
45
|
-
}) });
|
|
32
|
+
return /* @__PURE__ */ jsx(Grid, { container: true, direction: "column", sx: styles.group, paddingLeft: 1, paddingRight: 1, paddingBottom: 1, children: children && Object.values(children).map((fieldData) => /* @__PURE__ */ createElement(
|
|
33
|
+
RuleValueEditor,
|
|
34
|
+
{
|
|
35
|
+
...props,
|
|
36
|
+
key: fieldData.name,
|
|
37
|
+
field: fieldData.name,
|
|
38
|
+
fieldData,
|
|
39
|
+
rule: value?.rules?.[fieldData.name],
|
|
40
|
+
handleOnChangeRule: generateOnChangeRuleHandler(fieldData.name)
|
|
41
|
+
}
|
|
42
|
+
)) });
|
|
46
43
|
}
|
|
47
44
|
export {
|
|
48
45
|
GroupValueEditor
|
|
@@ -9,7 +9,6 @@ const styles = {
|
|
|
9
9
|
}
|
|
10
10
|
};
|
|
11
11
|
function RuleValueEditor(props) {
|
|
12
|
-
var _a, _b;
|
|
13
12
|
const {
|
|
14
13
|
schema: {
|
|
15
14
|
controls: { valueEditor: ValueEditorControlElement }
|
|
@@ -19,7 +18,7 @@ function RuleValueEditor(props) {
|
|
|
19
18
|
handleOnChangeRule
|
|
20
19
|
} = props;
|
|
21
20
|
const intl = useIntl();
|
|
22
|
-
const operator =
|
|
21
|
+
const operator = rule?.operator ?? fieldData.operators?.map((op) => op.name)[0];
|
|
23
22
|
const handleOnChangeOperator = (newOperator) => {
|
|
24
23
|
handleOnChangeRule({
|
|
25
24
|
...rule,
|
|
@@ -44,7 +43,7 @@ function RuleValueEditor(props) {
|
|
|
44
43
|
handleOnChangeOperator(event.target.value);
|
|
45
44
|
},
|
|
46
45
|
variant: "standard",
|
|
47
|
-
children:
|
|
46
|
+
children: fieldData.operators?.map((option) => /* @__PURE__ */ jsx(MenuItem, { value: option.name, children: intl.formatMessage({ id: option.label }) }, option.name))
|
|
48
47
|
}
|
|
49
48
|
) }),
|
|
50
49
|
/* @__PURE__ */ jsx(Grid, { container: true, item: true, xs: 5.5, sx: styles.gridItem, paddingLeft: 1, children: /* @__PURE__ */ jsx(
|
|
@@ -53,7 +52,7 @@ function RuleValueEditor(props) {
|
|
|
53
52
|
...props,
|
|
54
53
|
operator,
|
|
55
54
|
handleOnChange: handleOnChangeValue,
|
|
56
|
-
value: rule
|
|
55
|
+
value: rule?.value
|
|
57
56
|
}
|
|
58
57
|
) })
|
|
59
58
|
] });
|
|
@@ -26,8 +26,7 @@ const useListenerManager = (urls) => {
|
|
|
26
26
|
urlsListenersRef.current = urlsListeners;
|
|
27
27
|
}, []);
|
|
28
28
|
const removeListenerEvent = useCallback((urlKey, id) => {
|
|
29
|
-
|
|
30
|
-
const listeners = (_a = urlsListenersRef.current) == null ? void 0 : _a[urlKey];
|
|
29
|
+
const listeners = urlsListenersRef.current?.[urlKey];
|
|
31
30
|
if (listeners) {
|
|
32
31
|
const newListerners = listeners.filter((l) => l.id !== id);
|
|
33
32
|
urlsListenersRef.current = {
|
|
@@ -38,8 +37,7 @@ const useListenerManager = (urls) => {
|
|
|
38
37
|
}, []);
|
|
39
38
|
const broadcast = useCallback(
|
|
40
39
|
(urlKey) => (...args) => {
|
|
41
|
-
|
|
42
|
-
const listeners = (_a = urlsListenersRef.current) == null ? void 0 : _a[urlKey];
|
|
40
|
+
const listeners = urlsListenersRef.current?.[urlKey];
|
|
43
41
|
if (listeners) {
|
|
44
42
|
listeners.forEach(({ callback }) => {
|
|
45
43
|
callback(...args);
|
|
@@ -34,7 +34,6 @@ const OverflowableText = styled(
|
|
|
34
34
|
children,
|
|
35
35
|
...props
|
|
36
36
|
}) => {
|
|
37
|
-
var _a, _b, _c, _d;
|
|
38
37
|
const element = useRef();
|
|
39
38
|
const isMultiLine = useMemo(() => maxLineCount && maxLineCount > 1, [maxLineCount]);
|
|
40
39
|
const [overflowed, setOverflowed] = useState(false);
|
|
@@ -53,10 +52,10 @@ const OverflowableText = styled(
|
|
|
53
52
|
}, [
|
|
54
53
|
checkOverflow,
|
|
55
54
|
text,
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
55
|
+
element.current?.scrollWidth,
|
|
56
|
+
element.current?.clientWidth,
|
|
57
|
+
element.current?.scrollHeight,
|
|
58
|
+
element.current?.clientHeight
|
|
60
59
|
]);
|
|
61
60
|
const defaultTooltipSx = !tooltipStyle ? overflowStyle.tooltip : false;
|
|
62
61
|
const finalTooltipSx = tooltipSx || defaultTooltipSx;
|
|
@@ -13,7 +13,8 @@ export declare enum ComputingType {
|
|
|
13
13
|
DYNAMIC_SIMULATION = "DYNAMIC_SIMULATION",
|
|
14
14
|
DYNAMIC_SECURITY_ANALYSIS = "DYNAMIC_SECURITY_ANALYSIS",
|
|
15
15
|
VOLTAGE_INITIALIZATION = "VOLTAGE_INITIALIZATION",
|
|
16
|
-
STATE_ESTIMATION = "STATE_ESTIMATION"
|
|
16
|
+
STATE_ESTIMATION = "STATE_ESTIMATION",
|
|
17
|
+
PCC_MIN = "PCC_MIN"
|
|
17
18
|
}
|
|
18
19
|
export declare const isValidComputingType: (value: string | undefined) => boolean;
|
|
19
20
|
export declare const formatComputingTypeLabel: (type: ComputingType) => string | undefined;
|
|
@@ -8,6 +8,7 @@ var ComputingType = /* @__PURE__ */ ((ComputingType2) => {
|
|
|
8
8
|
ComputingType2["DYNAMIC_SECURITY_ANALYSIS"] = "DYNAMIC_SECURITY_ANALYSIS";
|
|
9
9
|
ComputingType2["VOLTAGE_INITIALIZATION"] = "VOLTAGE_INITIALIZATION";
|
|
10
10
|
ComputingType2["STATE_ESTIMATION"] = "STATE_ESTIMATION";
|
|
11
|
+
ComputingType2["PCC_MIN"] = "PCC_MIN";
|
|
11
12
|
return ComputingType2;
|
|
12
13
|
})(ComputingType || {});
|
|
13
14
|
const isValidComputingType = (value) => {
|
|
@@ -33,6 +34,8 @@ const formatComputingTypeLabel = (type) => {
|
|
|
33
34
|
return "DynamicSecurityAnalysis";
|
|
34
35
|
case "STATE_ESTIMATION":
|
|
35
36
|
return "StateEstimation";
|
|
37
|
+
case "PCC_MIN":
|
|
38
|
+
return "PccMin";
|
|
36
39
|
default:
|
|
37
40
|
console.warn(`Unrecognized computing type while formatting its label : ${type}`);
|
|
38
41
|
return void 0;
|
|
@@ -66,7 +66,7 @@ const getSAParametersFromSchema = (name, limitReductions) => {
|
|
|
66
66
|
[PARAM_SA_PROVIDER]: yup.string().required()
|
|
67
67
|
});
|
|
68
68
|
const limitReductionsSchema = getLimitReductionsFormSchema(
|
|
69
|
-
|
|
69
|
+
limitReductions?.length ? limitReductions[0].temporaryLimitReductions.length : 0
|
|
70
70
|
);
|
|
71
71
|
const thresholdsSchema = yup.object().shape({
|
|
72
72
|
[PARAM_SA_FLOW_PROPORTIONAL_THRESHOLD]: yup.number().min(0, "NormalizedPercentage").max(100, "NormalizedPercentage").required(),
|
|
@@ -13,7 +13,7 @@ const toFormValuesLimitReductions = (limits) => !limits ? {} : {
|
|
|
13
13
|
};
|
|
14
14
|
const toFormValueSaParameters = (params) => ({
|
|
15
15
|
[PARAM_SA_PROVIDER]: params[PARAM_SA_PROVIDER],
|
|
16
|
-
...toFormValuesLimitReductions(params
|
|
16
|
+
...toFormValuesLimitReductions(params?.limitReductions),
|
|
17
17
|
// SA specific form values
|
|
18
18
|
[PARAM_SA_FLOW_PROPORTIONAL_THRESHOLD]: params[PARAM_SA_FLOW_PROPORTIONAL_THRESHOLD] * 100,
|
|
19
19
|
[PARAM_SA_LOW_VOLTAGE_PROPORTIONAL_THRESHOLD]: params[PARAM_SA_LOW_VOLTAGE_PROPORTIONAL_THRESHOLD] * 100,
|
|
@@ -163,7 +163,7 @@ function LoadFlowGeneralParameters({ provider, specificParams }) {
|
|
|
163
163
|
onClick: setShowSpecificLfParams,
|
|
164
164
|
infoText: provider ?? "",
|
|
165
165
|
disabled: !provider || !specificParams,
|
|
166
|
-
children: showSpecificLfParams &&
|
|
166
|
+
children: showSpecificLfParams && specificParams?.map((item) => /* @__PURE__ */ createElement(LoadFlowParameterField, { id: SPECIFIC_PARAMETERS, ...item, key: item.name }))
|
|
167
167
|
}
|
|
168
168
|
)
|
|
169
169
|
] });
|
|
@@ -60,7 +60,7 @@ function LoadFlowParametersContent({
|
|
|
60
60
|
}) {
|
|
61
61
|
return /* @__PURE__ */ jsx(Box, { sx: styles.wrapper, children: /* @__PURE__ */ jsx(Grid, { container: true, sx: styles.container, children: /* @__PURE__ */ jsxs(Grid, { item: true, sx: styles.maxWidth, children: [
|
|
62
62
|
/* @__PURE__ */ jsx(TabPanel, { value: selectedTab, index: TabValues.GENERAL, children: /* @__PURE__ */ jsx(LoadFlowGeneralParameters, { provider: currentProvider, specificParams: specificParameters }) }),
|
|
63
|
-
/* @__PURE__ */ jsx(TabPanel, { value: selectedTab, index: TabValues.LIMIT_REDUCTIONS, children: /* @__PURE__ */ jsx(Grid, { container: true, sx: { width: "100%" }, children: currentProvider === PARAM_PROVIDER_OPENLOADFLOW ? /* @__PURE__ */ jsx(LimitReductionsTableForm, { limits:
|
|
63
|
+
/* @__PURE__ */ jsx(TabPanel, { value: selectedTab, index: TabValues.LIMIT_REDUCTIONS, children: /* @__PURE__ */ jsx(Grid, { container: true, sx: { width: "100%" }, children: currentProvider === PARAM_PROVIDER_OPENLOADFLOW ? /* @__PURE__ */ jsx(LimitReductionsTableForm, { limits: params?.limitReductions ?? defaultLimitReductions }) : /* @__PURE__ */ jsx(
|
|
64
64
|
ParameterLineSlider,
|
|
65
65
|
{
|
|
66
66
|
name: PARAM_LIMIT_REDUCTION,
|
|
@@ -74,7 +74,7 @@ function LoadFlowParametersForm({
|
|
|
74
74
|
paramsLoaded
|
|
75
75
|
} = loadflowMethods;
|
|
76
76
|
return /* @__PURE__ */ jsx(CustomFormProvider, { validationSchema: formSchema, ...formMethods, removeOptional: true, language, children: /* @__PURE__ */ jsxs(Box, { sx: styles.form, children: [
|
|
77
|
-
renderTitleFields
|
|
77
|
+
renderTitleFields?.(),
|
|
78
78
|
paramsLoaded ? /* @__PURE__ */ jsxs(Box, { sx: styles.loadflowParameters, children: [
|
|
79
79
|
/* @__PURE__ */ jsx(
|
|
80
80
|
LoadFlowParametersHeader,
|
|
@@ -72,7 +72,7 @@ const getCommonLoadFlowParametersFormSchema = () => {
|
|
|
72
72
|
};
|
|
73
73
|
const getSpecificLoadFlowParametersFormSchema = (specificParameters) => {
|
|
74
74
|
const shape = {};
|
|
75
|
-
specificParameters
|
|
75
|
+
specificParameters?.forEach((param) => {
|
|
76
76
|
switch (param.type) {
|
|
77
77
|
case ParameterType.STRING:
|
|
78
78
|
shape[param.name] = yup.string().required();
|
|
@@ -98,7 +98,7 @@ const getSpecificLoadFlowParametersFormSchema = (specificParameters) => {
|
|
|
98
98
|
});
|
|
99
99
|
};
|
|
100
100
|
const getDefaultSpecificParamsValues = (specificParams) => {
|
|
101
|
-
return specificParams
|
|
101
|
+
return specificParams?.reduce((acc, param) => {
|
|
102
102
|
if (param.type === ParameterType.STRING_LIST && param.defaultValue === null) {
|
|
103
103
|
acc[param.name] = [];
|
|
104
104
|
} else if ((param.type === ParameterType.DOUBLE || param.type === ParameterType.INTEGER) && Number.isNaN(Number(param.defaultValue))) {
|
|
@@ -110,7 +110,7 @@ const getDefaultSpecificParamsValues = (specificParams) => {
|
|
|
110
110
|
}, {});
|
|
111
111
|
};
|
|
112
112
|
const setSpecificParameters = (provider, specificParamsDescriptions, formMethods) => {
|
|
113
|
-
const specificParams = provider ?
|
|
113
|
+
const specificParams = provider ? specificParamsDescriptions?.[provider] ?? [] : [];
|
|
114
114
|
const specificParamsValues = getDefaultSpecificParamsValues(specificParams);
|
|
115
115
|
formMethods.setValue(SPECIFIC_PARAMETERS, specificParamsValues);
|
|
116
116
|
};
|
|
@@ -56,7 +56,7 @@ 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
61
|
const [tabIndexesWithError, setTabIndexesWithError] = useState([]);
|
|
62
62
|
const { snackError } = useSnackMessage();
|
|
@@ -64,12 +64,12 @@ const useLoadFlowParametersForm = (parametersBackend, enableDeveloperMode, param
|
|
|
64
64
|
setSelectedTab(newValue);
|
|
65
65
|
}, []);
|
|
66
66
|
const specificParametersValues = useMemo(() => {
|
|
67
|
-
const specificParams = currentProvider ? specificParamsDescriptions
|
|
67
|
+
const specificParams = currentProvider ? specificParamsDescriptions?.[currentProvider] : void 0;
|
|
68
68
|
return getDefaultSpecificParamsValues(specificParams);
|
|
69
69
|
}, [currentProvider, specificParamsDescriptions]);
|
|
70
70
|
const specificParameters = useMemo(() => {
|
|
71
|
-
const specificParams = currentProvider ? specificParamsDescriptions
|
|
72
|
-
return specificParams
|
|
71
|
+
const specificParams = currentProvider ? specificParamsDescriptions?.[currentProvider] : void 0;
|
|
72
|
+
return specificParams?.map((param) => ({
|
|
73
73
|
name: param.name,
|
|
74
74
|
type: param.type,
|
|
75
75
|
label: param.label,
|
|
@@ -79,24 +79,23 @@ const useLoadFlowParametersForm = (parametersBackend, enableDeveloperMode, param
|
|
|
79
79
|
}));
|
|
80
80
|
}, [currentProvider, specificParamsDescriptions]);
|
|
81
81
|
const formSchema = useMemo(() => {
|
|
82
|
-
var _a;
|
|
83
82
|
return yup.object({
|
|
84
83
|
[PROVIDER]: yup.string().required(),
|
|
85
84
|
[PARAM_LIMIT_REDUCTION]: yup.number().nullable(),
|
|
86
85
|
...getCommonLoadFlowParametersFormSchema().fields,
|
|
87
86
|
...getLimitReductionsFormSchema(
|
|
88
|
-
|
|
87
|
+
params?.limitReductions ? params.limitReductions[0]?.temporaryLimitReductions.length : 0
|
|
89
88
|
).fields,
|
|
90
89
|
...getSpecificLoadFlowParametersFormSchema(specificParameters).fields
|
|
91
90
|
}).concat(getNameElementEditorSchema(name));
|
|
92
|
-
}, [name, params
|
|
91
|
+
}, [name, params?.limitReductions, specificParameters]);
|
|
93
92
|
const formMethods = useForm({
|
|
94
93
|
defaultValues: {
|
|
95
94
|
...getNameElementEditorEmptyFormData(name, description),
|
|
96
95
|
[PROVIDER]: provider,
|
|
97
96
|
[PARAM_LIMIT_REDUCTION]: null,
|
|
98
97
|
[COMMON_PARAMETERS]: {
|
|
99
|
-
...params
|
|
98
|
+
...params?.commonParameters
|
|
100
99
|
},
|
|
101
100
|
[SPECIFIC_PARAMETERS]: {
|
|
102
101
|
...specificParametersValues
|
|
@@ -109,22 +108,22 @@ const useLoadFlowParametersForm = (parametersBackend, enableDeveloperMode, param
|
|
|
109
108
|
const watchProvider = watch("provider");
|
|
110
109
|
const toLimitReductions = useCallback(
|
|
111
110
|
(formLimits) => {
|
|
112
|
-
if (
|
|
111
|
+
if (formLimits?.length === 0) {
|
|
113
112
|
return [];
|
|
114
113
|
}
|
|
115
114
|
if (watchProvider === PARAM_PROVIDER_OPENLOADFLOW) {
|
|
116
|
-
if (!
|
|
115
|
+
if (!params?.limitReductions) {
|
|
117
116
|
return defaultLimitReductions.map(
|
|
118
117
|
(vlLimits, indexVl) => mapLimitReductions(vlLimits, formLimits, indexVl)
|
|
119
118
|
);
|
|
120
119
|
}
|
|
121
|
-
return params
|
|
120
|
+
return params?.limitReductions.map(
|
|
122
121
|
(vlLimits, indexVl) => mapLimitReductions(vlLimits, formLimits, indexVl)
|
|
123
122
|
);
|
|
124
123
|
}
|
|
125
124
|
return [];
|
|
126
125
|
},
|
|
127
|
-
[defaultLimitReductions, params
|
|
126
|
+
[defaultLimitReductions, params?.limitReductions, watchProvider]
|
|
128
127
|
);
|
|
129
128
|
const getSpecificParametersPerProvider = (formData, _specificParametersValues) => {
|
|
130
129
|
return Object.keys(formData[SPECIFIC_PARAMETERS]).reduce(
|
|
@@ -157,9 +156,9 @@ const useLoadFlowParametersForm = (parametersBackend, enableDeveloperMode, param
|
|
|
157
156
|
);
|
|
158
157
|
const toLoadFlowFormValues = useCallback(
|
|
159
158
|
(_params) => {
|
|
160
|
-
const specificParams = _params.provider ? specificParamsDescriptions
|
|
159
|
+
const specificParams = _params.provider ? specificParamsDescriptions?.[_params.provider] : void 0;
|
|
161
160
|
const specificParamsPerProvider = _params.specificParametersPerProvider[_params.provider];
|
|
162
|
-
const formatted = specificParams
|
|
161
|
+
const formatted = specificParams?.reduce((acc, param) => {
|
|
163
162
|
if (specificParamsPerProvider && Object.prototype.hasOwnProperty.call(specificParamsPerProvider, param.name)) {
|
|
164
163
|
if (param.type === ParameterType.BOOLEAN) {
|
|
165
164
|
acc[param.name] = specificParamsPerProvider[param.name] === "true";
|
|
@@ -197,10 +196,10 @@ const useLoadFlowParametersForm = (parametersBackend, enableDeveloperMode, param
|
|
|
197
196
|
const onValidationError = useCallback(
|
|
198
197
|
(errors) => {
|
|
199
198
|
const tabsInError = [];
|
|
200
|
-
if (
|
|
199
|
+
if (errors?.[LIMIT_REDUCTIONS_FORM] && TabValues.LIMIT_REDUCTIONS !== selectedTab) {
|
|
201
200
|
tabsInError.push(TabValues.LIMIT_REDUCTIONS);
|
|
202
201
|
}
|
|
203
|
-
if ((
|
|
202
|
+
if ((errors?.[SPECIFIC_PARAMETERS] || errors?.[COMMON_PARAMETERS] || errors?.[PROVIDER]) && TabValues.GENERAL !== selectedTab) {
|
|
204
203
|
tabsInError.push(TabValues.GENERAL);
|
|
205
204
|
}
|
|
206
205
|
setTabIndexesWithError(tabsInError);
|
|
@@ -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
|
] });
|