Skip to content

feat: add template activity_bump property #11734

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 10 commits into from
Feb 13, 2024
Prev Previous commit
Fix frontend validations
  • Loading branch information
deansheather committed Feb 13, 2024
commit ca00bad76ed3900422813e7f23a21c194fda4ff3
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import TemplateSchedulePage from "./TemplateSchedulePage";

const validFormValues: TemplateScheduleFormValues = {
default_ttl_ms: 1,
activity_bump_ms: 1,
use_max_ttl: true,
max_ttl_ms: 2,
failure_ttl_ms: 7,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,26 +25,31 @@ export const getValidationSchema = (): Yup.AnyObjectSchema =>
Yup.object({
default_ttl_ms: Yup.number()
.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()
.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).",
),
max_ttl_ms: Yup.number()
.integer()
.required()
.min(0, "Maximum 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).",
),
failure_ttl_ms: Yup.number()
.integer()
.required()
.min(0, "Failure cleanup days must not be less than 0.")
.test(
"positive-if-enabled",
Expand All @@ -59,6 +64,8 @@ export const getValidationSchema = (): Yup.AnyObjectSchema =>
},
),
time_til_dormant_ms: Yup.number()
.integer()
.required()
.min(0, "Dormancy threshold days must not be less than 0.")
.test(
"positive-if-enabled",
Expand All @@ -73,6 +80,8 @@ export const getValidationSchema = (): Yup.AnyObjectSchema =>
},
),
time_til_dormant_autodelete_ms: Yup.number()
.integer()
.required()
.min(0, "Dormancy auto-deletion days must not be less than 0.")
.test(
"positive-if-enabled",
Expand Down