From 6c157aa70bb65bde2860b510e15cd864f540f435 Mon Sep 17 00:00:00 2001 From: Jacob Overgaard <752371+iOvergaard@users.noreply.github.com> Date: Mon, 27 May 2024 22:03:26 +0200 Subject: [PATCH] fix: change uui-menu-item to uui-ref-node-document-type to be able to display descriptions --- .../document-create-options-modal.element.ts | 30 ++++++++++++------- 1 file changed, 19 insertions(+), 11 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/packages/documents/documents/entity-actions/create/document-create-options-modal.element.ts b/src/Umbraco.Web.UI.Client/src/packages/documents/documents/entity-actions/create/document-create-options-modal.element.ts index a5a81d1c5d..cff57ab694 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/documents/documents/entity-actions/create/document-create-options-modal.element.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/documents/documents/entity-actions/create/document-create-options-modal.element.ts @@ -3,7 +3,7 @@ import type { UmbDocumentCreateOptionsModalData, UmbDocumentCreateOptionsModalValue, } from './document-create-options-modal.token.js'; -import { html, nothing, customElement, state, ifDefined, repeat, css } from '@umbraco-cms/backoffice/external/lit'; +import { html, customElement, state, ifDefined, repeat, css, when } from '@umbraco-cms/backoffice/external/lit'; import { UmbTextStyles } from '@umbraco-cms/backoffice/style'; import { UmbModalBaseElement } from '@umbraco-cms/backoffice/modal'; import { @@ -128,16 +128,24 @@ export class UmbDocumentCreateOptionsModalElement extends UmbModalBaseElement< #renderDocumentTypes() { return html` - ${this._allowedDocumentTypes.length === 0 ? html`

No allowed types

` : nothing} - ${this._allowedDocumentTypes.map( - (documentType) => html` - this.#onSelectDocumentType(documentType.unique)}> - - - `, + ${when( + this._allowedDocumentTypes.length === 0, + () => html`

No allowed types

`, + () => + repeat( + this._allowedDocumentTypes, + (documentType) => documentType.unique, + (documentType) => + html` this.#onSelectDocumentType(documentType.unique)}> + + `, + ), )}
`; }