Skip to content

Commit

Permalink
Bugfix: No document type allowed at root message
Browse files Browse the repository at this point in the history
  • Loading branch information
loivsen authored and iOvergaard committed Sep 25, 2024
1 parent 0880e25 commit a5500fd
Showing 1 changed file with 28 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -132,24 +132,39 @@ export class UmbDocumentCreateOptionsModalElement extends UmbModalBaseElement<
`;
}

#renderNoDocumentTypes() {
if (this.data?.documentType?.unique) {
return html`
<umb-localize key="create_noDocumentTypes">
There are no allowed Document Types available for creating content here. You must enable these in
<strong>Document Types</strong> within the <strong>Settings</strong> section, by editing the
<strong>Allowed child node types</strong> under <strong>Structure</strong>.
</umb-localize>
<br />
<uui-button
id="edit-permissions"
look="secondary"
href=${`/section/settings/workspace/document-type/edit/${this.data?.documentType?.unique}/view/structure`}
label=${this.localize.term('create_noDocumentTypesEditPermissions')}
@click=${() => this._rejectModal()}></uui-button>
`;
} else {
return html`
<umb-localize key="create_noDocumentTypesAllowedAtRoot">
There are no allowed Document Types available for creating content here. You must enable these in
<strong>Document Types</strong> within the <strong>Settings</strong> section, by changing the
<strong>Allow as root</strong> option under <strong>Structure</strong>.
</umb-localize>
`;
}
}

#renderDocumentTypes() {
return html`
<uui-box .headline=${this._headline}>
${when(
this._allowedDocumentTypes.length === 0,
() => html`
<umb-localize key="create_noDocumentTypes">
There are no allowed Document Types available for creating content here. You must enable these in
<strong>Document Types</strong> within the <strong>Settings</strong> section, by editing the
<strong>Allowed child node types</strong> under <strong>Permissions</strong>.<br />
</umb-localize>
<uui-button
id="edit-permissions"
look="secondary"
href=${`/section/settings/workspace/document-type/edit/${this.data?.documentType?.unique}/view/structure`}
label=${this.localize.term('create_noDocumentTypesEditPermissions')}
@click=${() => this._rejectModal()}></uui-button>
`,
() => this.#renderNoDocumentTypes(),
() =>
repeat(
this._allowedDocumentTypes,
Expand Down

0 comments on commit a5500fd

Please sign in to comment.