@umbraco-cms/backoffice 14.0.0-8a5fc0ad → 14.0.0-8c1d7e37
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist-cms/apps/backoffice/backoffice.element.js +1 -1
- package/dist-cms/custom-elements.json +81 -81
- package/dist-cms/mocks/data/partial-views.data.d.ts +19 -3
- package/dist-cms/mocks/data/partial-views.data.js +277 -10
- package/dist-cms/mocks/data/utils.d.ts +2 -1
- package/dist-cms/mocks/data/utils.js +5 -0
- package/dist-cms/mocks/handlers/partial-views.handlers.d.ts +2 -1
- package/dist-cms/mocks/handlers/partial-views.handlers.js +37 -5
- package/dist-cms/packages/core/entity-action/common/create-folder/create-folder.action.d.ts +8 -0
- package/dist-cms/packages/core/entity-action/common/create-folder/create-folder.action.js +21 -0
- package/dist-cms/packages/core/entity-action/common/index.d.ts +1 -0
- package/dist-cms/packages/core/entity-action/common/index.js +1 -0
- package/dist-cms/packages/core/modal/common/folder/folder-modal.element.js +4 -1
- package/dist-cms/packages/core/modal/token/folder-modal.token.d.ts +1 -0
- package/dist-cms/packages/core/section/section-default.element.js +1 -1
- package/dist-cms/packages/core/section/section-views/index.d.ts +1 -1
- package/dist-cms/packages/core/section/section-views/index.js +1 -1
- package/dist-cms/packages/core/tree/file-system-tree-item/file-system-tree-item.context.d.ts +1 -0
- package/dist-cms/packages/core/tree/file-system-tree-item/file-system-tree-item.context.js +12 -0
- package/dist-cms/packages/core/tree/file-system-tree-item/file-system-tree-item.element.js +1 -0
- package/dist-cms/packages/core/workspace/workspace-action/workspace-action.element.js +12 -4
- package/dist-cms/packages/{translation → dictionary}/dictionary/entity-actions/export/export.action.d.ts +0 -1
- package/dist-cms/packages/{translation → dictionary}/dictionary/entity-actions/export/export.action.js +0 -1
- package/dist-cms/packages/{translation → dictionary}/dictionary/entity-actions/import/import.action.d.ts +0 -1
- package/dist-cms/packages/{translation → dictionary}/dictionary/entity-actions/import/import.action.js +0 -1
- package/dist-cms/packages/dictionary/dictionary/index.d.ts +1 -0
- package/dist-cms/packages/dictionary/dictionary/index.js +1 -0
- package/dist-cms/packages/dictionary/dictionary/repository/index.d.ts +3 -0
- package/dist-cms/packages/dictionary/dictionary/repository/index.js +3 -0
- package/dist-cms/packages/{translation → dictionary}/dictionary/repository/manifests.js +1 -1
- package/dist-cms/packages/{translation → dictionary}/section.manifest.js +4 -4
- package/dist-cms/packages/{translation → dictionary}/umbraco-package.d.ts +1 -1
- package/dist-cms/packages/dictionary/umbraco-package.js +9 -0
- package/dist-cms/packages/settings/dashboards/published-status/dashboard-published-status.element.js +11 -3
- package/dist-cms/packages/settings/languages/workspace/language/language-workspace.element.d.ts +0 -1
- package/dist-cms/packages/settings/languages/workspace/language/language-workspace.element.js +0 -1
- package/dist-cms/packages/templating/components/insert-menu/templating-insert-menu.element.js +1 -1
- package/dist-cms/packages/templating/manifests.d.ts +6 -1
- package/dist-cms/packages/templating/partial-views/config.d.ts +3 -4
- package/dist-cms/packages/templating/partial-views/config.js +1 -0
- package/dist-cms/packages/templating/partial-views/entity-actions/create/create-empty.action.js +1 -1
- package/dist-cms/packages/templating/partial-views/entity-actions/create/create-from-snippet.action.d.ts +10 -1
- package/dist-cms/packages/templating/partial-views/entity-actions/create/create-from-snippet.action.js +16 -1
- package/dist-cms/packages/templating/partial-views/entity-actions/create/create-from-snippet.modal.d.ts +16 -0
- package/dist-cms/packages/templating/partial-views/entity-actions/create/create-from-snippet.modal.js +73 -0
- package/dist-cms/packages/templating/partial-views/entity-actions/manifests.d.ts +6 -1
- package/dist-cms/packages/templating/partial-views/entity-actions/manifests.js +43 -5
- package/dist-cms/packages/templating/partial-views/manifests.d.ts +6 -1
- package/dist-cms/packages/templating/partial-views/repository/partial-views.repository.d.ts +39 -23
- package/dist-cms/packages/templating/partial-views/repository/partial-views.repository.js +66 -19
- package/dist-cms/packages/templating/partial-views/repository/sources/partial-views.detail.server.data.d.ts +48 -13
- package/dist-cms/packages/templating/partial-views/repository/sources/partial-views.detail.server.data.js +56 -17
- package/dist-cms/packages/templating/partial-views/repository/sources/partial-views.folder.server.data.d.ts +17 -0
- package/dist-cms/packages/templating/partial-views/repository/sources/partial-views.folder.server.data.js +23 -0
- package/dist-cms/packages/templating/partial-views/workspace/partial-views-workspace-edit.element.d.ts +6 -1
- package/dist-cms/packages/templating/partial-views/workspace/partial-views-workspace-edit.element.js +123 -27
- package/dist-cms/packages/templating/partial-views/workspace/partial-views-workspace.context.d.ts +8 -6
- package/dist-cms/packages/templating/partial-views/workspace/partial-views-workspace.context.js +47 -6
- package/dist-cms/packages/templating/partial-views/workspace/partial-views-workspace.element.d.ts +1 -0
- package/dist-cms/packages/templating/partial-views/workspace/partial-views-workspace.element.js +7 -3
- package/dist-cms/shared/repository/data-source/data-source.interface.d.ts +2 -2
- package/dist-cms/shared/repository/detail-repository.interface.d.ts +2 -2
- package/dist-cms/tsconfig.tsbuildinfo +1 -1
- package/dist-cms/vscode-html-custom-data.json +40 -40
- package/package.json +19 -19
- package/dist-cms/packages/translation/umbraco-package.js +0 -9
- /package/dist-cms/packages/{translation → dictionary}/dashboards/dictionary/dashboard-translation-dictionary.element.d.ts +0 -0
- /package/dist-cms/packages/{translation → dictionary}/dashboards/dictionary/dashboard-translation-dictionary.element.js +0 -0
- /package/dist-cms/packages/{translation → dictionary}/dictionary/entity-actions/create/create-dictionary-modal.element.d.ts +0 -0
- /package/dist-cms/packages/{translation → dictionary}/dictionary/entity-actions/create/create-dictionary-modal.element.js +0 -0
- /package/dist-cms/packages/{translation → dictionary}/dictionary/entity-actions/create/create.action.d.ts +0 -0
- /package/dist-cms/packages/{translation → dictionary}/dictionary/entity-actions/create/create.action.js +0 -0
- /package/dist-cms/packages/{translation → dictionary}/dictionary/entity-actions/export/export-dictionary-modal.element.d.ts +0 -0
- /package/dist-cms/packages/{translation → dictionary}/dictionary/entity-actions/export/export-dictionary-modal.element.js +0 -0
- /package/dist-cms/packages/{translation → dictionary}/dictionary/entity-actions/import/import-dictionary-modal.element.d.ts +0 -0
- /package/dist-cms/packages/{translation → dictionary}/dictionary/entity-actions/import/import-dictionary-modal.element.js +0 -0
- /package/dist-cms/packages/{translation → dictionary}/dictionary/entity-actions/manifests.d.ts +0 -0
- /package/dist-cms/packages/{translation → dictionary}/dictionary/entity-actions/manifests.js +0 -0
- /package/dist-cms/packages/{translation → dictionary}/dictionary/entity-actions/reload.action.d.ts +0 -0
- /package/dist-cms/packages/{translation → dictionary}/dictionary/entity-actions/reload.action.js +0 -0
- /package/dist-cms/packages/{translation → dictionary}/dictionary/manifests.d.ts +0 -0
- /package/dist-cms/packages/{translation → dictionary}/dictionary/manifests.js +0 -0
- /package/dist-cms/packages/{translation → dictionary}/dictionary/menu-item/dictionary-menu-item.element.d.ts +0 -0
- /package/dist-cms/packages/{translation → dictionary}/dictionary/menu-item/dictionary-menu-item.element.js +0 -0
- /package/dist-cms/packages/{translation → dictionary}/dictionary/menu-item/manifests.d.ts +0 -0
- /package/dist-cms/packages/{translation → dictionary}/dictionary/menu-item/manifests.js +0 -0
- /package/dist-cms/packages/{translation → dictionary}/dictionary/menu.manifests.d.ts +0 -0
- /package/dist-cms/packages/{translation → dictionary}/dictionary/menu.manifests.js +0 -0
- /package/dist-cms/packages/{translation → dictionary}/dictionary/repository/dictionary.repository.d.ts +0 -0
- /package/dist-cms/packages/{translation → dictionary}/dictionary/repository/dictionary.repository.js +0 -0
- /package/dist-cms/packages/{translation → dictionary}/dictionary/repository/dictionary.store.d.ts +0 -0
- /package/dist-cms/packages/{translation → dictionary}/dictionary/repository/dictionary.store.js +0 -0
- /package/dist-cms/packages/{translation → dictionary}/dictionary/repository/dictionary.tree.store.d.ts +0 -0
- /package/dist-cms/packages/{translation → dictionary}/dictionary/repository/dictionary.tree.store.js +0 -0
- /package/dist-cms/packages/{translation → dictionary}/dictionary/repository/manifests.d.ts +0 -0
- /package/dist-cms/packages/{translation → dictionary}/dictionary/repository/sources/dictionary.detail.server.data.d.ts +0 -0
- /package/dist-cms/packages/{translation → dictionary}/dictionary/repository/sources/dictionary.detail.server.data.js +0 -0
- /package/dist-cms/packages/{translation → dictionary}/dictionary/repository/sources/dictionary.tree.server.data.d.ts +0 -0
- /package/dist-cms/packages/{translation → dictionary}/dictionary/repository/sources/dictionary.tree.server.data.js +0 -0
- /package/dist-cms/packages/{translation → dictionary}/dictionary/tree/manifests.d.ts +0 -0
- /package/dist-cms/packages/{translation → dictionary}/dictionary/tree/manifests.js +0 -0
- /package/dist-cms/packages/{translation → dictionary}/dictionary/workspace/dictionary-workspace-editor.element.d.ts +0 -0
- /package/dist-cms/packages/{translation → dictionary}/dictionary/workspace/dictionary-workspace-editor.element.js +0 -0
- /package/dist-cms/packages/{translation → dictionary}/dictionary/workspace/dictionary-workspace.context.d.ts +0 -0
- /package/dist-cms/packages/{translation → dictionary}/dictionary/workspace/dictionary-workspace.context.js +0 -0
- /package/dist-cms/packages/{translation → dictionary}/dictionary/workspace/dictionary-workspace.element.d.ts +0 -0
- /package/dist-cms/packages/{translation → dictionary}/dictionary/workspace/dictionary-workspace.element.js +0 -0
- /package/dist-cms/packages/{translation → dictionary}/dictionary/workspace/manifests.d.ts +0 -0
- /package/dist-cms/packages/{translation → dictionary}/dictionary/workspace/manifests.js +0 -0
- /package/dist-cms/packages/{translation → dictionary}/dictionary/workspace/views/editor/workspace-view-dictionary-editor.element.d.ts +0 -0
- /package/dist-cms/packages/{translation → dictionary}/dictionary/workspace/views/editor/workspace-view-dictionary-editor.element.js +0 -0
- /package/dist-cms/packages/{translation → dictionary}/manifests.d.ts +0 -0
- /package/dist-cms/packages/{translation → dictionary}/manifests.js +0 -0
- /package/dist-cms/packages/{translation → dictionary}/section.manifest.d.ts +0 -0
|
@@ -1,19 +1,28 @@
|
|
|
1
|
+
import { PartialViewGetFolderResponse } from './sources/partial-views.folder.server.data.js';
|
|
1
2
|
import { Observable } from '../../../../external/rxjs/index.js';
|
|
2
3
|
import { UmbControllerHostElement } from '../../../../libs/controller-api/index.js';
|
|
3
|
-
import {
|
|
4
|
-
import { UmbDetailRepository, UmbTreeRepository } from '../../../../shared/repository/index.js';
|
|
5
|
-
export declare class UmbPartialViewsRepository implements UmbTreeRepository<
|
|
4
|
+
import { CreateFolderRequestModel, CreatePartialViewRequestModel, FileSystemTreeItemPresentationModel, FolderModelBaseModel, FolderReponseModel, PagedSnippetItemResponseModel, PartialViewItemResponseModel, PartialViewResponseModel, ProblemDetails, TextFileResponseModelBaseModel, UpdatePartialViewRequestModel } from '../../../../external/backend-api/index.js';
|
|
5
|
+
import { DataSourceResponse, UmbDataSourceErrorResponse, UmbDetailRepository, UmbFolderRepository, UmbTreeRepository } from '../../../../shared/repository/index.js';
|
|
6
|
+
export declare class UmbPartialViewsRepository implements UmbTreeRepository<FileSystemTreeItemPresentationModel>, UmbDetailRepository<CreatePartialViewRequestModel, string, UpdatePartialViewRequestModel, PartialViewResponseModel, string>, UmbFolderRepository {
|
|
6
7
|
#private;
|
|
7
8
|
constructor(host: UmbControllerHostElement);
|
|
8
|
-
|
|
9
|
-
data?:
|
|
9
|
+
createFolderScaffold(parentId: string | null): Promise<{
|
|
10
|
+
data?: FolderReponseModel | undefined;
|
|
10
11
|
error?: ProblemDetails | undefined;
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
12
|
+
}>;
|
|
13
|
+
createFolder(requestBody: CreateFolderRequestModel): Promise<{
|
|
14
|
+
data?: string | undefined;
|
|
15
|
+
error?: ProblemDetails | undefined;
|
|
16
|
+
}>;
|
|
17
|
+
requestFolder(unique: string): Promise<{
|
|
18
|
+
data?: PartialViewGetFolderResponse | undefined;
|
|
19
|
+
error?: ProblemDetails | undefined;
|
|
20
|
+
}>;
|
|
21
|
+
updateFolder(unique: string, folder: FolderModelBaseModel): Promise<{
|
|
22
|
+
data?: FolderModelBaseModel | undefined;
|
|
23
|
+
error?: ProblemDetails | undefined;
|
|
24
|
+
}>;
|
|
25
|
+
deleteFolder(path: string): Promise<{
|
|
17
26
|
error?: ProblemDetails | undefined;
|
|
18
27
|
}>;
|
|
19
28
|
requestTreeRoot(): Promise<{
|
|
@@ -29,12 +38,12 @@ export declare class UmbPartialViewsRepository implements UmbTreeRepository<Enti
|
|
|
29
38
|
requestRootTreeItems(): Promise<{
|
|
30
39
|
data: import("../../../../external/backend-api/index.js").PagedFileSystemTreeItemPresentationModel | undefined;
|
|
31
40
|
error: import("../../../../external/backend-api/index.js").ApiError | import("../../../../external/backend-api/index.js").CancelError | undefined;
|
|
32
|
-
asObservable: () => Observable<
|
|
41
|
+
asObservable: () => Observable<FileSystemTreeItemPresentationModel[]>;
|
|
33
42
|
}>;
|
|
34
43
|
requestTreeItemsOf(path: string | null): Promise<{
|
|
35
44
|
data: any;
|
|
36
45
|
error: any;
|
|
37
|
-
asObservable: () => Observable<
|
|
46
|
+
asObservable: () => Observable<FileSystemTreeItemPresentationModel[]>;
|
|
38
47
|
}>;
|
|
39
48
|
requestTreeItems(keys: Array<string>): Promise<{
|
|
40
49
|
data: undefined;
|
|
@@ -43,17 +52,24 @@ export declare class UmbPartialViewsRepository implements UmbTreeRepository<Enti
|
|
|
43
52
|
} | {
|
|
44
53
|
data: any;
|
|
45
54
|
error: any;
|
|
46
|
-
asObservable: () => Observable<
|
|
55
|
+
asObservable: () => Observable<FileSystemTreeItemPresentationModel[]>;
|
|
47
56
|
}>;
|
|
48
|
-
rootTreeItems(): Promise<Observable<
|
|
49
|
-
treeItemsOf(parentPath: string | null): Promise<Observable<
|
|
50
|
-
treeItems(paths: Array<string>): Promise<Observable<
|
|
57
|
+
rootTreeItems(): Promise<Observable<FileSystemTreeItemPresentationModel[]>>;
|
|
58
|
+
treeItemsOf(parentPath: string | null): Promise<Observable<FileSystemTreeItemPresentationModel[]>>;
|
|
59
|
+
treeItems(paths: Array<string>): Promise<Observable<FileSystemTreeItemPresentationModel[]>>;
|
|
51
60
|
requestByKey(path: string): Promise<{
|
|
52
|
-
data: undefined;
|
|
53
|
-
error: undefined;
|
|
61
|
+
data: TextFileResponseModelBaseModel | undefined;
|
|
62
|
+
error: import("../../../../external/backend-api/index.js").ApiError | import("../../../../external/backend-api/index.js").CancelError | undefined;
|
|
54
63
|
}>;
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
64
|
+
requestById(id: string): Promise<DataSourceResponse<any>>;
|
|
65
|
+
byId(id: string): Promise<Observable<any>>;
|
|
66
|
+
createScaffold(parentId: string | null, preset: string): Promise<DataSourceResponse<TextFileResponseModelBaseModel>>;
|
|
67
|
+
create(data: CreatePartialViewRequestModel): Promise<DataSourceResponse<any>>;
|
|
68
|
+
save(id: string, requestBody: UpdatePartialViewRequestModel): Promise<UmbDataSourceErrorResponse>;
|
|
69
|
+
delete(id: string): Promise<UmbDataSourceErrorResponse>;
|
|
70
|
+
getSnippets({ skip, take }: {
|
|
71
|
+
skip?: number | undefined;
|
|
72
|
+
take?: number | undefined;
|
|
73
|
+
}): Promise<DataSourceResponse<PagedSnippetItemResponseModel>>;
|
|
74
|
+
requestItems(keys: Array<string>): Promise<DataSourceResponse<PartialViewItemResponseModel[]>>;
|
|
59
75
|
}
|
|
@@ -1,34 +1,63 @@
|
|
|
1
|
+
import { PARTIAL_VIEW_ROOT_ENTITY_TYPE } from '../config.js';
|
|
1
2
|
import { UmbPartialViewDetailServerDataSource } from './sources/partial-views.detail.server.data.js';
|
|
2
3
|
import { UmbPartialViewsTreeServerDataSource } from './sources/partial-views.tree.server.data.js';
|
|
3
4
|
import { UMB_PARTIAL_VIEW_TREE_STORE_CONTEXT_TOKEN } from './partial-views.tree.store.js';
|
|
5
|
+
import { UmbPartialViewsFolderServerDataSource, } from './sources/partial-views.folder.server.data.js';
|
|
4
6
|
import { UmbContextConsumerController } from '../../../../libs/context-api/index.js';
|
|
5
|
-
import { PARTIAL_VIEW_ROOT_ENTITY_TYPE } from '../config.js';
|
|
6
7
|
export class UmbPartialViewsRepository {
|
|
7
8
|
#init;
|
|
8
9
|
#host;
|
|
9
10
|
#treeDataSource;
|
|
10
11
|
#detailDataSource;
|
|
12
|
+
#folderDataSource;
|
|
11
13
|
#treeStore;
|
|
12
14
|
constructor(host) {
|
|
13
15
|
this.#host = host;
|
|
14
16
|
this.#treeDataSource = new UmbPartialViewsTreeServerDataSource(this.#host);
|
|
15
17
|
this.#detailDataSource = new UmbPartialViewDetailServerDataSource(this.#host);
|
|
18
|
+
this.#folderDataSource = new UmbPartialViewsFolderServerDataSource(this.#host);
|
|
16
19
|
this.#init = Promise.all([
|
|
17
20
|
new UmbContextConsumerController(this.#host, UMB_PARTIAL_VIEW_TREE_STORE_CONTEXT_TOKEN, (instance) => {
|
|
18
21
|
this.#treeStore = instance;
|
|
19
22
|
}),
|
|
20
23
|
]);
|
|
21
24
|
}
|
|
22
|
-
|
|
23
|
-
|
|
25
|
+
//#region FOLDER
|
|
26
|
+
createFolderScaffold(parentId) {
|
|
27
|
+
const data = {
|
|
28
|
+
name: '',
|
|
29
|
+
parentId,
|
|
30
|
+
};
|
|
31
|
+
return Promise.resolve({ data, error: undefined });
|
|
24
32
|
}
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
33
|
+
async createFolder(requestBody) {
|
|
34
|
+
await this.#init;
|
|
35
|
+
const req = {
|
|
36
|
+
parentPath: requestBody.parentId,
|
|
37
|
+
name: requestBody.name,
|
|
38
|
+
};
|
|
39
|
+
const promise = this.#folderDataSource.insert(req);
|
|
40
|
+
await promise;
|
|
41
|
+
this.requestTreeItemsOf(requestBody.parentId ? requestBody.parentId : null);
|
|
42
|
+
return promise;
|
|
43
|
+
}
|
|
44
|
+
async requestFolder(unique) {
|
|
45
|
+
await this.#init;
|
|
46
|
+
return this.#folderDataSource.get(unique);
|
|
47
|
+
}
|
|
48
|
+
updateFolder(unique, folder) {
|
|
29
49
|
throw new Error('Method not implemented.');
|
|
30
50
|
}
|
|
31
|
-
|
|
51
|
+
async deleteFolder(path) {
|
|
52
|
+
await this.#init;
|
|
53
|
+
const { data } = await this.requestFolder(path);
|
|
54
|
+
const promise = this.#folderDataSource.delete(path);
|
|
55
|
+
await promise;
|
|
56
|
+
this.requestTreeItemsOf(data?.parentPath ? data?.parentPath : null);
|
|
57
|
+
return promise;
|
|
58
|
+
}
|
|
59
|
+
//#endregion
|
|
60
|
+
//#region TREE
|
|
32
61
|
async requestTreeRoot() {
|
|
33
62
|
await this.#init;
|
|
34
63
|
const data = {
|
|
@@ -54,7 +83,7 @@ export class UmbPartialViewsRepository {
|
|
|
54
83
|
return this.requestRootTreeItems();
|
|
55
84
|
}
|
|
56
85
|
await this.#init;
|
|
57
|
-
const { data, error } = await this.#treeDataSource.getChildrenOf({ path });
|
|
86
|
+
const { data, error } = await this.#treeDataSource.getChildrenOf({ path, skip: 0, take: 100 });
|
|
58
87
|
if (data) {
|
|
59
88
|
this.#treeStore.appendItems(data.items);
|
|
60
89
|
}
|
|
@@ -85,7 +114,8 @@ export class UmbPartialViewsRepository {
|
|
|
85
114
|
await this.#init;
|
|
86
115
|
return this.#treeStore.items(paths);
|
|
87
116
|
}
|
|
88
|
-
|
|
117
|
+
//#endregion
|
|
118
|
+
//#region DETAILS
|
|
89
119
|
async requestByKey(path) {
|
|
90
120
|
if (!path)
|
|
91
121
|
throw new Error('Path is missing');
|
|
@@ -93,17 +123,34 @@ export class UmbPartialViewsRepository {
|
|
|
93
123
|
const { data, error } = await this.#detailDataSource.get(path);
|
|
94
124
|
return { data, error };
|
|
95
125
|
}
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
126
|
+
requestById(id) {
|
|
127
|
+
throw new Error('Method not implemented.');
|
|
128
|
+
}
|
|
129
|
+
byId(id) {
|
|
130
|
+
throw new Error('Method not implemented.');
|
|
131
|
+
}
|
|
132
|
+
createScaffold(parentId, preset) {
|
|
133
|
+
return this.#detailDataSource.createScaffold(parentId, preset);
|
|
134
|
+
}
|
|
135
|
+
async create(data) {
|
|
136
|
+
const promise = this.#detailDataSource.insert(data);
|
|
137
|
+
await promise;
|
|
138
|
+
this.requestTreeItemsOf(data.parentPath ? data.parentPath : null);
|
|
139
|
+
return promise;
|
|
140
|
+
}
|
|
141
|
+
save(id, requestBody) {
|
|
142
|
+
return this.#detailDataSource.update(id, requestBody);
|
|
99
143
|
}
|
|
100
|
-
async
|
|
101
|
-
|
|
144
|
+
async delete(id) {
|
|
145
|
+
const promise = this.#detailDataSource.delete(id);
|
|
146
|
+
const parentPath = id.substring(0, id.lastIndexOf('/'));
|
|
147
|
+
this.requestTreeItemsOf(parentPath ? parentPath : null);
|
|
148
|
+
return promise;
|
|
102
149
|
}
|
|
103
|
-
|
|
104
|
-
return
|
|
150
|
+
getSnippets({ skip = 0, take = 100 }) {
|
|
151
|
+
return this.#detailDataSource.getSnippets({ skip, take });
|
|
105
152
|
}
|
|
106
|
-
|
|
107
|
-
return
|
|
153
|
+
requestItems(keys) {
|
|
154
|
+
return this.#detailDataSource.getItems(keys);
|
|
108
155
|
}
|
|
109
156
|
}
|
|
@@ -1,26 +1,61 @@
|
|
|
1
1
|
import { PartialViewDetails } from '../../config.js';
|
|
2
|
+
import { CreatePartialViewRequestModel, PagedSnippetItemResponseModel, PartialViewItemResponseModel, PartialViewResponseModel, UpdatePartialViewRequestModel } from '../../../../../external/backend-api/index.js';
|
|
2
3
|
import type { UmbControllerHostElement } from '../../../../../libs/controller-api/index.js';
|
|
3
4
|
import { DataSourceResponse, UmbDataSource } from '../../../../../shared/repository/index.js';
|
|
4
|
-
export declare class UmbPartialViewDetailServerDataSource implements UmbDataSource<
|
|
5
|
+
export declare class UmbPartialViewDetailServerDataSource implements UmbDataSource<CreatePartialViewRequestModel, string, UpdatePartialViewRequestModel, PartialViewResponseModel, string> {
|
|
5
6
|
#private;
|
|
7
|
+
constructor(host: UmbControllerHostElement);
|
|
6
8
|
/**
|
|
7
|
-
* Creates
|
|
8
|
-
*
|
|
9
|
+
* Creates a new partial view scaffold
|
|
10
|
+
*
|
|
11
|
+
* @param {(string | null)} [parentId=null] You can leave this empty
|
|
12
|
+
* @param {string} preset Name of the snippet to use as a preset
|
|
13
|
+
* @return {*} {Promise<DataSourceResponse<PartialViewDetails>>}
|
|
9
14
|
* @memberof UmbPartialViewDetailServerDataSource
|
|
10
15
|
*/
|
|
11
|
-
|
|
12
|
-
|
|
16
|
+
createScaffold(parentId: string | null | undefined, preset: string): Promise<DataSourceResponse<PartialViewDetails>>;
|
|
17
|
+
/**
|
|
18
|
+
* Get possible snippets for partial views
|
|
19
|
+
*
|
|
20
|
+
* @param {*} { skip = 0, take = 100 }
|
|
21
|
+
* @return {*} {Promise<DataSourceResponse<PagedSnippetItemResponseModel>>}
|
|
22
|
+
* @memberof UmbPartialViewDetailServerDataSource
|
|
23
|
+
*/
|
|
24
|
+
getSnippets({ skip, take }: {
|
|
25
|
+
skip?: number | undefined;
|
|
26
|
+
take?: number | undefined;
|
|
27
|
+
}): Promise<DataSourceResponse<PagedSnippetItemResponseModel>>;
|
|
13
28
|
/**
|
|
14
|
-
* Fetches a
|
|
29
|
+
* Fetches a partial view with the given path from the server
|
|
15
30
|
* @param {string} path
|
|
16
31
|
* @return {*}
|
|
17
32
|
* @memberof UmbStylesheetServerDataSource
|
|
18
33
|
*/
|
|
19
|
-
get(path: string): Promise<
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
34
|
+
get(path: string): Promise<DataSourceResponse<import("../../../../../external/backend-api/index.js").TextFileResponseModelBaseModel>>;
|
|
35
|
+
/**
|
|
36
|
+
* Creates a new partial view
|
|
37
|
+
*
|
|
38
|
+
* @param {CreatePartialViewRequestModel} requestBody
|
|
39
|
+
* @return {*} {Promise<DataSourceResponse<string>>}
|
|
40
|
+
* @memberof UmbPartialViewDetailServerDataSource
|
|
41
|
+
*/
|
|
42
|
+
insert(requestBody: CreatePartialViewRequestModel): Promise<DataSourceResponse<string>>;
|
|
43
|
+
/**
|
|
44
|
+
* Updates a partial view
|
|
45
|
+
*
|
|
46
|
+
* @param {string} [unique='']
|
|
47
|
+
* @param {UpdatePartialViewRequestModel} requestBody
|
|
48
|
+
* @return {*} {Promise<DataSourceResponse<any>>}
|
|
49
|
+
* @memberof UmbPartialViewDetailServerDataSource
|
|
50
|
+
*/
|
|
51
|
+
update(unique: string | undefined, requestBody: UpdatePartialViewRequestModel): Promise<DataSourceResponse<any>>;
|
|
52
|
+
/**
|
|
53
|
+
* Deletes a partial view
|
|
54
|
+
*
|
|
55
|
+
* @param {string} path
|
|
56
|
+
* @return {*} {Promise<DataSourceResponse>}
|
|
57
|
+
* @memberof UmbPartialViewDetailServerDataSource
|
|
58
|
+
*/
|
|
59
|
+
delete(path: string): Promise<DataSourceResponse>;
|
|
60
|
+
getItems(keys: Array<string>): Promise<DataSourceResponse<PartialViewItemResponseModel[]>>;
|
|
26
61
|
}
|
|
@@ -1,36 +1,75 @@
|
|
|
1
|
-
|
|
1
|
+
import { PartialViewResource, } from '../../../../../external/backend-api/index.js';
|
|
2
|
+
import { tryExecuteAndNotify } from '../../../../../shared/resources/index.js';
|
|
2
3
|
export class UmbPartialViewDetailServerDataSource {
|
|
3
4
|
#host;
|
|
5
|
+
constructor(host) {
|
|
6
|
+
this.#host = host;
|
|
7
|
+
}
|
|
4
8
|
/**
|
|
5
|
-
* Creates
|
|
6
|
-
*
|
|
9
|
+
* Creates a new partial view scaffold
|
|
10
|
+
*
|
|
11
|
+
* @param {(string | null)} [parentId=null] You can leave this empty
|
|
12
|
+
* @param {string} preset Name of the snippet to use as a preset
|
|
13
|
+
* @return {*} {Promise<DataSourceResponse<PartialViewDetails>>}
|
|
7
14
|
* @memberof UmbPartialViewDetailServerDataSource
|
|
8
15
|
*/
|
|
9
|
-
|
|
10
|
-
this.#host
|
|
16
|
+
createScaffold(parentId = null, preset) {
|
|
17
|
+
return tryExecuteAndNotify(this.#host, PartialViewResource.getPartialViewSnippetByName({ name: preset }));
|
|
11
18
|
}
|
|
12
|
-
|
|
13
|
-
|
|
19
|
+
/**
|
|
20
|
+
* Get possible snippets for partial views
|
|
21
|
+
*
|
|
22
|
+
* @param {*} { skip = 0, take = 100 }
|
|
23
|
+
* @return {*} {Promise<DataSourceResponse<PagedSnippetItemResponseModel>>}
|
|
24
|
+
* @memberof UmbPartialViewDetailServerDataSource
|
|
25
|
+
*/
|
|
26
|
+
getSnippets({ skip = 0, take = 100 }) {
|
|
27
|
+
return tryExecuteAndNotify(this.#host, PartialViewResource.getPartialViewSnippet({ skip, take }));
|
|
14
28
|
}
|
|
15
29
|
/**
|
|
16
|
-
* Fetches a
|
|
30
|
+
* Fetches a partial view with the given path from the server
|
|
17
31
|
* @param {string} path
|
|
18
32
|
* @return {*}
|
|
19
33
|
* @memberof UmbStylesheetServerDataSource
|
|
20
34
|
*/
|
|
21
|
-
|
|
35
|
+
get(path) {
|
|
22
36
|
if (!path)
|
|
23
37
|
throw new Error('Path is missing');
|
|
24
|
-
|
|
25
|
-
return { data: undefined, error: undefined };
|
|
38
|
+
return tryExecuteAndNotify(this.#host, PartialViewResource.getPartialView({ path }));
|
|
26
39
|
}
|
|
27
|
-
|
|
28
|
-
|
|
40
|
+
/**
|
|
41
|
+
* Creates a new partial view
|
|
42
|
+
*
|
|
43
|
+
* @param {CreatePartialViewRequestModel} requestBody
|
|
44
|
+
* @return {*} {Promise<DataSourceResponse<string>>}
|
|
45
|
+
* @memberof UmbPartialViewDetailServerDataSource
|
|
46
|
+
*/
|
|
47
|
+
insert(requestBody) {
|
|
48
|
+
return tryExecuteAndNotify(this.#host, PartialViewResource.postPartialView({ requestBody }));
|
|
49
|
+
}
|
|
50
|
+
//TODO the parameters here are bit ugly, since unique is already in the request body parameter, but it has to be done to marry the UmbDataSource interface an backend API together... maybe come up with some nicer solution
|
|
51
|
+
/**
|
|
52
|
+
* Updates a partial view
|
|
53
|
+
*
|
|
54
|
+
* @param {string} [unique='']
|
|
55
|
+
* @param {UpdatePartialViewRequestModel} requestBody
|
|
56
|
+
* @return {*} {Promise<DataSourceResponse<any>>}
|
|
57
|
+
* @memberof UmbPartialViewDetailServerDataSource
|
|
58
|
+
*/
|
|
59
|
+
update(unique = '', requestBody) {
|
|
60
|
+
return tryExecuteAndNotify(this.#host, PartialViewResource.putPartialView({ requestBody }));
|
|
29
61
|
}
|
|
30
|
-
|
|
31
|
-
|
|
62
|
+
/**
|
|
63
|
+
* Deletes a partial view
|
|
64
|
+
*
|
|
65
|
+
* @param {string} path
|
|
66
|
+
* @return {*} {Promise<DataSourceResponse>}
|
|
67
|
+
* @memberof UmbPartialViewDetailServerDataSource
|
|
68
|
+
*/
|
|
69
|
+
delete(path) {
|
|
70
|
+
return tryExecuteAndNotify(this.#host, PartialViewResource.deletePartialView({ path }));
|
|
32
71
|
}
|
|
33
|
-
|
|
34
|
-
|
|
72
|
+
getItems(keys) {
|
|
73
|
+
return tryExecuteAndNotify(this.#host, PartialViewResource.getPartialViewItem({ id: keys }));
|
|
35
74
|
}
|
|
36
75
|
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { CreateFolderRequestModel, FolderModelBaseModel, FolderReponseModel } from '../../../../../external/backend-api/index.js';
|
|
2
|
+
import { UmbControllerHostElement } from '../../../../../libs/controller-api/index.js';
|
|
3
|
+
import { DataSourceResponse, UmbFolderDataSource } from '../../../../../shared/repository/index.js';
|
|
4
|
+
export type PartialViewGetFolderResponse = {
|
|
5
|
+
path: string;
|
|
6
|
+
parentPath: string;
|
|
7
|
+
name: string;
|
|
8
|
+
};
|
|
9
|
+
export declare class UmbPartialViewsFolderServerDataSource implements UmbFolderDataSource {
|
|
10
|
+
#private;
|
|
11
|
+
constructor(host: UmbControllerHostElement);
|
|
12
|
+
createScaffold(parentId: string | null): Promise<DataSourceResponse<FolderReponseModel>>;
|
|
13
|
+
get(unique: string): Promise<DataSourceResponse<PartialViewGetFolderResponse>>;
|
|
14
|
+
insert(requestBody: CreateFolderRequestModel): Promise<DataSourceResponse<string>>;
|
|
15
|
+
update(unique: string, data: CreateFolderRequestModel): Promise<DataSourceResponse<FolderModelBaseModel>>;
|
|
16
|
+
delete(path: string): Promise<DataSourceResponse<unknown>>;
|
|
17
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { PartialViewResource, } from '../../../../../external/backend-api/index.js';
|
|
2
|
+
import { tryExecuteAndNotify } from '../../../../../shared/resources/index.js';
|
|
3
|
+
export class UmbPartialViewsFolderServerDataSource {
|
|
4
|
+
#host;
|
|
5
|
+
constructor(host) {
|
|
6
|
+
this.#host = host;
|
|
7
|
+
}
|
|
8
|
+
createScaffold(parentId) {
|
|
9
|
+
throw new Error('Method not implemented.');
|
|
10
|
+
}
|
|
11
|
+
get(unique) {
|
|
12
|
+
return tryExecuteAndNotify(this.#host, PartialViewResource.getPartialViewFolder({ path: unique }));
|
|
13
|
+
}
|
|
14
|
+
insert(requestBody) {
|
|
15
|
+
return tryExecuteAndNotify(this.#host, PartialViewResource.postPartialViewFolder({ requestBody }));
|
|
16
|
+
}
|
|
17
|
+
update(unique, data) {
|
|
18
|
+
throw new Error('Method not implemented.');
|
|
19
|
+
}
|
|
20
|
+
delete(path) {
|
|
21
|
+
return tryExecuteAndNotify(this.#host, PartialViewResource.deletePartialViewFolder({ path }));
|
|
22
|
+
}
|
|
23
|
+
}
|
|
@@ -1,9 +1,14 @@
|
|
|
1
1
|
import { UmbLitElement } from '../../../../shared/lit-element/index.js';
|
|
2
2
|
export declare class UmbPartialViewsWorkspaceEditElement extends UmbLitElement {
|
|
3
3
|
#private;
|
|
4
|
-
private _name
|
|
4
|
+
private get _name();
|
|
5
|
+
private set _name(value);
|
|
5
6
|
private _content?;
|
|
7
|
+
private _path?;
|
|
8
|
+
private _ready?;
|
|
6
9
|
private _codeEditor?;
|
|
10
|
+
private _modalContext?;
|
|
11
|
+
private inputQuery$;
|
|
7
12
|
constructor();
|
|
8
13
|
render(): import("lit-html").TemplateResult<1>;
|
|
9
14
|
static styles: import("@lit/reactive-element/css-tag.js").CSSResult[];
|