-
Notifications
You must be signed in to change notification settings - Fork 881
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
Conversation
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.
Backend looks fine 👍🏻
coderd/templates.go
Outdated
@@ -504,7 +503,7 @@ func (api *API) patchTemplateMeta(rw http.ResponseWriter, r *http.Request) { | |||
DisplayName: displayName, | |||
Description: desc, | |||
Icon: icon, | |||
DefaultTtl: int64(maxTTL), | |||
DefaultTtl: int64(defaultTTLMillis), |
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... 😅
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 comment
The 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 templatePage.json
? There's an example PR here that should walk you through how to do it. Let me know if you need any help!
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.
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 :)
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.
Nice work!
Issue: #3321
This PR modifies the site code to present the
template.display_name
on pages: "Templates" and "Create workspace". I will modify the/api/v2/workspaces
in the follow-up (to exposetemplate_display_name
, and then cover "Workspaces" and "Workspace Summary".