diff --git a/src/packages/core/collection/components/boolean-table-column-view/boolean-table-column-view.element.ts b/src/packages/core/collection/components/boolean-table-column-view/boolean-table-column-view.element.ts index cecfee1d0d..856e202deb 100644 --- a/src/packages/core/collection/components/boolean-table-column-view/boolean-table-column-view.element.ts +++ b/src/packages/core/collection/components/boolean-table-column-view/boolean-table-column-view.element.ts @@ -1,8 +1,7 @@ import { html, nothing, customElement, property } from '@umbraco-cms/backoffice/external/lit'; import { UmbLitElement } from '@umbraco-cms/backoffice/lit-element'; -const elementName = 'umb-boolean-table-column-view'; -@customElement(elementName) +@customElement('umb-boolean-table-column-view') export class UmbBooleanTableColumnViewElement extends UmbLitElement { @property({ attribute: false }) value = false; @@ -14,6 +13,6 @@ export class UmbBooleanTableColumnViewElement extends UmbLitElement { declare global { interface HTMLElementTagNameMap { - [elementName]: UmbBooleanTableColumnViewElement; + 'umb-boolean-table-column-view': UmbBooleanTableColumnViewElement; } } diff --git a/src/packages/core/collection/components/index.ts b/src/packages/core/collection/components/index.ts index a0bff0823a..a440030db1 100644 --- a/src/packages/core/collection/components/index.ts +++ b/src/packages/core/collection/components/index.ts @@ -1,9 +1,9 @@ +import './boolean-table-column-view/boolean-table-column-view.element.js'; import './collection-action-bundle.element.js'; import './collection-filter-field.element.js'; import './collection-selection-actions.element.js'; import './collection-toolbar.element.js'; import './collection-view-bundle.element.js'; -import './boolean-table-column-view/boolean-table-column-view.element.js'; import './pagination/collection-pagination.element.js'; export * from './collection-action-bundle.element.js'; diff --git a/src/packages/core/collection/components/pagination/collection-pagination.element.ts b/src/packages/core/collection/components/pagination/collection-pagination.element.ts index 7ee0688115..8bd77abf64 100644 --- a/src/packages/core/collection/components/pagination/collection-pagination.element.ts +++ b/src/packages/core/collection/components/pagination/collection-pagination.element.ts @@ -63,6 +63,10 @@ export class UmbCollectionPaginationElement extends UmbLitElement { UmbTextStyles, css` :host { + display: contents; + } + + uui-pagination { display: block; margin-top: var(--uui-size-layout-1); } diff --git a/src/packages/core/collection/default/collection-default.element.ts b/src/packages/core/collection/default/collection-default.element.ts index c1d0f54116..4350fdf0a7 100644 --- a/src/packages/core/collection/default/collection-default.element.ts +++ b/src/packages/core/collection/default/collection-default.element.ts @@ -113,11 +113,11 @@ export class UmbCollectionDefaultElement extends UmbLitElement { } #router { - display: none; + visibility: hidden; } .has-items #router { - display: block; + visibility: visible; } #empty-state { diff --git a/src/packages/core/workspace/entity-detail/entity-detail-workspace-base.ts b/src/packages/core/workspace/entity-detail/entity-detail-workspace-base.ts index a73af451b5..855370f93a 100644 --- a/src/packages/core/workspace/entity-detail/entity-detail-workspace-base.ts +++ b/src/packages/core/workspace/entity-detail/entity-detail-workspace-base.ts @@ -11,7 +11,7 @@ import { } from '@umbraco-cms/backoffice/entity-action'; import { UmbExtensionApiInitializer } from '@umbraco-cms/backoffice/extension-api'; import { umbExtensionsRegistry, type ManifestRepository } from '@umbraco-cms/backoffice/extension-registry'; -import type { UmbDetailRepository, UmbRepositoryResponseWithAsObservable } from '@umbraco-cms/backoffice/repository'; +import type { UmbDetailRepository } from '@umbraco-cms/backoffice/repository'; export interface UmbEntityDetailWorkspaceContextArgs { entityType: string; @@ -47,7 +47,6 @@ export abstract class UmbEntityDetailWorkspaceContextBase< public readonly unique = this._data.createObservablePartOfCurrent((data) => data?.unique); protected _getDataPromise?: Promise; - protected _detailRepository?: DetailRepositoryType; #entityContext = new UmbEntityContext(this); @@ -71,6 +70,7 @@ export abstract class UmbEntityDetailWorkspaceContextBase< constructor(host: UmbControllerHost, args: UmbEntityWorkspaceContextArgs) { super(host, args.workspaceAlias); this.#entityType = args.entityType; + this.#entityContext.setEntityType(this.#entityType); window.addEventListener('willchangestate', this.#onWillNavigate); this.#observeRepository(args.detailRepositoryAlias); } @@ -119,12 +119,9 @@ export abstract class UmbEntityDetailWorkspaceContextBase< return this.#parent.getValue()?.entityType; } - /** - * Load the workspace data - * @param {string} unique The unique identifier of the entity to load. - * @returns { Promise> } The data of the entity. - */ - async load(unique: string): Promise> { + async load(unique: string) { + this.#entityContext.setEntityType(this.#entityType); + this.#entityContext.setUnique(unique); await this.#init; this.resetState(); this._getDataPromise = this._detailRepository!.requestByUnique(unique); @@ -133,8 +130,6 @@ export abstract class UmbEntityDetailWorkspaceContextBase< const data = response.data; if (data) { - this.#entityContext.setEntityType(this.#entityType); - this.#entityContext.setUnique(unique); this._data.setPersisted(data); this._data.setCurrent(data); this.setIsNew(false); diff --git a/src/packages/documents/document-types/components/input-document-type/input-document-type.element.ts b/src/packages/documents/document-types/components/input-document-type/input-document-type.element.ts index de53c7122e..f7bc27eead 100644 --- a/src/packages/documents/document-types/components/input-document-type/input-document-type.element.ts +++ b/src/packages/documents/document-types/components/input-document-type/input-document-type.element.ts @@ -1,5 +1,5 @@ import type { UmbDocumentTypeItemModel } from '../../repository/index.js'; -import { UMB_DOCUMENT_TYPE_WORKSPACE_MODAL } from '../../workspace/document-type-workspace.modal-token.js'; +import { UMB_DOCUMENT_TYPE_WORKSPACE_MODAL } from '../../workspace/document-type/document-type-workspace.modal-token.js'; import type { UmbDocumentTypeTreeItemModel } from '../../tree/types.js'; import { UMB_EDIT_DOCUMENT_TYPE_WORKSPACE_PATH_PATTERN } from '../../paths.js'; import { UmbDocumentTypePickerInputContext } from './input-document-type.context.js'; diff --git a/src/packages/documents/document-types/entity-actions/create/manifests.ts b/src/packages/documents/document-types/entity-actions/create/manifests.ts index 2879df41cf..59786bc3e6 100644 --- a/src/packages/documents/document-types/entity-actions/create/manifests.ts +++ b/src/packages/documents/document-types/entity-actions/create/manifests.ts @@ -1,4 +1,5 @@ -import { UMB_DOCUMENT_TYPE_FOLDER_ENTITY_TYPE, UMB_DOCUMENT_TYPE_ROOT_ENTITY_TYPE } from '../../entity.js'; +import { UMB_DOCUMENT_TYPE_ROOT_ENTITY_TYPE } from '../../entity.js'; +import { UMB_DOCUMENT_TYPE_FOLDER_ENTITY_TYPE } from '../../tree/index.js'; export const manifests: Array = [ { diff --git a/src/packages/documents/document-types/entity.ts b/src/packages/documents/document-types/entity.ts index 7279881dac..3e502f8058 100644 --- a/src/packages/documents/document-types/entity.ts +++ b/src/packages/documents/document-types/entity.ts @@ -1,10 +1,10 @@ +import type { UmbDocumentTypeFolderEntityType } from './tree/index.js'; + export const UMB_DOCUMENT_TYPE_ENTITY_TYPE = 'document-type'; export const UMB_DOCUMENT_TYPE_ROOT_ENTITY_TYPE = 'document-type-root'; -export const UMB_DOCUMENT_TYPE_FOLDER_ENTITY_TYPE = 'document-type-folder'; export type UmbDocumentTypeEntityType = typeof UMB_DOCUMENT_TYPE_ENTITY_TYPE; export type UmbDocumentTypeRootEntityType = typeof UMB_DOCUMENT_TYPE_ROOT_ENTITY_TYPE; -export type UmbDocumentTypeFolderEntityType = typeof UMB_DOCUMENT_TYPE_FOLDER_ENTITY_TYPE; export type UmbDocumentTypeEntityTypeUnion = | UmbDocumentTypeEntityType diff --git a/src/packages/documents/document-types/tree/document-type.tree.server.data-source.ts b/src/packages/documents/document-types/tree/document-type.tree.server.data-source.ts index afd9e20e58..7f8dbfa1b7 100644 --- a/src/packages/documents/document-types/tree/document-type.tree.server.data-source.ts +++ b/src/packages/documents/document-types/tree/document-type.tree.server.data-source.ts @@ -1,9 +1,6 @@ -import { - UMB_DOCUMENT_TYPE_ENTITY_TYPE, - UMB_DOCUMENT_TYPE_FOLDER_ENTITY_TYPE, - UMB_DOCUMENT_TYPE_ROOT_ENTITY_TYPE, -} from '../entity.js'; +import { UMB_DOCUMENT_TYPE_ENTITY_TYPE, UMB_DOCUMENT_TYPE_ROOT_ENTITY_TYPE } from '../entity.js'; import type { UmbDocumentTypeTreeItemModel } from './types.js'; +import { UMB_DOCUMENT_TYPE_FOLDER_ENTITY_TYPE } from './folder/index.js'; import type { UmbTreeAncestorsOfRequestArgs, UmbTreeChildrenOfRequestArgs, diff --git a/src/packages/documents/document-types/tree/folder/entity.ts b/src/packages/documents/document-types/tree/folder/entity.ts new file mode 100644 index 0000000000..7b75b94cde --- /dev/null +++ b/src/packages/documents/document-types/tree/folder/entity.ts @@ -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; diff --git a/src/packages/documents/document-types/tree/folder/index.ts b/src/packages/documents/document-types/tree/folder/index.ts index 388ec6aca4..8bf4a043c8 100644 --- a/src/packages/documents/document-types/tree/folder/index.ts +++ b/src/packages/documents/document-types/tree/folder/index.ts @@ -1,2 +1,3 @@ export * from './repository/index.js'; export * from './workspace/index.js'; +export * from './entity.js'; diff --git a/src/packages/documents/document-types/tree/folder/manifests.ts b/src/packages/documents/document-types/tree/folder/manifests.ts index 9715c8438e..c8a24ff157 100644 --- a/src/packages/documents/document-types/tree/folder/manifests.ts +++ b/src/packages/documents/document-types/tree/folder/manifests.ts @@ -1,7 +1,7 @@ -import { UMB_DOCUMENT_TYPE_FOLDER_ENTITY_TYPE } from '../../entity.js'; -import { UMB_DOCUMENT_TYPE_FOLDER_REPOSITORY_ALIAS } from './repository/constants.js'; -import { manifests as workspaceManifests } from './workspace/manifests.js'; import { manifests as repositoryManifests } from './repository/manifests.js'; +import { manifests as workspaceManifests } from './workspace/manifests.js'; +import { UMB_DOCUMENT_TYPE_FOLDER_REPOSITORY_ALIAS } from './repository/constants.js'; +import { UMB_DOCUMENT_TYPE_FOLDER_ENTITY_TYPE } from './entity.js'; export const manifests: Array = [ { diff --git a/src/packages/documents/document-types/tree/folder/repository/document-type-folder.server.data-source.ts b/src/packages/documents/document-types/tree/folder/repository/document-type-folder.server.data-source.ts index 4c088664be..0c30b4d911 100644 --- a/src/packages/documents/document-types/tree/folder/repository/document-type-folder.server.data-source.ts +++ b/src/packages/documents/document-types/tree/folder/repository/document-type-folder.server.data-source.ts @@ -1,4 +1,4 @@ -import { UMB_DOCUMENT_TYPE_FOLDER_ENTITY_TYPE } from '../../../entity.js'; +import { UMB_DOCUMENT_TYPE_FOLDER_ENTITY_TYPE } from '../entity.js'; import type { UmbFolderModel } from '@umbraco-cms/backoffice/tree'; import { DocumentTypeService } from '@umbraco-cms/backoffice/external/backend-api'; import type { UmbControllerHost } from '@umbraco-cms/backoffice/controller-api'; diff --git a/src/packages/documents/document-types/tree/folder/types.ts b/src/packages/documents/document-types/tree/folder/types.ts index 20929ae03b..4c5a953a9d 100644 --- a/src/packages/documents/document-types/tree/folder/types.ts +++ b/src/packages/documents/document-types/tree/folder/types.ts @@ -1,5 +1,5 @@ -import type { UMB_DOCUMENT_TYPE_FOLDER_ENTITY_TYPE } from '../../entity.js'; import type { UmbDocumentTypeTreeItemModel } from '../types.js'; +import type { UMB_DOCUMENT_TYPE_FOLDER_ENTITY_TYPE } from './entity.js'; export interface UmbDocumentTypeFolderTreeItemModel extends UmbDocumentTypeTreeItemModel { entityType: typeof UMB_DOCUMENT_TYPE_FOLDER_ENTITY_TYPE; diff --git a/src/packages/documents/document-types/tree/folder/workspace/document-type-folder-workspace.context.ts b/src/packages/documents/document-types/tree/folder/workspace/document-type-folder-workspace.context.ts index 81ee4598ca..670f2a1ddf 100644 --- a/src/packages/documents/document-types/tree/folder/workspace/document-type-folder-workspace.context.ts +++ b/src/packages/documents/document-types/tree/folder/workspace/document-type-folder-workspace.context.ts @@ -1,8 +1,8 @@ -import { UMB_DOCUMENT_TYPE_FOLDER_ENTITY_TYPE } from '../../../entity.js'; import { UMB_DOCUMENT_TYPE_FOLDER_REPOSITORY_ALIAS, type UmbDocumentTypeFolderRepository, } from '../repository/index.js'; +import { UMB_DOCUMENT_TYPE_FOLDER_ENTITY_TYPE } from '../entity.js'; import { UMB_DOCUMENT_TYPE_FOLDER_WORKSPACE_ALIAS } from './constants.js'; import { UmbDocumentTypeFolderWorkspaceEditorElement } from './document-type-folder-editor.element.js'; import type { UmbControllerHost } from '@umbraco-cms/backoffice/controller-api'; diff --git a/src/packages/documents/document-types/tree/folder/workspace/document-type-folder.workspace.context-token.ts b/src/packages/documents/document-types/tree/folder/workspace/document-type-folder.workspace.context-token.ts index f81ff2e17c..8f59d8fd8f 100644 --- a/src/packages/documents/document-types/tree/folder/workspace/document-type-folder.workspace.context-token.ts +++ b/src/packages/documents/document-types/tree/folder/workspace/document-type-folder.workspace.context-token.ts @@ -1,4 +1,4 @@ -import { UMB_DOCUMENT_TYPE_FOLDER_ENTITY_TYPE } from '../../../entity.js'; +import { UMB_DOCUMENT_TYPE_FOLDER_ENTITY_TYPE } from '../entity.js'; import type { UmbDocumentTypeFolderWorkspaceContext } from './document-type-folder-workspace.context.js'; import { UmbContextToken } from '@umbraco-cms/backoffice/context-api'; import type { UmbWorkspaceContext } from '@umbraco-cms/backoffice/workspace'; diff --git a/src/packages/documents/document-types/tree/folder/workspace/index.ts b/src/packages/documents/document-types/tree/folder/workspace/index.ts index e69de29bb2..14b140114e 100644 --- a/src/packages/documents/document-types/tree/folder/workspace/index.ts +++ b/src/packages/documents/document-types/tree/folder/workspace/index.ts @@ -0,0 +1,2 @@ +export * from './constants.js'; +export * from './paths.js'; diff --git a/src/packages/documents/document-types/tree/folder/workspace/manifests.ts b/src/packages/documents/document-types/tree/folder/workspace/manifests.ts index 34dcbc13e2..884ed1b6d7 100644 --- a/src/packages/documents/document-types/tree/folder/workspace/manifests.ts +++ b/src/packages/documents/document-types/tree/folder/workspace/manifests.ts @@ -1,4 +1,4 @@ -import { UMB_DOCUMENT_TYPE_FOLDER_ENTITY_TYPE } from '../../../entity.js'; +import { UMB_DOCUMENT_TYPE_FOLDER_ENTITY_TYPE } from '../entity.js'; import { UMB_DOCUMENT_TYPE_FOLDER_WORKSPACE_ALIAS } from './constants.js'; import { UMB_WORKSPACE_CONDITION_ALIAS, UmbSubmitWorkspaceAction } from '@umbraco-cms/backoffice/workspace'; diff --git a/src/packages/documents/document-types/tree/folder/workspace/paths.ts b/src/packages/documents/document-types/tree/folder/workspace/paths.ts new file mode 100644 index 0000000000..5a9b113494 --- /dev/null +++ b/src/packages/documents/document-types/tree/folder/workspace/paths.ts @@ -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, +); diff --git a/src/packages/documents/document-types/tree/index.ts b/src/packages/documents/document-types/tree/index.ts index a372c0b6a5..addb6f04a5 100644 --- a/src/packages/documents/document-types/tree/index.ts +++ b/src/packages/documents/document-types/tree/index.ts @@ -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'; diff --git a/src/packages/documents/document-types/tree/manifests.ts b/src/packages/documents/document-types/tree/manifests.ts index 40f1ed4830..47e012f97a 100644 --- a/src/packages/documents/document-types/tree/manifests.ts +++ b/src/packages/documents/document-types/tree/manifests.ts @@ -1,15 +1,14 @@ -import { - UMB_DOCUMENT_TYPE_ENTITY_TYPE, - UMB_DOCUMENT_TYPE_FOLDER_ENTITY_TYPE, - UMB_DOCUMENT_TYPE_ROOT_ENTITY_TYPE, -} from '../entity.js'; +import { UMB_DOCUMENT_TYPE_ENTITY_TYPE, UMB_DOCUMENT_TYPE_ROOT_ENTITY_TYPE } from '../entity.js'; +import { UMB_DOCUMENT_TYPE_ROOT_WORKSPACE_ALIAS } from '../workspace/document-type-root/index.js'; import { UMB_DOCUMENT_TYPE_TREE_ALIAS, UMB_DOCUMENT_TYPE_TREE_REPOSITORY_ALIAS, UMB_DOCUMENT_TYPE_TREE_STORE_ALIAS, } from './constants.js'; +import { UMB_DOCUMENT_TYPE_FOLDER_ENTITY_TYPE, UMB_DOCUMENT_TYPE_FOLDER_WORKSPACE_ALIAS } from './folder/index.js'; import { manifests as folderManifests } from './folder/manifests.js'; -import { manifests as reloadManifests } from './reload-tree-item-children/manifests.js'; +import { manifests as treeItemChildrenManifests } from './tree-item-children/manifests.js'; +import { UMB_DOCUMENT_TYPE_TREE_ITEM_CHILDREN_COLLECTION_ALIAS } from './tree-item-children/collection/index.js'; export const manifests: Array = [ { @@ -45,15 +44,23 @@ export const manifests: Array = [ ], }, { - type: 'workspace', - kind: 'default', - alias: 'Umb.Workspace.DocumentType.Root', - name: 'Document Type Root Workspace', + type: 'workspaceView', + kind: 'collection', + alias: 'Umb.WorkspaceView.DocumentType.TreeItemChildrenCollection', + name: 'Document Type Tree Item Children Collection Workspace View', meta: { - entityType: UMB_DOCUMENT_TYPE_ROOT_ENTITY_TYPE, - headline: '#treeHeaders_documentTypes', + label: '#general_design', + pathname: 'design', + icon: 'icon-member-dashed-line', + collectionAlias: UMB_DOCUMENT_TYPE_TREE_ITEM_CHILDREN_COLLECTION_ALIAS, }, + conditions: [ + { + alias: 'Umb.Condition.WorkspaceAlias', + oneOf: [UMB_DOCUMENT_TYPE_ROOT_WORKSPACE_ALIAS, UMB_DOCUMENT_TYPE_FOLDER_WORKSPACE_ALIAS], + }, + ], }, ...folderManifests, - ...reloadManifests, + ...treeItemChildrenManifests, ]; diff --git a/src/packages/documents/document-types/tree/tree-item-children/collection/constants.ts b/src/packages/documents/document-types/tree/tree-item-children/collection/constants.ts new file mode 100644 index 0000000000..906ddd8683 --- /dev/null +++ b/src/packages/documents/document-types/tree/tree-item-children/collection/constants.ts @@ -0,0 +1 @@ +export const UMB_DOCUMENT_TYPE_TREE_ITEM_CHILDREN_COLLECTION_ALIAS = 'Umb.Collection.DocumentType.TreeItemChildren'; diff --git a/src/packages/documents/document-types/tree/tree-item-children/collection/index.ts b/src/packages/documents/document-types/tree/tree-item-children/collection/index.ts new file mode 100644 index 0000000000..6c11f6abbb --- /dev/null +++ b/src/packages/documents/document-types/tree/tree-item-children/collection/index.ts @@ -0,0 +1,2 @@ +export * from './constants.js'; +export * from './repository/index.js'; diff --git a/src/packages/documents/document-types/tree/tree-item-children/collection/manifests.ts b/src/packages/documents/document-types/tree/tree-item-children/collection/manifests.ts new file mode 100644 index 0000000000..8f03eaf7df --- /dev/null +++ b/src/packages/documents/document-types/tree/tree-item-children/collection/manifests.ts @@ -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 = [ + { + 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, +]; diff --git a/src/packages/documents/document-types/tree/tree-item-children/collection/repository/constants.ts b/src/packages/documents/document-types/tree/tree-item-children/collection/repository/constants.ts new file mode 100644 index 0000000000..2f9a0ac272 --- /dev/null +++ b/src/packages/documents/document-types/tree/tree-item-children/collection/repository/constants.ts @@ -0,0 +1,2 @@ +export const UMB_DOCUMENT_TYPE_TREE_ITEM_CHILDREN_COLLECTION_REPOSITORY_ALIAS = + 'Umb.Repository.DocumentType.TreeItemChildrenCollection'; diff --git a/src/packages/documents/document-types/tree/tree-item-children/collection/repository/document-type-tree-item-children-collection.repository.ts b/src/packages/documents/document-types/tree/tree-item-children/collection/repository/document-type-tree-item-children-collection.repository.ts new file mode 100644 index 0000000000..5968a3aef1 --- /dev/null +++ b/src/packages/documents/document-types/tree/tree-item-children/collection/repository/document-type-tree-item-children-collection.repository.ts @@ -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 }; diff --git a/src/packages/documents/document-types/tree/tree-item-children/collection/repository/index.ts b/src/packages/documents/document-types/tree/tree-item-children/collection/repository/index.ts new file mode 100644 index 0000000000..4f07201dcf --- /dev/null +++ b/src/packages/documents/document-types/tree/tree-item-children/collection/repository/index.ts @@ -0,0 +1 @@ +export * from './constants.js'; diff --git a/src/packages/documents/document-types/tree/tree-item-children/collection/repository/manifests.ts b/src/packages/documents/document-types/tree/tree-item-children/collection/repository/manifests.ts new file mode 100644 index 0000000000..5b37fad314 --- /dev/null +++ b/src/packages/documents/document-types/tree/tree-item-children/collection/repository/manifests.ts @@ -0,0 +1,10 @@ +import { UMB_DOCUMENT_TYPE_TREE_ITEM_CHILDREN_COLLECTION_REPOSITORY_ALIAS } from './constants.js'; + +export const manifests: Array = [ + { + 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'), + }, +]; diff --git a/src/packages/documents/document-types/tree/tree-item-children/collection/types.ts b/src/packages/documents/document-types/tree/tree-item-children/collection/types.ts new file mode 100644 index 0000000000..a45264779f --- /dev/null +++ b/src/packages/documents/document-types/tree/tree-item-children/collection/types.ts @@ -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; +} diff --git a/src/packages/documents/document-types/tree/tree-item-children/collection/views/document-type-tree-item-table-collection-view.element.ts b/src/packages/documents/document-types/tree/tree-item-children/collection/views/document-type-tree-item-table-collection-view.element.ts new file mode 100644 index 0000000000..ff8f006f37 --- /dev/null +++ b/src/packages/documents/document-types/tree/tree-item-children/collection/views/document-type-tree-item-table-collection-view.element.ts @@ -0,0 +1,135 @@ +import { UMB_EDIT_DOCUMENT_TYPE_WORKSPACE_PATH_PATTERN } from '../../../../paths.js'; +import { UMB_EDIT_DOCUMENT_TYPE_FOLDER_WORKSPACE_PATH_PATTERN } from '../../../folder/index.js'; +import type { UmbDocumentTypeTreeItemModel } from '../../../types.js'; +import type { UmbDefaultCollectionContext } from '@umbraco-cms/backoffice/collection'; +import { UMB_COLLECTION_CONTEXT } from '@umbraco-cms/backoffice/collection'; +import type { UmbTableColumn, UmbTableConfig, UmbTableItem } from '@umbraco-cms/backoffice/components'; +import { css, html, customElement, state } from '@umbraco-cms/backoffice/external/lit'; +import { UmbTextStyles } from '@umbraco-cms/backoffice/style'; +import { UmbLitElement } from '@umbraco-cms/backoffice/lit-element'; +import { UmbModalRouteRegistrationController, type UmbModalRouteBuilder } from '@umbraco-cms/backoffice/router'; +import { UMB_WORKSPACE_MODAL } from '@umbraco-cms/backoffice/workspace'; + +const elementName = 'umb-document-type-tree-item-table-collection-view'; +@customElement(elementName) +export class UmbDocumentTypeTreeItemTableCollectionViewElement extends UmbLitElement { + @state() + private _tableConfig: UmbTableConfig = { + allowSelection: false, + }; + + @state() + private _tableColumns: Array = [ + { + name: 'Name', + alias: 'name', + }, + { + name: 'Element Type', + alias: 'isElementType', + }, + { + name: '', + alias: 'entityActions', + }, + ]; + + @state() + private _tableItems: Array = []; + + #collectionContext?: UmbDefaultCollectionContext; + #routeBuilder?: UmbModalRouteBuilder; + + constructor() { + super(); + + this.consumeContext(UMB_COLLECTION_CONTEXT, (instance) => { + this.#collectionContext = instance; + }); + + this.#registerModalRoute(); + } + + #registerModalRoute() { + new UmbModalRouteRegistrationController(this, UMB_WORKSPACE_MODAL) + .addAdditionalPath(':entityType') + .onSetup((params) => { + return { data: { entityType: params.entityType, preset: {} } }; + }) + .observeRouteBuilder((routeBuilder) => { + this.#routeBuilder = routeBuilder; + + // NOTE: Configuring the observations AFTER the route builder is ready, + // otherwise there is a race condition and `#collectionContext.items` tends to win. [LK] + this.#observeCollectionItems(); + }); + } + + #observeCollectionItems() { + if (!this.#collectionContext) return; + this.observe(this.#collectionContext.items, (items) => this.#createTableItems(items), 'umbCollectionItemsObserver'); + } + + #createTableItems(items: Array) { + const routeBuilder = this.#routeBuilder; + if (!routeBuilder) throw new Error('Route builder not ready'); + + this._tableItems = items.map((item) => { + const modalEditPath = + routeBuilder({ entityType: item.entityType }) + + UMB_EDIT_DOCUMENT_TYPE_WORKSPACE_PATH_PATTERN.generateLocal({ unique: item.unique }); + const inlineEditPath = UMB_EDIT_DOCUMENT_TYPE_FOLDER_WORKSPACE_PATH_PATTERN.generateAbsolute({ + unique: item.unique, + }); + + return { + id: item.unique, + icon: item.isFolder && !item.icon ? 'icon-folder' : item.icon, + data: [ + { + columnAlias: 'name', + value: html``, + }, + { + columnAlias: 'isElementType', + value: html``, + }, + { + columnAlias: 'entityActions', + value: html``, + }, + ], + }; + }); + } + + override render() { + return html` + + `; + } + + static override styles = [ + UmbTextStyles, + css` + :host { + display: flex; + flex-direction: column; + } + `, + ]; +} + +export { UmbDocumentTypeTreeItemTableCollectionViewElement as element }; + +declare global { + interface HTMLElementTagNameMap { + [elementName]: UmbDocumentTypeTreeItemTableCollectionViewElement; + } +} diff --git a/src/packages/documents/document-types/tree/tree-item-children/collection/views/manifests.ts b/src/packages/documents/document-types/tree/tree-item-children/collection/views/manifests.ts new file mode 100644 index 0000000000..489068637d --- /dev/null +++ b/src/packages/documents/document-types/tree/tree-item-children/collection/views/manifests.ts @@ -0,0 +1,23 @@ +import { UMB_DOCUMENT_TYPE_TREE_ITEM_CHILDREN_COLLECTION_ALIAS } from '../constants.js'; +import { UMB_COLLECTION_ALIAS_CONDITION } from '@umbraco-cms/backoffice/collection'; + +export const manifests: Array = [ + { + type: 'collectionView', + alias: 'Umb.CollectionView.DocumentType.TreeItem.Table', + name: 'Document Type Tree Item Table Collection View', + element: () => import('./document-type-tree-item-table-collection-view.element.js'), + weight: 300, + meta: { + label: 'Table', + icon: 'icon-list', + pathName: 'table', + }, + conditions: [ + { + alias: UMB_COLLECTION_ALIAS_CONDITION, + match: UMB_DOCUMENT_TYPE_TREE_ITEM_CHILDREN_COLLECTION_ALIAS, + }, + ], + }, +]; diff --git a/src/packages/documents/document-types/tree/tree-item-children/manifests.ts b/src/packages/documents/document-types/tree/tree-item-children/manifests.ts new file mode 100644 index 0000000000..b6ea5ab54e --- /dev/null +++ b/src/packages/documents/document-types/tree/tree-item-children/manifests.ts @@ -0,0 +1,4 @@ +import { manifests as collectionManifests } from './collection/manifests.js'; +import { manifests as reloadEntityActionManifests } from './reload-entity-action/manifests.js'; + +export const manifests: Array = [...collectionManifests, ...reloadEntityActionManifests]; diff --git a/src/packages/documents/document-types/tree/reload-tree-item-children/manifests.ts b/src/packages/documents/document-types/tree/tree-item-children/reload-entity-action/manifests.ts similarity index 68% rename from src/packages/documents/document-types/tree/reload-tree-item-children/manifests.ts rename to src/packages/documents/document-types/tree/tree-item-children/reload-entity-action/manifests.ts index 550364e51b..8f0ada4ebc 100644 --- a/src/packages/documents/document-types/tree/reload-tree-item-children/manifests.ts +++ b/src/packages/documents/document-types/tree/tree-item-children/reload-entity-action/manifests.ts @@ -1,8 +1,5 @@ -import { - UMB_DOCUMENT_TYPE_ROOT_ENTITY_TYPE, - UMB_DOCUMENT_TYPE_ENTITY_TYPE, - UMB_DOCUMENT_TYPE_FOLDER_ENTITY_TYPE, -} from '../../entity.js'; +import { UMB_DOCUMENT_TYPE_ROOT_ENTITY_TYPE, UMB_DOCUMENT_TYPE_ENTITY_TYPE } from '../../../entity.js'; +import { UMB_DOCUMENT_TYPE_FOLDER_ENTITY_TYPE } from '../../folder/index.js'; export const manifests: Array = [ { diff --git a/src/packages/documents/document-types/tree/types.ts b/src/packages/documents/document-types/tree/types.ts index 24d72d14ff..c8eeff4228 100644 --- a/src/packages/documents/document-types/tree/types.ts +++ b/src/packages/documents/document-types/tree/types.ts @@ -1,8 +1,5 @@ -import type { - UmbDocumentTypeEntityType, - UmbDocumentTypeFolderEntityType, - UmbDocumentTypeRootEntityType, -} from '../entity.js'; +import type { UmbDocumentTypeEntityType, UmbDocumentTypeRootEntityType } from '../entity.js'; +import type { UmbDocumentTypeFolderEntityType } from './folder/index.js'; import type { UmbTreeItemModel, UmbTreeRootModel } from '@umbraco-cms/backoffice/tree'; export interface UmbDocumentTypeTreeItemModel extends UmbTreeItemModel { diff --git a/src/packages/documents/document-types/workspace/document-type-root/constants.ts b/src/packages/documents/document-types/workspace/document-type-root/constants.ts new file mode 100644 index 0000000000..494ee8fb32 --- /dev/null +++ b/src/packages/documents/document-types/workspace/document-type-root/constants.ts @@ -0,0 +1 @@ +export const UMB_DOCUMENT_TYPE_ROOT_WORKSPACE_ALIAS = 'Umb.Workspace.DocumentType.Root'; diff --git a/src/packages/documents/document-types/workspace/document-type-root/index.ts b/src/packages/documents/document-types/workspace/document-type-root/index.ts new file mode 100644 index 0000000000..4f07201dcf --- /dev/null +++ b/src/packages/documents/document-types/workspace/document-type-root/index.ts @@ -0,0 +1 @@ +export * from './constants.js'; diff --git a/src/packages/documents/document-types/workspace/document-type-root/manifests.ts b/src/packages/documents/document-types/workspace/document-type-root/manifests.ts new file mode 100644 index 0000000000..c61b55778a --- /dev/null +++ b/src/packages/documents/document-types/workspace/document-type-root/manifests.ts @@ -0,0 +1,14 @@ +import { UMB_DOCUMENT_TYPE_ROOT_ENTITY_TYPE } from '../../entity.js'; + +export const manifests: Array = [ + { + type: 'workspace', + kind: 'default', + alias: 'Umb.Workspace.DocumentType.Root', + name: 'Document Type Root Workspace', + meta: { + entityType: UMB_DOCUMENT_TYPE_ROOT_ENTITY_TYPE, + headline: '#treeHeaders_documentTypes', + }, + }, +]; diff --git a/src/packages/documents/document-types/workspace/document-type/constants.ts b/src/packages/documents/document-types/workspace/document-type/constants.ts new file mode 100644 index 0000000000..6592bb27dd --- /dev/null +++ b/src/packages/documents/document-types/workspace/document-type/constants.ts @@ -0,0 +1 @@ +export const UMB_DOCUMENT_TYPE_WORKSPACE_ALIAS = 'Umb.Workspace.DocumentType'; diff --git a/src/packages/documents/document-types/workspace/document-type-workspace-editor.element.ts b/src/packages/documents/document-types/workspace/document-type/document-type-workspace-editor.element.ts similarity index 100% rename from src/packages/documents/document-types/workspace/document-type-workspace-editor.element.ts rename to src/packages/documents/document-types/workspace/document-type/document-type-workspace-editor.element.ts diff --git a/src/packages/documents/document-types/workspace/document-type-workspace.context-token.ts b/src/packages/documents/document-types/workspace/document-type/document-type-workspace.context-token.ts similarity index 100% rename from src/packages/documents/document-types/workspace/document-type-workspace.context-token.ts rename to src/packages/documents/document-types/workspace/document-type/document-type-workspace.context-token.ts diff --git a/src/packages/documents/document-types/workspace/document-type-workspace.context.ts b/src/packages/documents/document-types/workspace/document-type/document-type-workspace.context.ts similarity index 97% rename from src/packages/documents/document-types/workspace/document-type-workspace.context.ts rename to src/packages/documents/document-types/workspace/document-type/document-type-workspace.context.ts index 57e2766b1c..888a9a30e9 100644 --- a/src/packages/documents/document-types/workspace/document-type-workspace.context.ts +++ b/src/packages/documents/document-types/workspace/document-type/document-type-workspace.context.ts @@ -4,10 +4,10 @@ import { UMB_CREATE_DOCUMENT_TYPE_WORKSPACE_PRESET_TEMPLATE, UMB_EDIT_DOCUMENT_TYPE_WORKSPACE_PATH_PATTERN, type UmbCreateDocumentTypeWorkspacePresetType, -} from '../paths.js'; -import type { UmbDocumentTypeDetailModel } from '../types.js'; -import { UMB_DOCUMENT_TYPE_ENTITY_TYPE } from '../entity.js'; -import { UmbDocumentTypeDetailRepository } from '../repository/detail/document-type-detail.repository.js'; +} from '../../paths.js'; +import type { UmbDocumentTypeDetailModel } from '../../types.js'; +import { UMB_DOCUMENT_TYPE_ENTITY_TYPE } from '../../entity.js'; +import { UmbDocumentTypeDetailRepository } from '../../repository/detail/document-type-detail.repository.js'; import { UmbDocumentTypeWorkspaceEditorElement } from './document-type-workspace-editor.element.js'; import { UmbContentTypeStructureManager } from '@umbraco-cms/backoffice/content-type'; import { UmbObjectState } from '@umbraco-cms/backoffice/observable-api'; diff --git a/src/packages/documents/document-types/workspace/document-type-workspace.modal-token.ts b/src/packages/documents/document-types/workspace/document-type/document-type-workspace.modal-token.ts similarity index 93% rename from src/packages/documents/document-types/workspace/document-type-workspace.modal-token.ts rename to src/packages/documents/document-types/workspace/document-type/document-type-workspace.modal-token.ts index 46162c38e0..e30cbcfd61 100644 --- a/src/packages/documents/document-types/workspace/document-type-workspace.modal-token.ts +++ b/src/packages/documents/document-types/workspace/document-type/document-type-workspace.modal-token.ts @@ -1,4 +1,4 @@ -import { UMB_DOCUMENT_TYPE_ENTITY_TYPE } from '../entity.js'; +import { UMB_DOCUMENT_TYPE_ENTITY_TYPE } from '../../entity.js'; import { UmbModalToken } from '@umbraco-cms/backoffice/modal'; import { UMB_WORKSPACE_MODAL } from '@umbraco-cms/backoffice/workspace'; import type { UmbDeepPartialObject } from '@umbraco-cms/backoffice/utils'; diff --git a/src/packages/documents/document-types/workspace/document-type/index.ts b/src/packages/documents/document-types/workspace/document-type/index.ts new file mode 100644 index 0000000000..5232133b80 --- /dev/null +++ b/src/packages/documents/document-types/workspace/document-type/index.ts @@ -0,0 +1,3 @@ +export * from './document-type-workspace.context-token.js'; +export * from './document-type-workspace.modal-token.js'; +export * from './constants.js'; diff --git a/src/packages/documents/document-types/workspace/document-type/manifests.ts b/src/packages/documents/document-types/workspace/document-type/manifests.ts new file mode 100644 index 0000000000..b4644169cb --- /dev/null +++ b/src/packages/documents/document-types/workspace/document-type/manifests.ts @@ -0,0 +1,106 @@ +import { UMB_DOCUMENT_TYPE_COMPOSITION_REPOSITORY_ALIAS } from '../../repository/composition/index.js'; +import { UMB_DOCUMENT_TYPE_WORKSPACE_ALIAS } from './constants.js'; +import { UMB_WORKSPACE_CONDITION_ALIAS, UmbSubmitWorkspaceAction } from '@umbraco-cms/backoffice/workspace'; + +export const manifests: Array = [ + { + type: 'workspace', + kind: 'routable', + alias: UMB_DOCUMENT_TYPE_WORKSPACE_ALIAS, + name: 'Document Type Workspace', + api: () => import('./document-type-workspace.context.js'), + meta: { + entityType: 'document-type', + }, + }, + { + type: 'workspaceView', + kind: 'contentTypeDesignEditor', + alias: 'Umb.WorkspaceView.DocumentType.Design', + name: 'Document Type Workspace Design View', + meta: { + label: '#general_design', + pathname: 'design', + icon: 'icon-document-dashed-line', + compositionRepositoryAlias: UMB_DOCUMENT_TYPE_COMPOSITION_REPOSITORY_ALIAS, + }, + conditions: [ + { + alias: UMB_WORKSPACE_CONDITION_ALIAS, + match: UMB_DOCUMENT_TYPE_WORKSPACE_ALIAS, + }, + ], + }, + { + type: 'workspaceView', + alias: 'Umb.WorkspaceView.DocumentType.Structure', + name: 'Document Type Workspace Structure View', + element: () => import('./views/structure/document-type-workspace-view-structure.element.js'), + weight: 800, + meta: { + label: '#contentTypeEditor_structure', + pathname: 'structure', + icon: 'icon-mindmap', + }, + conditions: [ + { + alias: UMB_WORKSPACE_CONDITION_ALIAS, + match: UMB_DOCUMENT_TYPE_WORKSPACE_ALIAS, + }, + ], + }, + { + type: 'workspaceView', + alias: 'Umb.WorkspaceView.DocumentType.Settings', + name: 'Document Type Workspace Settings View', + element: () => import('./views/settings/document-type-workspace-view-settings.element.js'), + weight: 600, + meta: { + label: '#general_settings', + pathname: 'settings', + icon: 'icon-settings', + }, + conditions: [ + { + alias: UMB_WORKSPACE_CONDITION_ALIAS, + match: UMB_DOCUMENT_TYPE_WORKSPACE_ALIAS, + }, + ], + }, + { + type: 'workspaceView', + alias: 'Umb.WorkspaceView.DocumentType.Templates', + name: 'Document Type Workspace Templates View', + element: () => import('./views/templates/document-type-workspace-view-templates.element.js'), + weight: 400, + meta: { + label: '#treeHeaders_templates', + pathname: 'templates', + icon: 'icon-layout', + }, + conditions: [ + { + alias: UMB_WORKSPACE_CONDITION_ALIAS, + match: UMB_DOCUMENT_TYPE_WORKSPACE_ALIAS, + }, + ], + }, + { + type: 'workspaceAction', + kind: 'default', + alias: 'Umb.WorkspaceAction.DocumentType.Save', + name: 'Save Document Type Workspace Action', + api: UmbSubmitWorkspaceAction, + meta: { + label: '#buttons_save', + look: 'primary', + color: 'positive', + }, + conditions: [ + { + alias: UMB_WORKSPACE_CONDITION_ALIAS, + match: UMB_DOCUMENT_TYPE_WORKSPACE_ALIAS, + }, + ], + }, +]; diff --git a/src/packages/documents/document-types/workspace/views/settings/document-type-workspace-view-settings.element.ts b/src/packages/documents/document-types/workspace/document-type/views/settings/document-type-workspace-view-settings.element.ts similarity index 100% rename from src/packages/documents/document-types/workspace/views/settings/document-type-workspace-view-settings.element.ts rename to src/packages/documents/document-types/workspace/document-type/views/settings/document-type-workspace-view-settings.element.ts diff --git a/src/packages/documents/document-types/workspace/views/structure/document-type-workspace-view-structure.element.ts b/src/packages/documents/document-types/workspace/document-type/views/structure/document-type-workspace-view-structure.element.ts similarity index 97% rename from src/packages/documents/document-types/workspace/views/structure/document-type-workspace-view-structure.element.ts rename to src/packages/documents/document-types/workspace/document-type/views/structure/document-type-workspace-view-structure.element.ts index 0a490ea644..5edd8d234d 100644 --- a/src/packages/documents/document-types/workspace/views/structure/document-type-workspace-view-structure.element.ts +++ b/src/packages/documents/document-types/workspace/document-type/views/structure/document-type-workspace-view-structure.element.ts @@ -1,5 +1,5 @@ import type { UmbDocumentTypeWorkspaceContext } from '../../document-type-workspace.context.js'; -import type { UmbInputDocumentTypeElement } from '../../../components/input-document-type/input-document-type.element.js'; +import type { UmbInputDocumentTypeElement } from '../../../../components/input-document-type/input-document-type.element.js'; import { UMB_DOCUMENT_TYPE_WORKSPACE_CONTEXT } from '../../document-type-workspace.context-token.js'; import { css, html, customElement, state } from '@umbraco-cms/backoffice/external/lit'; import { UmbTextStyles } from '@umbraco-cms/backoffice/style'; diff --git a/src/packages/documents/document-types/workspace/views/templates/document-type-workspace-view-templates.element.ts b/src/packages/documents/document-types/workspace/document-type/views/templates/document-type-workspace-view-templates.element.ts similarity index 100% rename from src/packages/documents/document-types/workspace/views/templates/document-type-workspace-view-templates.element.ts rename to src/packages/documents/document-types/workspace/document-type/views/templates/document-type-workspace-view-templates.element.ts diff --git a/src/packages/documents/document-types/workspace/index.ts b/src/packages/documents/document-types/workspace/index.ts index cf7ab5393f..7aa5441487 100644 --- a/src/packages/documents/document-types/workspace/index.ts +++ b/src/packages/documents/document-types/workspace/index.ts @@ -1,2 +1 @@ -export * from './document-type-workspace.context-token.js'; -export * from './document-type-workspace.modal-token.js'; +export * from './document-type/index.js'; diff --git a/src/packages/documents/document-types/workspace/manifests.ts b/src/packages/documents/document-types/workspace/manifests.ts index 3177e42a18..8d1f79b665 100644 --- a/src/packages/documents/document-types/workspace/manifests.ts +++ b/src/packages/documents/document-types/workspace/manifests.ts @@ -1,107 +1,4 @@ -import { UMB_DOCUMENT_TYPE_COMPOSITION_REPOSITORY_ALIAS } from '../repository/composition/index.js'; -import { UMB_WORKSPACE_CONDITION_ALIAS, UmbSubmitWorkspaceAction } from '@umbraco-cms/backoffice/workspace'; +import { manifests as documentTypeManifests } from './document-type/manifests.js'; +import { manifests as documentTypeRootManifests } from './document-type-root/manifests.js'; -export const UMB_DOCUMENT_TYPE_WORKSPACE_ALIAS = 'Umb.Workspace.DocumentType'; - -export const manifests: Array = [ - { - type: 'workspace', - kind: 'routable', - alias: UMB_DOCUMENT_TYPE_WORKSPACE_ALIAS, - name: 'Document Type Workspace', - api: () => import('./document-type-workspace.context.js'), - meta: { - entityType: 'document-type', - }, - }, - { - type: 'workspaceView', - kind: 'contentTypeDesignEditor', - alias: 'Umb.WorkspaceView.DocumentType.Design', - name: 'Document Type Workspace Design View', - meta: { - label: '#general_design', - pathname: 'design', - icon: 'icon-document-dashed-line', - compositionRepositoryAlias: UMB_DOCUMENT_TYPE_COMPOSITION_REPOSITORY_ALIAS, - }, - conditions: [ - { - alias: UMB_WORKSPACE_CONDITION_ALIAS, - match: UMB_DOCUMENT_TYPE_WORKSPACE_ALIAS, - }, - ], - }, - { - type: 'workspaceView', - alias: 'Umb.WorkspaceView.DocumentType.Structure', - name: 'Document Type Workspace Structure View', - element: () => import('./views/structure/document-type-workspace-view-structure.element.js'), - weight: 800, - meta: { - label: '#contentTypeEditor_structure', - pathname: 'structure', - icon: 'icon-mindmap', - }, - conditions: [ - { - alias: UMB_WORKSPACE_CONDITION_ALIAS, - match: UMB_DOCUMENT_TYPE_WORKSPACE_ALIAS, - }, - ], - }, - { - type: 'workspaceView', - alias: 'Umb.WorkspaceView.DocumentType.Settings', - name: 'Document Type Workspace Settings View', - element: () => import('./views/settings/document-type-workspace-view-settings.element.js'), - weight: 600, - meta: { - label: '#general_settings', - pathname: 'settings', - icon: 'icon-settings', - }, - conditions: [ - { - alias: UMB_WORKSPACE_CONDITION_ALIAS, - match: UMB_DOCUMENT_TYPE_WORKSPACE_ALIAS, - }, - ], - }, - { - type: 'workspaceView', - alias: 'Umb.WorkspaceView.DocumentType.Templates', - name: 'Document Type Workspace Templates View', - element: () => import('./views/templates/document-type-workspace-view-templates.element.js'), - weight: 400, - meta: { - label: '#treeHeaders_templates', - pathname: 'templates', - icon: 'icon-layout', - }, - conditions: [ - { - alias: UMB_WORKSPACE_CONDITION_ALIAS, - match: UMB_DOCUMENT_TYPE_WORKSPACE_ALIAS, - }, - ], - }, - { - type: 'workspaceAction', - kind: 'default', - alias: 'Umb.WorkspaceAction.DocumentType.Save', - name: 'Save Document Type Workspace Action', - api: UmbSubmitWorkspaceAction, - meta: { - label: '#buttons_save', - look: 'primary', - color: 'positive', - }, - conditions: [ - { - alias: UMB_WORKSPACE_CONDITION_ALIAS, - match: UMB_DOCUMENT_TYPE_WORKSPACE_ALIAS, - }, - ], - }, -]; +export const manifests: Array = [...documentTypeManifests, ...documentTypeRootManifests];