add trash method to document and media repositories

This commit is contained in:
Mads Rasmussen
2023-02-07 19:24:13 +01:00
parent 24d4157b77
commit db46500f6f
5 changed files with 10 additions and 18 deletions

View File

@@ -220,6 +220,10 @@ export class UmbDocumentRepository implements UmbTreeRepository, UmbDetailReposi
// Listing all currently known methods we need to implement:
// these currently only covers posting data
// TODO: find a good way to split these
async trash() {
alert('trash');
}
async saveAndPublish() {
alert('save and publish');
}

View File

@@ -1,4 +1,4 @@
import { TrashMediaEntityAction } from './trash-media.entity-action';
import { UmbTrashEntityAction } from '../../../shared/entity-actions/trash/trash.action';
import { ManifestEntityAction } from 'libs/extensions-registry/entity-action.models';
const entityActions: Array<ManifestEntityAction> = [
@@ -10,7 +10,7 @@ const entityActions: Array<ManifestEntityAction> = [
entityType: 'media',
icon: 'umb:trash',
label: 'Trash',
api: TrashMediaEntityAction,
api: UmbTrashEntityAction,
repositoryAlias: 'Umb.Repository.Media',
},
},

View File

@@ -1,15 +0,0 @@
import { UmbControllerHostInterface } from '@umbraco-cms/controller';
export class TrashMediaEntityAction {
#host: UmbControllerHostInterface;
#key: string;
constructor(host: UmbControllerHostInterface, key: string) {
this.#host = host;
this.#key = key;
}
async execute() {
alert('trash media');
}
}

View File

@@ -213,6 +213,10 @@ export class UmbMediaRepository implements UmbTreeRepository, UmbDetailRepositor
return { error };
}
async trash() {
alert('trash');
}
async move() {
alert('move');
}

View File

@@ -33,7 +33,6 @@ export class UmbCollectionBulkActionDeleteElement extends UmbLitElement {
}
#handleClick(event: Event) {
// TODO: Revisit this subscription nightmare, can we make this simpler, avoid subscribing to the selection?
const selectionSubscription = this.#collectionContext?.selection.subscribe((selection) => {