update common entity actions
This commit is contained in:
@@ -1,13 +1,12 @@
|
||||
import { UmbEntityActionBase } from '../../entity-action.js';
|
||||
import { UmbEntityActionBase } from '../../entity-action-base.js';
|
||||
import type { UmbControllerHostElement } from '@umbraco-cms/backoffice/controller-api';
|
||||
|
||||
export class UmbCopyEntityAction<T extends { copy(): Promise<void> }> extends UmbEntityActionBase<T> {
|
||||
constructor(host: UmbControllerHostElement, repositoryAlias: string, unique: string, entityType: string) {
|
||||
super(host, repositoryAlias, unique, entityType);
|
||||
export class UmbCopyEntityAction extends UmbEntityActionBase<any> {
|
||||
constructor(host: UmbControllerHostElement, args: any) {
|
||||
super(host, args);
|
||||
}
|
||||
|
||||
async execute() {
|
||||
console.log(`execute for: ${this.unique}`);
|
||||
await this.repository?.copy();
|
||||
console.log(`execute copy for: ${this.args.unique}`);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,15 +1,12 @@
|
||||
import { UmbEntityActionBase } from '../../entity-action.js';
|
||||
import type { UmbControllerHostElement } from '@umbraco-cms/backoffice/controller-api';
|
||||
import { UmbEntityActionBase } from '../../entity-action-base.js';
|
||||
import type { UmbControllerHost } from '@umbraco-cms/backoffice/controller-api';
|
||||
|
||||
// TODO: investigate what we need to finish the generic move action. We would need to open a picker, which requires a modal token,
|
||||
// maybe we can use kinds to make a specific manifest to the move action.
|
||||
export class UmbMoveEntityAction<T extends { move(): Promise<void> }> extends UmbEntityActionBase<T> {
|
||||
constructor(host: UmbControllerHostElement, repositoryAlias: string, unique: string, entityType: string) {
|
||||
super(host, repositoryAlias, unique, entityType);
|
||||
export class UmbMoveEntityAction extends UmbEntityActionBase<any> {
|
||||
constructor(host: UmbControllerHost, args: any) {
|
||||
super(host, args);
|
||||
}
|
||||
|
||||
async execute() {
|
||||
console.log(`execute for: ${this.unique}`);
|
||||
await this.repository?.move();
|
||||
console.log(`execute move for: ${this.args.unique}`);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,15 +1,12 @@
|
||||
import { UmbEntityActionBase } from '../../entity-action.js';
|
||||
import { UmbEntityActionBase } from '../../entity-action-base.js';
|
||||
import type { UmbControllerHostElement } from '@umbraco-cms/backoffice/controller-api';
|
||||
|
||||
export class UmbSortChildrenOfEntityAction<
|
||||
T extends { sortChildrenOf(): Promise<void> },
|
||||
> extends UmbEntityActionBase<T> {
|
||||
constructor(host: UmbControllerHostElement, repositoryAlias: string, unique: string, entityType: string) {
|
||||
super(host, repositoryAlias, unique, entityType);
|
||||
export class UmbSortChildrenOfEntityAction extends UmbEntityActionBase<any> {
|
||||
constructor(host: UmbControllerHostElement, args: any) {
|
||||
super(host, args);
|
||||
}
|
||||
|
||||
async execute() {
|
||||
console.log(`execute for: ${this.unique}`);
|
||||
await this.repository?.sortChildrenOf();
|
||||
console.log(`execute sort for: ${this.args.unique}`);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,11 +1,15 @@
|
||||
import { UmbEntityActionBase } from '../../entity-action.js';
|
||||
import { umbConfirmModal } from '@umbraco-cms/backoffice/modal';
|
||||
import type { UmbItemRepository } from '@umbraco-cms/backoffice/repository';
|
||||
import { UmbEntityActionBase } from '../../entity-action-base.js';
|
||||
import type { UmbControllerHost } from '@umbraco-cms/backoffice/controller-api';
|
||||
//import { umbConfirmModal } from '@umbraco-cms/backoffice/modal';
|
||||
|
||||
export class UmbTrashEntityAction extends UmbEntityActionBase<any> {
|
||||
constructor(host: UmbControllerHost, args: any) {
|
||||
super(host, args);
|
||||
}
|
||||
|
||||
export class UmbTrashEntityAction<
|
||||
T extends UmbItemRepository<any> & { trash(unique: string): Promise<void> },
|
||||
> extends UmbEntityActionBase<T> {
|
||||
async execute() {
|
||||
console.log(`execute trash for: ${this.args.unique}`);
|
||||
/*
|
||||
if (!this.repository) return;
|
||||
|
||||
const { data } = await this.repository.requestItems([this.unique]);
|
||||
@@ -22,5 +26,6 @@ export class UmbTrashEntityAction<
|
||||
|
||||
this.repository?.trash(this.unique);
|
||||
}
|
||||
*/
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user