@umbraco-cms/backoffice 14.0.0--preview004-e91a3686 → 14.0.0--preview004-bf106bcf
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 -0
- package/dist-cms/assets/lang/da-dk.js +2 -0
- package/dist-cms/assets/lang/da-dk.ts +2 -0
- package/dist-cms/assets/lang/en-us.js +2 -0
- package/dist-cms/assets/lang/en-us.ts +2 -0
- package/dist-cms/custom-elements.json +96 -62
- package/dist-cms/mocks/browser-handlers.js +4 -1
- package/dist-cms/mocks/data/object-type/object-type.data.d.ts +8 -0
- package/dist-cms/mocks/data/object-type/object-type.data.js +28 -0
- package/dist-cms/mocks/data/{relation-type.data.d.ts → relations/relation-type.data.d.ts} +2 -2
- package/dist-cms/mocks/data/{relation-type.data.js → relations/relation-type.data.js} +2 -2
- package/dist-cms/mocks/data/relations/relation.data.d.ts +12 -0
- package/dist-cms/mocks/data/relations/relation.data.js +104 -0
- package/dist-cms/mocks/handlers/object-type/index.js +2 -0
- package/dist-cms/mocks/handlers/object-type/item.handlers.d.ts +1 -0
- package/dist-cms/mocks/handlers/object-type/item.handlers.js +10 -0
- package/dist-cms/mocks/handlers/object-type/slug.d.ts +1 -0
- package/dist-cms/mocks/handlers/object-type/slug.js +1 -0
- package/dist-cms/mocks/handlers/relations/index.d.ts +2 -0
- package/dist-cms/mocks/handlers/relations/index.js +2 -0
- package/dist-cms/mocks/handlers/relations/relation/index.d.ts +1 -0
- package/dist-cms/mocks/handlers/relations/relation/index.js +2 -0
- package/dist-cms/mocks/handlers/relations/relation/item.handlers.d.ts +1 -0
- package/dist-cms/mocks/handlers/relations/relation/item.handlers.js +13 -0
- package/dist-cms/mocks/handlers/relations/relation/slug.d.ts +1 -0
- package/dist-cms/mocks/handlers/relations/relation/slug.js +1 -0
- package/dist-cms/mocks/handlers/relations/relation-type/detail.handlers.d.ts +1 -0
- package/dist-cms/mocks/handlers/relations/relation-type/detail.handlers.js +41 -0
- package/dist-cms/mocks/handlers/relations/relation-type/index.d.ts +1 -0
- package/dist-cms/mocks/handlers/relations/relation-type/index.js +3 -0
- package/dist-cms/mocks/handlers/relations/relation-type/slug.d.ts +1 -0
- package/dist-cms/mocks/handlers/relations/relation-type/slug.js +1 -0
- package/dist-cms/mocks/handlers/relations/relation-type/tree.handlers.d.ts +1 -0
- package/dist-cms/mocks/handlers/relations/relation-type/tree.handlers.js +32 -0
- package/dist-cms/packages/core/components/input-start-node/input-start-node.element.d.ts +11 -3
- package/dist-cms/packages/core/components/input-start-node/input-start-node.element.js +26 -16
- package/dist-cms/packages/core/index.d.ts +1 -0
- package/dist-cms/packages/core/index.js +1 -0
- package/dist-cms/packages/core/object-type/index.d.ts +2 -0
- package/dist-cms/packages/core/object-type/index.js +2 -0
- package/dist-cms/packages/core/object-type/input-object-type.element.d.ts +20 -0
- package/dist-cms/packages/core/object-type/input-object-type.element.js +53 -0
- package/dist-cms/packages/core/object-type/object-type.repository.d.ts +11 -0
- package/dist-cms/packages/core/object-type/object-type.repository.js +17 -0
- package/dist-cms/packages/core/property-editor/uis/tree-picker/config/start-node/property-editor-ui-tree-picker-start-node.element.js +5 -3
- package/dist-cms/packages/documents/documents/components/index.d.ts +1 -0
- package/dist-cms/packages/documents/documents/components/index.js +1 -0
- package/dist-cms/packages/documents/documents/components/input-document-picker-root/input-document-picker-root.element.d.ts +19 -0
- package/dist-cms/packages/documents/documents/components/input-document-picker-root/input-document-picker-root.element.js +93 -0
- package/dist-cms/packages/members/member-types/workspace/member-type-workspace.context.js +1 -1
- package/dist-cms/packages/relations/index.d.ts +3 -0
- package/dist-cms/packages/relations/index.js +3 -0
- package/dist-cms/packages/relations/manifests.d.ts +1 -0
- package/dist-cms/packages/relations/manifests.js +3 -0
- package/dist-cms/packages/relations/relation-types/entity-actions/create.action.d.ts +7 -0
- package/dist-cms/packages/relations/relation-types/entity-actions/create.action.js +11 -0
- package/dist-cms/packages/relations/relation-types/entity-actions/manifests.d.ts +2 -0
- package/dist-cms/packages/relations/relation-types/entity-actions/manifests.js +32 -0
- package/dist-cms/packages/{settings → relations}/relation-types/index.d.ts +1 -0
- package/dist-cms/packages/{settings → relations}/relation-types/index.js +1 -0
- package/dist-cms/packages/relations/relation-types/manifests.d.ts +1 -0
- package/dist-cms/packages/{settings → relations}/relation-types/manifests.js +8 -1
- package/dist-cms/packages/{settings → relations}/relation-types/repository/manifests.js +1 -1
- package/dist-cms/packages/{settings → relations}/relation-types/repository/relation-type.repository.d.ts +4 -0
- package/dist-cms/packages/{settings → relations}/relation-types/repository/relation-type.repository.js +10 -0
- package/dist-cms/packages/{settings → relations}/relation-types/repository/sources/relation-type.server.data.d.ts +7 -0
- package/dist-cms/packages/{settings → relations}/relation-types/repository/sources/relation-type.server.data.js +25 -4
- package/dist-cms/packages/{settings → relations}/relation-types/workspace/relation-type-workspace.context.d.ts +4 -0
- package/dist-cms/packages/{settings → relations}/relation-types/workspace/relation-type-workspace.context.js +10 -3
- package/dist-cms/packages/{settings → relations}/relation-types/workspace/views/relation/workspace-view-relation-type-relation.element.d.ts +3 -1
- package/dist-cms/packages/{settings → relations}/relation-types/workspace/views/relation/workspace-view-relation-type-relation.element.js +16 -69
- package/dist-cms/packages/{settings → relations}/relation-types/workspace/views/relation-type/relation-type-workspace-view-relation-type.element.js +17 -5
- package/dist-cms/packages/relations/relations/entities.d.ts +1 -0
- package/dist-cms/packages/relations/relations/entities.js +1 -0
- package/dist-cms/packages/relations/relations/index.d.ts +2 -0
- package/dist-cms/packages/relations/relations/index.js +2 -0
- package/dist-cms/packages/relations/relations/manifests.d.ts +1 -0
- package/dist-cms/packages/relations/relations/manifests.js +2 -0
- package/dist-cms/packages/relations/relations/repository/index.d.ts +1 -0
- package/dist-cms/packages/relations/relations/repository/index.js +1 -0
- package/dist-cms/packages/relations/relations/repository/manifests.d.ts +3 -0
- package/dist-cms/packages/relations/relations/repository/manifests.js +9 -0
- package/dist-cms/packages/relations/relations/repository/relation.repository.d.ts +15 -0
- package/dist-cms/packages/relations/relations/repository/relation.repository.js +38 -0
- package/dist-cms/packages/relations/relations/repository/sources/relation.server.data.d.ts +30 -0
- package/dist-cms/packages/relations/relations/repository/sources/relation.server.data.js +48 -0
- package/dist-cms/packages/relations/umbraco-package.d.ts +7 -0
- package/dist-cms/packages/relations/umbraco-package.js +9 -0
- package/dist-cms/packages/settings/manifests.js +0 -2
- package/dist-cms/tsconfig.build.tsbuildinfo +1 -1
- package/dist-cms/vscode-html-custom-data.json +47 -30
- package/package.json +3 -2
- package/dist-cms/mocks/handlers/relation-type.handlers.js +0 -66
- package/dist-cms/packages/settings/relation-types/manifests.d.ts +0 -1
- /package/dist-cms/mocks/handlers/{relation-type.handlers.d.ts → object-type/index.d.ts} +0 -0
- /package/dist-cms/packages/{settings → relations}/relation-types/entities.d.ts +0 -0
- /package/dist-cms/packages/{settings → relations}/relation-types/entities.js +0 -0
- /package/dist-cms/packages/{settings → relations}/relation-types/menu-item/manifests.d.ts +0 -0
- /package/dist-cms/packages/{settings → relations}/relation-types/menu-item/manifests.js +0 -0
- /package/dist-cms/packages/{settings → relations}/relation-types/repository/index.d.ts +0 -0
- /package/dist-cms/packages/{settings → relations}/relation-types/repository/index.js +0 -0
- /package/dist-cms/packages/{settings → relations}/relation-types/repository/manifests.d.ts +0 -0
- /package/dist-cms/packages/{settings → relations}/relation-types/repository/relation-type.store.d.ts +0 -0
- /package/dist-cms/packages/{settings → relations}/relation-types/repository/relation-type.store.js +0 -0
- /package/dist-cms/packages/{settings → relations}/relation-types/tree/index.d.ts +0 -0
- /package/dist-cms/packages/{settings → relations}/relation-types/tree/index.js +0 -0
- /package/dist-cms/packages/{settings → relations}/relation-types/tree/manifests.d.ts +0 -0
- /package/dist-cms/packages/{settings → relations}/relation-types/tree/manifests.js +0 -0
- /package/dist-cms/packages/{settings → relations}/relation-types/tree/relation-type-tree.repository.d.ts +0 -0
- /package/dist-cms/packages/{settings → relations}/relation-types/tree/relation-type-tree.repository.js +0 -0
- /package/dist-cms/packages/{settings → relations}/relation-types/tree/relation-type-tree.server.data-source.d.ts +0 -0
- /package/dist-cms/packages/{settings → relations}/relation-types/tree/relation-type-tree.server.data-source.js +0 -0
- /package/dist-cms/packages/{settings → relations}/relation-types/tree/relation-type-tree.store.d.ts +0 -0
- /package/dist-cms/packages/{settings → relations}/relation-types/tree/relation-type-tree.store.js +0 -0
- /package/dist-cms/packages/{settings → relations}/relation-types/tree/types.d.ts +0 -0
- /package/dist-cms/packages/{settings → relations}/relation-types/tree/types.js +0 -0
- /package/dist-cms/packages/{settings → relations}/relation-types/workspace/manifests.d.ts +0 -0
- /package/dist-cms/packages/{settings → relations}/relation-types/workspace/manifests.js +0 -0
- /package/dist-cms/packages/{settings → relations}/relation-types/workspace/relation-type-workspace-editor.element.d.ts +0 -0
- /package/dist-cms/packages/{settings → relations}/relation-types/workspace/relation-type-workspace-editor.element.js +0 -0
- /package/dist-cms/packages/{settings → relations}/relation-types/workspace/relation-type-workspace.element.d.ts +0 -0
- /package/dist-cms/packages/{settings → relations}/relation-types/workspace/relation-type-workspace.element.js +0 -0
- /package/dist-cms/packages/{settings → relations}/relation-types/workspace/views/relation-type/relation-type-workspace-view-relation-type.element.d.ts +0 -0
|
@@ -2,12 +2,14 @@ import { UmbLitElement } from '../../../../../../shared/lit-element/index.js';
|
|
|
2
2
|
import { RelationResponseModel } from '../../../../../../external/backend-api/index.js';
|
|
3
3
|
import { UmbWorkspaceViewElement } from '../../../../../core/extension-registry/index.js';
|
|
4
4
|
export declare class UmbWorkspaceViewRelationTypeRelationElement extends UmbLitElement implements UmbWorkspaceViewElement {
|
|
5
|
+
#private;
|
|
5
6
|
_relations: Array<RelationResponseModel>;
|
|
7
|
+
constructor();
|
|
6
8
|
private _tableConfig;
|
|
7
9
|
private _tableColumns;
|
|
8
10
|
private get _tableItems();
|
|
9
11
|
render(): import("lit-html").TemplateResult<1>;
|
|
10
|
-
static styles: import("@lit/reactive-element/css-tag").CSSResult[];
|
|
12
|
+
static styles: import("@lit/reactive-element/css-tag.js").CSSResult[];
|
|
11
13
|
}
|
|
12
14
|
export default UmbWorkspaceViewRelationTypeRelationElement;
|
|
13
15
|
declare global {
|
|
@@ -4,14 +4,16 @@ 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 { UMB_RELATION_TYPE_WORKSPACE_CONTEXT } from '../../relation-type-workspace.context.js';
|
|
7
8
|
import { UmbTextStyles } from '../../../../../../shared/style/index.js';
|
|
8
9
|
import { css, html, customElement, state } from '../../../../../../external/lit/index.js';
|
|
9
10
|
import { UmbLitElement } from '../../../../../../shared/lit-element/index.js';
|
|
10
11
|
let UmbWorkspaceViewRelationTypeRelationElement = class UmbWorkspaceViewRelationTypeRelationElement extends UmbLitElement {
|
|
12
|
+
#workspaceContext;
|
|
11
13
|
constructor() {
|
|
12
|
-
super(
|
|
14
|
+
super();
|
|
13
15
|
//TODO Use real data
|
|
14
|
-
this._relations =
|
|
16
|
+
this._relations = [];
|
|
15
17
|
this._tableConfig = {
|
|
16
18
|
allowSelection: false,
|
|
17
19
|
hideIcon: true,
|
|
@@ -34,11 +36,22 @@ let UmbWorkspaceViewRelationTypeRelationElement = class UmbWorkspaceViewRelation
|
|
|
34
36
|
alias: 'comment',
|
|
35
37
|
},
|
|
36
38
|
];
|
|
39
|
+
this.consumeContext(UMB_RELATION_TYPE_WORKSPACE_CONTEXT, (instance) => {
|
|
40
|
+
this.#workspaceContext = instance;
|
|
41
|
+
this.#getRelations();
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
async #getRelations() {
|
|
45
|
+
if (!this.#workspaceContext) {
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
const response = await this.#workspaceContext.getRelations();
|
|
49
|
+
this._relations = response.data?.items ?? [];
|
|
37
50
|
}
|
|
38
51
|
get _tableItems() {
|
|
39
52
|
return this._relations.map((relation) => {
|
|
40
53
|
return {
|
|
41
|
-
|
|
54
|
+
id: relation.parentId + '-' + relation.childId, // Add the missing id property
|
|
42
55
|
data: [
|
|
43
56
|
{
|
|
44
57
|
columnAlias: 'parent',
|
|
@@ -82,70 +95,4 @@ UmbWorkspaceViewRelationTypeRelationElement = __decorate([
|
|
|
82
95
|
customElement('umb-workspace-view-relation-type-relation')
|
|
83
96
|
], UmbWorkspaceViewRelationTypeRelationElement);
|
|
84
97
|
export { UmbWorkspaceViewRelationTypeRelationElement };
|
|
85
|
-
const MockData = [
|
|
86
|
-
{
|
|
87
|
-
parentId: '1',
|
|
88
|
-
parentName: 'Parent 1',
|
|
89
|
-
childId: '2',
|
|
90
|
-
childName: 'Child 1',
|
|
91
|
-
createDate: '2021-01-01',
|
|
92
|
-
comment: 'Comment 1',
|
|
93
|
-
},
|
|
94
|
-
{
|
|
95
|
-
parentId: '1',
|
|
96
|
-
parentName: 'Parent 1',
|
|
97
|
-
childId: '3',
|
|
98
|
-
childName: 'Child 2',
|
|
99
|
-
createDate: '2021-01-01',
|
|
100
|
-
comment: 'Comment 2',
|
|
101
|
-
},
|
|
102
|
-
{
|
|
103
|
-
parentId: '1',
|
|
104
|
-
parentName: 'Parent 1',
|
|
105
|
-
childId: '4',
|
|
106
|
-
childName: 'Child 3',
|
|
107
|
-
createDate: '2021-01-01',
|
|
108
|
-
comment: 'Comment 3',
|
|
109
|
-
},
|
|
110
|
-
{
|
|
111
|
-
parentId: '1',
|
|
112
|
-
parentName: 'Parent 1',
|
|
113
|
-
childId: '5',
|
|
114
|
-
childName: 'Child 4',
|
|
115
|
-
createDate: '2021-01-01',
|
|
116
|
-
comment: 'Comment 4',
|
|
117
|
-
},
|
|
118
|
-
{
|
|
119
|
-
parentId: '1',
|
|
120
|
-
parentName: 'Parent 1',
|
|
121
|
-
childId: '6',
|
|
122
|
-
childName: 'Child 5',
|
|
123
|
-
createDate: '2021-01-01',
|
|
124
|
-
comment: 'Comment 5',
|
|
125
|
-
},
|
|
126
|
-
{
|
|
127
|
-
parentId: '1',
|
|
128
|
-
parentName: 'Parent 1',
|
|
129
|
-
childId: '7',
|
|
130
|
-
childName: 'Child 6',
|
|
131
|
-
createDate: '2021-01-01',
|
|
132
|
-
comment: 'Comment 6',
|
|
133
|
-
},
|
|
134
|
-
{
|
|
135
|
-
parentId: '1',
|
|
136
|
-
parentName: 'Parent 1',
|
|
137
|
-
childId: '8',
|
|
138
|
-
childName: 'Child 7',
|
|
139
|
-
createDate: '2021-01-01',
|
|
140
|
-
comment: 'Comment 7',
|
|
141
|
-
},
|
|
142
|
-
{
|
|
143
|
-
parentId: '1',
|
|
144
|
-
parentName: 'Parent 1',
|
|
145
|
-
childId: '9',
|
|
146
|
-
childName: 'Child 8',
|
|
147
|
-
createDate: '2021-01-01',
|
|
148
|
-
comment: 'Comment 8',
|
|
149
|
-
},
|
|
150
|
-
];
|
|
151
98
|
export default UmbWorkspaceViewRelationTypeRelationElement;
|
|
@@ -59,15 +59,27 @@ let UmbRelationTypeWorkspaceViewRelationTypeElement = class UmbRelationTypeWorks
|
|
|
59
59
|
</uui-box>
|
|
60
60
|
`;
|
|
61
61
|
}
|
|
62
|
+
#onParentObjectTypeChange(event) {
|
|
63
|
+
const value = event.target.value;
|
|
64
|
+
this.#workspaceContext?.update('parentObjectType', value);
|
|
65
|
+
}
|
|
66
|
+
#onChildObjectTypeChange(event) {
|
|
67
|
+
const value = event.target.value;
|
|
68
|
+
this.#workspaceContext?.update('childObjectType', value);
|
|
69
|
+
}
|
|
62
70
|
#renderParentProperty() {
|
|
63
|
-
if (this._relationType
|
|
71
|
+
if (!this.#workspaceContext?.getIsNew() && this._relationType)
|
|
64
72
|
return html `<div slot="editor">${this._relationType.parentObjectTypeName}</div>`;
|
|
65
|
-
return html
|
|
73
|
+
return html `
|
|
74
|
+
<umb-input-object-type @change=${this.#onParentObjectTypeChange} slot="editor"></umb-input-object-type>
|
|
75
|
+
`;
|
|
66
76
|
}
|
|
67
77
|
#renderChildProperty() {
|
|
68
|
-
if (this._relationType
|
|
69
|
-
return html `<div slot="editor">${this._relationType.
|
|
70
|
-
return html
|
|
78
|
+
if (!this.#workspaceContext?.getIsNew() && this._relationType)
|
|
79
|
+
return html `<div slot="editor">${this._relationType.childObjectTypeName}</div>`;
|
|
80
|
+
return html `
|
|
81
|
+
<umb-input-object-type @change=${this.#onChildObjectTypeChange} slot="editor"></umb-input-object-type>
|
|
82
|
+
`;
|
|
71
83
|
}
|
|
72
84
|
static { this.styles = [
|
|
73
85
|
css `
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const UMB_RELATION_ENTITY_TYPE = "relation";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const UMB_RELATION_ENTITY_TYPE = 'relation';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const manifests: import("../../core/index.js").ManifestRepository<import("../../../libs/extension-api/index.js").UmbApi>[];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './relation.repository.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './relation.repository.js';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { UmbRelationRepository } from './relation.repository.js';
|
|
2
|
+
export const UMB_RELATION_REPOSITORY_ALIAS = 'Umb.Repository.Relation';
|
|
3
|
+
const repository = {
|
|
4
|
+
type: 'repository',
|
|
5
|
+
alias: UMB_RELATION_REPOSITORY_ALIAS,
|
|
6
|
+
name: 'Relation Repository',
|
|
7
|
+
api: UmbRelationRepository,
|
|
8
|
+
};
|
|
9
|
+
export const manifests = [repository];
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { type UmbControllerHost } from '../../../../libs/controller-api/index.js';
|
|
2
|
+
import { UmbBaseController } from '../../../../libs/class-api/index.js';
|
|
3
|
+
import { UmbApi } from '../../../../libs/extension-api/index.js';
|
|
4
|
+
export declare class UmbRelationRepository extends UmbBaseController implements UmbApi {
|
|
5
|
+
#private;
|
|
6
|
+
constructor(host: UmbControllerHost);
|
|
7
|
+
requestById(id: string): Promise<{
|
|
8
|
+
data: import("../../../../external/backend-api/index.js").PagedRelationResponseModel | undefined;
|
|
9
|
+
error: import("../../../../external/backend-api/index.js").ApiError | import("../../../../external/backend-api/index.js").CancelError | undefined;
|
|
10
|
+
}>;
|
|
11
|
+
requestChildRelationById(childId: string, relationTypeAlias?: string): Promise<{
|
|
12
|
+
data: import("../../../../external/backend-api/index.js").PagedRelationResponseModel | undefined;
|
|
13
|
+
error: import("../../../../external/backend-api/index.js").ApiError | import("../../../../external/backend-api/index.js").CancelError | undefined;
|
|
14
|
+
}>;
|
|
15
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { UmbRelationServerDataSource } from './sources/relation.server.data.js';
|
|
2
|
+
import { UmbBaseController } from '../../../../libs/class-api/index.js';
|
|
3
|
+
import { UMB_NOTIFICATION_CONTEXT_TOKEN } from '../../../core/notification/index.js';
|
|
4
|
+
export class UmbRelationRepository extends UmbBaseController {
|
|
5
|
+
#init;
|
|
6
|
+
#detailDataSource;
|
|
7
|
+
#notificationContext;
|
|
8
|
+
constructor(host) {
|
|
9
|
+
super(host);
|
|
10
|
+
// TODO: figure out how spin up get the correct data source
|
|
11
|
+
this.#detailDataSource = new UmbRelationServerDataSource(this._host);
|
|
12
|
+
this.#init = Promise.all([
|
|
13
|
+
this.consumeContext(UMB_NOTIFICATION_CONTEXT_TOKEN, (instance) => {
|
|
14
|
+
this.#notificationContext = instance;
|
|
15
|
+
}).asPromise(),
|
|
16
|
+
]);
|
|
17
|
+
}
|
|
18
|
+
async requestById(id) {
|
|
19
|
+
await this.#init;
|
|
20
|
+
// TODO: should we show a notification if the id is missing?
|
|
21
|
+
// Investigate what is best for Acceptance testing, cause in that perspective a thrown error might be the best choice?
|
|
22
|
+
if (!id) {
|
|
23
|
+
throw new Error('Id is missing');
|
|
24
|
+
}
|
|
25
|
+
const { data, error } = await this.#detailDataSource.read(id);
|
|
26
|
+
return { data, error };
|
|
27
|
+
}
|
|
28
|
+
async requestChildRelationById(childId, relationTypeAlias) {
|
|
29
|
+
await this.#init;
|
|
30
|
+
// TODO: should we show a notification if the id is missing?
|
|
31
|
+
// Investigate what is best for Acceptance testing, cause in that perspective a thrown error might be the best choice?
|
|
32
|
+
if (!childId) {
|
|
33
|
+
throw new Error('Id is missing');
|
|
34
|
+
}
|
|
35
|
+
const { data, error } = await this.#detailDataSource.readChildRelations(childId, relationTypeAlias);
|
|
36
|
+
return { data, error };
|
|
37
|
+
}
|
|
38
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { UmbControllerHost } from '../../../../../libs/controller-api/index.js';
|
|
2
|
+
/**
|
|
3
|
+
* A data source for the Relation that fetches data from the server
|
|
4
|
+
* @export
|
|
5
|
+
* @class UmbRelationServerDataSource
|
|
6
|
+
* @implements {RepositoryDetailDataSource}
|
|
7
|
+
*/
|
|
8
|
+
export declare class UmbRelationServerDataSource {
|
|
9
|
+
#private;
|
|
10
|
+
/**
|
|
11
|
+
* Creates an instance of UmbRelationServerDataSource.
|
|
12
|
+
* @param {UmbControllerHost} host
|
|
13
|
+
* @memberof UmbRelationServerDataSource
|
|
14
|
+
*/
|
|
15
|
+
constructor(host: UmbControllerHost);
|
|
16
|
+
/**
|
|
17
|
+
* Fetches relations by the given id from the server
|
|
18
|
+
* @param {string} id
|
|
19
|
+
* @return {*}
|
|
20
|
+
* @memberof UmbRelationServerDataSource
|
|
21
|
+
*/
|
|
22
|
+
read(id: string): Promise<import("../../../../core/repository/index.js").DataSourceResponse<import("../../../../../external/backend-api/index.js").PagedRelationResponseModel>>;
|
|
23
|
+
/**
|
|
24
|
+
* Fetches relations by the given id from the server
|
|
25
|
+
* @param {string} childId
|
|
26
|
+
* @return {*}
|
|
27
|
+
* @memberof UmbRelationServerDataSource
|
|
28
|
+
*/
|
|
29
|
+
readChildRelations(childId: string, relationTypeAlias?: string): Promise<import("../../../../core/repository/index.js").DataSourceResponse<import("../../../../../external/backend-api/index.js").PagedRelationResponseModel>>;
|
|
30
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { RelationResource } from '../../../../../external/backend-api/index.js';
|
|
2
|
+
import { tryExecuteAndNotify } from '../../../../../shared/resources/index.js';
|
|
3
|
+
/**
|
|
4
|
+
* A data source for the Relation that fetches data from the server
|
|
5
|
+
* @export
|
|
6
|
+
* @class UmbRelationServerDataSource
|
|
7
|
+
* @implements {RepositoryDetailDataSource}
|
|
8
|
+
*/
|
|
9
|
+
export class UmbRelationServerDataSource {
|
|
10
|
+
#host;
|
|
11
|
+
/**
|
|
12
|
+
* Creates an instance of UmbRelationServerDataSource.
|
|
13
|
+
* @param {UmbControllerHost} host
|
|
14
|
+
* @memberof UmbRelationServerDataSource
|
|
15
|
+
*/
|
|
16
|
+
constructor(host) {
|
|
17
|
+
this.#host = host;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Fetches relations by the given id from the server
|
|
21
|
+
* @param {string} id
|
|
22
|
+
* @return {*}
|
|
23
|
+
* @memberof UmbRelationServerDataSource
|
|
24
|
+
*/
|
|
25
|
+
async read(id) {
|
|
26
|
+
if (!id) {
|
|
27
|
+
throw new Error('Id is missing');
|
|
28
|
+
}
|
|
29
|
+
return tryExecuteAndNotify(this.#host, RelationResource.getRelationTypeById({
|
|
30
|
+
id,
|
|
31
|
+
}));
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Fetches relations by the given id from the server
|
|
35
|
+
* @param {string} childId
|
|
36
|
+
* @return {*}
|
|
37
|
+
* @memberof UmbRelationServerDataSource
|
|
38
|
+
*/
|
|
39
|
+
async readChildRelations(childId, relationTypeAlias) {
|
|
40
|
+
if (!childId) {
|
|
41
|
+
throw new Error('Id is missing');
|
|
42
|
+
}
|
|
43
|
+
return tryExecuteAndNotify(this.#host, RelationResource.getRelationChildRelationByChildId({
|
|
44
|
+
childId,
|
|
45
|
+
relationTypeAlias,
|
|
46
|
+
}));
|
|
47
|
+
}
|
|
48
|
+
}
|
|
@@ -1,14 +1,12 @@
|
|
|
1
1
|
import { manifests as dashboardManifests } from './dashboards/manifests.js';
|
|
2
2
|
import { manifests as extensionManifests } from './extensions/manifests.js';
|
|
3
3
|
import { manifests as languageManifests } from './languages/manifests.js';
|
|
4
|
-
import { manifests as relationTypeManifests } from './relation-types/manifests.js';
|
|
5
4
|
import { manifests as settingsMenuManifests } from './menu.manifests.js';
|
|
6
5
|
import { manifests as settingsSectionManifests } from './section.manifests.js';
|
|
7
6
|
export const manifests = [
|
|
8
7
|
...dashboardManifests,
|
|
9
8
|
...extensionManifests,
|
|
10
9
|
...languageManifests,
|
|
11
|
-
...relationTypeManifests,
|
|
12
10
|
...settingsMenuManifests,
|
|
13
11
|
...settingsSectionManifests,
|
|
14
12
|
];
|