-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #992 from umbraco/improvement-split-document-recyc…
…le-bin-tree-repo Improvement: Split document recycle bin tree into its own repo
- Loading branch information
Showing
12 changed files
with
91 additions
and
125 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
export const UMB_DOCUMENT_RECYCLE_BIN_ROOT_ENTITY_TYPE = 'document-recycle-bin-root'; | ||
export const UMB_DOCUMENT_RECYCLE_BIN_ENTITY_TYPE = 'document-recycle-bin'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
export * from './repository/index.js'; | ||
export * from './tree/index.js'; | ||
export * from './entities.js'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,5 @@ | ||
import { manifests as repositoryManifests } from './repository/manifests.js'; | ||
import { manifests as treeManifests } from './tree/manifests.js'; | ||
import { manifests as menuItemManifests } from './menu-item/manifests.js'; | ||
import { manifests as entityActionManifests } from './entity-action/manifests.js'; | ||
|
||
export const manifests = [...repositoryManifests, ...treeManifests, ...menuItemManifests, ...entityActionManifests]; | ||
export const manifests = [...treeManifests, ...menuItemManifests, ...entityActionManifests]; |
81 changes: 0 additions & 81 deletions
81
src/packages/documents/documents/recycle-bin/repository/document-recycle-bin.repository.ts
This file was deleted.
Oops, something went wrong.
1 change: 0 additions & 1 deletion
1
src/packages/documents/documents/recycle-bin/repository/index.ts
This file was deleted.
Oops, something went wrong.
23 changes: 0 additions & 23 deletions
23
src/packages/documents/documents/recycle-bin/repository/manifests.ts
This file was deleted.
Oops, something went wrong.
28 changes: 28 additions & 0 deletions
28
src/packages/documents/documents/recycle-bin/tree/document-recycle-bin-tree.repository.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import { UMB_DOCUMENT_RECYCLE_BIN_ROOT_ENTITY_TYPE } from '../entities.js'; | ||
import { UmbDocumentRecycleBinTreeServerDataSource } from './document-recycle-bin.server.data-source.js'; | ||
import { UmbDocumentRecycleBinTreeItemModel, UmbDocumentRecycleBinTreeRootModel } from './types.js'; | ||
import { UMB_DOCUMENT_RECYCLE_BIN_TREE_STORE_CONTEXT } from './document-recycle-bin-tree.store.js'; | ||
import { UmbTreeRepositoryBase } from '@umbraco-cms/backoffice/tree'; | ||
import { type UmbControllerHost } from '@umbraco-cms/backoffice/controller-api'; | ||
import { UmbApi } from '@umbraco-cms/backoffice/extension-api'; | ||
|
||
export class UmbDocumentRecycleBinTreeRepository | ||
extends UmbTreeRepositoryBase<UmbDocumentRecycleBinTreeItemModel, UmbDocumentRecycleBinTreeRootModel> | ||
implements UmbApi | ||
{ | ||
constructor(host: UmbControllerHost) { | ||
super(host, UmbDocumentRecycleBinTreeServerDataSource, UMB_DOCUMENT_RECYCLE_BIN_TREE_STORE_CONTEXT); | ||
} | ||
|
||
async requestTreeRoot() { | ||
const data = { | ||
id: null, | ||
type: UMB_DOCUMENT_RECYCLE_BIN_ROOT_ENTITY_TYPE, | ||
name: 'Recycle Bin', | ||
icon: 'icon-trash', | ||
hasChildren: true, | ||
}; | ||
|
||
return { data }; | ||
} | ||
} |
6 changes: 3 additions & 3 deletions
6
...sitory/document-recycle.bin.tree.store.ts → ...n/tree/document-recycle-bin-tree.store.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
export { UmbDocumentRecycleBinTreeRepository } from './document-recycle-bin-tree.repository.js'; | ||
export { | ||
UMB_DOCUMENT_RECYCLE_BIN_TREE_REPOSITORY_ALIAS, | ||
UMB_DOCUMENT_RECYCLE_BIN_TREE_STORE_ALIAS, | ||
UMB_DOCUMENT_RECYCLE_BIN_TREE_ALIAS, | ||
} from './manifests.js'; | ||
export { UMB_DOCUMENT_RECYCLE_BIN_TREE_STORE_CONTEXT } from './document-recycle-bin-tree.store.js'; | ||
export { type UmbDocumentRecycleBinTreeStore } from './document-recycle-bin-tree.store.js'; | ||
export * from './types.js'; |
39 changes: 32 additions & 7 deletions
39
src/packages/documents/documents/recycle-bin/tree/manifests.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,48 @@ | ||
import { DOCUMENT_RECYCLE_BIN_REPOSITORY_ALIAS } from '../repository/manifests.js'; | ||
import type { ManifestTree, ManifestTreeItem } from '@umbraco-cms/backoffice/extension-registry'; | ||
import { UMB_DOCUMENT_RECYCLE_BIN_ENTITY_TYPE, UMB_DOCUMENT_RECYCLE_BIN_ROOT_ENTITY_TYPE } from '../entities.js'; | ||
import { UmbDocumentRecycleBinTreeRepository } from './document-recycle-bin-tree.repository.js'; | ||
import { UmbDocumentRecycleBinTreeStore } from './document-recycle-bin-tree.store.js'; | ||
import type { | ||
ManifestRepository, | ||
ManifestTree, | ||
ManifestTreeItem, | ||
ManifestTreeStore, | ||
} from '@umbraco-cms/backoffice/extension-registry'; | ||
|
||
export const UMB_DOCUMENT_RECYCLE_BIN_TREE_REPOSITORY_ALIAS = 'Umb.Repository.DocumentRecycleBin.Tree'; | ||
export const UMB_DOCUMENT_RECYCLE_BIN_TREE_STORE_ALIAS = 'Umb.Store.DocumentRecycleBin.Tree'; | ||
export const UMB_DOCUMENT_RECYCLE_BIN_TREE_ALIAS = 'Umb.Tree.DocumentRecycleBin'; | ||
|
||
const treeRepository: ManifestRepository = { | ||
type: 'repository', | ||
alias: UMB_DOCUMENT_RECYCLE_BIN_TREE_REPOSITORY_ALIAS, | ||
name: 'Document Recycle Bin Tree Repository', | ||
api: UmbDocumentRecycleBinTreeRepository, | ||
}; | ||
|
||
const treeStore: ManifestTreeStore = { | ||
type: 'treeStore', | ||
alias: UMB_DOCUMENT_RECYCLE_BIN_TREE_STORE_ALIAS, | ||
name: 'Document Recycle Bin Tree Store', | ||
api: UmbDocumentRecycleBinTreeStore, | ||
}; | ||
|
||
const tree: ManifestTree = { | ||
type: 'tree', | ||
alias: 'Umb.Tree.DocumentRecycleBin', | ||
alias: UMB_DOCUMENT_RECYCLE_BIN_TREE_ALIAS, | ||
name: 'Document Recycle Bin Tree', | ||
meta: { | ||
repositoryAlias: DOCUMENT_RECYCLE_BIN_REPOSITORY_ALIAS, | ||
repositoryAlias: UMB_DOCUMENT_RECYCLE_BIN_TREE_REPOSITORY_ALIAS, | ||
}, | ||
}; | ||
|
||
const treeItem: ManifestTreeItem = { | ||
type: 'treeItem', | ||
kind: 'entity', | ||
alias: 'Umb.TreeItem.DocumentRecycleBin', | ||
name: 'Document Recycle Bin Tree Item', | ||
name: 'DocumentRecycleBin Tree Item', | ||
meta: { | ||
entityTypes: ['document-recycle-bin-root'], | ||
entityTypes: [UMB_DOCUMENT_RECYCLE_BIN_ROOT_ENTITY_TYPE, UMB_DOCUMENT_RECYCLE_BIN_ENTITY_TYPE], | ||
}, | ||
}; | ||
|
||
export const manifests = [tree, treeItem]; | ||
export const manifests = [treeRepository, treeStore, tree, treeItem]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import { RecycleBinItemResponseModel } from '@umbraco-cms/backoffice/backend-api'; | ||
import type { UmbEntityTreeItemModel, UmbEntityTreeRootModel } from '@umbraco-cms/backoffice/tree'; | ||
|
||
export type UmbDocumentRecycleBinTreeItemModel = RecycleBinItemResponseModel & UmbEntityTreeItemModel; | ||
export type UmbDocumentRecycleBinTreeRootModel = RecycleBinItemResponseModel & UmbEntityTreeRootModel; |