-
Notifications
You must be signed in to change notification settings - Fork 60
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 #2446 from umbraco/v15/feature/folder-children-col…
…lection-workspace-view Feature: Folder Children Collection Workspace View
- Loading branch information
Showing
49 changed files
with
445 additions
and
171 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
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
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
2 changes: 1 addition & 1 deletion
2
...es/documents/document-types/components/input-document-type/input-document-type.element.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
3 changes: 2 additions & 1 deletion
3
src/packages/documents/document-types/entity-actions/create/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
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
7 changes: 2 additions & 5 deletions
7
src/packages/documents/document-types/tree/document-type.tree.server.data-source.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
export const UMB_DOCUMENT_TYPE_FOLDER_ENTITY_TYPE = 'document-type-folder'; | ||
export type UmbDocumentTypeFolderEntityType = typeof UMB_DOCUMENT_TYPE_FOLDER_ENTITY_TYPE; |
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,2 +1,3 @@ | ||
export * from './repository/index.js'; | ||
export * from './workspace/index.js'; | ||
export * from './entity.js'; |
6 changes: 3 additions & 3 deletions
6
src/packages/documents/document-types/tree/folder/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
2 changes: 1 addition & 1 deletion
2
...ocuments/document-types/tree/folder/repository/document-type-folder.server.data-source.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
2 changes: 1 addition & 1 deletion
2
.../documents/document-types/tree/folder/workspace/document-type-folder-workspace.context.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
2 changes: 1 addition & 1 deletion
2
...ents/document-types/tree/folder/workspace/document-type-folder.workspace.context-token.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
export * from './constants.js'; | ||
export * from './paths.js'; |
2 changes: 1 addition & 1 deletion
2
src/packages/documents/document-types/tree/folder/workspace/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
14 changes: 14 additions & 0 deletions
14
src/packages/documents/document-types/tree/folder/workspace/paths.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,14 @@ | ||
import { UMB_DOCUMENT_TYPE_FOLDER_ENTITY_TYPE } from '../entity.js'; | ||
import { UmbPathPattern } from '@umbraco-cms/backoffice/router'; | ||
import { UMB_SETTINGS_SECTION_PATHNAME } from '@umbraco-cms/backoffice/settings'; | ||
import { UMB_WORKSPACE_PATH_PATTERN } from '@umbraco-cms/backoffice/workspace'; | ||
|
||
export const UMB_DOCUMENT_TYPE_FOLDER_WORKSPACE_PATH = UMB_WORKSPACE_PATH_PATTERN.generateAbsolute({ | ||
sectionName: UMB_SETTINGS_SECTION_PATHNAME, | ||
entityType: UMB_DOCUMENT_TYPE_FOLDER_ENTITY_TYPE, | ||
}); | ||
|
||
export const UMB_EDIT_DOCUMENT_TYPE_FOLDER_WORKSPACE_PATH_PATTERN = new UmbPathPattern<{ unique: string }>( | ||
'edit/:unique', | ||
UMB_DOCUMENT_TYPE_FOLDER_WORKSPACE_PATH, | ||
); |
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,4 +1,5 @@ | ||
export { UMB_DOCUMENT_TYPE_TREE_STORE_CONTEXT } from './document-type.tree.store.context-token.js'; | ||
export { UMB_DOCUMENT_TYPE_TREE_REPOSITORY_ALIAS, UMB_DOCUMENT_TYPE_TREE_ALIAS } from './constants.js'; | ||
export * from './constants.js'; | ||
export * from './folder/index.js'; | ||
export * from './tree-item-children/collection/index.js'; | ||
export type * from './types.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
1 change: 1 addition & 0 deletions
1
src/packages/documents/document-types/tree/tree-item-children/collection/constants.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 @@ | ||
export const UMB_DOCUMENT_TYPE_TREE_ITEM_CHILDREN_COLLECTION_ALIAS = 'Umb.Collection.DocumentType.TreeItemChildren'; |
2 changes: 2 additions & 0 deletions
2
src/packages/documents/document-types/tree/tree-item-children/collection/index.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,2 @@ | ||
export * from './constants.js'; | ||
export * from './repository/index.js'; |
18 changes: 18 additions & 0 deletions
18
src/packages/documents/document-types/tree/tree-item-children/collection/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 |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import { manifests as viewManifests } from './views/manifests.js'; | ||
import { manifests as repositoryManifests } from './repository/manifests.js'; | ||
import { UMB_DOCUMENT_TYPE_TREE_ITEM_CHILDREN_COLLECTION_ALIAS } from './constants.js'; | ||
import { UMB_DOCUMENT_TYPE_TREE_ITEM_CHILDREN_COLLECTION_REPOSITORY_ALIAS } from './repository/index.js'; | ||
|
||
export const manifests: Array<UmbExtensionManifest> = [ | ||
{ | ||
type: 'collection', | ||
kind: 'default', | ||
alias: UMB_DOCUMENT_TYPE_TREE_ITEM_CHILDREN_COLLECTION_ALIAS, | ||
name: 'Document Type Tree Item Children Collection', | ||
meta: { | ||
repositoryAlias: UMB_DOCUMENT_TYPE_TREE_ITEM_CHILDREN_COLLECTION_REPOSITORY_ALIAS, | ||
}, | ||
}, | ||
...viewManifests, | ||
...repositoryManifests, | ||
]; |
2 changes: 2 additions & 0 deletions
2
...kages/documents/document-types/tree/tree-item-children/collection/repository/constants.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,2 @@ | ||
export const UMB_DOCUMENT_TYPE_TREE_ITEM_CHILDREN_COLLECTION_REPOSITORY_ALIAS = | ||
'Umb.Repository.DocumentType.TreeItemChildrenCollection'; |
33 changes: 33 additions & 0 deletions
33
...-children/collection/repository/document-type-tree-item-children-collection.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,33 @@ | ||
import { UmbDocumentTypeTreeRepository } from '../../../document-type-tree.repository.js'; | ||
import type { UmbCollectionFilterModel, UmbCollectionRepository } from '@umbraco-cms/backoffice/collection'; | ||
import { UmbRepositoryBase } from '@umbraco-cms/backoffice/repository'; | ||
import { UMB_ENTITY_CONTEXT, type UmbEntityModel } from '@umbraco-cms/backoffice/entity'; | ||
|
||
export class UmbDocumentTypeTreeItemChildrenCollectionRepository | ||
extends UmbRepositoryBase | ||
implements UmbCollectionRepository | ||
{ | ||
#treeRepository = new UmbDocumentTypeTreeRepository(this); | ||
|
||
async requestCollection(filter: UmbCollectionFilterModel) { | ||
// TODO: get parent from args | ||
const entityContext = await this.getContext(UMB_ENTITY_CONTEXT); | ||
if (!entityContext) throw new Error('Entity context not found'); | ||
|
||
const entityType = entityContext.getEntityType(); | ||
const unique = entityContext.getUnique(); | ||
|
||
if (!entityType) throw new Error('Entity type not found'); | ||
if (unique === undefined) throw new Error('Unique not found'); | ||
|
||
const parent: UmbEntityModel = { entityType, unique }; | ||
|
||
if (parent.unique === null) { | ||
return this.#treeRepository.requestTreeRootItems({ skip: filter.skip, take: filter.take }); | ||
} else { | ||
return this.#treeRepository.requestTreeItemsOf({ parent, skip: filter.skip, take: filter.take }); | ||
} | ||
} | ||
} | ||
|
||
export { UmbDocumentTypeTreeItemChildrenCollectionRepository as api }; |
1 change: 1 addition & 0 deletions
1
src/packages/documents/document-types/tree/tree-item-children/collection/repository/index.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 @@ | ||
export * from './constants.js'; |
10 changes: 10 additions & 0 deletions
10
...kages/documents/document-types/tree/tree-item-children/collection/repository/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 |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import { UMB_DOCUMENT_TYPE_TREE_ITEM_CHILDREN_COLLECTION_REPOSITORY_ALIAS } from './constants.js'; | ||
|
||
export const manifests: Array<UmbExtensionManifest> = [ | ||
{ | ||
type: 'repository', | ||
alias: UMB_DOCUMENT_TYPE_TREE_ITEM_CHILDREN_COLLECTION_REPOSITORY_ALIAS, | ||
name: 'Document Type Tree Item Children Collection Repository', | ||
api: () => import('./document-type-tree-item-children-collection.repository.js'), | ||
}, | ||
]; |
6 changes: 6 additions & 0 deletions
6
src/packages/documents/document-types/tree/tree-item-children/collection/types.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,6 @@ | ||
import type { UmbCollectionFilterModel } from '@umbraco-cms/backoffice/collection'; | ||
import type { UmbEntityModel } from '@umbraco-cms/backoffice/entity'; | ||
|
||
export interface UmbDocumentTypeTreeItemChildrenCollectionFilterModel extends UmbCollectionFilterModel { | ||
parent: UmbEntityModel; | ||
} |
Oops, something went wrong.