Skip to content

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

Merged
merged 12 commits into from
Nov 14, 2022
Merged

Conversation

mtojek
Copy link
Member

@mtojek mtojek commented Nov 14, 2022

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 expose template_display_name, and then cover "Workspaces" and "Workspace Summary".

@mtojek mtojek self-assigned this Nov 14, 2022
Copy link
Member

@mafredri mafredri left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Backend looks fine 👍🏻

@@ -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),
Copy link
Member

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... 😅

@mtojek mtojek marked this pull request as ready for review November 14, 2022 18:13
@mtojek mtojek requested a review from a team as a code owner November 14, 2022 18:13
@mtojek mtojek requested review from Kira-Pilot and a team and removed request for a team and Kira-Pilot November 14, 2022 18:13
import * as Yup from "yup"

export const Language = {
nameLabel: "Name",
displayNameLabel: "Display name",
Copy link
Member

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!

Copy link
Member Author

@mtojek mtojek Nov 14, 2022

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 :)

Copy link
Member

@Kira-Pilot Kira-Pilot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work!

@mtojek mtojek merged commit 49b340e into coder:main Nov 14, 2022
@github-actions github-actions bot locked and limited conversation to collaborators Nov 14, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants