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

Bugfix: Hide template input when there are no allowed templates #2484

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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`
<div class="general-item">
Expand All @@ -224,6 +223,20 @@ export class UmbDocumentWorkspaceViewInfoElement extends UmbLitElement {
<umb-icon slot="icon" name=${ifDefined(this._documentTypeIcon)}></umb-icon>
</uui-ref-node-document-type>
</div>
${this.#renderTemplateInput()}
<div class="general-item">
<strong><umb-localize key="template_id">Id</umb-localize></strong>
<span>${this._documentUnique}</span>
</div>
`;
}

#renderTemplateInput() {
if (this._allowedTemplates?.length === 0) return nothing;

const editTemplatePath = this._routeBuilder?.({ entityType: 'template' }) ?? '';

return html`
<div class="general-item">
<strong><umb-localize key="template_template">Template</umb-localize></strong>
${this._templateUnique
Expand All @@ -247,10 +260,6 @@ export class UmbDocumentWorkspaceViewInfoElement extends UmbLitElement {
@click=${this.#openTemplatePicker}></uui-button>
`}
</div>
<div class="general-item">
<strong><umb-localize key="template_id">Id</umb-localize></strong>
<span>${this._documentUnique}</span>
</div>
`;
}

Expand Down
Loading