Skip to content

Commit 40f96f2

Browse files
authored
Fix operational limits groups edition for Line and Transformers creation (#3371)
Signed-off-by: basseche <[email protected]>
1 parent 0757e28 commit 40f96f2

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

src/components/dialogs/limits/limits-pane-utils.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -112,19 +112,19 @@ export const getLimitsValidationSchema = (isModification: boolean = false, id: s
112112
return limitsValidationSchemaCreation(id, isModification);
113113
};
114114

115-
const limitsEmptyFormData = (id: string) => {
115+
const limitsEmptyFormData = (isModification: boolean, id: string) => {
116116
const limitsGroup = {
117117
[OPERATIONAL_LIMITS_GROUPS]: [],
118118
[SELECTED_LIMITS_GROUP_1]: null,
119119
[SELECTED_LIMITS_GROUP_2]: null,
120-
[ENABLE_OLG_MODIFICATION]: false,
120+
[ENABLE_OLG_MODIFICATION]: !isModification,
121121
};
122122

123123
return { [id]: limitsGroup };
124124
};
125125

126-
export const getLimitsEmptyFormData = (id = LIMITS) => {
127-
return limitsEmptyFormData(id);
126+
export const getLimitsEmptyFormData = (isModification = true, id = LIMITS) => {
127+
return limitsEmptyFormData(isModification, id);
128128
};
129129

130130
export const formatOpLimitGroupsToFormInfos = (
@@ -151,7 +151,7 @@ export const getAllLimitsFormData = (
151151
operationalLimitsGroups: OperationalLimitsGroupFormInfos[] = [],
152152
selectedOperationalLimitsGroup1: string | null = null,
153153
selectedOperationalLimitsGroup2: string | null = null,
154-
enableOLGModification?: boolean,
154+
enableOLGModification: boolean | null = true,
155155
id = LIMITS
156156
) => {
157157
return {

src/components/dialogs/network-modifications/line/creation/line-creation-dialog.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ import { LimitsPane } from '../../../limits/limits-pane.tsx';
9191
const emptyFormData = {
9292
...getHeaderEmptyFormData(),
9393
...getCharacteristicsEmptyFormData(),
94-
...getLimitsEmptyFormData(),
94+
...getLimitsEmptyFormData(false),
9595
...emptyProperties,
9696
};
9797

src/components/dialogs/network-modifications/two-windings-transformer/creation/two-windings-transformer-creation-dialog.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ const emptyFormData = {
125125
[EQUIPMENT_ID]: '',
126126
[EQUIPMENT_NAME]: '',
127127
...getTwoWindingsTransformerEmptyFormData(),
128-
...getLimitsEmptyFormData(),
128+
...getLimitsEmptyFormData(false),
129129
...getRatioTapChangerEmptyFormData(),
130130
...getPhaseTapChangerEmptyFormData(),
131131
...emptyProperties,

0 commit comments

Comments
 (0)