Merge branch 'feature/entity-action-kind' of https://github.com/umbraco/Umbraco.CMS.Backoffice into feature/entity-action-kind
This commit is contained in:
@@ -13,7 +13,7 @@ export class UmbCollectionSelectionActionsElement extends UmbLitElement {
|
||||
private _selectionLength = 0;
|
||||
|
||||
@state()
|
||||
private _extensionProps = {};
|
||||
private _elementProps = {};
|
||||
|
||||
private _selection: Array<string | null> = [];
|
||||
|
||||
@@ -53,7 +53,7 @@ export class UmbCollectionSelectionActionsElement extends UmbLitElement {
|
||||
(selection) => {
|
||||
this._selectionLength = selection.length;
|
||||
this._selection = selection;
|
||||
this._extensionProps = { selection: this._selection };
|
||||
this._elementProps = { selection: this._selection };
|
||||
},
|
||||
'umbSelectionObserver',
|
||||
);
|
||||
@@ -86,8 +86,8 @@ export class UmbCollectionSelectionActionsElement extends UmbLitElement {
|
||||
id="actions"
|
||||
type="entityBulkAction"
|
||||
default-element="umb-entity-bulk-action"
|
||||
.props=${this._extensionProps}
|
||||
.apiArgs=${[this._extensionProps]}
|
||||
.elementProps=${this._elementProps}
|
||||
.apiArgs=${[this._elementProps]}
|
||||
@action-executed=${this.#onActionExecuted}>
|
||||
</umb-extension-with-api-slot>
|
||||
</div>
|
||||
|
||||
@@ -77,13 +77,13 @@ export class UmbExtensionWithApiSlotElement extends UmbLitElement {
|
||||
* @type {Record<string, any>}
|
||||
* @memberof UmbExtensionSlot
|
||||
* @example
|
||||
* <umb-extension-with-api-slot type="my-extension-type" .props=${{foo: 'bar'}}></umb-extension-with-api-slot>
|
||||
* <umb-extension-with-api-slot type="my-extension-type" .elementProps=${{foo: 'bar'}}></umb-extension-with-api-slot>
|
||||
*/
|
||||
@property({ type: Object, attribute: false })
|
||||
get props(): Record<string, unknown> | undefined {
|
||||
@property({ attribute: false })
|
||||
get elementProps(): Record<string, unknown> | undefined {
|
||||
return this.#props;
|
||||
}
|
||||
set props(newVal: Record<string, unknown> | undefined) {
|
||||
set elementProps(newVal: Record<string, unknown> | undefined) {
|
||||
// TODO, compare changes since last time. only reset the ones that changed. This might be better done by the controller is self:
|
||||
this.#props = newVal;
|
||||
if (this.#extensionsController) {
|
||||
|
||||
@@ -40,7 +40,7 @@ export class UmbEntityActionListElement extends UmbLitElement {
|
||||
type="entityAction"
|
||||
default-element="umb-entity-action"
|
||||
.filter=${this._filter}
|
||||
.props=${this._props}
|
||||
.elementProps=${this._props}
|
||||
.apiArgs=${[this._props]}></umb-extension-with-api-slot>
|
||||
`
|
||||
: '';
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
import type { UmbEntityBulkAction } from './entity-bulk-action.interface.js';
|
||||
import type { UmbEntityBulkActionArgs } from './types.js';
|
||||
import type { MetaEntityBulkAction } from '@umbraco-cms/backoffice/extension-registry';
|
||||
import { UmbActionBase } from '@umbraco-cms/backoffice/action';
|
||||
|
||||
export abstract class UmbEntityBulkActionBase<ArgsMetaType = unknown>
|
||||
export abstract class UmbEntityBulkActionBase<ArgsMetaType extends MetaEntityBulkAction>
|
||||
extends UmbActionBase<UmbEntityBulkActionArgs<ArgsMetaType>>
|
||||
implements UmbEntityBulkAction<ArgsMetaType>
|
||||
{
|
||||
|
||||
@@ -6,7 +6,7 @@ import { UmbLitElement } from '@umbraco-cms/backoffice/lit-element';
|
||||
|
||||
@customElement('umb-entity-bulk-action')
|
||||
export class UmbEntityBulkActionElement<
|
||||
MetaType = MetaEntityBulkAction,
|
||||
MetaType extends MetaEntityBulkAction = MetaEntityBulkAction,
|
||||
ApiType extends UmbEntityBulkActionBase<MetaType> = UmbEntityBulkActionBase<MetaType>,
|
||||
> extends UmbLitElement {
|
||||
@property({ attribute: false })
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
import type { UmbEntityBulkActionArgs } from './types.js';
|
||||
import type { MetaEntityBulkAction } from '@umbraco-cms/backoffice/extension-registry';
|
||||
import type { UmbAction } from '@umbraco-cms/backoffice/action';
|
||||
|
||||
export interface UmbEntityBulkAction<ArgsMetaType> extends UmbAction<UmbEntityBulkActionArgs<ArgsMetaType>> {
|
||||
export interface UmbEntityBulkAction<ArgsMetaType extends MetaEntityBulkAction>
|
||||
extends UmbAction<UmbEntityBulkActionArgs<ArgsMetaType>> {
|
||||
selection: Array<string>;
|
||||
|
||||
// I don't think we need this one, now that we have the above one? [NL]
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
export interface UmbEntityBulkActionArgs<MetaArgsType> {
|
||||
import type { MetaEntityBulkAction } from '../extension-registry/models/entity-bulk-action.model.js';
|
||||
|
||||
export interface UmbEntityBulkActionArgs<MetaArgsType extends MetaEntityBulkAction> {
|
||||
entityType: string;
|
||||
meta: MetaArgsType;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user