Skip to content

Commit 5c0b915

Browse files
committed
add missing edit permissions for document create options modal
1 parent 6366776 commit 5c0b915

File tree

1 file changed

+17
-5
lines changed

1 file changed

+17
-5
lines changed

src/packages/documents/documents/entity-actions/create/document-create-options-modal.element.ts

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -118,9 +118,11 @@ export class UmbDocumentCreateOptionsModalElement extends UmbModalBaseElement<
118118
render() {
119119
return html`
120120
<umb-body-layout headline=${this.localize.term('actions_create')}>
121-
${this._availableBlueprints.length && this.#documentTypeUnique
122-
? this.#renderBlueprints()
123-
: this.#renderDocumentTypes()}
121+
${when(
122+
this._availableBlueprints.length === 0 && this.#documentTypeUnique,
123+
() => this.#renderBlueprints(),
124+
() => this.#renderDocumentTypes(),
125+
)}
124126
<uui-button slot="actions" id="cancel" label="Cancel" @click="${this._rejectModal}"></uui-button>
125127
</umb-body-layout>
126128
`;
@@ -134,8 +136,14 @@ export class UmbDocumentCreateOptionsModalElement extends UmbModalBaseElement<
134136
<umb-localize key="create_noDocumentTypes">
135137
There are no allowed Document Types available for creating content here. You must enable these in
136138
<strong>Document Types</strong> within the <strong>Settings</strong> section, by editing the
137-
<strong>Allowed child node types</strong> under <strong>Permissions</strong>
139+
<strong>Allowed child node types</strong> under <strong>Permissions</strong><br />
138140
</umb-localize>
141+
<uui-button
142+
id="edit-permissions"
143+
look="secondary"
144+
@click=${() => this._rejectModal()}
145+
href=${`/section/settings/workspace/document-type/edit/${this.data?.documentType?.unique}/view/structure`}
146+
label=${this.localize.term('create_noDocumentTypesEditPermissions')}></uui-button>
139147
`,
140148
() =>
141149
repeat(
@@ -145,7 +153,7 @@ export class UmbDocumentCreateOptionsModalElement extends UmbModalBaseElement<
145153
html` <uui-ref-node-document-type
146154
data-id=${ifDefined(documentType.unique)}
147155
.name=${documentType.name}
148-
.alias=${documentType.description}
156+
.alias=${documentType.description ?? ''}
149157
select-only
150158
selectable
151159
@selected=${() => this.#onSelectDocumentType(documentType.unique)}>
@@ -183,6 +191,10 @@ export class UmbDocumentCreateOptionsModalElement extends UmbModalBaseElement<
183191
#blank {
184192
border-bottom: 1px solid var(--uui-color-border);
185193
}
194+
195+
#edit-permissions {
196+
margin-top: var(--uui-size-6);
197+
}
186198
`,
187199
];
188200
}

0 commit comments

Comments
 (0)