register bulk copy for documents
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
import { UmbDocumentRepository } from '../../repository/document.repository';
|
||||
import { UmbActionBase } from '../../../../shared/entity-actions';
|
||||
import { UmbControllerHostInterface } from '@umbraco-cms/controller';
|
||||
|
||||
export class UmbDocumentCopyEntityBulkAction 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 copy for: ${this.#selection}`);
|
||||
await this.repository?.copy();
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,5 @@
|
||||
import { UmbDocumentMoveEntityBulkAction } from './move/move.action';
|
||||
import { UmbDocumentCopyEntityBulkAction } from './copy/copy.action';
|
||||
import { ManifestEntityBulkAction } from '@umbraco-cms/extensions-registry';
|
||||
|
||||
const entityType = 'document';
|
||||
@@ -9,7 +10,7 @@ const entityActions: Array<ManifestEntityBulkAction> = [
|
||||
type: 'entityBulkAction',
|
||||
alias: 'Umb.EntityBulkAction.Document.Move',
|
||||
name: 'Move Document Entity Bulk Action',
|
||||
weight: 1000,
|
||||
weight: 10,
|
||||
meta: {
|
||||
entityType,
|
||||
label: 'Move',
|
||||
@@ -17,6 +18,18 @@ const entityActions: Array<ManifestEntityBulkAction> = [
|
||||
api: UmbDocumentMoveEntityBulkAction,
|
||||
},
|
||||
},
|
||||
{
|
||||
type: 'entityBulkAction',
|
||||
alias: 'Umb.EntityBulkAction.Document.Copy',
|
||||
name: 'Copy Document Entity Bulk Action',
|
||||
weight: 9,
|
||||
meta: {
|
||||
entityType,
|
||||
label: 'Copy',
|
||||
repositoryAlias,
|
||||
api: UmbDocumentCopyEntityBulkAction,
|
||||
},
|
||||
},
|
||||
];
|
||||
|
||||
export const manifests = [...entityActions];
|
||||
|
||||
Reference in New Issue
Block a user