-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Closed as not planned
Labels
Description
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.
coder/site/src/pages/CreateTemplatePage/CreateTemplateForm.tsx
Lines 93 to 113 in 05eac64
| 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. | |
| // |
matifali