register folder workspace for document types

This commit is contained in:
Mads Rasmussen
2024-09-25 15:18:27 +02:00
parent b90b9b7461
commit 5c2b2bdbb8
4 changed files with 62 additions and 0 deletions

View File

@@ -1,4 +1,5 @@
import { UMB_DOCUMENT_TYPE_FOLDER_ENTITY_TYPE } from '../../entity.js';
import { manifests as workspaceManifests } from './workspace/manifests.js';
export const UMB_DOCUMENT_TYPE_FOLDER_REPOSITORY_ALIAS = 'Umb.Repository.DocumentType.Folder';
@@ -29,4 +30,5 @@ export const manifests: Array<UmbExtensionManifest> = [
folderRepositoryAlias: UMB_DOCUMENT_TYPE_FOLDER_REPOSITORY_ALIAS,
},
},
...workspaceManifests,
];

View File

@@ -0,0 +1 @@
export const UMB_DOCUMENT_TYPE_FOLDER_WORKSPACE_ALIAS = 'Umb.Workspace.DocumentType.Folder';

View File

@@ -0,0 +1,27 @@
import { UmbDocumentTypeTreeRepository } from '../../document-type-tree.repository.js';
import { UmbLitElement } from '@umbraco-cms/backoffice/lit-element';
import { css, html, customElement } from '@umbraco-cms/backoffice/external/lit';
const elementName = 'umb-folder-collection-workspace-view';
@customElement(elementName)
export class UmbFolderCollectionWorkspaceViewEditorElement extends UmbLitElement {
#treeRepository = new UmbDocumentTypeTreeRepository(this);
constructor() {
super();
}
override render() {
return html` <div>Some Collection</div>`;
}
static override styles = [css``];
}
export { UmbFolderCollectionWorkspaceViewEditorElement as element };
declare global {
interface HTMLElementTagNameMap {
[elementName]: UmbFolderCollectionWorkspaceViewEditorElement;
}
}

View File

@@ -0,0 +1,32 @@
import { UMB_DOCUMENT_TYPE_FOLDER_ENTITY_TYPE } from '../../../entity.js';
import { UMB_DOCUMENT_TYPE_FOLDER_WORKSPACE_ALIAS } from './constants.js';
export const manifests: Array<UmbExtensionManifest> = [
{
type: 'workspace',
kind: 'default',
alias: UMB_DOCUMENT_TYPE_FOLDER_WORKSPACE_ALIAS,
name: 'Document Type Folder Workspace',
meta: {
entityType: UMB_DOCUMENT_TYPE_FOLDER_ENTITY_TYPE,
},
},
{
type: 'workspaceView',
//kind: 'folderCollection',
alias: 'Umb.WorkspaceView.DocumentType.FolderCollection',
name: 'Document Type Folder Collection Workspace View',
element: () => import('./folder-collection-workspace-view.element.js'),
meta: {
pathname: 'folder',
label: 'Folder',
icon: 'folder',
},
conditions: [
{
alias: 'Umb.Condition.WorkspaceAlias',
match: UMB_DOCUMENT_TYPE_FOLDER_WORKSPACE_ALIAS,
},
],
},
];