Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Add a display name to template settings #3321

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

Closed
bpmct opened this issue Jul 30, 2022 · 11 comments · Fixed by #5082
Closed

Add a display name to template settings #3321

bpmct opened this issue Jul 30, 2022 · 11 comments · Fixed by #5082
Assignees
Labels
api Area: HTTP API

Comments

@bpmct
Copy link
Member

bpmct commented Jul 30, 2022

Problem statement

I'd love to be able to create templates with the following names:

  • Proxmox VM
  • Proxmox Container
  • Standard Dev Bundle
  • Bare Dev Bundle
  • Ubuntu Slim
  • Docker with nixOS

However, template names are currently being validated as usernames so this is not possible.

Name string `json:"name" validate:"username,required"`

usernameRegex = regexp.MustCompile("^[a-zA-Z0-9]+(?:-[a-zA-Z0-9]+)*$")

Definition of done

Users can create templates with names that contain spaces.

@bpmct bpmct self-assigned this Jul 30, 2022
@bpmct bpmct added the api Area: HTTP API label Jul 30, 2022
@bpmct
Copy link
Member Author

bpmct commented Jul 31, 2022

Chatted with @kylecarbs a bit, it looks like this was done in order to have consistent validation and pretty URLs across objects. Perhaps a template could have a label aws-linux and slug Develop on Linux with EC2

@ketang
Copy link
Contributor

ketang commented Jul 31, 2022

Spaces I understand for URLs but underscores?

Also, we've trimmed down the number of places where we use a name in the URL; is that true of templates as well? Given anticipated future template namespacing, seems like the template name has pros and cons for use in the URL.

@bpmct
Copy link
Member Author

bpmct commented Aug 1, 2022

@ketang Yeah I couldn't identify a use for underscores, so not sure why I included it. I'll change the issue title.

@bpmct bpmct changed the title Cannot use spaces or underscores in template name Cannot use spaces in template name Aug 1, 2022
@bpmct
Copy link
Member Author

bpmct commented Aug 1, 2022

Also, we've trimmed down the number of places where we use a name in the URL; is that true of templates as well? Given anticipated future template namespacing, seems like the template name has pros and cons for use in the URL.

Yep, still in the URL
Screen Shot 2022-08-01 at 9 59 56 AM

@kylecarbs kylecarbs changed the title Cannot use spaces in template name Add a display name to template settings Aug 24, 2022
@kylecarbs
Copy link
Member

@bpmct I updated the title to say that a display name should exist instead. I still think the slug naming is helpful.

@github-actions
Copy link

This issue is becoming stale. In order to keep the tracker readable and actionable, I'm going close to this issue in 7 days if there isn't more activity.

@github-actions github-actions bot added the stale This issue is like stale bread. label Oct 30, 2022
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Nov 7, 2022
@mtojek mtojek reopened this Nov 8, 2022
@mtojek
Copy link
Member

mtojek commented Nov 8, 2022

Looking at this one.

@mtojek mtojek self-assigned this Nov 8, 2022
@mtojek mtojek removed the stale This issue is like stale bread. label Nov 8, 2022
@mtojek
Copy link
Member

mtojek commented Nov 8, 2022

Hey @bpmct! Could you please confirm the scope of this issue:

  1. Introduce an extra property for templates: display_name. Display names can have spaces.
  2. Add CLI flag to coder templates create <template-name> --display-name <display-name>
  3. Use the "display name" on the template page like https://dev.coder.com/templates/aws-linux. When "display name" is undefined, just use "name".
  4. Slug (for instance, .../aws-linux) is left as is.

Did I miss anything? Should it be possible to change the display name using UI?

@bpmct
Copy link
Member Author

bpmct commented Nov 8, 2022

Hey @mtojek. Love this. Will it also use the template display name on other pages, such as the workspace page and workspaces list?

Did I miss anything? Should it be possible to change the display name using UI?

For consistency's sake, I think the display name should be managed just like the icon and description properties (via coder templates edit and the UI).

@mtojek
Copy link
Member

mtojek commented Nov 8, 2022

Will it also use the template display name on other pages, such as the workspace page and workspaces list?

That's the plan and I hope it's doable.

For consistency's sake, I think the display name should be managed just like the icon and description properties (via coder templates edit and the UI).

Ok, so it seems that instead of coder templates create <template-name> --display-name <display-name> we can go with templates edit. Please correct me if I'm wrong.

@bpmct
Copy link
Member Author

bpmct commented Nov 8, 2022

Yep! That makes sense :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api Area: HTTP API
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants