Skip to content

Commit a5029e9

Browse files
committed
reorganize
1 parent 7611e7e commit a5029e9

File tree

10 files changed

+54
-12
lines changed

10 files changed

+54
-12
lines changed

src/packages/documents/document-types/tree/folder/repository/manifests.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export const manifests: Array<UmbExtensionManifest> = [
1010
{
1111
type: 'store',
1212
alias: UMB_DOCUMENT_TYPE_FOLDER_STORE_ALIAS,
13-
name: 'Document Type Store',
13+
name: 'Document Type Folder Store',
1414
api: () => import('./document-type-folder.store.js'),
1515
},
1616
];
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
export { UmbScriptFolderRepository } from './script-folder.repository.js';
2-
export { UMB_SCRIPT_FOLDER_REPOSITORY_ALIAS, UMB_DELETE_SCRIPT_FOLDER_ENTITY_ACTION_ALIAS } from './manifests.js';
1+
export * from './repository/index.js';
Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,10 @@
11
import { UMB_SCRIPT_FOLDER_ENTITY_TYPE } from '../../entity.js';
2+
import { UMB_SCRIPT_FOLDER_REPOSITORY_ALIAS } from './repository/index.js';
3+
import { manifests as repositoryManifests } from './repository/manifests.js';
24

3-
export const UMB_SCRIPT_FOLDER_REPOSITORY_ALIAS = 'Umb.Repository.Script.Folder';
45
export const UMB_DELETE_SCRIPT_FOLDER_ENTITY_ACTION_ALIAS = 'Umb.EntityAction.Script.Folder.Delete';
56

67
export const manifests: Array<UmbExtensionManifest> = [
7-
{
8-
type: 'repository',
9-
alias: UMB_SCRIPT_FOLDER_REPOSITORY_ALIAS,
10-
name: 'Script Folder Repository',
11-
api: () => import('./script-folder.repository.js'),
12-
},
138
{
149
type: 'entityAction',
1510
kind: 'folderDelete',
@@ -20,4 +15,5 @@ export const manifests: Array<UmbExtensionManifest> = [
2015
folderRepositoryAlias: UMB_SCRIPT_FOLDER_REPOSITORY_ALIAS,
2116
},
2217
},
18+
...repositoryManifests,
2319
];
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
export const UMB_SCRIPT_FOLDER_REPOSITORY_ALIAS = 'Umb.Repository.Script.Folder';
2+
export const UMB_SCRIPT_FOLDER_STORE_ALIAS = 'Umb.Store.Script.Folder';
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
export * from './constants.js';
2+
export * from './script-folder.repository.js';
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import { UMB_SCRIPT_FOLDER_REPOSITORY_ALIAS, UMB_SCRIPT_FOLDER_STORE_ALIAS } from './constants.js';
2+
3+
export const manifests: Array<UmbExtensionManifest> = [
4+
{
5+
type: 'repository',
6+
alias: UMB_SCRIPT_FOLDER_REPOSITORY_ALIAS,
7+
name: 'Script Folder Repository',
8+
api: () => import('./script-folder.repository.js'),
9+
},
10+
{
11+
type: 'store',
12+
alias: UMB_SCRIPT_FOLDER_STORE_ALIAS,
13+
name: 'Script Folder Store',
14+
api: () => import('./script-folder.store.js'),
15+
},
16+
];

src/packages/templating/scripts/tree/folder/script-folder.repository.ts renamed to src/packages/templating/scripts/tree/folder/repository/script-folder.repository.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
import { UmbScriptFolderServerDataSource } from './script-folder.server.data-source.js';
2+
import { UMB_SCRIPT_FOLDER_STORE_CONTEXT } from './script-folder.store.context.token.js';
23
import type { UmbControllerHost } from '@umbraco-cms/backoffice/controller-api';
34
import { UmbDetailRepositoryBase } from '@umbraco-cms/backoffice/repository';
45
import type { UmbFolderModel } from '@umbraco-cms/backoffice/tree';
56

67
export class UmbScriptFolderRepository extends UmbDetailRepositoryBase<UmbFolderModel> {
78
constructor(host: UmbControllerHost) {
8-
super(host, UmbScriptFolderServerDataSource);
9+
super(host, UmbScriptFolderServerDataSource, UMB_SCRIPT_FOLDER_STORE_CONTEXT);
910
}
1011
}
1112

src/packages/templating/scripts/tree/folder/script-folder.server.data-source.ts renamed to src/packages/templating/scripts/tree/folder/repository/script-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_SCRIPT_FOLDER_ENTITY_TYPE } from '../../entity.js';
1+
import { UMB_SCRIPT_FOLDER_ENTITY_TYPE } from '../../../entity.js';
22
import { UmbServerFilePathUniqueSerializer } from '@umbraco-cms/backoffice/server-file-system';
33
import type { UmbFolderModel } from '@umbraco-cms/backoffice/tree';
44
import type { CreateScriptFolderRequestModel } from '@umbraco-cms/backoffice/external/backend-api';
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
import type { UmbScriptFolderStore } from './script-folder.store.js';
2+
import { UmbContextToken } from '@umbraco-cms/backoffice/context-api';
3+
4+
export const UMB_SCRIPT_FOLDER_STORE_CONTEXT = new UmbContextToken<UmbScriptFolderStore>('UmbScriptFolderStore');
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import { UMB_SCRIPT_FOLDER_STORE_CONTEXT } from './script-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 UmbScriptFolderStore
8+
* @augments {UmbStoreBase}
9+
* @description - Data Store for Script Folders
10+
*/
11+
export class UmbScriptFolderStore extends UmbDetailStoreBase<UmbFolderModel> {
12+
/**
13+
* Creates an instance of UmbScriptFolderStore.
14+
* @param {UmbControllerHost} host - The controller host for this controller to be appended to
15+
* @memberof UmbScriptFolderStore
16+
*/
17+
constructor(host: UmbControllerHost) {
18+
super(host, UMB_SCRIPT_FOLDER_STORE_CONTEXT.toString());
19+
}
20+
}
21+
22+
export { UmbScriptFolderStore as api };

0 commit comments

Comments
 (0)