add recycle bin tree store
This commit is contained in:
@@ -1,5 +1,8 @@
|
||||
import { UMB_DOCUMENT_TREE_STORE_CONTEXT_TOKEN, UmbDocumentTreeStore } from '../../repository/document.tree.store.js';
|
||||
import { UmbDocumentRecycleBinTreeServerDataSource } from './sources/document-recycle-bin.tree.server.data.js';
|
||||
import {
|
||||
UMB_DOCUMENT_RECYCLE_BIN_TREE_STORE_CONTEXT,
|
||||
UmbDocumentRecycleBinTreeStore,
|
||||
} from './document-recycle.bin.tree.store.js';
|
||||
import type { UmbTreeDataSource, UmbTreeRepository } from '@umbraco-cms/backoffice/repository';
|
||||
import { UmbControllerHostElement } from '@umbraco-cms/backoffice/controller-api';
|
||||
import { UmbContextConsumerController } from '@umbraco-cms/backoffice/context-api';
|
||||
@@ -11,7 +14,7 @@ export class UmbDocumentRecycleBinRepository implements UmbTreeRepository<Docume
|
||||
#host: UmbControllerHostElement;
|
||||
|
||||
#treeSource: UmbTreeDataSource;
|
||||
#treeStore?: UmbDocumentTreeStore;
|
||||
#treeStore?: UmbDocumentRecycleBinTreeStore;
|
||||
|
||||
constructor(host: UmbControllerHostElement) {
|
||||
this.#host = host;
|
||||
@@ -20,7 +23,7 @@ export class UmbDocumentRecycleBinRepository implements UmbTreeRepository<Docume
|
||||
this.#treeSource = new UmbDocumentRecycleBinTreeServerDataSource(this.#host);
|
||||
|
||||
this.#init = Promise.all([
|
||||
new UmbContextConsumerController(this.#host, UMB_DOCUMENT_TREE_STORE_CONTEXT_TOKEN, (instance) => {
|
||||
new UmbContextConsumerController(this.#host, UMB_DOCUMENT_RECYCLE_BIN_TREE_STORE_CONTEXT, (instance) => {
|
||||
this.#treeStore = instance;
|
||||
}),
|
||||
]);
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
import { UmbContextToken } from '@umbraco-cms/backoffice/context-api';
|
||||
import { UmbEntityTreeStore } from '@umbraco-cms/backoffice/store';
|
||||
import { UmbControllerHostElement } from '@umbraco-cms/backoffice/controller-api';
|
||||
|
||||
/**
|
||||
* @export
|
||||
* @class UmbDocumentRecycleBinTreeStore
|
||||
* @extends {UmbEntityTreeStore}
|
||||
* @description - Tree Data Store for the Document Recycle Bin
|
||||
*/
|
||||
export class UmbDocumentRecycleBinTreeStore extends UmbEntityTreeStore {
|
||||
/**
|
||||
* Creates an instance of UmbDocumentRecycleBinTreeStore.
|
||||
* @param {UmbControllerHostElement} host
|
||||
* @memberof UmbDocumentRecycleBinTreeStore
|
||||
*/
|
||||
constructor(host: UmbControllerHostElement) {
|
||||
super(host, UMB_DOCUMENT_RECYCLE_BIN_TREE_STORE_CONTEXT.toString());
|
||||
}
|
||||
}
|
||||
|
||||
export const UMB_DOCUMENT_RECYCLE_BIN_TREE_STORE_CONTEXT = new UmbContextToken<UmbDocumentRecycleBinTreeStore>(
|
||||
'UmbDocumentRecycleBinTreeStore',
|
||||
);
|
||||
@@ -1,5 +1,6 @@
|
||||
import { UmbDocumentRecycleBinRepository } from './document-recycle-bin.repository.js';
|
||||
import type { ManifestRepository } from '@umbraco-cms/backoffice/extension-registry';
|
||||
import { UmbDocumentRecycleBinTreeStore } from './document-recycle.bin.tree.store.js';
|
||||
import type { ManifestRepository, ManifestTreeStore } from '@umbraco-cms/backoffice/extension-registry';
|
||||
|
||||
export const DOCUMENT_RECYCLE_BIN_REPOSITORY_ALIAS = 'Umb.Repository.DocumentRecycleBin';
|
||||
|
||||
@@ -10,4 +11,13 @@ const repository: ManifestRepository = {
|
||||
class: UmbDocumentRecycleBinRepository,
|
||||
};
|
||||
|
||||
export const manifests = [repository];
|
||||
export const DOCUMENT_RECYCLE_BIN_TREE_STORE_ALIAS = 'Umb.Store.DocumentRecycleBinTree';
|
||||
|
||||
const treeStore: ManifestTreeStore = {
|
||||
type: 'treeStore',
|
||||
alias: DOCUMENT_RECYCLE_BIN_TREE_STORE_ALIAS,
|
||||
name: 'Document Recycle Bin Tree Store',
|
||||
class: UmbDocumentRecycleBinTreeStore,
|
||||
};
|
||||
|
||||
export const manifests = [repository, treeStore];
|
||||
|
||||
Reference in New Issue
Block a user