retrieve headline
This commit is contained in:
@@ -16,10 +16,13 @@ export class UmbCreateDocumentModalElement extends UmbModalBaseElement<
|
||||
private _allowedDocumentTypes: DocumentTypeTreeItemResponseModel[] = [];
|
||||
|
||||
@state()
|
||||
private _headline?: string;
|
||||
private _headline: string = 'Create';
|
||||
|
||||
async firstUpdated() {
|
||||
await this.#retrieveAllowedChildrenOf(this.data?.id || null);
|
||||
const documentId = this.data?.id || null;
|
||||
|
||||
this.#retrieveAllowedChildrenOf(documentId);
|
||||
this.#retrieveHeadline(documentId);
|
||||
}
|
||||
|
||||
async #retrieveAllowedChildrenOf(id: string | null) {
|
||||
@@ -31,6 +34,15 @@ export class UmbCreateDocumentModalElement extends UmbModalBaseElement<
|
||||
}
|
||||
}
|
||||
|
||||
async #retrieveHeadline(id: string) {
|
||||
if (!id) return;
|
||||
const { data } = await this.#documentRepository.requestById(id);
|
||||
if (data) {
|
||||
// TODO: we need to get the correct variant context here
|
||||
this._headline = `Create at ${data.variants?.[0].name}`;
|
||||
}
|
||||
}
|
||||
|
||||
private _handleCancel() {
|
||||
this.modalContext?.reject();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user