@umbraco-cms/backoffice 14.0.0-3ffd4766 → 14.0.0-40e04294
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/custom-elements.json +33 -11
- package/dist-cms/external/backend-api/index.js +1 -1
- package/dist-cms/external/backend-api/src/index.d.ts +17 -1
- package/dist-cms/external/backend-api/src/models/CreateContentRequestModelBaseDocumentValueModelDocumentVariantRequestModel.d.ts +1 -0
- package/dist-cms/external/backend-api/src/models/CreateContentRequestModelBaseMediaValueModelMediaVariantRequestModel.d.ts +1 -0
- package/dist-cms/external/backend-api/src/models/CreateContentTypeRequestModelBaseCreateDocumentTypePropertyTypeRequestModelCreateDocumentTypePropertyTypeContainerRequestModel.d.ts +2 -0
- package/dist-cms/external/backend-api/src/models/CreateContentTypeRequestModelBaseCreateMediaTypePropertyTypeRequestModelCreateMediaTypePropertyTypeContainerRequestModel.d.ts +20 -0
- package/dist-cms/external/backend-api/src/models/CreateMediaTypePropertyTypeContainerRequestModel.d.ts +2 -0
- package/dist-cms/external/backend-api/src/models/CreateMediaTypePropertyTypeRequestModel.d.ts +2 -0
- package/dist-cms/external/backend-api/src/models/CreateMediaTypeRequestModel.d.ts +2 -0
- package/dist-cms/external/backend-api/src/models/DeleteUserGroupsRequestModel.d.ts +3 -0
- package/dist-cms/external/backend-api/src/models/DeleteUsersRequestModel.d.ts +3 -0
- package/dist-cms/external/backend-api/src/models/ItemSortingRequestModel.d.ts +4 -0
- package/dist-cms/external/backend-api/src/models/ProblemDetailsBuilderModel.d.ts +1 -0
- package/dist-cms/external/backend-api/src/models/RelationResponseModel.d.ts +2 -2
- package/dist-cms/external/backend-api/src/models/ResetPasswordRequestModel.d.ts +3 -0
- package/dist-cms/external/backend-api/src/models/ResetPasswordTokenRequestModel.d.ts +4 -0
- package/dist-cms/external/backend-api/src/models/SortingRequestModel.d.ts +5 -0
- package/dist-cms/external/backend-api/src/models/UpdateContentTypeRequestModelBaseUpdateMediaTypePropertyTypeRequestModelUpdateMediaTypePropertyTypeContainerRequestModel.d.ts +18 -0
- package/dist-cms/external/backend-api/src/models/{UpdateFolderReponseModel.d.ts → UpdateFolderResponseModel.d.ts} +1 -1
- package/dist-cms/external/backend-api/src/models/UpdateMediaTypePropertyTypeContainerRequestModel.d.ts +2 -0
- package/dist-cms/external/backend-api/src/models/UpdateMediaTypePropertyTypeRequestModel.d.ts +2 -0
- package/dist-cms/external/backend-api/src/models/UpdateMediaTypeRequestModel.d.ts +2 -0
- package/dist-cms/external/backend-api/src/models/VerifyResetPasswordTokenRequestModel.d.ts +4 -0
- package/dist-cms/external/backend-api/src/services/DataTypeResource.d.ts +2 -2
- package/dist-cms/external/backend-api/src/services/DocumentResource.d.ts +21 -21
- package/dist-cms/external/backend-api/src/services/DocumentTypeResource.d.ts +35 -3
- package/dist-cms/external/backend-api/src/services/MediaResource.d.ts +13 -5
- package/dist-cms/external/backend-api/src/services/MediaTypeResource.d.ts +56 -0
- package/dist-cms/external/backend-api/src/services/RelationResource.d.ts +1 -9
- package/dist-cms/external/backend-api/src/services/SecurityResource.d.ts +24 -0
- package/dist-cms/external/backend-api/src/services/UserGroupResource.d.ts +8 -0
- package/dist-cms/external/backend-api/src/services/UserResource.d.ts +8 -0
- package/dist-cms/external/router-slot/config.d.ts +8 -0
- package/dist-cms/external/router-slot/index.d.ts +4 -3
- package/dist-cms/external/router-slot/index.js +1 -1
- package/dist-cms/external/router-slot/model.d.ts +123 -0
- package/dist-cms/external/router-slot/router-slot.d.ts +111 -0
- package/dist-cms/external/router-slot/util/anchor.d.ts +5 -0
- package/dist-cms/external/router-slot/util/events.d.ts +26 -0
- package/dist-cms/external/router-slot/util/history.d.ts +32 -0
- package/dist-cms/external/router-slot/util/index.d.ts +6 -0
- package/dist-cms/external/router-slot/util/router.d.ts +72 -0
- package/dist-cms/external/router-slot/util/shadow.d.ts +15 -0
- package/dist-cms/external/router-slot/util/url.d.ts +78 -0
- package/dist-cms/external/router-slot/util.d.ts +1 -0
- package/dist-cms/libs/observable-api/observer.js +2 -1
- package/dist-cms/mocks/browser-handlers.js +3 -1
- package/dist-cms/mocks/data/document.data.d.ts +6 -2
- package/dist-cms/mocks/data/document.data.js +54 -4
- package/dist-cms/mocks/data/entity.data.js +0 -2
- package/dist-cms/mocks/data/scripts.data.d.ts +21 -0
- package/dist-cms/mocks/data/scripts.data.js +205 -0
- package/dist-cms/mocks/handlers/{document.handlers.js → document/document.handlers.js} +28 -40
- package/dist-cms/mocks/handlers/document/index.d.ts +1 -0
- package/dist-cms/mocks/handlers/document/index.js +5 -0
- package/dist-cms/mocks/handlers/document/item.handlers.d.ts +1 -0
- package/dist-cms/mocks/handlers/document/item.handlers.js +13 -0
- package/dist-cms/mocks/handlers/document/recycle-bin.handlers.d.ts +1 -0
- package/dist-cms/mocks/handlers/document/recycle-bin.handlers.js +16 -0
- package/dist-cms/mocks/handlers/document/slug.d.ts +1 -0
- package/dist-cms/mocks/handlers/document/slug.js +1 -0
- package/dist-cms/mocks/handlers/document/tree.handlers.d.ts +1 -0
- package/dist-cms/mocks/handlers/document/tree.handlers.js +16 -0
- package/dist-cms/mocks/handlers/scripts.handlers.d.ts +2 -0
- package/dist-cms/mocks/handlers/scripts.handlers.js +83 -0
- package/dist-cms/packages/core/content-type/content-type-container-structure-helper.class.js +2 -2
- package/dist-cms/packages/core/content-type/content-type-property-structure-helper.class.js +1 -1
- package/dist-cms/packages/core/content-type/content-type-structure-manager.class.d.ts +15 -15
- package/dist-cms/packages/core/content-type/content-type-structure-manager.class.js +79 -103
- package/dist-cms/packages/core/entity-action/common/trash/trash.action.d.ts +1 -1
- package/dist-cms/packages/core/entity-action/common/trash/trash.action.js +1 -1
- package/dist-cms/packages/core/modal/token/create-document-modal.token.d.ts +8 -0
- package/dist-cms/packages/core/modal/token/create-document-modal.token.js +5 -0
- package/dist-cms/packages/core/modal/token/index.d.ts +1 -1
- package/dist-cms/packages/core/modal/token/index.js +1 -1
- package/dist-cms/packages/core/store/store-base.d.ts +18 -6
- package/dist-cms/packages/core/store/store-base.js +22 -6
- package/dist-cms/packages/documents/document-types/entity-actions/manifests.js +1 -1
- package/dist-cms/packages/documents/document-types/manifests.js +0 -2
- package/dist-cms/packages/documents/document-types/repository/document-type-item.store.d.ts +20 -0
- package/dist-cms/packages/documents/document-types/repository/document-type-item.store.js +23 -0
- package/dist-cms/packages/documents/document-types/repository/document-type.repository.d.ts +5 -21
- package/dist-cms/packages/documents/document-types/repository/document-type.repository.js +26 -20
- package/dist-cms/packages/documents/document-types/repository/manifests.d.ts +3 -2
- package/dist-cms/packages/documents/document-types/repository/manifests.js +9 -1
- package/dist-cms/packages/documents/document-types/repository/sources/document-type-item.server.data.d.ts +25 -0
- package/dist-cms/packages/documents/document-types/repository/sources/document-type-item.server.data.js +32 -0
- package/dist-cms/packages/documents/document-types/repository/sources/document-type.server.data.d.ts +1 -1
- package/dist-cms/packages/documents/document-types/repository/sources/document-type.server.data.js +1 -12
- package/dist-cms/packages/documents/document-types/workspace/document-type-workspace.context.js +27 -27
- package/dist-cms/packages/documents/document-types/workspace/views/design/document-type-workspace-view-edit.element.js +8 -4
- package/dist-cms/packages/documents/documents/entity-actions/create/create-document-modal.element.d.ts +17 -0
- package/dist-cms/packages/documents/{document-types/modals/allowed-document-types/allowed-document-types-modal.element.js → documents/entity-actions/create/create-document-modal.element.js} +29 -38
- package/dist-cms/packages/documents/documents/entity-actions/create/create.action.d.ts +0 -2
- package/dist-cms/packages/documents/documents/entity-actions/create/create.action.js +7 -23
- package/dist-cms/packages/documents/documents/entity-actions/create/manifests.d.ts +2 -0
- package/dist-cms/packages/documents/documents/entity-actions/create/manifests.js +27 -0
- package/dist-cms/packages/documents/documents/entity-actions/manifests.d.ts +2 -2
- package/dist-cms/packages/documents/documents/entity-actions/manifests.js +15 -48
- package/dist-cms/packages/documents/documents/index.d.ts +1 -0
- package/dist-cms/packages/documents/documents/index.js +1 -0
- package/dist-cms/packages/documents/documents/manifests.d.ts +13 -1
- package/dist-cms/packages/documents/documents/manifests.js +2 -0
- package/dist-cms/packages/documents/documents/menu-item/manifests.js +1 -1
- package/dist-cms/packages/documents/documents/recycle-bin/entity-action/manifests.d.ts +14 -0
- package/dist-cms/packages/documents/documents/recycle-bin/entity-action/manifests.js +18 -0
- package/dist-cms/packages/documents/documents/recycle-bin/index.d.ts +1 -0
- package/dist-cms/packages/documents/documents/recycle-bin/index.js +1 -0
- package/dist-cms/packages/documents/documents/recycle-bin/manifests.d.ts +13 -0
- package/dist-cms/packages/documents/documents/recycle-bin/manifests.js +5 -0
- package/dist-cms/packages/documents/documents/recycle-bin/menu-item/manifests.d.ts +1 -0
- package/dist-cms/packages/documents/documents/recycle-bin/menu-item/manifests.js +14 -0
- package/dist-cms/packages/documents/documents/recycle-bin/repository/document-recycle-bin.repository.d.ts +28 -0
- package/dist-cms/packages/documents/documents/recycle-bin/repository/document-recycle-bin.repository.js +56 -0
- package/dist-cms/packages/documents/documents/recycle-bin/repository/document-recycle.bin.tree.store.d.ts +18 -0
- package/dist-cms/packages/documents/documents/recycle-bin/repository/document-recycle.bin.tree.store.js +19 -0
- package/dist-cms/packages/documents/documents/recycle-bin/repository/index.d.ts +1 -0
- package/dist-cms/packages/documents/documents/recycle-bin/repository/index.js +1 -0
- package/dist-cms/packages/documents/documents/recycle-bin/repository/manifests.d.ts +4 -0
- package/dist-cms/packages/documents/documents/recycle-bin/repository/manifests.js +17 -0
- package/dist-cms/packages/documents/documents/recycle-bin/repository/sources/document-recycle-bin.tree.server.data.d.ts +29 -0
- package/dist-cms/packages/documents/documents/recycle-bin/repository/sources/document-recycle-bin.tree.server.data.js +49 -0
- package/dist-cms/packages/documents/documents/recycle-bin/tree/manifests.d.ts +2 -0
- package/dist-cms/packages/documents/documents/recycle-bin/tree/manifests.js +19 -0
- package/dist-cms/packages/documents/documents/repository/document-item.store.d.ts +20 -0
- package/dist-cms/packages/documents/documents/repository/document-item.store.js +23 -0
- package/dist-cms/packages/documents/documents/repository/document.repository.d.ts +10 -9
- package/dist-cms/packages/documents/documents/repository/document.repository.js +47 -25
- package/dist-cms/packages/documents/documents/repository/document.store.d.ts +0 -12
- package/dist-cms/packages/documents/documents/repository/document.store.js +0 -16
- package/dist-cms/packages/documents/documents/repository/sources/document-item.server.data.d.ts +24 -0
- package/dist-cms/packages/documents/documents/repository/sources/document-item.server.data.js +31 -0
- package/dist-cms/packages/documents/documents/repository/sources/document.server.data.d.ts +9 -21
- package/dist-cms/packages/documents/documents/repository/sources/document.server.data.js +33 -62
- package/dist-cms/packages/documents/documents/workspace/manifests.js +6 -4
- package/dist-cms/packages/documents/manifests.d.ts +13 -1
- package/dist-cms/packages/settings/dashboards/performance-profiling/dashboard-performance-profiling.element.d.ts +3 -1
- package/dist-cms/packages/settings/dashboards/performance-profiling/dashboard-performance-profiling.element.js +26 -40
- package/dist-cms/packages/settings/relation-types/workspace/views/relation/workspace-view-relation-type-relation.element.js +17 -17
- package/dist-cms/packages/templating/manifests.js +2 -0
- package/dist-cms/packages/templating/scripts/config.d.ts +20 -0
- package/dist-cms/packages/templating/scripts/config.js +22 -0
- package/dist-cms/packages/templating/scripts/entity-actions/create/create-empty.action.d.ts +8 -0
- package/dist-cms/packages/templating/scripts/entity-actions/create/create-empty.action.js +9 -0
- package/dist-cms/packages/templating/scripts/entity-actions/manifests.d.ts +2 -0
- package/dist-cms/packages/templating/scripts/entity-actions/manifests.js +56 -0
- package/dist-cms/packages/templating/scripts/index.d.ts +2 -0
- package/dist-cms/packages/templating/scripts/index.js +2 -0
- package/dist-cms/packages/templating/scripts/manifests.d.ts +1 -0
- package/dist-cms/packages/templating/scripts/manifests.js +12 -0
- package/dist-cms/packages/templating/scripts/menu-item/manifests.d.ts +1 -0
- package/dist-cms/packages/templating/scripts/menu-item/manifests.js +16 -0
- package/dist-cms/packages/templating/scripts/repository/index.d.ts +1 -0
- package/dist-cms/packages/templating/scripts/repository/index.js +1 -0
- package/dist-cms/packages/templating/scripts/repository/manifests.d.ts +2 -0
- package/dist-cms/packages/templating/scripts/repository/manifests.js +23 -0
- package/dist-cms/packages/templating/scripts/repository/scripts.repository.d.ts +71 -0
- package/dist-cms/packages/templating/scripts/repository/scripts.repository.js +154 -0
- package/dist-cms/packages/templating/scripts/repository/scripts.store.d.ts +31 -0
- package/dist-cms/packages/templating/scripts/repository/scripts.store.js +37 -0
- package/dist-cms/packages/templating/scripts/repository/scripts.tree.store.d.ts +19 -0
- package/dist-cms/packages/templating/scripts/repository/scripts.tree.store.js +21 -0
- package/dist-cms/packages/templating/scripts/repository/sources/index.d.ts +11 -0
- package/dist-cms/packages/templating/scripts/repository/sources/index.js +1 -0
- package/dist-cms/packages/templating/scripts/repository/sources/scripts.detail.server.data.d.ts +41 -0
- package/dist-cms/packages/templating/scripts/repository/sources/scripts.detail.server.data.js +57 -0
- package/dist-cms/packages/templating/scripts/repository/sources/scripts.folder.server.data.d.ts +17 -0
- package/dist-cms/packages/templating/scripts/repository/sources/scripts.folder.server.data.js +23 -0
- package/dist-cms/packages/templating/scripts/repository/sources/scripts.tree.server.data.d.ts +14 -0
- package/dist-cms/packages/templating/scripts/repository/sources/scripts.tree.server.data.js +31 -0
- package/dist-cms/packages/templating/scripts/tree/manifests.d.ts +2 -0
- package/dist-cms/packages/templating/scripts/tree/manifests.js +20 -0
- package/dist-cms/packages/templating/scripts/workspace/manifests.d.ts +2 -0
- package/dist-cms/packages/templating/scripts/workspace/manifests.js +32 -0
- package/dist-cms/packages/templating/scripts/workspace/scripts-workspace-edit.element.d.ts +24 -0
- package/dist-cms/packages/templating/scripts/workspace/scripts-workspace-edit.element.js +171 -0
- package/dist-cms/packages/templating/scripts/workspace/scripts-workspace.context.d.ts +23 -0
- package/dist-cms/packages/templating/scripts/workspace/scripts-workspace.context.js +87 -0
- package/dist-cms/packages/templating/scripts/workspace/scripts-workspace.element.d.ts +14 -0
- package/dist-cms/packages/templating/scripts/workspace/scripts-workspace.element.js +50 -0
- package/dist-cms/packages/templating/templates/modals/query-builder/query-builder.element.d.ts +1 -1
- package/dist-cms/packages/templating/templates/modals/query-builder/query-builder.element.js +1 -1
- package/dist-cms/shared/repository/data-source/folder-data-source.interface.d.ts +2 -2
- package/dist-cms/shared/repository/folder-repository.interface.d.ts +2 -2
- package/dist-cms/shared/router/index.d.ts +1 -1
- package/dist-cms/shared/router/index.js +1 -1
- package/dist-cms/tsconfig.build.tsbuildinfo +1 -1
- package/dist-cms/vscode-html-custom-data.json +17 -7
- package/package.json +2 -3
- package/dist-cms/packages/core/modal/token/allowed-document-types-modal.token.d.ts +0 -9
- package/dist-cms/packages/core/modal/token/allowed-document-types-modal.token.js +0 -5
- package/dist-cms/packages/documents/document-types/modals/allowed-document-types/allowed-document-types-modal.element.d.ts +0 -19
- package/dist-cms/packages/documents/document-types/modals/manifests.d.ts +0 -2
- package/dist-cms/packages/documents/document-types/modals/manifests.js +0 -9
- package/router-slot-2.3.0.tgz +0 -0
- /package/dist-cms/mocks/handlers/{document.handlers.d.ts → document/document.handlers.d.ts} +0 -0
|
@@ -4,78 +4,61 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
4
4
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
5
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
6
|
};
|
|
7
|
-
import { UmbTextStyles } from
|
|
8
|
-
import { css, html, customElement, state } from '../../../../external/lit/index.js';
|
|
7
|
+
import { UmbTextStyles } from '../../../../shared/style/index.js';
|
|
8
|
+
import { css, html, customElement, state, query, unsafeHTML } from '../../../../external/lit/index.js';
|
|
9
9
|
import { UmbLitElement } from '../../../../shared/lit-element/index.js';
|
|
10
10
|
import { ProfilingResource } from '../../../../external/backend-api/index.js';
|
|
11
11
|
import { tryExecuteAndNotify } from '../../../../shared/resources/index.js';
|
|
12
12
|
export let UmbDashboardPerformanceProfilingElement = class UmbDashboardPerformanceProfilingElement extends UmbLitElement {
|
|
13
13
|
constructor() {
|
|
14
14
|
super(...arguments);
|
|
15
|
+
this._profilingStatus = true;
|
|
15
16
|
// TODO: Get this from the management api configuration when available
|
|
16
17
|
this._isDebugMode = true;
|
|
17
18
|
}
|
|
19
|
+
#setToggle(value) {
|
|
20
|
+
this._toggle.checked = value;
|
|
21
|
+
this._profilingStatus = value;
|
|
22
|
+
}
|
|
18
23
|
firstUpdated() {
|
|
19
24
|
this._getProfilingStatus();
|
|
20
25
|
}
|
|
21
26
|
async _getProfilingStatus() {
|
|
22
27
|
const { data } = await tryExecuteAndNotify(this, ProfilingResource.getProfilingStatus());
|
|
23
|
-
if (data)
|
|
24
|
-
|
|
25
|
-
|
|
28
|
+
if (!data || !data.enabled)
|
|
29
|
+
return;
|
|
30
|
+
this._profilingStatus = data.enabled;
|
|
26
31
|
}
|
|
27
32
|
async _changeProfilingStatus() {
|
|
28
33
|
const { error } = await tryExecuteAndNotify(this, ProfilingResource.putProfilingStatus({ requestBody: { enabled: !this._profilingStatus } }));
|
|
29
|
-
if (
|
|
30
|
-
this
|
|
34
|
+
if (error) {
|
|
35
|
+
this.#setToggle(this._profilingStatus);
|
|
36
|
+
}
|
|
37
|
+
else {
|
|
38
|
+
this.#setToggle(!this._profilingStatus);
|
|
31
39
|
}
|
|
32
40
|
}
|
|
33
41
|
renderProfilingStatus() {
|
|
34
42
|
return this._isDebugMode
|
|
35
43
|
? html `
|
|
36
|
-
|
|
37
|
-
Umbraco is running in debug mode. This means you can use the built-in performance profiler to assess
|
|
38
|
-
performance when rendering pages.
|
|
39
|
-
</p>
|
|
40
|
-
<p>
|
|
41
|
-
If you want to activate the profiler for a specific page rendering, simply add
|
|
42
|
-
<strong>umbDebug=true</strong> to the querystring when requesting the page.
|
|
43
|
-
</p>
|
|
44
|
-
|
|
45
|
-
<p>
|
|
46
|
-
If you want the profiler to be activated by default for all page renderings, you can use the toggle below.
|
|
47
|
-
It will set a cookie in your browser, which then activates the profiler automatically. In other words, the
|
|
48
|
-
profiler will only be active by default in your browser - not everyone else's.
|
|
49
|
-
</p>
|
|
44
|
+
${unsafeHTML(this.localize.term('profiling_performanceProfilingDescription'))}
|
|
50
45
|
|
|
51
46
|
<uui-toggle
|
|
47
|
+
id="toggle"
|
|
52
48
|
label="Activate the profiler by default"
|
|
53
49
|
label-position="left"
|
|
54
|
-
|
|
50
|
+
?checked="${this._profilingStatus}"
|
|
55
51
|
@change="${this._changeProfilingStatus}"></uui-toggle>
|
|
56
52
|
|
|
57
|
-
<h4
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
<strong>Umbraco:CMS:Hosting:Debug</strong> to <strong>false</strong> in appsettings.json,
|
|
61
|
-
appsettings.{Environment}.json or via an environment variable.
|
|
62
|
-
</p>
|
|
53
|
+
<h4>${this.localize.term('profiling_reminder')}</h4>
|
|
54
|
+
|
|
55
|
+
${unsafeHTML(this.localize.term('profiling_reminderDescription'))}
|
|
63
56
|
`
|
|
64
|
-
: html `
|
|
65
|
-
<p>
|
|
66
|
-
Umbraco is not running in debug mode, so you can't use the built-in profiler. This is how it should be for a
|
|
67
|
-
production site.
|
|
68
|
-
</p>
|
|
69
|
-
<p>
|
|
70
|
-
Debug mode is turned on by setting <strong>Umbraco:CMS:Hosting:Debug</strong> to <strong>true</strong> in
|
|
71
|
-
appsettings.json, appsettings.{Environment}.json or via an environment variable.
|
|
72
|
-
</p>
|
|
73
|
-
`;
|
|
57
|
+
: html ` ${unsafeHTML(this.localize.term('profiling_profilerEnabledDescription'))} `;
|
|
74
58
|
}
|
|
75
59
|
render() {
|
|
76
60
|
return html `
|
|
77
|
-
<uui-box>
|
|
78
|
-
<h1>Performance Profiling</h1>
|
|
61
|
+
<uui-box headline=${this.localize.term('profiling_performanceProfiling')}>
|
|
79
62
|
${typeof this._profilingStatus === 'undefined' ? html `<uui-loader></uui-loader>` : this.renderProfilingStatus()}
|
|
80
63
|
</uui-box>
|
|
81
64
|
`;
|
|
@@ -108,6 +91,9 @@ __decorate([
|
|
|
108
91
|
__decorate([
|
|
109
92
|
state()
|
|
110
93
|
], UmbDashboardPerformanceProfilingElement.prototype, "_isDebugMode", void 0);
|
|
94
|
+
__decorate([
|
|
95
|
+
query('#toggle')
|
|
96
|
+
], UmbDashboardPerformanceProfilingElement.prototype, "_toggle", void 0);
|
|
111
97
|
UmbDashboardPerformanceProfilingElement = __decorate([
|
|
112
98
|
customElement('umb-dashboard-performance-profiling')
|
|
113
99
|
], UmbDashboardPerformanceProfilingElement);
|
|
@@ -4,7 +4,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
4
4
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
5
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
6
|
};
|
|
7
|
-
import { UmbTextStyles } from
|
|
7
|
+
import { UmbTextStyles } from '../../../../../../shared/style/index.js';
|
|
8
8
|
import { css, html, customElement, state } from '../../../../../../external/lit/index.js';
|
|
9
9
|
import { UmbLitElement } from '../../../../../../shared/lit-element/index.js';
|
|
10
10
|
export let UmbWorkspaceViewRelationTypeRelationElement = class UmbWorkspaceViewRelationTypeRelationElement extends UmbLitElement {
|
|
@@ -83,65 +83,65 @@ UmbWorkspaceViewRelationTypeRelationElement = __decorate([
|
|
|
83
83
|
], UmbWorkspaceViewRelationTypeRelationElement);
|
|
84
84
|
const MockData = [
|
|
85
85
|
{
|
|
86
|
-
parentId: 1,
|
|
86
|
+
parentId: '1',
|
|
87
87
|
parentName: 'Parent 1',
|
|
88
|
-
childId: 2,
|
|
88
|
+
childId: '2',
|
|
89
89
|
childName: 'Child 1',
|
|
90
90
|
createDate: '2021-01-01',
|
|
91
91
|
comment: 'Comment 1',
|
|
92
92
|
},
|
|
93
93
|
{
|
|
94
|
-
parentId: 1,
|
|
94
|
+
parentId: '1',
|
|
95
95
|
parentName: 'Parent 1',
|
|
96
|
-
childId: 3,
|
|
96
|
+
childId: '3',
|
|
97
97
|
childName: 'Child 2',
|
|
98
98
|
createDate: '2021-01-01',
|
|
99
99
|
comment: 'Comment 2',
|
|
100
100
|
},
|
|
101
101
|
{
|
|
102
|
-
parentId: 1,
|
|
102
|
+
parentId: '1',
|
|
103
103
|
parentName: 'Parent 1',
|
|
104
|
-
childId: 4,
|
|
104
|
+
childId: '4',
|
|
105
105
|
childName: 'Child 3',
|
|
106
106
|
createDate: '2021-01-01',
|
|
107
107
|
comment: 'Comment 3',
|
|
108
108
|
},
|
|
109
109
|
{
|
|
110
|
-
parentId: 1,
|
|
110
|
+
parentId: '1',
|
|
111
111
|
parentName: 'Parent 1',
|
|
112
|
-
childId: 5,
|
|
112
|
+
childId: '5',
|
|
113
113
|
childName: 'Child 4',
|
|
114
114
|
createDate: '2021-01-01',
|
|
115
115
|
comment: 'Comment 4',
|
|
116
116
|
},
|
|
117
117
|
{
|
|
118
|
-
parentId: 1,
|
|
118
|
+
parentId: '1',
|
|
119
119
|
parentName: 'Parent 1',
|
|
120
|
-
childId: 6,
|
|
120
|
+
childId: '6',
|
|
121
121
|
childName: 'Child 5',
|
|
122
122
|
createDate: '2021-01-01',
|
|
123
123
|
comment: 'Comment 5',
|
|
124
124
|
},
|
|
125
125
|
{
|
|
126
|
-
parentId: 1,
|
|
126
|
+
parentId: '1',
|
|
127
127
|
parentName: 'Parent 1',
|
|
128
|
-
childId: 7,
|
|
128
|
+
childId: '7',
|
|
129
129
|
childName: 'Child 6',
|
|
130
130
|
createDate: '2021-01-01',
|
|
131
131
|
comment: 'Comment 6',
|
|
132
132
|
},
|
|
133
133
|
{
|
|
134
|
-
parentId: 1,
|
|
134
|
+
parentId: '1',
|
|
135
135
|
parentName: 'Parent 1',
|
|
136
|
-
childId: 8,
|
|
136
|
+
childId: '8',
|
|
137
137
|
childName: 'Child 7',
|
|
138
138
|
createDate: '2021-01-01',
|
|
139
139
|
comment: 'Comment 7',
|
|
140
140
|
},
|
|
141
141
|
{
|
|
142
|
-
parentId: 1,
|
|
142
|
+
parentId: '1',
|
|
143
143
|
parentName: 'Parent 1',
|
|
144
|
-
childId: 9,
|
|
144
|
+
childId: '9',
|
|
145
145
|
childName: 'Child 8',
|
|
146
146
|
createDate: '2021-01-01',
|
|
147
147
|
comment: 'Comment 8',
|
|
@@ -2,6 +2,7 @@ import { manifests as menuManifests } from './menu.manifests.js';
|
|
|
2
2
|
import { manifests as templateManifests } from './templates/manifests.js';
|
|
3
3
|
import { manifests as stylesheetManifests } from './stylesheets/manifests.js';
|
|
4
4
|
import { manifests as partialManifests } from './partial-views/manifests.js';
|
|
5
|
+
import { manifests as scriptsManifest } from './scripts/manifests.js';
|
|
5
6
|
import { manifests as modalManifests } from './modals/manifests.js';
|
|
6
7
|
export const manifests = [
|
|
7
8
|
...menuManifests,
|
|
@@ -9,4 +10,5 @@ export const manifests = [
|
|
|
9
10
|
...stylesheetManifests,
|
|
10
11
|
...partialManifests,
|
|
11
12
|
...modalManifests,
|
|
13
|
+
...scriptsManifest,
|
|
12
14
|
];
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { ScriptResponseModel } from '../../../external/backend-api/index.js';
|
|
2
|
+
export type ScriptDetails = ScriptResponseModel;
|
|
3
|
+
export declare const SCRIPTS_ENTITY_TYPE = "script";
|
|
4
|
+
export declare const SCRIPTS_ROOT_ENTITY_TYPE = "script-root";
|
|
5
|
+
export declare const SCRIPTS_FOLDER_ENTITY_TYPE = "script-folder";
|
|
6
|
+
export declare const SCRIPTS_FOLDER_EMPTY_ENTITY_TYPE = "script-folder-empty";
|
|
7
|
+
export declare const SCRIPTS_STORE_ALIAS = "Umb.Store.Scripts";
|
|
8
|
+
export declare const UMB_SCRIPTS_STORE_CONTEXT_TOKEN_ALIAS = "Umb.Store.Scripts.Context.Token";
|
|
9
|
+
export declare const SCRIPTS_REPOSITORY_ALIAS = "Umb.Repository.Scripts";
|
|
10
|
+
export declare const SCRIPTS_MENU_ITEM_ALIAS = "Umb.MenuItem.Scripts";
|
|
11
|
+
export declare const SCRIPTS_TREE_ALIAS = "Umb.Tree.Scripts";
|
|
12
|
+
export declare const SCRIPTS_TREE_ITEM_ALIAS = "Umb.TreeItem.Scripts";
|
|
13
|
+
export declare const SCRIPTS_TREE_STORE_ALIAS = "Umb.Store.Scripts.Tree";
|
|
14
|
+
export declare const UMB_SCRIPTS_TREE_STORE_CONTEXT_TOKEN_ALIAS = "Umb.Store.Scripts.Tree.Context.Token";
|
|
15
|
+
export declare const SCRIPTS_ENTITY_ACTION_DELETE_ALIAS = "Umb.EntityAction.Scripts.Delete";
|
|
16
|
+
export declare const SCRIPTS_ENTITY_ACTION_CREATE_NEW_ALIAS = "Umb.EntityAction.ScriptsFolder.Create.New";
|
|
17
|
+
export declare const SCRIPTS_ENTITY_ACTION_DELETE_FOLDER_ALIAS = "Umb.EntityAction.ScriptsFolder.DeleteFolder";
|
|
18
|
+
export declare const SCRIPTS_ENTITY_ACTION_CREATE_FOLDER_NEW_ALIAS = "Umb.EntityAction.ScriptsFolder.CreateFolder";
|
|
19
|
+
export declare const SCRIPTS_WORKSPACE_ALIAS = "Umb.Workspace.Scripts";
|
|
20
|
+
export declare const SCRIPTS_WORKSPACE_ACTION_SAVE_ALIAS = "Umb.WorkspaceAction.Scripts.Save";
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
//ENTITY TYPES
|
|
2
|
+
export const SCRIPTS_ENTITY_TYPE = 'script';
|
|
3
|
+
export const SCRIPTS_ROOT_ENTITY_TYPE = 'script-root';
|
|
4
|
+
export const SCRIPTS_FOLDER_ENTITY_TYPE = 'script-folder';
|
|
5
|
+
export const SCRIPTS_FOLDER_EMPTY_ENTITY_TYPE = 'script-folder-empty';
|
|
6
|
+
export const SCRIPTS_STORE_ALIAS = 'Umb.Store.Scripts';
|
|
7
|
+
export const UMB_SCRIPTS_STORE_CONTEXT_TOKEN_ALIAS = 'Umb.Store.Scripts.Context.Token';
|
|
8
|
+
export const SCRIPTS_REPOSITORY_ALIAS = 'Umb.Repository.Scripts';
|
|
9
|
+
export const SCRIPTS_MENU_ITEM_ALIAS = 'Umb.MenuItem.Scripts';
|
|
10
|
+
//TREE
|
|
11
|
+
export const SCRIPTS_TREE_ALIAS = 'Umb.Tree.Scripts';
|
|
12
|
+
export const SCRIPTS_TREE_ITEM_ALIAS = 'Umb.TreeItem.Scripts';
|
|
13
|
+
export const SCRIPTS_TREE_STORE_ALIAS = 'Umb.Store.Scripts.Tree';
|
|
14
|
+
export const UMB_SCRIPTS_TREE_STORE_CONTEXT_TOKEN_ALIAS = 'Umb.Store.Scripts.Tree.Context.Token';
|
|
15
|
+
//ENTITY (tree) ACTIONS
|
|
16
|
+
export const SCRIPTS_ENTITY_ACTION_DELETE_ALIAS = 'Umb.EntityAction.Scripts.Delete';
|
|
17
|
+
export const SCRIPTS_ENTITY_ACTION_CREATE_NEW_ALIAS = 'Umb.EntityAction.ScriptsFolder.Create.New';
|
|
18
|
+
export const SCRIPTS_ENTITY_ACTION_DELETE_FOLDER_ALIAS = 'Umb.EntityAction.ScriptsFolder.DeleteFolder';
|
|
19
|
+
export const SCRIPTS_ENTITY_ACTION_CREATE_FOLDER_NEW_ALIAS = 'Umb.EntityAction.ScriptsFolder.CreateFolder';
|
|
20
|
+
//WORKSPACE
|
|
21
|
+
export const SCRIPTS_WORKSPACE_ALIAS = 'Umb.Workspace.Scripts';
|
|
22
|
+
export const SCRIPTS_WORKSPACE_ACTION_SAVE_ALIAS = 'Umb.WorkspaceAction.Scripts.Save';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { UmbEntityActionBase } from '../../../../core/entity-action/index.js';
|
|
2
|
+
import { UmbControllerHostElement } from '../../../../../libs/controller-api/index.js';
|
|
3
|
+
export declare class UmbCreateScriptAction<T extends {
|
|
4
|
+
copy(): Promise<void>;
|
|
5
|
+
}> extends UmbEntityActionBase<T> {
|
|
6
|
+
constructor(host: UmbControllerHostElement, repositoryAlias: string, unique: string);
|
|
7
|
+
execute(): Promise<void>;
|
|
8
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { UmbEntityActionBase } from '../../../../core/entity-action/index.js';
|
|
2
|
+
export class UmbCreateScriptAction extends UmbEntityActionBase {
|
|
3
|
+
constructor(host, repositoryAlias, unique) {
|
|
4
|
+
super(host, repositoryAlias, unique);
|
|
5
|
+
}
|
|
6
|
+
async execute() {
|
|
7
|
+
history.pushState(null, '', `section/settings/workspace/script/create/${this.unique ?? 'null'}`);
|
|
8
|
+
}
|
|
9
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { SCRIPTS_REPOSITORY_ALIAS, SCRIPTS_ENTITY_TYPE, SCRIPTS_FOLDER_ENTITY_TYPE, SCRIPTS_ROOT_ENTITY_TYPE, SCRIPTS_FOLDER_EMPTY_ENTITY_TYPE, SCRIPTS_ENTITY_ACTION_DELETE_ALIAS, SCRIPTS_ENTITY_ACTION_CREATE_NEW_ALIAS, SCRIPTS_ENTITY_ACTION_DELETE_FOLDER_ALIAS, SCRIPTS_ENTITY_ACTION_CREATE_FOLDER_NEW_ALIAS, } from '../config.js';
|
|
2
|
+
import { UmbCreateScriptAction } from './create/create-empty.action.js';
|
|
3
|
+
import { UmbCreateFolderEntityAction, UmbDeleteEntityAction, UmbDeleteFolderEntityAction, } from '../../../core/entity-action/index.js';
|
|
4
|
+
const scriptsViewActions = [
|
|
5
|
+
{
|
|
6
|
+
type: 'entityAction',
|
|
7
|
+
alias: SCRIPTS_ENTITY_ACTION_DELETE_ALIAS,
|
|
8
|
+
name: 'Delete Scripts Entity Action',
|
|
9
|
+
meta: {
|
|
10
|
+
icon: 'umb:trash',
|
|
11
|
+
label: 'Delete',
|
|
12
|
+
api: UmbDeleteEntityAction,
|
|
13
|
+
repositoryAlias: SCRIPTS_REPOSITORY_ALIAS,
|
|
14
|
+
entityTypes: [SCRIPTS_ENTITY_TYPE],
|
|
15
|
+
},
|
|
16
|
+
},
|
|
17
|
+
];
|
|
18
|
+
const scriptsFolderActions = [
|
|
19
|
+
{
|
|
20
|
+
type: 'entityAction',
|
|
21
|
+
alias: SCRIPTS_ENTITY_ACTION_CREATE_NEW_ALIAS,
|
|
22
|
+
name: 'Create Scripts Entity Under Directory Action',
|
|
23
|
+
meta: {
|
|
24
|
+
icon: 'umb:article',
|
|
25
|
+
label: 'New empty script',
|
|
26
|
+
api: UmbCreateScriptAction,
|
|
27
|
+
repositoryAlias: SCRIPTS_REPOSITORY_ALIAS,
|
|
28
|
+
entityTypes: [SCRIPTS_FOLDER_ENTITY_TYPE, SCRIPTS_FOLDER_EMPTY_ENTITY_TYPE, SCRIPTS_ROOT_ENTITY_TYPE],
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
type: 'entityAction',
|
|
33
|
+
alias: SCRIPTS_ENTITY_ACTION_DELETE_FOLDER_ALIAS,
|
|
34
|
+
name: 'Remove empty folder',
|
|
35
|
+
meta: {
|
|
36
|
+
icon: 'umb:trash',
|
|
37
|
+
label: 'Remove folder',
|
|
38
|
+
api: UmbDeleteFolderEntityAction,
|
|
39
|
+
repositoryAlias: SCRIPTS_REPOSITORY_ALIAS,
|
|
40
|
+
entityTypes: [SCRIPTS_FOLDER_EMPTY_ENTITY_TYPE],
|
|
41
|
+
},
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
type: 'entityAction',
|
|
45
|
+
alias: SCRIPTS_ENTITY_ACTION_CREATE_FOLDER_NEW_ALIAS,
|
|
46
|
+
name: 'Create empty folder',
|
|
47
|
+
meta: {
|
|
48
|
+
icon: 'umb:add',
|
|
49
|
+
label: 'Create folder',
|
|
50
|
+
api: UmbCreateFolderEntityAction,
|
|
51
|
+
repositoryAlias: SCRIPTS_REPOSITORY_ALIAS,
|
|
52
|
+
entityTypes: [SCRIPTS_FOLDER_EMPTY_ENTITY_TYPE, SCRIPTS_FOLDER_ENTITY_TYPE, SCRIPTS_ROOT_ENTITY_TYPE],
|
|
53
|
+
},
|
|
54
|
+
},
|
|
55
|
+
];
|
|
56
|
+
export const manifests = [...scriptsViewActions, ...scriptsFolderActions];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const manifests: (import("../../core/index.js").ManifestEntityAction | import("../../core/index.js").ManifestMenuItemTreeKind | import("../../core/index.js").ManifestRepository | import("../../core/index.js").ManifestStore | import("../../core/index.js").ManifestTree | import("../../core/index.js").ManifestTreeItem | import("../../core/index.js").ManifestTreeStore | import("../../core/index.js").ManifestWorkspace | import("../../core/index.js").ManifestWorkspaceAction)[];
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { manifests as repositoryManifests } from './repository/manifests.js';
|
|
2
|
+
import { manifests as menuItemManifests } from './menu-item/manifests.js';
|
|
3
|
+
import { manifests as treeManifests } from './tree/manifests.js';
|
|
4
|
+
import { manifests as entityActionsManifests } from './entity-actions/manifests.js';
|
|
5
|
+
import { manifests as workspaceManifests } from './workspace/manifests.js';
|
|
6
|
+
export const manifests = [
|
|
7
|
+
...repositoryManifests,
|
|
8
|
+
...menuItemManifests,
|
|
9
|
+
...treeManifests,
|
|
10
|
+
...entityActionsManifests,
|
|
11
|
+
...workspaceManifests,
|
|
12
|
+
];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const manifests: import("../../../core/extension-registry/index.js").ManifestMenuItemTreeKind[];
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { SCRIPTS_ENTITY_TYPE, SCRIPTS_MENU_ITEM_ALIAS, SCRIPTS_TREE_ALIAS } from '../config.js';
|
|
2
|
+
const menuItem = {
|
|
3
|
+
type: 'menuItem',
|
|
4
|
+
kind: 'tree',
|
|
5
|
+
alias: SCRIPTS_MENU_ITEM_ALIAS,
|
|
6
|
+
name: 'Scripts Menu Item',
|
|
7
|
+
weight: 10,
|
|
8
|
+
meta: {
|
|
9
|
+
label: 'Scripts',
|
|
10
|
+
icon: 'umb:folder',
|
|
11
|
+
entityType: SCRIPTS_ENTITY_TYPE,
|
|
12
|
+
treeAlias: SCRIPTS_TREE_ALIAS,
|
|
13
|
+
menus: ['Umb.Menu.Templating'],
|
|
14
|
+
},
|
|
15
|
+
};
|
|
16
|
+
export const manifests = [menuItem];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './scripts.repository.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './scripts.repository.js';
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { SCRIPTS_REPOSITORY_ALIAS, SCRIPTS_STORE_ALIAS, SCRIPTS_TREE_STORE_ALIAS } from '../config.js';
|
|
2
|
+
import { UmbScriptsRepository } from './scripts.repository.js';
|
|
3
|
+
import { UmbScriptsStore } from './scripts.store.js';
|
|
4
|
+
import { UmbScriptsTreeStore } from './scripts.tree.store.js';
|
|
5
|
+
const repository = {
|
|
6
|
+
type: 'repository',
|
|
7
|
+
alias: SCRIPTS_REPOSITORY_ALIAS,
|
|
8
|
+
name: 'Scripts Repository',
|
|
9
|
+
class: UmbScriptsRepository,
|
|
10
|
+
};
|
|
11
|
+
const store = {
|
|
12
|
+
type: 'store',
|
|
13
|
+
alias: SCRIPTS_STORE_ALIAS,
|
|
14
|
+
name: 'Scripts Store',
|
|
15
|
+
class: UmbScriptsStore,
|
|
16
|
+
};
|
|
17
|
+
const treeStore = {
|
|
18
|
+
type: 'treeStore',
|
|
19
|
+
alias: SCRIPTS_TREE_STORE_ALIAS,
|
|
20
|
+
name: 'Scripts Tree Store',
|
|
21
|
+
class: UmbScriptsTreeStore,
|
|
22
|
+
};
|
|
23
|
+
export const manifests = [repository, store, treeStore];
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { ScriptsGetFolderResponse } from './sources/scripts.folder.server.data.js';
|
|
2
|
+
import { DataSourceResponse, UmbDataSourceErrorResponse, UmbDetailRepository, UmbFolderRepository, UmbTreeRepository } from '../../../../shared/repository/index.js';
|
|
3
|
+
import { CreateFolderRequestModel, CreateScriptRequestModel, FileItemResponseModelBaseModel, FileSystemTreeItemPresentationModel, FolderModelBaseModel, FolderResponseModel, ProblemDetails, ScriptResponseModel, TextFileResponseModelBaseModel, UpdateScriptRequestModel } from '../../../../external/backend-api/index.js';
|
|
4
|
+
import { UmbControllerHostElement } from '../../../../libs/controller-api/index.js';
|
|
5
|
+
import { Observable } from '../../../../external/rxjs/index.js';
|
|
6
|
+
export declare class UmbScriptsRepository implements UmbTreeRepository<FileSystemTreeItemPresentationModel>, UmbDetailRepository<CreateScriptRequestModel, string, UpdateScriptRequestModel, ScriptResponseModel, string>, UmbFolderRepository {
|
|
7
|
+
#private;
|
|
8
|
+
constructor(host: UmbControllerHostElement);
|
|
9
|
+
createFolderScaffold(parentId: string | null): Promise<{
|
|
10
|
+
data?: FolderResponseModel | undefined;
|
|
11
|
+
error?: ProblemDetails | undefined;
|
|
12
|
+
}>;
|
|
13
|
+
createFolder(requestBody: CreateFolderRequestModel): Promise<{
|
|
14
|
+
data?: string | undefined;
|
|
15
|
+
error?: ProblemDetails | undefined;
|
|
16
|
+
}>;
|
|
17
|
+
requestFolder(unique: string): Promise<{
|
|
18
|
+
data?: ScriptsGetFolderResponse | 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<{
|
|
26
|
+
error?: ProblemDetails | undefined;
|
|
27
|
+
}>;
|
|
28
|
+
requestTreeRoot(): Promise<{
|
|
29
|
+
data: {
|
|
30
|
+
id: null;
|
|
31
|
+
path: null;
|
|
32
|
+
type: string;
|
|
33
|
+
name: string;
|
|
34
|
+
icon: string;
|
|
35
|
+
hasChildren: boolean;
|
|
36
|
+
};
|
|
37
|
+
}>;
|
|
38
|
+
requestRootTreeItems(): Promise<{
|
|
39
|
+
data: import("../../../../external/backend-api/index.js").PagedFileSystemTreeItemPresentationModel | undefined;
|
|
40
|
+
error: import("../../../../external/backend-api/index.js").ApiError | import("../../../../external/backend-api/index.js").CancelError | undefined;
|
|
41
|
+
asObservable: () => Observable<FileSystemTreeItemPresentationModel[]>;
|
|
42
|
+
}>;
|
|
43
|
+
requestTreeItemsOf(path: string | null): Promise<{
|
|
44
|
+
data: any;
|
|
45
|
+
error: any;
|
|
46
|
+
asObservable: () => Observable<FileSystemTreeItemPresentationModel[]>;
|
|
47
|
+
}>;
|
|
48
|
+
requestTreeItems(keys: Array<string>): Promise<{
|
|
49
|
+
data: undefined;
|
|
50
|
+
error: ProblemDetails;
|
|
51
|
+
asObservable?: undefined;
|
|
52
|
+
} | {
|
|
53
|
+
data: any;
|
|
54
|
+
error: any;
|
|
55
|
+
asObservable: () => Observable<FileSystemTreeItemPresentationModel[]>;
|
|
56
|
+
}>;
|
|
57
|
+
rootTreeItems(): Promise<Observable<FileSystemTreeItemPresentationModel[]>>;
|
|
58
|
+
treeItemsOf(parentPath: string | null): Promise<Observable<FileSystemTreeItemPresentationModel[]>>;
|
|
59
|
+
treeItems(paths: Array<string>): Promise<Observable<FileSystemTreeItemPresentationModel[]>>;
|
|
60
|
+
requestByKey(path: string): Promise<{
|
|
61
|
+
data: TextFileResponseModelBaseModel | undefined;
|
|
62
|
+
error: import("../../../../external/backend-api/index.js").ApiError | import("../../../../external/backend-api/index.js").CancelError | undefined;
|
|
63
|
+
}>;
|
|
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: CreateScriptRequestModel): Promise<DataSourceResponse<any>>;
|
|
68
|
+
save(id: string, requestBody: UpdateScriptRequestModel): Promise<UmbDataSourceErrorResponse>;
|
|
69
|
+
delete(id: string): Promise<UmbDataSourceErrorResponse>;
|
|
70
|
+
requestItems(keys: Array<string>): Promise<DataSourceResponse<FileItemResponseModelBaseModel[]>>;
|
|
71
|
+
}
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
import { SCRIPTS_ROOT_ENTITY_TYPE } from '../config.js';
|
|
2
|
+
import { UmbScriptsTreeServerDataSource } from './sources/scripts.tree.server.data.js';
|
|
3
|
+
import { UmbScriptsServerDataSource } from './sources/scripts.detail.server.data.js';
|
|
4
|
+
import { UmbScriptsFolderServerDataSource } from './sources/scripts.folder.server.data.js';
|
|
5
|
+
import { UMB_SCRIPTS_TREE_STORE_CONTEXT_TOKEN } from './scripts.tree.store.js';
|
|
6
|
+
import { UmbContextConsumerController } from '../../../../libs/context-api/index.js';
|
|
7
|
+
export class UmbScriptsRepository {
|
|
8
|
+
#init;
|
|
9
|
+
#host;
|
|
10
|
+
#treeDataSource;
|
|
11
|
+
#detailDataSource;
|
|
12
|
+
#folderDataSource;
|
|
13
|
+
#treeStore;
|
|
14
|
+
constructor(host) {
|
|
15
|
+
this.#host = host;
|
|
16
|
+
this.#treeDataSource = new UmbScriptsTreeServerDataSource(this.#host);
|
|
17
|
+
this.#detailDataSource = new UmbScriptsServerDataSource(this.#host);
|
|
18
|
+
this.#folderDataSource = new UmbScriptsFolderServerDataSource(this.#host);
|
|
19
|
+
this.#init = Promise.all([
|
|
20
|
+
new UmbContextConsumerController(this.#host, UMB_SCRIPTS_TREE_STORE_CONTEXT_TOKEN, (instance) => {
|
|
21
|
+
this.#treeStore = instance;
|
|
22
|
+
}),
|
|
23
|
+
]);
|
|
24
|
+
}
|
|
25
|
+
//#region FOLDER
|
|
26
|
+
createFolderScaffold(parentId) {
|
|
27
|
+
const data = {
|
|
28
|
+
name: '',
|
|
29
|
+
parentId,
|
|
30
|
+
};
|
|
31
|
+
return Promise.resolve({ data, error: undefined });
|
|
32
|
+
}
|
|
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) {
|
|
49
|
+
throw new Error('Method not implemented.');
|
|
50
|
+
}
|
|
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
|
|
61
|
+
async requestTreeRoot() {
|
|
62
|
+
await this.#init;
|
|
63
|
+
const data = {
|
|
64
|
+
id: null,
|
|
65
|
+
path: null,
|
|
66
|
+
type: SCRIPTS_ROOT_ENTITY_TYPE,
|
|
67
|
+
name: 'Scripts',
|
|
68
|
+
icon: 'umb:folder',
|
|
69
|
+
hasChildren: true,
|
|
70
|
+
};
|
|
71
|
+
return { data };
|
|
72
|
+
}
|
|
73
|
+
async requestRootTreeItems() {
|
|
74
|
+
await this.#init;
|
|
75
|
+
const { data, error } = await this.#treeDataSource.getRootItems();
|
|
76
|
+
if (data) {
|
|
77
|
+
this.#treeStore?.appendItems(data.items);
|
|
78
|
+
}
|
|
79
|
+
return { data, error, asObservable: () => this.#treeStore.rootItems };
|
|
80
|
+
}
|
|
81
|
+
async requestTreeItemsOf(path) {
|
|
82
|
+
if (path === null || path === '/' || path === '') {
|
|
83
|
+
return this.requestRootTreeItems();
|
|
84
|
+
}
|
|
85
|
+
await this.#init;
|
|
86
|
+
const response = await this.#treeDataSource.getChildrenOf({ path, skip: 0, take: 100 });
|
|
87
|
+
const { data, error } = response;
|
|
88
|
+
if (data) {
|
|
89
|
+
this.#treeStore.appendItems(data.items);
|
|
90
|
+
}
|
|
91
|
+
return { data, error, asObservable: () => this.#treeStore.childrenOf(path) };
|
|
92
|
+
}
|
|
93
|
+
async requestTreeItems(keys) {
|
|
94
|
+
await this.#init;
|
|
95
|
+
if (!keys) {
|
|
96
|
+
const error = { title: 'Keys are missing' };
|
|
97
|
+
return { data: undefined, error };
|
|
98
|
+
}
|
|
99
|
+
const { data, error } = await this.#treeDataSource.getItem(keys);
|
|
100
|
+
return { data, error, asObservable: () => this.#treeStore.items(keys) };
|
|
101
|
+
}
|
|
102
|
+
async rootTreeItems() {
|
|
103
|
+
await this.#init;
|
|
104
|
+
return this.#treeStore.rootItems;
|
|
105
|
+
}
|
|
106
|
+
async treeItemsOf(parentPath) {
|
|
107
|
+
if (!parentPath)
|
|
108
|
+
throw new Error('Parent Path is missing');
|
|
109
|
+
await this.#init;
|
|
110
|
+
return this.#treeStore.childrenOf(parentPath);
|
|
111
|
+
}
|
|
112
|
+
async treeItems(paths) {
|
|
113
|
+
if (!paths)
|
|
114
|
+
throw new Error('Paths are missing');
|
|
115
|
+
await this.#init;
|
|
116
|
+
return this.#treeStore.items(paths);
|
|
117
|
+
}
|
|
118
|
+
//#endregion
|
|
119
|
+
//#region DETAILS
|
|
120
|
+
async requestByKey(path) {
|
|
121
|
+
if (!path)
|
|
122
|
+
throw new Error('Path is missing');
|
|
123
|
+
await this.#init;
|
|
124
|
+
const { data, error } = await this.#detailDataSource.get(path);
|
|
125
|
+
return { data, error };
|
|
126
|
+
}
|
|
127
|
+
requestById(id) {
|
|
128
|
+
throw new Error('Method not implemented.');
|
|
129
|
+
}
|
|
130
|
+
byId(id) {
|
|
131
|
+
throw new Error('Method not implemented.');
|
|
132
|
+
}
|
|
133
|
+
createScaffold(parentId, preset) {
|
|
134
|
+
return this.#detailDataSource.createScaffold(parentId, preset);
|
|
135
|
+
}
|
|
136
|
+
async create(data) {
|
|
137
|
+
const promise = this.#detailDataSource.insert(data);
|
|
138
|
+
await promise;
|
|
139
|
+
this.requestTreeItemsOf(data.parentPath ? data.parentPath : null);
|
|
140
|
+
return promise;
|
|
141
|
+
}
|
|
142
|
+
save(id, requestBody) {
|
|
143
|
+
return this.#detailDataSource.update(id, requestBody);
|
|
144
|
+
}
|
|
145
|
+
async delete(id) {
|
|
146
|
+
const promise = this.#detailDataSource.delete(id);
|
|
147
|
+
const parentPath = id.substring(0, id.lastIndexOf('/'));
|
|
148
|
+
this.requestTreeItemsOf(parentPath ? parentPath : null);
|
|
149
|
+
return promise;
|
|
150
|
+
}
|
|
151
|
+
requestItems(keys) {
|
|
152
|
+
return this.#detailDataSource.getItems(keys);
|
|
153
|
+
}
|
|
154
|
+
}
|