Skip to content
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

feat: show template.display_name on Workspace pages #5082

Merged
merged 6 commits into from
Nov 16, 2022

Conversation

mtojek
Copy link
Member

@mtojek mtojek commented Nov 15, 2022

Fixes: #3321

This PR modifies the Workspaces API to expose template.display_name. The property is consumed by Workspace pages.

@mtojek mtojek changed the title feat: expose template.display_name via Workspaces endpoint feat: show template.display_name on Workspace pages Nov 15, 2022
@mtojek mtojek requested a review from a team November 15, 2022 12:02
@mtojek mtojek marked this pull request as ready for review November 15, 2022 12:02
@mtojek mtojek requested a review from a team as a code owner November 15, 2022 12:02
@mtojek mtojek requested review from code-asher, a team and presleyp and removed request for a team, code-asher and presleyp November 15, 2022 12:02
Copy link
Member

@deansheather deansheather left a comment

Choose a reason for hiding this comment

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

Backend lgtm

Copy link
Collaborator

@BrunoQuaresma BrunoQuaresma left a comment

Choose a reason for hiding this comment

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

LGTM. Just left some comments but it is up to you.

it("renders the template display name", async () => {
await renderWorkspacePage()
await screen.findByText(MockWorkspace.template_display_name)
})
Copy link
Collaborator

Choose a reason for hiding this comment

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

In the FE, we use Storybook for visual tests and "integration tests"(the ones run by Jest) only for testing actions. So I think we can remove this.

Copy link
Member Author

Choose a reason for hiding this comment

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

Removed, thanks for the suggestion!

<TableCellDataPrimary>
{workspace.template_display_name.length > 0
? workspace.template_display_name
: workspace.template_name}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Maybe we could have a util function on utils/workspace called getWorkspaceDisplayName(workspace: Workspace): string but it is your call.

Copy link
Member Author

Choose a reason for hiding this comment

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

Added a util function.

@mtojek mtojek merged commit 32927b1 into coder:main Nov 16, 2022
@github-actions github-actions bot locked and limited conversation to collaborators Nov 16, 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.

Add a display name to template settings
3 participants