-
Notifications
You must be signed in to change notification settings - Fork 989
Show template.display_name in the site UI #5069
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
Changes from 1 commit
3117742
0b38bea
78a2e2f
3f679e7
2d64310
ef1e3f0
a13c3c2
6ff5dc8
fe5e095
1834d4b
a313568
6396671
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,11 +12,12 @@ import { Stack } from "components/Stack/Stack" | |
import { FormikContextType, FormikTouched, useFormik } from "formik" | ||
import { FC, useRef, useState } from "react" | ||
import { colors } from "theme/colors" | ||
import { getFormHelpers, nameValidator, onChangeTrimmed } from "util/formUtils" | ||
import { getFormHelpers, nameValidator, templateDisplayNameValidator, onChangeTrimmed } from "util/formUtils" | ||
import * as Yup from "yup" | ||
|
||
export const Language = { | ||
nameLabel: "Name", | ||
displayNameLabel: "Display name", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We're actually moving away from these Language blocks and instead using react-i18next for translations because it's a cleaner solution. We try to knock them out whenever we come across them in legacy code. Would you mind adding a new translation for your label in There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks for the suggestion, @Kira-Pilot! 6396671 . I guess that I can polish the entire page, but would rather do this in a follow-up PR :) |
||
descriptionLabel: "Description", | ||
defaultTtlLabel: "Auto-stop default", | ||
iconLabel: "Icon", | ||
|
@@ -36,6 +37,7 @@ const MS_HOUR_CONVERSION = 3600000 | |
|
||
export const validationSchema = Yup.object({ | ||
name: nameValidator(Language.nameLabel), | ||
display_name: templateDisplayNameValidator(Language.displayNameLabel), | ||
description: Yup.string().max( | ||
MAX_DESCRIPTION_CHAR_LIMIT, | ||
Language.descriptionMaxError, | ||
|
@@ -105,6 +107,16 @@ export const TemplateSettingsForm: FC<TemplateSettingsForm> = ({ | |
variant="outlined" | ||
/> | ||
|
||
<TextField | ||
{...getFieldHelpers("display_name")} | ||
disabled={isSubmitting} | ||
onChange={onChangeTrimmed(form)} | ||
autoFocus | ||
fullWidth | ||
label={Language.displayNameLabel} | ||
variant="outlined" | ||
/> | ||
|
||
<TextField | ||
{...getFieldHelpers("description")} | ||
multiline | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thought this had to be a bug but I was surprised to notice we're storing nanoseconds in the database... 😅