add trash method to document and media repositories
This commit is contained in:
@@ -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');
|
||||
}
|
||||
|
||||
@@ -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',
|
||||
},
|
||||
},
|
||||
|
||||
@@ -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');
|
||||
}
|
||||
}
|
||||
@@ -213,6 +213,10 @@ export class UmbMediaRepository implements UmbTreeRepository, UmbDetailRepositor
|
||||
return { error };
|
||||
}
|
||||
|
||||
async trash() {
|
||||
alert('trash');
|
||||
}
|
||||
|
||||
async move() {
|
||||
alert('move');
|
||||
}
|
||||
|
||||
@@ -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) => {
|
||||
|
||||
Reference in New Issue
Block a user