provide from entity action list
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import { UmbEntityContext } from '@umbraco-cms/backoffice/entity';
|
||||
import type { UmbEntityActionArgs } from './types.js';
|
||||
import { html, customElement, property, state, css } from '@umbraco-cms/backoffice/external/lit';
|
||||
import type { ManifestEntityAction, MetaEntityAction } from '@umbraco-cms/backoffice/extension-registry';
|
||||
@@ -43,9 +44,14 @@ export class UmbEntityActionListElement extends UmbLitElement {
|
||||
[UmbEntityActionArgs<MetaEntityAction>]
|
||||
>;
|
||||
|
||||
#entityContext = new UmbEntityContext(this);
|
||||
|
||||
#generateApiArgs() {
|
||||
if (!this._props.entityType || this._props.unique !== undefined) return;
|
||||
|
||||
this.#entityContext.setEntityType(this._props.entityType);
|
||||
this.#entityContext.setUnique(this._props.unique);
|
||||
|
||||
this._apiArgs = (manifest: ManifestEntityAction<MetaEntityAction>) => {
|
||||
return [{ entityType: this._props.entityType!, unique: this._props.unique!, meta: manifest.meta }];
|
||||
};
|
||||
@@ -59,7 +65,7 @@ export class UmbEntityActionListElement extends UmbLitElement {
|
||||
.filter=${this._filter}
|
||||
.elementProps=${this._props}
|
||||
.apiArgs=${this._apiArgs}></umb-extension-with-api-slot>
|
||||
`
|
||||
`
|
||||
: '';
|
||||
}
|
||||
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
import { UmbEntityContext } from '@umbraco-cms/backoffice/entity';
|
||||
import type { UmbSectionSidebarContext } from '../section-sidebar/index.js';
|
||||
import { UMB_SECTION_SIDEBAR_CONTEXT } from '../section-sidebar/index.js';
|
||||
import { UmbTextStyles } from '@umbraco-cms/backoffice/style';
|
||||
import { css, html, nothing, customElement, state } from '@umbraco-cms/backoffice/external/lit';
|
||||
import { UmbLitElement } from '@umbraco-cms/backoffice/lit-element';
|
||||
import { UmbContextBase } from '@umbraco-cms/backoffice/class-api';
|
||||
import type { UmbControllerHost } from '@umbraco-cms/backoffice/controller-api';
|
||||
import { UmbStringState, observeMultiple } from '@umbraco-cms/backoffice/observable-api';
|
||||
import { observeMultiple } from '@umbraco-cms/backoffice/observable-api';
|
||||
|
||||
@customElement('umb-section-sidebar-context-menu')
|
||||
export class UmbSectionSidebarContextMenuElement extends UmbLitElement {
|
||||
@@ -23,8 +22,6 @@ export class UmbSectionSidebarContextMenuElement extends UmbLitElement {
|
||||
@state()
|
||||
private _headline?: string;
|
||||
|
||||
#entityContext = new UmbEntityContext(this);
|
||||
|
||||
constructor() {
|
||||
super();
|
||||
|
||||
@@ -56,9 +53,6 @@ export class UmbSectionSidebarContextMenuElement extends UmbLitElement {
|
||||
(values) => {
|
||||
this._unique = values[0];
|
||||
this._entityType = values[1];
|
||||
|
||||
this.#entityContext.setEntityType(this._entityType);
|
||||
this.#entityContext.setUnique(this._unique);
|
||||
},
|
||||
),
|
||||
'_observeEntityModel';
|
||||
|
||||
Reference in New Issue
Block a user