Skip to content

Create Template: Move default values to BE #11917

@BrunoQuaresma

Description

@BrunoQuaresma

When creating a new template, the FE must pass the default values in the API request, but this should not be mandatory so that the client can send requests with only the necessary data and be consistent.

max_ttl_hours: Yup.number()
.integer()
.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).",
),
autostop_requirement_days_of_week: Yup.string().required(),
autostop_requirement_weeks: Yup.number().required().min(1).max(16),
autostart_requirement_days_of_week: Yup.array().of(Yup.string()).required(),
});
const defaultInitialValues: CreateTemplateData = {
name: "",
display_name: "",
description: "",
icon: "",
default_ttl_hours: 24,
// max_ttl is an enterprise-only feature, and the server ignores the value if
// you are not licensed. We hide the form value based on entitlements.
//

Metadata

Metadata

Assignees

No one assigned

    Labels

    apiArea: HTTP APIstaleThis issue is like stale bread.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions