Skip to content

Commit 4add154

Browse files
committed
reorganize
1 parent 53d0d6c commit 4add154

File tree

9 files changed

+55
-14
lines changed

9 files changed

+55
-14
lines changed
Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1 @@
1-
export { UmbStylesheetFolderRepository } from './stylesheet-folder.repository.js';
2-
export {
3-
UMB_STYLESHEET_FOLDER_REPOSITORY_ALIAS,
4-
UMB_DELETE_STYLESHEET_FOLDER_ENTITY_ACTION_ALIAS,
5-
} 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_STYLESHEET_FOLDER_ENTITY_TYPE } from '../../entity.js';
2+
import { UMB_STYLESHEET_FOLDER_REPOSITORY_ALIAS } from './repository/index.js';
3+
import { manifests as repositoryManifests } from './repository/manifests.js';
24

3-
export const UMB_STYLESHEET_FOLDER_REPOSITORY_ALIAS = 'Umb.Repository.Stylesheet.Folder';
45
export const UMB_DELETE_STYLESHEET_FOLDER_ENTITY_ACTION_ALIAS = 'Umb.EntityAction.Stylesheet.Folder.Delete';
56

67
export const manifests: Array<UmbExtensionManifest> = [
7-
{
8-
type: 'repository',
9-
alias: UMB_STYLESHEET_FOLDER_REPOSITORY_ALIAS,
10-
name: 'Stylesheet Folder Repository',
11-
api: () => import('./stylesheet-folder.repository.js'),
12-
},
138
{
149
type: 'entityAction',
1510
kind: 'folderDelete',
@@ -20,4 +15,5 @@ export const manifests: Array<UmbExtensionManifest> = [
2015
folderRepositoryAlias: UMB_STYLESHEET_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_STYLESHEET_FOLDER_REPOSITORY_ALIAS = 'Umb.Repository.Stylesheet.Folder';
2+
export const UMB_STYLESHEET_FOLDER_STORE_ALIAS = 'Umb.Store.Stylesheet.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 './stylesheet-folder.repository.js';
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import { UMB_STYLESHEET_FOLDER_REPOSITORY_ALIAS, UMB_STYLESHEET_FOLDER_STORE_ALIAS } from './constants.js';
2+
3+
export const manifests: Array<UmbExtensionManifest> = [
4+
{
5+
type: 'repository',
6+
alias: UMB_STYLESHEET_FOLDER_REPOSITORY_ALIAS,
7+
name: 'Stylesheet Folder Repository',
8+
api: () => import('./stylesheet-folder.repository.js'),
9+
},
10+
{
11+
type: 'store',
12+
alias: UMB_STYLESHEET_FOLDER_STORE_ALIAS,
13+
name: 'Stylesheet Folder Store',
14+
api: () => import('./stylesheet-folder.store.js'),
15+
},
16+
];

src/packages/templating/stylesheets/tree/folder/stylesheet-folder.repository.ts renamed to src/packages/templating/stylesheets/tree/folder/repository/stylesheet-folder.repository.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { UmbStylesheetFolderServerDataSource } from './stylesheet-folder.server.data-source.js';
2+
import { UMB_STYLESHEET_FOLDER_STORE_CONTEXT } from './stylesheet-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 UmbStylesheetFolderRepository extends UmbDetailRepositoryBase<
89
UmbStylesheetFolderServerDataSource
910
> {
1011
constructor(host: UmbControllerHost) {
11-
super(host, UmbStylesheetFolderServerDataSource);
12+
super(host, UmbStylesheetFolderServerDataSource, UMB_STYLESHEET_FOLDER_STORE_CONTEXT);
1213
}
1314
}
1415

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

0 commit comments

Comments
 (0)