Show template.display_name in the site UI (#5069)

* Show display_name field in the template settings

* Show template.display_name on pages: Templates, CreateWorkspace

* Fix: template.display_name pattern

* make fmt/prettier

* Fix tests

* Fix: make fmt/prettier

* Fix: merge

* Fix: autoFocus

* i18n: display_name
This commit is contained in:
Marcin Tojek
2022-11-14 21:11:50 +01:00
committed by GitHub
parent e872e18883
commit 49b340e039
12 changed files with 88 additions and 22 deletions

View File

@ -480,7 +480,9 @@ func (api *API) patchTemplateMeta(rw http.ResponseWriter, r *http.Request) {
return nil
}
// Update template metadata -- empty fields are not overwritten.
// Update template metadata -- empty fields are not overwritten,
// except for display_name, icon, and default_ttl.
// The exception is required to clear content of these fields with UI.
name := req.Name
displayName := req.DisplayName
desc := req.Description
@ -490,9 +492,6 @@ func (api *API) patchTemplateMeta(rw http.ResponseWriter, r *http.Request) {
if name == "" {
name = template.Name
}
if displayName == "" {
displayName = template.DisplayName
}
if desc == "" {
desc = template.Description
}