register move for documents
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
import { UmbDocumentMoveEntityBulkAction } from './move/move.action';
|
||||
import { ManifestEntityBulkAction } from '@umbraco-cms/extensions-registry';
|
||||
|
||||
const entityType = 'document';
|
||||
const repositoryAlias = 'Umb.Repository.Documents';
|
||||
|
||||
const entityActions: Array<ManifestEntityBulkAction> = [
|
||||
{
|
||||
type: 'entityBulkAction',
|
||||
alias: 'Umb.EntityBulkAction.Document.Move',
|
||||
name: 'Move Document Entity Bulk Action',
|
||||
weight: 1000,
|
||||
meta: {
|
||||
entityType,
|
||||
label: 'Move',
|
||||
repositoryAlias,
|
||||
api: UmbDocumentMoveEntityBulkAction,
|
||||
},
|
||||
},
|
||||
];
|
||||
|
||||
export const manifests = [...entityActions];
|
||||
@@ -0,0 +1,21 @@
|
||||
import { UmbDocumentRepository } from '../../repository/document.repository';
|
||||
import { UmbActionBase } from '../../../../shared/entity-actions';
|
||||
import { UmbControllerHostInterface } from '@umbraco-cms/controller';
|
||||
|
||||
export class UmbDocumentMoveEntityBulkAction extends UmbActionBase<UmbDocumentRepository> {
|
||||
#selection: Array<string>;
|
||||
|
||||
constructor(host: UmbControllerHostInterface, repositoryAlias: string, selection: Array<string>) {
|
||||
super(host, repositoryAlias);
|
||||
this.#selection = selection;
|
||||
}
|
||||
|
||||
setSelection(selection: Array<string>) {
|
||||
this.#selection = selection;
|
||||
}
|
||||
|
||||
async execute() {
|
||||
console.log(`execute move for: ${this.#selection}`);
|
||||
await this.repository?.move();
|
||||
}
|
||||
}
|
||||
@@ -4,6 +4,7 @@ import { manifests as repositoryManifests } from './repository/manifests';
|
||||
import { manifests as treeManifests } from './tree/manifests';
|
||||
import { manifests as workspaceManifests } from './workspace/manifests';
|
||||
import { manifests as entityActionManifests } from './entity-actions/manifests';
|
||||
import { manifests as entityBulkActionManifests } from './entity-bulk-actions/manifests';
|
||||
|
||||
export const manifests = [
|
||||
...collectionManifests,
|
||||
@@ -12,4 +13,5 @@ export const manifests = [
|
||||
...repositoryManifests,
|
||||
...workspaceManifests,
|
||||
...entityActionManifests,
|
||||
...entityBulkActionManifests,
|
||||
];
|
||||
|
||||
Reference in New Issue
Block a user