@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.
Files changed (123) hide show
  1. package/dist-cms/apps/backoffice/backoffice.element.js +1 -0
  2. package/dist-cms/assets/lang/da-dk.js +2 -0
  3. package/dist-cms/assets/lang/da-dk.ts +2 -0
  4. package/dist-cms/assets/lang/en-us.js +2 -0
  5. package/dist-cms/assets/lang/en-us.ts +2 -0
  6. package/dist-cms/custom-elements.json +96 -62
  7. package/dist-cms/mocks/browser-handlers.js +4 -1
  8. package/dist-cms/mocks/data/object-type/object-type.data.d.ts +8 -0
  9. package/dist-cms/mocks/data/object-type/object-type.data.js +28 -0
  10. package/dist-cms/mocks/data/{relation-type.data.d.ts → relations/relation-type.data.d.ts} +2 -2
  11. package/dist-cms/mocks/data/{relation-type.data.js → relations/relation-type.data.js} +2 -2
  12. package/dist-cms/mocks/data/relations/relation.data.d.ts +12 -0
  13. package/dist-cms/mocks/data/relations/relation.data.js +104 -0
  14. package/dist-cms/mocks/handlers/object-type/index.js +2 -0
  15. package/dist-cms/mocks/handlers/object-type/item.handlers.d.ts +1 -0
  16. package/dist-cms/mocks/handlers/object-type/item.handlers.js +10 -0
  17. package/dist-cms/mocks/handlers/object-type/slug.d.ts +1 -0
  18. package/dist-cms/mocks/handlers/object-type/slug.js +1 -0
  19. package/dist-cms/mocks/handlers/relations/index.d.ts +2 -0
  20. package/dist-cms/mocks/handlers/relations/index.js +2 -0
  21. package/dist-cms/mocks/handlers/relations/relation/index.d.ts +1 -0
  22. package/dist-cms/mocks/handlers/relations/relation/index.js +2 -0
  23. package/dist-cms/mocks/handlers/relations/relation/item.handlers.d.ts +1 -0
  24. package/dist-cms/mocks/handlers/relations/relation/item.handlers.js +13 -0
  25. package/dist-cms/mocks/handlers/relations/relation/slug.d.ts +1 -0
  26. package/dist-cms/mocks/handlers/relations/relation/slug.js +1 -0
  27. package/dist-cms/mocks/handlers/relations/relation-type/detail.handlers.d.ts +1 -0
  28. package/dist-cms/mocks/handlers/relations/relation-type/detail.handlers.js +41 -0
  29. package/dist-cms/mocks/handlers/relations/relation-type/index.d.ts +1 -0
  30. package/dist-cms/mocks/handlers/relations/relation-type/index.js +3 -0
  31. package/dist-cms/mocks/handlers/relations/relation-type/slug.d.ts +1 -0
  32. package/dist-cms/mocks/handlers/relations/relation-type/slug.js +1 -0
  33. package/dist-cms/mocks/handlers/relations/relation-type/tree.handlers.d.ts +1 -0
  34. package/dist-cms/mocks/handlers/relations/relation-type/tree.handlers.js +32 -0
  35. package/dist-cms/packages/core/components/input-start-node/input-start-node.element.d.ts +11 -3
  36. package/dist-cms/packages/core/components/input-start-node/input-start-node.element.js +26 -16
  37. package/dist-cms/packages/core/index.d.ts +1 -0
  38. package/dist-cms/packages/core/index.js +1 -0
  39. package/dist-cms/packages/core/object-type/index.d.ts +2 -0
  40. package/dist-cms/packages/core/object-type/index.js +2 -0
  41. package/dist-cms/packages/core/object-type/input-object-type.element.d.ts +20 -0
  42. package/dist-cms/packages/core/object-type/input-object-type.element.js +53 -0
  43. package/dist-cms/packages/core/object-type/object-type.repository.d.ts +11 -0
  44. package/dist-cms/packages/core/object-type/object-type.repository.js +17 -0
  45. package/dist-cms/packages/core/property-editor/uis/tree-picker/config/start-node/property-editor-ui-tree-picker-start-node.element.js +5 -3
  46. package/dist-cms/packages/documents/documents/components/index.d.ts +1 -0
  47. package/dist-cms/packages/documents/documents/components/index.js +1 -0
  48. package/dist-cms/packages/documents/documents/components/input-document-picker-root/input-document-picker-root.element.d.ts +19 -0
  49. package/dist-cms/packages/documents/documents/components/input-document-picker-root/input-document-picker-root.element.js +93 -0
  50. package/dist-cms/packages/members/member-types/workspace/member-type-workspace.context.js +1 -1
  51. package/dist-cms/packages/relations/index.d.ts +3 -0
  52. package/dist-cms/packages/relations/index.js +3 -0
  53. package/dist-cms/packages/relations/manifests.d.ts +1 -0
  54. package/dist-cms/packages/relations/manifests.js +3 -0
  55. package/dist-cms/packages/relations/relation-types/entity-actions/create.action.d.ts +7 -0
  56. package/dist-cms/packages/relations/relation-types/entity-actions/create.action.js +11 -0
  57. package/dist-cms/packages/relations/relation-types/entity-actions/manifests.d.ts +2 -0
  58. package/dist-cms/packages/relations/relation-types/entity-actions/manifests.js +32 -0
  59. package/dist-cms/packages/{settings → relations}/relation-types/index.d.ts +1 -0
  60. package/dist-cms/packages/{settings → relations}/relation-types/index.js +1 -0
  61. package/dist-cms/packages/relations/relation-types/manifests.d.ts +1 -0
  62. package/dist-cms/packages/{settings → relations}/relation-types/manifests.js +8 -1
  63. package/dist-cms/packages/{settings → relations}/relation-types/repository/manifests.js +1 -1
  64. package/dist-cms/packages/{settings → relations}/relation-types/repository/relation-type.repository.d.ts +4 -0
  65. package/dist-cms/packages/{settings → relations}/relation-types/repository/relation-type.repository.js +10 -0
  66. package/dist-cms/packages/{settings → relations}/relation-types/repository/sources/relation-type.server.data.d.ts +7 -0
  67. package/dist-cms/packages/{settings → relations}/relation-types/repository/sources/relation-type.server.data.js +25 -4
  68. package/dist-cms/packages/{settings → relations}/relation-types/workspace/relation-type-workspace.context.d.ts +4 -0
  69. package/dist-cms/packages/{settings → relations}/relation-types/workspace/relation-type-workspace.context.js +10 -3
  70. package/dist-cms/packages/{settings → relations}/relation-types/workspace/views/relation/workspace-view-relation-type-relation.element.d.ts +3 -1
  71. package/dist-cms/packages/{settings → relations}/relation-types/workspace/views/relation/workspace-view-relation-type-relation.element.js +16 -69
  72. package/dist-cms/packages/{settings → relations}/relation-types/workspace/views/relation-type/relation-type-workspace-view-relation-type.element.js +17 -5
  73. package/dist-cms/packages/relations/relations/entities.d.ts +1 -0
  74. package/dist-cms/packages/relations/relations/entities.js +1 -0
  75. package/dist-cms/packages/relations/relations/index.d.ts +2 -0
  76. package/dist-cms/packages/relations/relations/index.js +2 -0
  77. package/dist-cms/packages/relations/relations/manifests.d.ts +1 -0
  78. package/dist-cms/packages/relations/relations/manifests.js +2 -0
  79. package/dist-cms/packages/relations/relations/repository/index.d.ts +1 -0
  80. package/dist-cms/packages/relations/relations/repository/index.js +1 -0
  81. package/dist-cms/packages/relations/relations/repository/manifests.d.ts +3 -0
  82. package/dist-cms/packages/relations/relations/repository/manifests.js +9 -0
  83. package/dist-cms/packages/relations/relations/repository/relation.repository.d.ts +15 -0
  84. package/dist-cms/packages/relations/relations/repository/relation.repository.js +38 -0
  85. package/dist-cms/packages/relations/relations/repository/sources/relation.server.data.d.ts +30 -0
  86. package/dist-cms/packages/relations/relations/repository/sources/relation.server.data.js +48 -0
  87. package/dist-cms/packages/relations/umbraco-package.d.ts +7 -0
  88. package/dist-cms/packages/relations/umbraco-package.js +9 -0
  89. package/dist-cms/packages/settings/manifests.js +0 -2
  90. package/dist-cms/tsconfig.build.tsbuildinfo +1 -1
  91. package/dist-cms/vscode-html-custom-data.json +47 -30
  92. package/package.json +3 -2
  93. package/dist-cms/mocks/handlers/relation-type.handlers.js +0 -66
  94. package/dist-cms/packages/settings/relation-types/manifests.d.ts +0 -1
  95. /package/dist-cms/mocks/handlers/{relation-type.handlers.d.ts → object-type/index.d.ts} +0 -0
  96. /package/dist-cms/packages/{settings → relations}/relation-types/entities.d.ts +0 -0
  97. /package/dist-cms/packages/{settings → relations}/relation-types/entities.js +0 -0
  98. /package/dist-cms/packages/{settings → relations}/relation-types/menu-item/manifests.d.ts +0 -0
  99. /package/dist-cms/packages/{settings → relations}/relation-types/menu-item/manifests.js +0 -0
  100. /package/dist-cms/packages/{settings → relations}/relation-types/repository/index.d.ts +0 -0
  101. /package/dist-cms/packages/{settings → relations}/relation-types/repository/index.js +0 -0
  102. /package/dist-cms/packages/{settings → relations}/relation-types/repository/manifests.d.ts +0 -0
  103. /package/dist-cms/packages/{settings → relations}/relation-types/repository/relation-type.store.d.ts +0 -0
  104. /package/dist-cms/packages/{settings → relations}/relation-types/repository/relation-type.store.js +0 -0
  105. /package/dist-cms/packages/{settings → relations}/relation-types/tree/index.d.ts +0 -0
  106. /package/dist-cms/packages/{settings → relations}/relation-types/tree/index.js +0 -0
  107. /package/dist-cms/packages/{settings → relations}/relation-types/tree/manifests.d.ts +0 -0
  108. /package/dist-cms/packages/{settings → relations}/relation-types/tree/manifests.js +0 -0
  109. /package/dist-cms/packages/{settings → relations}/relation-types/tree/relation-type-tree.repository.d.ts +0 -0
  110. /package/dist-cms/packages/{settings → relations}/relation-types/tree/relation-type-tree.repository.js +0 -0
  111. /package/dist-cms/packages/{settings → relations}/relation-types/tree/relation-type-tree.server.data-source.d.ts +0 -0
  112. /package/dist-cms/packages/{settings → relations}/relation-types/tree/relation-type-tree.server.data-source.js +0 -0
  113. /package/dist-cms/packages/{settings → relations}/relation-types/tree/relation-type-tree.store.d.ts +0 -0
  114. /package/dist-cms/packages/{settings → relations}/relation-types/tree/relation-type-tree.store.js +0 -0
  115. /package/dist-cms/packages/{settings → relations}/relation-types/tree/types.d.ts +0 -0
  116. /package/dist-cms/packages/{settings → relations}/relation-types/tree/types.js +0 -0
  117. /package/dist-cms/packages/{settings → relations}/relation-types/workspace/manifests.d.ts +0 -0
  118. /package/dist-cms/packages/{settings → relations}/relation-types/workspace/manifests.js +0 -0
  119. /package/dist-cms/packages/{settings → relations}/relation-types/workspace/relation-type-workspace-editor.element.d.ts +0 -0
  120. /package/dist-cms/packages/{settings → relations}/relation-types/workspace/relation-type-workspace-editor.element.js +0 -0
  121. /package/dist-cms/packages/{settings → relations}/relation-types/workspace/relation-type-workspace.element.d.ts +0 -0
  122. /package/dist-cms/packages/{settings → relations}/relation-types/workspace/relation-type-workspace.element.js +0 -0
  123. /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(...arguments);
