@umbraco-cms/backoffice 14.0.0--preview004-9f49270d → 14.0.0--preview004-e20cec44
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 +0 -12
- package/dist-cms/mocks/data/stylesheet.data.js +3 -2
- package/dist-cms/mocks/handlers/stylesheet.handlers.js +3 -3
- package/dist-cms/packages/core/data-type/tree/data-type-tree.repository.d.ts +2 -2
- package/dist-cms/packages/core/data-type/tree/data-type-tree.repository.js +2 -2
- package/dist-cms/packages/core/extension-registry/models/menu-item.model.d.ts +1 -0
- package/dist-cms/packages/core/modal/token/document-picker-modal.token.js +1 -1
- package/dist-cms/packages/core/section/section-main-views/section-main-views.element.js +3 -3
- package/dist-cms/packages/core/store/file-system-item.store.d.ts +20 -0
- package/dist-cms/packages/core/store/file-system-item.store.js +22 -0
- package/dist-cms/packages/core/store/index.d.ts +1 -0
- package/dist-cms/packages/core/store/index.js +1 -0
- package/dist-cms/packages/core/tree/file-system-tree.store.js +4 -1
- package/dist-cms/packages/core/tree/index.d.ts +1 -1
- package/dist-cms/packages/core/tree/index.js +1 -1
- package/dist-cms/packages/core/tree/tree-menu-item/tree-menu-item.element.js +7 -1
- package/dist-cms/packages/core/tree/{entity-tree.repository.d.ts → tree-repository-base.d.ts} +10 -10
- package/dist-cms/packages/core/tree/{entity-tree.repository.js → tree-repository-base.js} +17 -17
- package/dist-cms/packages/core/tree/tree-repository.interface.d.ts +4 -4
- package/dist-cms/packages/dictionary/dictionary/entities.d.ts +2 -0
- package/dist-cms/packages/dictionary/dictionary/entities.js +2 -0
- package/dist-cms/packages/dictionary/dictionary/entity-actions/create/create.action.d.ts +0 -1
- package/dist-cms/packages/dictionary/dictionary/entity-actions/create/create.action.js +2 -31
- package/dist-cms/packages/dictionary/dictionary/entity-actions/manifests.js +14 -15
- 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/manifests.d.ts +1 -1
- package/dist-cms/packages/dictionary/dictionary/menu-item/manifests.d.ts +1 -2
- package/dist-cms/packages/dictionary/dictionary/menu-item/manifests.js +6 -2
- package/dist-cms/packages/dictionary/dictionary/repository/dictionary.repository.d.ts +3 -30
- package/dist-cms/packages/dictionary/dictionary/repository/dictionary.repository.js +2 -51
- package/dist-cms/packages/dictionary/dictionary/repository/index.d.ts +0 -2
- package/dist-cms/packages/dictionary/dictionary/repository/index.js +0 -2
- package/dist-cms/packages/dictionary/dictionary/repository/manifests.d.ts +4 -5
- package/dist-cms/packages/dictionary/dictionary/repository/manifests.js +5 -13
- package/dist-cms/packages/dictionary/dictionary/tree/dictionary-tree.repository.d.ts +16 -0
- package/dist-cms/packages/dictionary/dictionary/tree/dictionary-tree.repository.js +19 -0
- package/dist-cms/packages/dictionary/dictionary/tree/dictionary-tree.server.data-source.d.ts +38 -0
- package/dist-cms/packages/dictionary/dictionary/{repository/sources/dictionary.tree.server.data.js → tree/dictionary-tree.server.data-source.js} +7 -8
- package/dist-cms/packages/dictionary/dictionary/{repository/dictionary.tree.store.d.ts → tree/dictionary-tree.store.d.ts} +4 -4
- package/dist-cms/packages/dictionary/dictionary/{repository/dictionary.tree.store.js → tree/dictionary-tree.store.js} +4 -4
- package/dist-cms/packages/dictionary/dictionary/tree/index.d.ts +5 -0
- package/dist-cms/packages/dictionary/dictionary/tree/index.js +4 -0
- package/dist-cms/packages/dictionary/dictionary/tree/manifests.d.ts +5 -2
- package/dist-cms/packages/dictionary/dictionary/tree/manifests.js +24 -7
- package/dist-cms/packages/dictionary/dictionary/tree/types.d.ts +4 -0
- package/dist-cms/packages/dictionary/dictionary/tree/types.js +1 -0
- package/dist-cms/packages/dictionary/dictionary/workspace/dictionary-workspace.context.js +0 -2
- package/dist-cms/packages/dictionary/manifests.d.ts +1 -1
- package/dist-cms/packages/documents/document-types/tree/document-type-tree.repository.d.ts +2 -2
- package/dist-cms/packages/documents/document-types/tree/document-type-tree.repository.js +2 -2
- package/dist-cms/packages/documents/documents/menu-item/manifests.d.ts +1 -2
- package/dist-cms/packages/documents/documents/menu-item/manifests.js +3 -1
- package/dist-cms/packages/documents/documents/tree/manifests.d.ts +1 -1
- package/dist-cms/packages/documents/documents/tree/manifests.js +2 -2
- package/dist-cms/packages/media/manifests.d.ts +1 -1
- package/dist-cms/packages/media/media/manifests.d.ts +1 -1
- package/dist-cms/packages/media/media/menu-item/manifests.d.ts +1 -2
- package/dist-cms/packages/media/media/menu-item/manifests.js +3 -1
- package/dist-cms/packages/media/media/tree/manifests.js +2 -2
- package/dist-cms/packages/templating/stylesheets/entity-actions/create/create-rtf.action.js +4 -0
- package/dist-cms/packages/templating/stylesheets/entity-actions/create/create.action.js +4 -0
- package/dist-cms/packages/templating/stylesheets/entity-actions/manifests.js +24 -11
- package/dist-cms/packages/templating/stylesheets/entity-type.d.ts +4 -0
- package/dist-cms/packages/templating/stylesheets/entity-type.js +4 -0
- package/dist-cms/packages/templating/stylesheets/index.d.ts +1 -0
- package/dist-cms/packages/templating/stylesheets/index.js +1 -0
- package/dist-cms/packages/templating/stylesheets/manifests.d.ts +1 -1
- package/dist-cms/packages/templating/stylesheets/menu-item/manifests.js +2 -2
- package/dist-cms/packages/templating/stylesheets/repository/index.d.ts +2 -0
- package/dist-cms/packages/templating/stylesheets/repository/index.js +2 -0
- package/dist-cms/packages/templating/stylesheets/repository/item/index.d.ts +3 -0
- package/dist-cms/packages/templating/stylesheets/repository/item/index.js +3 -0
- package/dist-cms/packages/templating/stylesheets/repository/item/manifests.d.ts +4 -0
- package/dist-cms/packages/templating/stylesheets/repository/item/manifests.js +17 -0
- package/dist-cms/packages/templating/stylesheets/repository/item/stylesheet-item.repository.d.ts +6 -0
- package/dist-cms/packages/templating/stylesheets/repository/item/stylesheet-item.repository.js +8 -0
- package/dist-cms/packages/templating/stylesheets/repository/item/stylesheet-item.server.data-source.d.ts +25 -0
- package/dist-cms/packages/templating/stylesheets/repository/item/stylesheet-item.server.data-source.js +32 -0
- package/dist-cms/packages/templating/stylesheets/repository/item/stylesheet-item.store.d.ts +19 -0
- package/dist-cms/packages/templating/stylesheets/repository/item/stylesheet-item.store.js +19 -0
- package/dist-cms/packages/templating/stylesheets/repository/manifests.d.ts +3 -2
- package/dist-cms/packages/templating/stylesheets/repository/manifests.js +4 -10
- package/dist-cms/packages/templating/stylesheets/repository/stylesheet.repository.d.ts +2 -29
- package/dist-cms/packages/templating/stylesheets/repository/stylesheet.repository.js +4 -71
- package/dist-cms/packages/templating/stylesheets/tree/index.d.ts +1 -0
- package/dist-cms/packages/templating/stylesheets/tree/index.js +1 -0
- package/dist-cms/packages/templating/stylesheets/tree/manifests.d.ts +5 -3
- package/dist-cms/packages/templating/stylesheets/tree/manifests.js +22 -6
- package/dist-cms/packages/templating/stylesheets/tree/stylesheet-tree.repository.d.ts +14 -0
- package/dist-cms/packages/templating/stylesheets/tree/stylesheet-tree.repository.js +18 -0
- package/dist-cms/packages/templating/stylesheets/{repository/sources/stylesheet.tree.server.data.d.ts → tree/stylesheet-tree.server.data-source.d.ts} +6 -6
- package/dist-cms/packages/templating/stylesheets/{repository/sources/stylesheet.tree.server.data.js → tree/stylesheet-tree.server.data-source.js} +2 -2
- package/dist-cms/packages/templating/stylesheets/workspace/stylesheet-workspace-editor.element.js +6 -1
- package/dist-cms/packages/templating/stylesheets/workspace/stylesheet-workspace.context.js +2 -2
- package/dist-cms/packages/templating/stylesheets/workspace/stylesheet-workspace.element.js +1 -0
- package/dist-cms/packages/user/current-user/current-user-header-app.element.js +6 -2
- package/dist-cms/tsconfig.build.tsbuildinfo +1 -1
- package/dist-cms/umbraco-package-schema.json +3 -0
- package/dist-cms/vscode-html-custom-data.json +0 -12
- package/package.json +1 -1
- package/dist-cms/packages/dictionary/dictionary/menu-item/dictionary-menu-item.element.d.ts +0 -10
- package/dist-cms/packages/dictionary/dictionary/menu-item/dictionary-menu-item.element.js +0 -17
- package/dist-cms/packages/dictionary/dictionary/repository/sources/dictionary.tree.server.data.d.ts +0 -37
- package/dist-cms/packages/documents/documents/menu-item/document-menu-item.element.d.ts +0 -10
- package/dist-cms/packages/documents/documents/menu-item/document-menu-item.element.js +0 -17
- package/dist-cms/packages/media/media/menu-item/media-menu-item.element.d.ts +0 -10
- package/dist-cms/packages/media/media/menu-item/media-menu-item.element.js +0 -17
- package/dist-cms/packages/templating/stylesheets/config.d.ts +0 -10
- package/dist-cms/packages/templating/stylesheets/config.js +0 -10
- /package/dist-cms/packages/templating/stylesheets/{repository/stylesheet.tree.store.d.ts → tree/stylesheet-tree.store.d.ts} +0 -0
- /package/dist-cms/packages/templating/stylesheets/{repository/stylesheet.tree.store.js → tree/stylesheet-tree.store.js} +0 -0
|
@@ -5464,10 +5464,6 @@
|
|
|
5464
5464
|
}
|
|
5465
5465
|
]
|
|
5466
5466
|
},
|
|
5467
|
-
{
|
|
5468
|
-
"name": "umb-dictionary-menu-item",
|
|
5469
|
-
"path": "./../src/packages/dictionary/dictionary/menu-item/dictionary-menu-item.element.ts"
|
|
5470
|
-
},
|
|
5471
5467
|
{
|
|
5472
5468
|
"name": "umb-dictionary-workspace-editor",
|
|
5473
5469
|
"path": "./../src/packages/dictionary/dictionary/workspace/dictionary-workspace-editor.element.ts",
|
|
@@ -6079,10 +6075,6 @@
|
|
|
6079
6075
|
}
|
|
6080
6076
|
]
|
|
6081
6077
|
},
|
|
6082
|
-
{
|
|
6083
|
-
"name": "umb-document-menu-item",
|
|
6084
|
-
"path": "./../src/packages/documents/documents/menu-item/document-menu-item.element.ts"
|
|
6085
|
-
},
|
|
6086
6078
|
{
|
|
6087
6079
|
"name": "umb-property-editor-ui-document-picker",
|
|
6088
6080
|
"path": "./../src/packages/documents/documents/property-editors/document-picker/property-editor-ui-document-picker.element.ts",
|
|
@@ -6965,10 +6957,6 @@
|
|
|
6965
6957
|
}
|
|
6966
6958
|
]
|
|
6967
6959
|
},
|
|
6968
|
-
{
|
|
6969
|
-
"name": "umb-media-menu-item",
|
|
6970
|
-
"path": "./../src/packages/media/media/menu-item/media-menu-item.element.ts"
|
|
6971
|
-
},
|
|
6972
6960
|
{
|
|
6973
6961
|
"name": "umb-media-workspace-editor",
|
|
6974
6962
|
"path": "./../src/packages/media/media/workspace/media-workspace-editor.element.ts",
|
|
@@ -70,7 +70,7 @@ h1 {
|
|
|
70
70
|
path: 'Folder 1/Stylesheet File 3.css',
|
|
71
71
|
name: 'Stylesheet File 3.css',
|
|
72
72
|
type: 'stylesheet',
|
|
73
|
-
hasChildren:
|
|
73
|
+
hasChildren: false,
|
|
74
74
|
isFolder: false,
|
|
75
75
|
content: `h1 {
|
|
76
76
|
color: pink;
|
|
@@ -189,9 +189,10 @@ ${rule.selector} {
|
|
|
189
189
|
return newItem;
|
|
190
190
|
}
|
|
191
191
|
insertStyleSheet(item) {
|
|
192
|
+
const parentPath = item.parentPath ? `${item.parentPath}/` : '';
|
|
192
193
|
const newItem = {
|
|
193
194
|
...item,
|
|
194
|
-
path: `${
|
|
195
|
+
path: `${parentPath}${item.name}`,
|
|
195
196
|
isFolder: false,
|
|
196
197
|
hasChildren: false,
|
|
197
198
|
type: 'stylesheet',
|
|
@@ -29,8 +29,8 @@ const detailHandlers = [
|
|
|
29
29
|
const response = umbStylesheetData.getStylesheet(path);
|
|
30
30
|
return res(ctx.status(200), ctx.json(response));
|
|
31
31
|
}),
|
|
32
|
-
rest.post(umbracoPath('/stylesheet'), (req, res, ctx) => {
|
|
33
|
-
const requestBody = req.json();
|
|
32
|
+
rest.post(umbracoPath('/stylesheet'), async (req, res, ctx) => {
|
|
33
|
+
const requestBody = (await req.json());
|
|
34
34
|
if (!requestBody)
|
|
35
35
|
return res(ctx.status(400, 'no body found'));
|
|
36
36
|
const response = umbStylesheetData.insertStyleSheet(requestBody);
|
|
@@ -44,7 +44,7 @@ const detailHandlers = [
|
|
|
44
44
|
return res(ctx.status(200), ctx.json(response));
|
|
45
45
|
}),
|
|
46
46
|
rest.put(umbracoPath('/stylesheet'), async (req, res, ctx) => {
|
|
47
|
-
const requestBody = await req.json();
|
|
47
|
+
const requestBody = (await req.json());
|
|
48
48
|
if (!requestBody)
|
|
49
49
|
return res(ctx.status(400, 'no body found'));
|
|
50
50
|
umbStylesheetData.updateData(requestBody);
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { UmbTreeRepositoryBase } from '../../tree/tree-repository-base.js';
|
|
2
2
|
import { UmbDataTypeTreeItemModel, UmbDataTypeTreeRootModel } from './types.js';
|
|
3
3
|
import { type UmbControllerHost } from '../../../../libs/controller-api/index.js';
|
|
4
4
|
import { UmbApi } from '../../../../libs/extension-api/index.js';
|
|
5
|
-
export declare class UmbDataTypeTreeRepository extends
|
|
5
|
+
export declare class UmbDataTypeTreeRepository extends UmbTreeRepositoryBase<UmbDataTypeTreeItemModel, UmbDataTypeTreeRootModel> implements UmbApi {
|
|
6
6
|
constructor(host: UmbControllerHost);
|
|
7
7
|
requestTreeRoot(): Promise<{
|
|
8
8
|
data: {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { UmbTreeRepositoryBase } from '../../tree/tree-repository-base.js';
|
|
2
2
|
import { DATA_TYPE_ROOT_ENTITY_TYPE } from '../entities.js';
|
|
3
3
|
import { UmbDataTypeTreeServerDataSource } from './data-type.tree.server.data.js';
|
|
4
4
|
import { UMB_DATA_TYPE_TREE_STORE_CONTEXT } from './data-type.tree.store.js';
|
|
5
|
-
export class UmbDataTypeTreeRepository extends
|
|
5
|
+
export class UmbDataTypeTreeRepository extends UmbTreeRepositoryBase {
|
|
6
6
|
constructor(host) {
|
|
7
7
|
super(host, UmbDataTypeTreeServerDataSource, UMB_DATA_TYPE_TREE_STORE_CONTEXT);
|
|
8
8
|
}
|
|
@@ -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, nothing, customElement, property, state } from '../../../../external/lit/index.js';
|
|
9
9
|
import { umbExtensionsRegistry, } from '../../extension-registry/index.js';
|
|
10
10
|
import { UmbExtensionsManifestController, createExtensionElement } from '../../../../libs/extension-api/index.js';
|
|
@@ -83,8 +83,8 @@ export let UmbSectionMainViewElement = class UmbSectionMainViewElement extends U
|
|
|
83
83
|
const dashboardPath = this.#constructDashboardPath(dashboard);
|
|
84
84
|
return html `
|
|
85
85
|
<uui-tab
|
|
86
|
-
.label="${dashboardName}"
|
|
87
86
|
href="${this._routerPath}/${dashboardPath}"
|
|
87
|
+
label="${dashboardName}"
|
|
88
88
|
?active="${this._activePath === dashboardPath}"></uui-tab>
|
|
89
89
|
`;
|
|
90
90
|
})}
|
|
@@ -101,8 +101,8 @@ export let UmbSectionMainViewElement = class UmbSectionMainViewElement extends U
|
|
|
101
101
|
const viewPath = this.#constructViewPath(view);
|
|
102
102
|
return html `
|
|
103
103
|
<uui-tab
|
|
104
|
-
.label="${viewName}"
|
|
105
104
|
href="${this._routerPath}/${viewPath}"
|
|
105
|
+
label="${viewName}"
|
|
106
106
|
?active="${this._activePath === viewPath}">
|
|
107
107
|
<uui-icon slot="icon" name=${view.meta.icon}></uui-icon>
|
|
108
108
|
${viewName}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { UmbStoreBase } from './store-base.js';
|
|
2
|
+
import { UmbItemStore } from './item-store.interface.js';
|
|
3
|
+
import type { FileItemResponseModelBaseModel } from '../../../external/backend-api/index.js';
|
|
4
|
+
import { UmbControllerHost } from '../../../libs/controller-api/index.js';
|
|
5
|
+
/**
|
|
6
|
+
* @export
|
|
7
|
+
* @class UmbFileSystemItemStore
|
|
8
|
+
* @extends {UmbStoreBase}
|
|
9
|
+
* @description - Data Store for File system items
|
|
10
|
+
*/
|
|
11
|
+
export declare class UmbFileSystemItemStore<T extends FileItemResponseModelBaseModel> extends UmbStoreBase<T> implements UmbItemStore<T> {
|
|
12
|
+
constructor(host: UmbControllerHost, storeAlias: string);
|
|
13
|
+
/**
|
|
14
|
+
* Return an observable to observe file system items
|
|
15
|
+
* @param {Array<string>} paths
|
|
16
|
+
* @return {*}
|
|
17
|
+
* @memberof UmbFileSystemItemStore
|
|
18
|
+
*/
|
|
19
|
+
items(paths: Array<string>): import("rxjs").Observable<T[]>;
|
|
20
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { UmbStoreBase } from './store-base.js';
|
|
2
|
+
import { UmbArrayState } from '../../../libs/observable-api/index.js';
|
|
3
|
+
/**
|
|
4
|
+
* @export
|
|
5
|
+
* @class UmbFileSystemItemStore
|
|
6
|
+
* @extends {UmbStoreBase}
|
|
7
|
+
* @description - Data Store for File system items
|
|
8
|
+
*/
|
|
9
|
+
export class UmbFileSystemItemStore extends UmbStoreBase {
|
|
10
|
+
constructor(host, storeAlias) {
|
|
11
|
+
super(host, storeAlias, new UmbArrayState([], (x) => x.path));
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Return an observable to observe file system items
|
|
15
|
+
* @param {Array<string>} paths
|
|
16
|
+
* @return {*}
|
|
17
|
+
* @memberof UmbFileSystemItemStore
|
|
18
|
+
*/
|
|
19
|
+
items(paths) {
|
|
20
|
+
return this._data.asObservablePart((items) => items.filter((item) => paths.includes(item.path ?? '')));
|
|
21
|
+
}
|
|
22
|
+
}
|
|
@@ -22,7 +22,10 @@ export class UmbFileSystemTreeStore extends UmbStoreBase {
|
|
|
22
22
|
* @memberof UmbFileSystemTreeStore
|
|
23
23
|
*/
|
|
24
24
|
childrenOf(parentPath) {
|
|
25
|
-
|
|
25
|
+
if (parentPath === null) {
|
|
26
|
+
return this.rootItems;
|
|
27
|
+
}
|
|
28
|
+
return this._data.asObservablePart((items) => items.filter((item) => item.path?.startsWith(parentPath + '/')));
|
|
26
29
|
}
|
|
27
30
|
/**
|
|
28
31
|
* Returns an observable to observe the items with the given ids
|
|
@@ -12,4 +12,4 @@ export * from './tree-data-source.interface.js';
|
|
|
12
12
|
export * from './tree-store.interface.js';
|
|
13
13
|
export * from './entity-tree-store.js';
|
|
14
14
|
export * from './file-system-tree.store.js';
|
|
15
|
-
export {
|
|
15
|
+
export { UmbTreeRepositoryBase } from './tree-repository-base.js';
|
|
@@ -12,4 +12,4 @@ export * from './tree-data-source.interface.js';
|
|
|
12
12
|
export * from './tree-store.interface.js';
|
|
13
13
|
export * from './entity-tree-store.js';
|
|
14
14
|
export * from './file-system-tree.store.js';
|
|
15
|
-
export {
|
|
15
|
+
export { UmbTreeRepositoryBase } from './tree-repository-base.js';
|
|
@@ -21,7 +21,13 @@ const manifest = {
|
|
|
21
21
|
umbExtensionsRegistry.register(manifest);
|
|
22
22
|
export let UmbMenuItemTreeElement = class UmbMenuItemTreeElement extends UmbLitElement {
|
|
23
23
|
render() {
|
|
24
|
-
return this.manifest
|
|
24
|
+
return this.manifest
|
|
25
|
+
? html `
|
|
26
|
+
<umb-tree
|
|
27
|
+
alias=${this.manifest?.meta.treeAlias}
|
|
28
|
+
?hide-tree-root=${this.manifest.meta.hideTreeRoot === true}></umb-tree>
|
|
29
|
+
`
|
|
30
|
+
: nothing;
|
|
25
31
|
}
|
|
26
32
|
};
|
|
27
33
|
__decorate([
|
package/dist-cms/packages/core/tree/{entity-tree.repository.d.ts → tree-repository-base.d.ts}
RENAMED
|
@@ -6,7 +6,7 @@ import { UmbRepositoryBase } from '../repository/index.js';
|
|
|
6
6
|
import { type UmbControllerHost } from '../../../libs/controller-api/index.js';
|
|
7
7
|
import { UmbApi } from '../../../libs/extension-api/index.js';
|
|
8
8
|
import { UmbContextToken } from '../../../libs/context-api/index.js';
|
|
9
|
-
export declare class
|
|
9
|
+
export declare class UmbTreeRepositoryBase<TreeItemType extends UmbEntityTreeItemModel, TreeRootType extends UmbEntityTreeRootModel> extends UmbRepositoryBase implements UmbTreeRepository<TreeItemType, TreeRootType>, UmbApi {
|
|
10
10
|
#private;
|
|
11
11
|
protected _init: Promise<unknown>;
|
|
12
12
|
protected _treeStore?: UmbTreeStore;
|
|
@@ -14,13 +14,13 @@ export declare class UmbEntityTreeRepositoryBase<TreeItemType extends UmbEntityT
|
|
|
14
14
|
/**
|
|
15
15
|
* Request the tree root item
|
|
16
16
|
* @return {*}
|
|
17
|
-
* @memberof
|
|
17
|
+
* @memberof UmbTreeRepositoryBase
|
|
18
18
|
*/
|
|
19
19
|
requestTreeRoot(): Promise<import("../repository/index.js").DataSourceResponse<any>>;
|
|
20
20
|
/**
|
|
21
21
|
* Requests root items of a tree
|
|
22
22
|
* @return {*}
|
|
23
|
-
* @memberof
|
|
23
|
+
* @memberof UmbTreeRepositoryBase
|
|
24
24
|
*/
|
|
25
25
|
requestRootTreeItems(): Promise<{
|
|
26
26
|
data: import("../repository/index.js").UmbPagedData<any> | undefined;
|
|
@@ -29,11 +29,11 @@ export declare class UmbEntityTreeRepositoryBase<TreeItemType extends UmbEntityT
|
|
|
29
29
|
}>;
|
|
30
30
|
/**
|
|
31
31
|
* Requests tree items of a given parent
|
|
32
|
-
* @param {(string | null)}
|
|
32
|
+
* @param {(string | null)} parentUnique
|
|
33
33
|
* @return {*}
|
|
34
|
-
* @memberof
|
|
34
|
+
* @memberof UmbTreeRepositoryBase
|
|
35
35
|
*/
|
|
36
|
-
requestTreeItemsOf(
|
|
36
|
+
requestTreeItemsOf(parentUnique: string | null): Promise<{
|
|
37
37
|
data: import("../repository/index.js").UmbPagedData<any> | undefined;
|
|
38
38
|
error: import("../../../external/backend-api/index.js").ApiError | import("../../../external/backend-api/index.js").CancelError | undefined;
|
|
39
39
|
asObservable: () => import("rxjs").Observable<any[]>;
|
|
@@ -41,14 +41,14 @@ export declare class UmbEntityTreeRepositoryBase<TreeItemType extends UmbEntityT
|
|
|
41
41
|
/**
|
|
42
42
|
* Returns a promise with an observable of tree root items
|
|
43
43
|
* @return {*}
|
|
44
|
-
* @memberof
|
|
44
|
+
* @memberof UmbTreeRepositoryBase
|
|
45
45
|
*/
|
|
46
46
|
rootTreeItems(): Promise<import("rxjs").Observable<any[]>>;
|
|
47
47
|
/**
|
|
48
48
|
* Returns a promise with an observable of children items of a given parent
|
|
49
|
-
* @param {(string | null)}
|
|
49
|
+
* @param {(string | null)} parentUnique
|
|
50
50
|
* @return {*}
|
|
51
|
-
* @memberof
|
|
51
|
+
* @memberof UmbTreeRepositoryBase
|
|
52
52
|
*/
|
|
53
|
-
treeItemsOf(
|
|
53
|
+
treeItemsOf(parentUnique: string | null): Promise<import("rxjs").Observable<any[]>>;
|
|
54
54
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { UmbRepositoryBase } from '../repository/index.js';
|
|
2
|
-
export class
|
|
2
|
+
export class UmbTreeRepositoryBase extends UmbRepositoryBase {
|
|
3
3
|
#treeSource;
|
|
4
4
|
constructor(host, treeSource, treeStoreContextAlias) {
|
|
5
5
|
super(host);
|
|
@@ -11,7 +11,7 @@ export class UmbEntityTreeRepositoryBase extends UmbRepositoryBase {
|
|
|
11
11
|
/**
|
|
12
12
|
* Request the tree root item
|
|
13
13
|
* @return {*}
|
|
14
|
-
* @memberof
|
|
14
|
+
* @memberof UmbTreeRepositoryBase
|
|
15
15
|
*/
|
|
16
16
|
async requestTreeRoot() {
|
|
17
17
|
if (!this.#treeSource.getTreeRoot?.()) {
|
|
@@ -22,7 +22,7 @@ export class UmbEntityTreeRepositoryBase extends UmbRepositoryBase {
|
|
|
22
22
|
/**
|
|
23
23
|
* Requests root items of a tree
|
|
24
24
|
* @return {*}
|
|
25
|
-
* @memberof
|
|
25
|
+
* @memberof UmbTreeRepositoryBase
|
|
26
26
|
*/
|
|
27
27
|
async requestRootTreeItems() {
|
|
28
28
|
await this._init;
|
|
@@ -34,24 +34,24 @@ export class UmbEntityTreeRepositoryBase extends UmbRepositoryBase {
|
|
|
34
34
|
}
|
|
35
35
|
/**
|
|
36
36
|
* Requests tree items of a given parent
|
|
37
|
-
* @param {(string | null)}
|
|
37
|
+
* @param {(string | null)} parentUnique
|
|
38
38
|
* @return {*}
|
|
39
|
-
* @memberof
|
|
39
|
+
* @memberof UmbTreeRepositoryBase
|
|
40
40
|
*/
|
|
41
|
-
async requestTreeItemsOf(
|
|
42
|
-
if (
|
|
43
|
-
throw new Error('Parent
|
|
41
|
+
async requestTreeItemsOf(parentUnique) {
|
|
42
|
+
if (parentUnique === undefined)
|
|
43
|
+
throw new Error('Parent unique is missing');
|
|
44
44
|
await this._init;
|
|
45
|
-
const { data, error } = await this.#treeSource.getChildrenOf(
|
|
45
|
+
const { data, error } = await this.#treeSource.getChildrenOf(parentUnique);
|
|
46
46
|
if (data) {
|
|
47
47
|
this._treeStore.appendItems(data.items);
|
|
48
48
|
}
|
|
49
|
-
return { data, error, asObservable: () => this._treeStore.childrenOf(
|
|
49
|
+
return { data, error, asObservable: () => this._treeStore.childrenOf(parentUnique) };
|
|
50
50
|
}
|
|
51
51
|
/**
|
|
52
52
|
* Returns a promise with an observable of tree root items
|
|
53
53
|
* @return {*}
|
|
54
|
-
* @memberof
|
|
54
|
+
* @memberof UmbTreeRepositoryBase
|
|
55
55
|
*/
|
|
56
56
|
async rootTreeItems() {
|
|
57
57
|
await this._init;
|
|
@@ -59,14 +59,14 @@ export class UmbEntityTreeRepositoryBase extends UmbRepositoryBase {
|
|
|
59
59
|
}
|
|
60
60
|
/**
|
|
61
61
|
* Returns a promise with an observable of children items of a given parent
|
|
62
|
-
* @param {(string | null)}
|
|
62
|
+
* @param {(string | null)} parentUnique
|
|
63
63
|
* @return {*}
|
|
64
|
-
* @memberof
|
|
64
|
+
* @memberof UmbTreeRepositoryBase
|
|
65
65
|
*/
|
|
66
|
-
async treeItemsOf(
|
|
67
|
-
if (
|
|
68
|
-
throw new Error('Parent
|
|
66
|
+
async treeItemsOf(parentUnique) {
|
|
67
|
+
if (parentUnique === undefined)
|
|
68
|
+
throw new Error('Parent unique is missing');
|
|
69
69
|
await this._init;
|
|
70
|
-
return this._treeStore.childrenOf(
|
|
70
|
+
return this._treeStore.childrenOf(parentUnique);
|
|
71
71
|
}
|
|
72
72
|
}
|
|
@@ -8,22 +8,22 @@ export interface UmbTreeRepository<TreeItemType extends UmbTreeItemModel = UmbTr
|
|
|
8
8
|
data?: TreeRootType;
|
|
9
9
|
error?: ProblemDetails;
|
|
10
10
|
}>;
|
|
11
|
-
|
|
11
|
+
requestTreeItemsOf: (parentUnique: string | null) => Promise<{
|
|
12
12
|
data?: UmbPagedData<TreeItemType>;
|
|
13
13
|
error?: ProblemDetails;
|
|
14
14
|
asObservable?: () => Observable<TreeItemType[]>;
|
|
15
15
|
}>;
|
|
16
|
-
|
|
16
|
+
treeItemsOf: (parentUnique: string | null) => Promise<Observable<TreeItemType[]>>;
|
|
17
|
+
requestRootTreeItems: () => Promise<{
|
|
17
18
|
data?: UmbPagedData<TreeItemType>;
|
|
18
19
|
error?: ProblemDetails;
|
|
19
20
|
asObservable?: () => Observable<TreeItemType[]>;
|
|
20
21
|
}>;
|
|
22
|
+
rootTreeItems: () => Promise<Observable<TreeItemType[]>>;
|
|
21
23
|
requestItemsLegacy?: (uniques: string[]) => Promise<{
|
|
22
24
|
data?: Array<TreeItemType>;
|
|
23
25
|
error?: ProblemDetails;
|
|
24
26
|
asObservable?: () => Observable<any[]>;
|
|
25
27
|
}>;
|
|
26
|
-
rootTreeItems: () => Promise<Observable<TreeItemType[]>>;
|
|
27
|
-
treeItemsOf: (parentUnique: string | null) => Promise<Observable<TreeItemType[]>>;
|
|
28
28
|
itemsLegacy?: (uniques: string[]) => Promise<Observable<any[]>>;
|
|
29
29
|
}
|
|
@@ -2,7 +2,6 @@ import { UmbDictionaryRepository } from '../../repository/dictionary.repository.
|
|
|
2
2
|
import { UmbEntityActionBase } from '../../../../core/entity-action/index.js';
|
|
3
3
|
import { UmbControllerHostElement } from '../../../../../libs/controller-api/index.js';
|
|
4
4
|
export default class UmbCreateDictionaryEntityAction extends UmbEntityActionBase<UmbDictionaryRepository> {
|
|
5
|
-
#private;
|
|
6
5
|
static styles: import("lit").CSSResult[];
|
|
7
6
|
constructor(host: UmbControllerHostElement, repositoryAlias: string, unique: string);
|
|
8
7
|
execute(): Promise<void>;
|
|
@@ -1,40 +1,11 @@
|
|
|
1
|
-
import { UmbTextStyles } from
|
|
2
|
-
import { UMB_SECTION_SIDEBAR_CONTEXT_TOKEN } from '../../../../core/section/index.js';
|
|
1
|
+
import { UmbTextStyles } from '../../../../../shared/style/index.js';
|
|
3
2
|
import { UmbEntityActionBase } from '../../../../core/entity-action/index.js';
|
|
4
|
-
import { UMB_MODAL_MANAGER_CONTEXT_TOKEN, UMB_CREATE_DICTIONARY_MODAL, } from '../../../../core/modal/index.js';
|
|
5
3
|
export default class UmbCreateDictionaryEntityAction extends UmbEntityActionBase {
|
|
6
4
|
static { this.styles = [UmbTextStyles]; }
|
|
7
|
-
#modalContext;
|
|
8
|
-
#sectionSidebarContext;
|
|
9
5
|
constructor(host, repositoryAlias, unique) {
|
|
10
6
|
super(host, repositoryAlias, unique);
|
|
11
|
-
this.consumeContext(UMB_MODAL_MANAGER_CONTEXT_TOKEN, (instance) => {
|
|
12
|
-
this.#modalContext = instance;
|
|
13
|
-
});
|
|
14
|
-
this.consumeContext(UMB_SECTION_SIDEBAR_CONTEXT_TOKEN, (instance) => {
|
|
15
|
-
this.#sectionSidebarContext = instance;
|
|
16
|
-
});
|
|
17
7
|
}
|
|
18
8
|
async execute() {
|
|
19
|
-
|
|
20
|
-
if (!this.#modalContext)
|
|
21
|
-
return;
|
|
22
|
-
if (!this.repository)
|
|
23
|
-
return;
|
|
24
|
-
// TODO: how can we get the current entity detail in the modal? Passing the observable
|
|
25
|
-
// feels a bit hacky. Works, but hacky.
|
|
26
|
-
const modalContext = this.#modalContext?.open(UMB_CREATE_DICTIONARY_MODAL, {
|
|
27
|
-
parentId: this.unique,
|
|
28
|
-
parentName: this.#sectionSidebarContext.headline,
|
|
29
|
-
});
|
|
30
|
-
const { name, parentId } = await modalContext.onSubmit();
|
|
31
|
-
if (!name || parentId === undefined)
|
|
32
|
-
return;
|
|
33
|
-
const { data: url } = await this.repository.create({ name, parentId });
|
|
34
|
-
if (!url)
|
|
35
|
-
return;
|
|
36
|
-
//TODO: Why do we need to extract the id like this?
|
|
37
|
-
const id = url.substring(url.lastIndexOf('/') + 1);
|
|
38
|
-
history.pushState({}, '', `/section/dictionary/workspace/dictionary-item/edit/${id}`);
|
|
9
|
+
history.pushState({}, '', `/section/dictionary/workspace/dictionary-item/create/${this.unique ?? 'null'}`);
|
|
39
10
|
}
|
|
40
11
|
}
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { UMB_DICTIONARY_REPOSITORY_ALIAS } from '../repository/manifests.js';
|
|
2
|
+
import { UMB_DICTIONARY_ENTITY_TYPE } from '../entities.js';
|
|
2
3
|
import UmbReloadDictionaryEntityAction from './reload.action.js';
|
|
3
4
|
import UmbImportDictionaryEntityAction from './import/import.action.js';
|
|
4
5
|
import UmbExportDictionaryEntityAction from './export/export.action.js';
|
|
5
6
|
import UmbCreateDictionaryEntityAction from './create/create.action.js';
|
|
6
7
|
import { UmbDeleteEntityAction, UmbMoveEntityAction } from '../../../core/entity-action/index.js';
|
|
7
|
-
const entityType = 'dictionary-item';
|
|
8
|
-
const repositoryAlias = DICTIONARY_REPOSITORY_ALIAS;
|
|
9
8
|
const entityActions = [
|
|
10
9
|
{
|
|
11
10
|
type: 'entityAction',
|
|
@@ -16,8 +15,8 @@ const entityActions = [
|
|
|
16
15
|
meta: {
|
|
17
16
|
icon: 'icon-add',
|
|
18
17
|
label: 'Create',
|
|
19
|
-
repositoryAlias,
|
|
20
|
-
entityTypes: [
|
|
18
|
+
repositoryAlias: UMB_DICTIONARY_REPOSITORY_ALIAS,
|
|
19
|
+
entityTypes: [UMB_DICTIONARY_ENTITY_TYPE],
|
|
21
20
|
},
|
|
22
21
|
},
|
|
23
22
|
{
|
|
@@ -29,8 +28,8 @@ const entityActions = [
|
|
|
29
28
|
meta: {
|
|
30
29
|
icon: 'icon-enter',
|
|
31
30
|
label: 'Move',
|
|
32
|
-
repositoryAlias,
|
|
33
|
-
entityTypes: [
|
|
31
|
+
repositoryAlias: UMB_DICTIONARY_REPOSITORY_ALIAS,
|
|
32
|
+
entityTypes: [UMB_DICTIONARY_ENTITY_TYPE],
|
|
34
33
|
},
|
|
35
34
|
},
|
|
36
35
|
{
|
|
@@ -42,8 +41,8 @@ const entityActions = [
|
|
|
42
41
|
meta: {
|
|
43
42
|
icon: 'icon-download-alt',
|
|
44
43
|
label: 'Export',
|
|
45
|
-
repositoryAlias,
|
|
46
|
-
entityTypes: [
|
|
44
|
+
repositoryAlias: UMB_DICTIONARY_REPOSITORY_ALIAS,
|
|
45
|
+
entityTypes: [UMB_DICTIONARY_ENTITY_TYPE],
|
|
47
46
|
},
|
|
48
47
|
},
|
|
49
48
|
{
|
|
@@ -55,8 +54,8 @@ const entityActions = [
|
|
|
55
54
|
meta: {
|
|
56
55
|
icon: 'icon-page-up',
|
|
57
56
|
label: 'Import',
|
|
58
|
-
repositoryAlias,
|
|
59
|
-
entityTypes: [
|
|
57
|
+
repositoryAlias: UMB_DICTIONARY_REPOSITORY_ALIAS,
|
|
58
|
+
entityTypes: [UMB_DICTIONARY_ENTITY_TYPE],
|
|
60
59
|
},
|
|
61
60
|
},
|
|
62
61
|
{
|
|
@@ -68,8 +67,8 @@ const entityActions = [
|
|
|
68
67
|
meta: {
|
|
69
68
|
icon: 'icon-refresh',
|
|
70
69
|
label: 'Reload',
|
|
71
|
-
repositoryAlias,
|
|
72
|
-
entityTypes: [
|
|
70
|
+
repositoryAlias: UMB_DICTIONARY_REPOSITORY_ALIAS,
|
|
71
|
+
entityTypes: [UMB_DICTIONARY_ENTITY_TYPE],
|
|
73
72
|
},
|
|
74
73
|
},
|
|
75
74
|
{
|
|
@@ -81,8 +80,8 @@ const entityActions = [
|
|
|
81
80
|
meta: {
|
|
82
81
|
icon: 'icon-trash',
|
|
83
82
|
label: 'Delete',
|
|
84
|
-
repositoryAlias,
|
|
85
|
-
entityTypes: [
|
|
83
|
+
repositoryAlias: UMB_DICTIONARY_REPOSITORY_ALIAS,
|
|
84
|
+
entityTypes: [UMB_DICTIONARY_ENTITY_TYPE],
|
|
86
85
|
},
|
|
87
86
|
},
|
|
88
87
|
];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const manifests: (import("../../core/index.js").ManifestModal | import("../../core/index.js").ManifestEntityAction | import("../../core/index.js").ManifestMenu | import("../../core/index.js").
|
|
1
|
+
export declare const manifests: (import("../../core/index.js").ManifestModal | import("../../core/index.js").ManifestEntityAction | import("../../core/index.js").ManifestMenu | import("../../core/index.js").ManifestMenuItemTreeKind | 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 | import("../../core/index.js").ManifestWorkspaceEditorView | import("../../core/index.js").ManifestRepository<import("../../../libs/extension-api/types.js").UmbApi>)[];
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export declare const manifests: ManifestMenuItem[];
|
|
1
|
+
export declare const manifests: import("../../../core/extension-registry/index.js").ManifestMenuItemTreeKind[];
|
|
@@ -1,14 +1,18 @@
|
|
|
1
|
+
import { UMB_DICTIONARY_ENTITY_TYPE } from '../entities.js';
|
|
2
|
+
import { UMB_DICTIONARY_TREE_ALIAS } from '../tree/index.js';
|
|
1
3
|
const menuItem = {
|
|
2
4
|
type: 'menuItem',
|
|
5
|
+
kind: 'tree',
|
|
3
6
|
alias: 'Umb.MenuItem.Dictionary',
|
|
4
7
|
name: 'Dictionary Menu Item',
|
|
5
8
|
weight: 400,
|
|
6
|
-
loader: () => import('./dictionary-menu-item.element.js'),
|
|
7
9
|
meta: {
|
|
8
10
|
label: 'Dictionary',
|
|
9
11
|
icon: 'icon-book-alt',
|
|
10
|
-
entityType:
|
|
12
|
+
entityType: UMB_DICTIONARY_ENTITY_TYPE,
|
|
11
13
|
menus: ['Umb.Menu.Dictionary'],
|
|
14
|
+
treeAlias: UMB_DICTIONARY_TREE_ALIAS,
|
|
15
|
+
hideTreeRoot: true,
|
|
12
16
|
},
|
|
13
17
|
};
|
|
14
18
|
export const manifests = [menuItem];
|
|
@@ -1,38 +1,11 @@
|
|
|
1
1
|
import { UmbBaseController, UmbControllerHostElement } from '../../../../libs/controller-api/index.js';
|
|
2
2
|
import { UmbDetailRepository } from '../../../core/repository/index.js';
|
|
3
|
-
import {
|
|
4
|
-
import { CreateDictionaryItemRequestModel, DictionaryOverviewResponseModel, EntityTreeItemResponseModel, ImportDictionaryRequestModel, UpdateDictionaryItemRequestModel } from '../../../../external/backend-api/index.js';
|
|
3
|
+
import { CreateDictionaryItemRequestModel, DictionaryOverviewResponseModel, ImportDictionaryRequestModel, UpdateDictionaryItemRequestModel } from '../../../../external/backend-api/index.js';
|
|
5
4
|
import type { UmbApi } from '../../../../libs/extension-api/index.js';
|
|
6
|
-
export declare class UmbDictionaryRepository extends UmbBaseController implements
|
|
5
|
+
export declare class UmbDictionaryRepository extends UmbBaseController implements UmbDetailRepository<CreateDictionaryItemRequestModel, any, UpdateDictionaryItemRequestModel, DictionaryOverviewResponseModel>, UmbApi {
|
|
7
6
|
#private;
|
|
8
7
|
constructor(host: UmbControllerHostElement);
|
|
9
|
-
|
|
10
|
-
data: {
|
|
11
|
-
id: null;
|
|
12
|
-
type: string;
|
|
13
|
-
name: string;
|
|
14
|
-
icon: string;
|
|
15
|
-
hasChildren: boolean;
|
|
16
|
-
};
|
|
17
|
-
}>;
|
|
18
|
-
requestRootTreeItems(): Promise<{
|
|
19
|
-
data: import("../../../core/repository/index.js").UmbPagedData<any> | undefined;
|
|
20
|
-
error: import("../../../../external/backend-api/index.js").ApiError | import("../../../../external/backend-api/index.js").CancelError | undefined;
|
|
21
|
-
asObservable: () => import("rxjs").Observable<EntityTreeItemResponseModel[]>;
|
|
22
|
-
}>;
|
|
23
|
-
requestTreeItemsOf(parentId: string | null): Promise<{
|
|
24
|
-
data: import("../../../core/repository/index.js").UmbPagedData<any> | undefined;
|
|
25
|
-
error: import("../../../../external/backend-api/index.js").ApiError | import("../../../../external/backend-api/index.js").CancelError | undefined;
|
|
26
|
-
asObservable: () => import("rxjs").Observable<EntityTreeItemResponseModel[]>;
|
|
27
|
-
}>;
|
|
28
|
-
requestItemsLegacy(ids: Array<string>): Promise<{
|
|
29
|
-
data: any[] | undefined;
|
|
30
|
-
error: import("../../../../external/backend-api/index.js").ApiError | import("../../../../external/backend-api/index.js").CancelError | undefined;
|
|
31
|
-
asObservable: () => import("rxjs").Observable<EntityTreeItemResponseModel[]>;
|
|
32
|
-
}>;
|
|
33
|
-
rootTreeItems(): Promise<import("rxjs").Observable<EntityTreeItemResponseModel[]>>;
|
|
34
|
-
treeItemsOf(parentId: string | null): Promise<import("rxjs").Observable<EntityTreeItemResponseModel[]>>;
|
|
35
|
-
itemsLegacy(ids: Array<string>): Promise<import("rxjs").Observable<EntityTreeItemResponseModel[]>>;
|
|
8
|
+
itemsLegacy(ids: Array<string>): Promise<import("rxjs").Observable<import("../../../../external/backend-api/index.js").EntityTreeItemResponseModel[]>>;
|
|
36
9
|
createScaffold(parentId: string | null, preset?: Partial<CreateDictionaryItemRequestModel>): Promise<{
|
|
37
10
|
data: {
|
|
38
11
|
name: string;
|