From aa646f2782d230551f1921ab39dbfeb2bfccc4fd Mon Sep 17 00:00:00 2001 From: Lone Iversen <108085781+loivsen@users.noreply.github.com> Date: Wed, 25 Sep 2024 14:02:51 +0200 Subject: [PATCH] Bugfix: No document type allowed at root message --- .../document-create-options-modal.element.ts | 41 +++++++++++++------ 1 file changed, 28 insertions(+), 13 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 3f6751d76b..a0eca87a0e 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 @@ -132,24 +132,39 @@ export class UmbDocumentCreateOptionsModalElement extends UmbModalBaseElement< `; } + #renderNoDocumentTypes() { + if (this.data?.documentType?.unique) { + return html` + + There are no allowed Document Types available for creating content here. You must enable these in + Document Types within the Settings section, by editing the + Allowed child node types under Structure. + +
+ this._rejectModal()}> + `; + } else { + return html` + + There are no allowed Document Types available for creating content here. You must enable these in + Document Types within the Settings section, by changing the + Allow as root option under Structure. + + `; + } + } + #renderDocumentTypes() { return html` ${when( this._allowedDocumentTypes.length === 0, - () => html` - - There are no allowed Document Types available for creating content here. You must enable these in - Document Types within the Settings section, by editing the - Allowed child node types under Permissions.
-
- this._rejectModal()}> - `, + () => this.#renderNoDocumentTypes(), () => repeat( this._allowedDocumentTypes,