From cb1272d6103c5b01990de5179b546d12f86af265 Mon Sep 17 00:00:00 2001 From: Mads Rasmussen Date: Thu, 24 Oct 2024 23:37:03 +0200 Subject: [PATCH] hide template input when there are no allowed templates --- .../document-workspace-view-info.element.ts | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/src/packages/documents/documents/workspace/views/info/document-workspace-view-info.element.ts b/src/packages/documents/documents/workspace/views/info/document-workspace-view-info.element.ts index c6a42baecf..f19154a2aa 100644 --- a/src/packages/documents/documents/workspace/views/info/document-workspace-view-info.element.ts +++ b/src/packages/documents/documents/workspace/views/info/document-workspace-view-info.element.ts @@ -206,7 +206,6 @@ export class UmbDocumentWorkspaceViewInfoElement extends UmbLitElement { #renderGeneralSection() { const editDocumentTypePath = this._routeBuilder?.({ entityType: 'document-type' }) ?? ''; - const editTemplatePath = this._routeBuilder?.({ entityType: 'template' }) ?? ''; return html`
@@ -224,6 +223,20 @@ export class UmbDocumentWorkspaceViewInfoElement extends UmbLitElement {
+ ${this.#renderTemplateInput()} +
+ Id + ${this._documentUnique} +
+ `; + } + + #renderTemplateInput() { + if (this._allowedTemplates?.length === 0) return nothing; + + const editTemplatePath = this._routeBuilder?.({ entityType: 'template' }) ?? ''; + + return html`
Template ${this._templateUnique @@ -247,10 +260,6 @@ export class UmbDocumentWorkspaceViewInfoElement extends UmbLitElement { @click=${this.#openTemplatePicker}> `}
-
- Id - ${this._documentUnique} -
`; }