This commit is contained in:
Mads Rasmussen
2024-11-02 20:29:53 +01:00
parent 1ce1ee458f
commit c2d186de2b

View File

@@ -12,7 +12,6 @@ import {
state,
repeat,
ifDefined,
property,
type PropertyValues,
} from '@umbraco-cms/backoffice/external/lit';
import { UmbModalBaseElement } from '@umbraco-cms/backoffice/modal';
@@ -28,9 +27,6 @@ export class UmbEntityCreateOptionActionListModalElement extends UmbModalBaseEle
@state()
private _apiControllers: Array<UmbExtensionApiInitializer<ManifestType>> = [];
@state()
_hrefMap = new Map<string, string>();
@state()
_hrefList: Array<any> = [];
@@ -65,12 +61,9 @@ export class UmbEntityCreateOptionActionListModalElement extends UmbModalBaseEle
);
}
async #onClick(event: Event, controller: UmbExtensionApiInitializer<ManifestType>) {
async #onClick(event: Event, controller: UmbExtensionApiInitializer<ManifestType>, href?: string) {
event.stopPropagation();
if (!controller.manifest) throw new Error('No manifest found');
const href = this._hrefMap.get(controller.manifest?.alias);
// skip if href is defined
if (href) {
return;
@@ -119,7 +112,7 @@ export class UmbEntityCreateOptionActionListModalElement extends UmbModalBaseEle
<uui-ref-node
name=${label}
detail=${ifDefined(manifest.meta.description)}
@click=${(event: Event) => this.#onClick(event, controller)}
@click=${(event: Event) => this.#onClick(event, controller, href)}
href=${ifDefined(href)}
target=${this.#getTarget(href)}
?selectable=${!href}