Skip to content

fix: adjust validation errors for template schedule form #15915

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 18, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -23,23 +23,23 @@ const MAX_TTL_DAYS = 30;
export const getValidationSchema = (): Yup.AnyObjectSchema =>
Yup.object({
default_ttl_ms: Yup.number()
.integer()
.integer("Default time until autostop must be an integer.")
.required()
.min(0, "Default time until autostop must not be less than 0.")
.max(
24 * MAX_TTL_DAYS /* 30 days in hours */,
"Please enter a limit that is less than or equal to 720 hours (30 days).",
),
activity_bump_ms: Yup.number()
.integer()
.integer("Activity bump must be an integer.")
.required()
.min(0, "Activity bump must not be less than 0.")
.max(
24 * MAX_TTL_DAYS /* 30 days in hours */,
"Please enter an activity bump duration that is less than or equal to 720 hours (30 days).",
),
failure_ttl_ms: Yup.number()
.integer()
.integer("Failure cleanup days must be an integer.")
.required()
.min(0, "Failure cleanup days must not be less than 0.")
.test(
Expand All @@ -54,7 +54,7 @@ export const getValidationSchema = (): Yup.AnyObjectSchema =>
},
),
time_til_dormant_ms: Yup.number()
.integer()
.integer("Dormancy threshold must be an integer.")
.required()
.min(0, "Dormancy threshold must not be less than 0.")
.test(
Expand All @@ -69,7 +69,7 @@ export const getValidationSchema = (): Yup.AnyObjectSchema =>
},
),
time_til_dormant_autodelete_ms: Yup.number()
.integer()
.integer("Dormancy auto-deletion days must be an integer.")
.required()
.min(0, "Dormancy auto-deletion days must not be less than 0.")
.test(
Expand Down
Loading