Skip to content

Commit 2802980

Browse files
authored
IST is now mandatory for operational limits group creation (#3190)
1 parent e3e906d commit 2802980

File tree

1 file changed

+3
-14
lines changed

1 file changed

+3
-14
lines changed

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

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -53,20 +53,9 @@ const temporaryLimitsValidationSchema = () => {
5353
};
5454

5555
const currentLimitsValidationSchema = (isModification = false) => ({
56-
[PERMANENT_LIMIT]: yup
57-
.number()
58-
.nullable()
59-
.positive('permanentCurrentLimitMustBeGreaterThanZero')
60-
// if there are valid (named) temporary limits, permanent limit is mandatory
61-
.when([TEMPORARY_LIMITS], {
62-
is: (temporaryLimits: TemporaryLimit[]) =>
63-
temporaryLimits?.length > 0 && temporaryLimits.find((limit) => limit.name) && !isModification,
64-
then: () =>
65-
yup
66-
.number()
67-
.required('permanentCurrentLimitMandatory')
68-
.positive('permanentCurrentLimitMustBeGreaterThanZero'),
69-
}),
56+
[PERMANENT_LIMIT]: isModification
57+
? yup.number().nullable().positive('permanentCurrentLimitMustBeGreaterThanZero')
58+
: yup.number().positive('permanentCurrentLimitMustBeGreaterThanZero').required(),
7059
[TEMPORARY_LIMITS]: yup
7160
.array()
7261
.of(temporaryLimitsValidationSchema())

0 commit comments

Comments
 (0)