fix workspace entity actions dropdown

This commit is contained in:
Niels Lyngsø
2023-08-04 10:10:08 +02:00
parent bc0b568d77
commit f1c35da25e
2 changed files with 7 additions and 5 deletions

View File

@@ -5,7 +5,6 @@ import { UmbLitElement } from '@umbraco-cms/internal/lit-element';
@customElement('umb-entity-action-list')
export class UmbEntityActionListElement extends UmbLitElement {
@property({ type: String, attribute: 'entity-type' })
private _entityType: string = '';
public get entityType(): string {
return this._entityType;
}
@@ -16,6 +15,7 @@ export class UmbEntityActionListElement extends UmbLitElement {
this._filter = (extension: ManifestEntityAction) => extension.meta.entityTypes.includes(this.entityType);
this.requestUpdate('_filter', oldValue);
}
private _entityType: string = '';
@state()
_filter?: (extension: ManifestEntityAction) => boolean;

View File

@@ -49,15 +49,17 @@ export class UmbWorkspaceActionMenuElement extends UmbLitElement {
}
#renderActionsMenu() {
return this._entityId
return this._entityId && this._entityType
? html`
<uui-popover id="action-menu-popover" .open=${this._actionMenuIsOpen} @close=${this.#close}>
<uui-button slot="trigger" label="Actions" @click=${this.#open}></uui-button>
<div id="action-menu-dropdown" slot="popover">
<uui-scroll-container>
<umb-entity-action-list @executed=${this.#onActionExecuted} entity-type=${this._entityType as string} unique=${
this._entityId
}></umb-entity-action-list>
<umb-entity-action-list
@executed=${this.#onActionExecuted}
.entityType=${this._entityType}
.unique=${this._entityId}>
</umb-entity-action-list>
</uui-scroll-container>
</div>
</uui-popover>