Skip to content

Template settings fixes/kira pilot #3668

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 13 commits into from
Aug 24, 2022
Prev Previous commit
Next Next commit
added some helper text
  • Loading branch information
Kira-Pilot committed Aug 24, 2022
commit 94abca98b79ebfc11dca37f45baf32db2562e88e
10 changes: 10 additions & 0 deletions site/src/pages/TemplateSettingsPage/TemplateSettingsForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import InputAdornment from "@material-ui/core/InputAdornment"
import Popover from "@material-ui/core/Popover"
import { makeStyles } from "@material-ui/core/styles"
import TextField from "@material-ui/core/TextField"
import Typography from "@material-ui/core/Typography"
import { Template, UpdateTemplateMeta } from "api/typesGenerated"
import { OpenDropdown } from "components/DropdownArrows/DropdownArrows"
import { FormFooter } from "components/FormFooter/FormFooter"
Expand All @@ -24,6 +25,10 @@ export const Language = {
selectEmoji: "Select emoji",
ttlMaxError: "Please enter a limit that is less than or equal to 168 hours (7 days).",
descriptionMaxError: "Please enter a description that is less than or equal to 128 characters.",
ttlHelperText: (
ttl?: number,
): string => `Workspaces created from this template will, by default, shut down ${ttl}
hours after starting.`,
}

const MAX_DESCRIPTION_CHAR_LIMIT = 128
Expand Down Expand Up @@ -168,6 +173,11 @@ export const TemplateSettingsForm: FC<TemplateSettingsForm> = ({
variant="outlined"
type="number"
/>
{!form.errors.max_ttl_ms && (
<Typography variant="subtitle2">
{Language.ttlHelperText(form.values.max_ttl_ms)}
</Typography>
)}
</Stack>

<FormFooter onCancel={onCancel} isLoading={isSubmitting} />
Expand Down