Skip to content

Commit 6bc1883

Browse files
committed
implement folder workspace for data type folders
1 parent 3dfd17e commit 6bc1883

15 files changed

+187
-11
lines changed
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
export { UmbDataTypeFolderRepository } from './data-type-folder.repository.js';
2-
export { UMB_DATA_TYPE_FOLDER_REPOSITORY_ALIAS } from './manifests.js';
1+
export * from './repository/index.js';
2+
export * from './workspace/index.js';

src/packages/data-type/tree/folder/manifests.ts

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,9 @@
11
import { UMB_DATA_TYPE_FOLDER_ENTITY_TYPE } from '../../entity.js';
2-
export const UMB_DATA_TYPE_FOLDER_REPOSITORY_ALIAS = 'Umb.Repository.DataType.Folder';
2+
import { UMB_DATA_TYPE_FOLDER_REPOSITORY_ALIAS } from './repository/index.js';
3+
import { manifests as workspaceManifests } from './workspace/manifests.js';
4+
import { manifests as repositoryManifests } from './repository/manifests.js';
35

46
export const manifests: Array<UmbExtensionManifest> = [
5-
{
6-
type: 'repository',
7-
alias: UMB_DATA_TYPE_FOLDER_REPOSITORY_ALIAS,
8-
name: 'Data Type Folder Repository',
9-
api: () => import('./data-type-folder.repository.js'),
10-
},
117
{
128
type: 'entityAction',
139
kind: 'folderUpdate',
@@ -28,4 +24,6 @@ export const manifests: Array<UmbExtensionManifest> = [
2824
folderRepositoryAlias: UMB_DATA_TYPE_FOLDER_REPOSITORY_ALIAS,
2925
},
3026
},
27+
...repositoryManifests,
28+
...workspaceManifests,
3129
];
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
export const UMB_DATA_TYPE_FOLDER_REPOSITORY_ALIAS = 'Umb.Repository.DataType.Folder';
2+
export const UMB_DATA_TYPE_FOLDER_STORE_ALIAS = 'Umb.Store.DataType.Folder';

src/packages/data-type/tree/folder/data-type-folder.repository.ts renamed to src/packages/data-type/tree/folder/repository/data-type-folder.repository.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { UmbDataTypeFolderServerDataSource } from './data-type-folder.server.data-source.js';
2+
import { UMB_DATA_TYPE_FOLDER_STORE_CONTEXT } from './data-type-folder.store.context-token.js';
23
import { UmbDetailRepositoryBase } from '@umbraco-cms/backoffice/repository';
34
import type { UmbControllerHost } from '@umbraco-cms/backoffice/controller-api';
45
import type { UmbFolderModel } from '@umbraco-cms/backoffice/tree';
@@ -8,7 +9,7 @@ export class UmbDataTypeFolderRepository extends UmbDetailRepositoryBase<
89
UmbDataTypeFolderServerDataSource
910
> {
1011
constructor(host: UmbControllerHost) {
11-
super(host, UmbDataTypeFolderServerDataSource);
12+
super(host, UmbDataTypeFolderServerDataSource, UMB_DATA_TYPE_FOLDER_STORE_CONTEXT);
1213
}
1314
}
1415

src/packages/data-type/tree/folder/data-type-folder.server.data-source.ts renamed to src/packages/data-type/tree/folder/repository/data-type-folder.server.data-source.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { UMB_DATA_TYPE_FOLDER_ENTITY_TYPE } from '../../entity.js';
1+
import { UMB_DATA_TYPE_FOLDER_ENTITY_TYPE } from '../../../entity.js';
22
import type { UmbFolderModel } from '@umbraco-cms/backoffice/tree';
33
import { DataTypeService } from '@umbraco-cms/backoffice/external/backend-api';
44
import type { UmbControllerHost } from '@umbraco-cms/backoffice/controller-api';
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
import type { UmbDataTypeFolderStore } from './data-type-folder.store.js';
2+
import { UmbContextToken } from '@umbraco-cms/backoffice/context-api';
3+
4+
export const UMB_DATA_TYPE_FOLDER_STORE_CONTEXT = new UmbContextToken<UmbDataTypeFolderStore>('UmbDataTypeFolderStore');
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import { UMB_DATA_TYPE_FOLDER_STORE_CONTEXT } from './data-type-folder.store.context-token.js';
2+
import { UmbDetailStoreBase } from '@umbraco-cms/backoffice/store';
3+
import type { UmbControllerHost } from '@umbraco-cms/backoffice/controller-api';
4+
import type { UmbFolderModel } from '@umbraco-cms/backoffice/tree';
5+
6+
/**
7+
* @class UmbDataTypeStore
8+
* @augments {UmbStoreBase}
9+
* @description - Data Store for Data Types
10+
*/
11+
export class UmbDataTypeFolderStore extends UmbDetailStoreBase<UmbFolderModel> {
12+
/**
13+
* Creates an instance of UmbDataTypeStore.
14+
* @param {UmbControllerHost} host - The controller host for this controller to be appended to
15+
* @memberof UmbDataTypeStore
16+
*/
17+
constructor(host: UmbControllerHost) {
18+
super(host, UMB_DATA_TYPE_FOLDER_STORE_CONTEXT.toString());
19+
}
20+
}
21+
22+
export { UmbDataTypeFolderStore as api };
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
export { UmbDataTypeFolderRepository } from './data-type-folder.repository.js';
2+
export * from './constants.js';
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import { UMB_DATA_TYPE_FOLDER_REPOSITORY_ALIAS, UMB_DATA_TYPE_FOLDER_STORE_ALIAS } from './constants.js';
2+
3+
export const manifests: Array<UmbExtensionManifest> = [
4+
{
5+
type: 'repository',
6+
alias: UMB_DATA_TYPE_FOLDER_REPOSITORY_ALIAS,
7+
name: 'Data Type Folder Repository',
8+
api: () => import('./data-type-folder.repository.js'),
9+
},
10+
{
11+
type: 'store',
12+
alias: UMB_DATA_TYPE_FOLDER_STORE_ALIAS,
13+
name: 'Data Type Folder Store',
14+
api: () => import('./data-type-folder.store.js'),
15+
},
16+
];
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export const UMB_DATA_TYPE_FOLDER_WORKSPACE_ALIAS = 'Umb.Workspace.DataType.Folder';

0 commit comments

Comments
 (0)