14
+ super();
13
15
  //TODO Use real data
14
- this._relations = MockData;
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
- key: relation.parentId + '-' + relation.childId,
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?.id)
71
+ if (!this.#workspaceContext?.getIsNew() && this._relationType)
64
72
  return html `<div slot="editor">${this._relationType.parentObjectTypeName}</div>`;
65
- return html `<uui-select slot="editor"></uui-select>`;
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?.id)
69
- return html `<div slot="editor">${this._relationType.parentObjectTypeName}</div>`;
70
- return html `<uui-select slot="editor"></uui-select>`;
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,2 @@
1
+ export * from './repository/index.js';
2
+ export * from './entities.js';
@@ -0,0 +1,2 @@
1
+ export * from './repository/index.js';
2
+ export * from './entities.js';
@@ -0,0 +1 @@
1
+ export declare const manifests: import("../../core/index.js").ManifestRepository<import("../../../libs/extension-api/index.js").UmbApi>[];
@@ -0,0 +1,2 @@
1
+ import { manifests as repositoryManifests } from './repository/manifests.js';
2
+ export const manifests = [...repositoryManifests];
@@ -0,0 +1 @@
1
+ export * from './relation.repository.js';
@@ -0,0 +1 @@
1
+ export * from './relation.repository.js';
@@ -0,0 +1,3 @@
1
+ import { ManifestRepository } from '../../../core/extension-registry/index.js';
2
+ export declare const UMB_RELATION_REPOSITORY_ALIAS = "Umb.Repository.Relation";
3
+ export declare const manifests: ManifestRepository<import("../../../../libs/extension-api/index.js").UmbApi>[];
@@ -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
+ }
@@ -0,0 +1,7 @@
1
+ export declare const name = "Umbraco.Core.Relations";
2
+ export declare const extensions: {
3
+ name: string;
4
+ alias: string;
5
+ type: string;
6
+ js: () => Promise<typeof import("./manifests.js")>;
7
+ }[];
@@ -0,0 +1,9 @@
1
+ export const name = 'Umbraco.Core.Relations';
2
+ export const extensions = [
3
+ {
4
+ name: 'Relations Bundle',
5
+ alias: 'Umb.Bundle.Relations',
6
+ type: 'bundle',
7
+ js: () => import('./manifests.js'),
8
+ },
9
+ ];
@@ -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
  ];