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 f1cb7e1e04..7ba21a6c4b 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 @@ -118,10 +118,16 @@ export class UmbDocumentCreateOptionsModalElement extends UmbModalBaseElement< render() { return html` - ${this._availableBlueprints.length && this.#documentTypeUnique - ? this.#renderBlueprints() - : this.#renderDocumentTypes()} - + ${when( + this._availableBlueprints.length === 0 && this.#documentTypeUnique, + () => this.#renderBlueprints(), + () => this.#renderDocumentTypes(), + )} + `; } @@ -134,8 +140,14 @@ export class UmbDocumentCreateOptionsModalElement extends UmbModalBaseElement< 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 + Allowed child node types under Permissions.
+ this._rejectModal()} + href=${`/section/settings/workspace/document-type/edit/${this.data?.documentType?.unique}/view/structure`} + label=${this.localize.term('create_noDocumentTypesEditPermissions')}> `, () => repeat( @@ -145,7 +157,7 @@ export class UmbDocumentCreateOptionsModalElement extends UmbModalBaseElement< html` this.#onSelectDocumentType(documentType.unique)}> @@ -183,6 +195,10 @@ export class UmbDocumentCreateOptionsModalElement extends UmbModalBaseElement< #blank { border-bottom: 1px solid var(--uui-color-border); } + + #edit-permissions { + margin-top: var(--uui-size-6); + } `, ]; } diff --git a/src/Umbraco.Web.UI.Client/src/packages/media/media/entity-actions/create/media-create-options-modal.element.ts b/src/Umbraco.Web.UI.Client/src/packages/media/media/entity-actions/create/media-create-options-modal.element.ts index 6e484f826a..682d7df899 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/media/media/entity-actions/create/media-create-options-modal.element.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/media/media/entity-actions/create/media-create-options-modal.element.ts @@ -3,9 +3,19 @@ import type { UmbMediaCreateOptionsModalData, UmbMediaCreateOptionsModalValue, } from './media-create-options-modal.token.js'; -import { html, nothing, customElement, state, ifDefined } from '@umbraco-cms/backoffice/external/lit'; +import { + html, + nothing, + customElement, + state, + ifDefined, + repeat, + css, + when, +} from '@umbraco-cms/backoffice/external/lit'; import { UmbModalBaseElement } from '@umbraco-cms/backoffice/modal'; import { UmbMediaTypeStructureRepository, type UmbAllowedMediaTypeModel } from '@umbraco-cms/backoffice/media-type'; +import { UmbTextStyles } from '@umbraco-cms/backoffice/style'; @customElement('umb-media-create-options-modal') export class UmbMediaCreateOptionsModalElement extends UmbModalBaseElement< @@ -63,21 +73,10 @@ export class UmbMediaCreateOptionsModalElement extends UmbModalBaseElement< return html` - ${this._allowedMediaTypes.length === 0 - ? html`` - : nothing} - ${this._allowedMediaTypes.map( - (mediaType) => html` - this.#onNavigate(mediaType)}> - ${mediaType.icon ? html`` : nothing} - - `, + ${when( + this._allowedMediaTypes.length === 0, + () => this.#renderNotAllowed(), + () => this.#renderAllowedMediaTypes(), )} `; } + + #renderNotAllowed() { + return html` + There are no allowed Media Types available for creating media here. You must enable these in + Media Types within the Settings section, by editing the + Allowed child node types under Permissions.
+ this._rejectModal()} + href=${`/section/settings/workspace/media-type/edit/${this.data?.mediaType?.unique}/view/structure`} + label=${this.localize.term('create_noMediaTypesEditPermissions')}>`; + } + + #renderAllowedMediaTypes() { + return repeat( + this._allowedMediaTypes, + (mediaType) => mediaType.unique, + (mediaType) => + html` this.#onNavigate(mediaType)}> + ${mediaType.icon ? html`` : nothing} + `, + ); + } + + static styles = [ + UmbTextStyles, + css` + #edit-permissions { + margin-top: var(--uui-size-6); + } + `, + ]; } export default UmbMediaCreateOptionsModalElement;