You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Nov 6, 2025. It is now read-only.
Copy file name to clipboardExpand all lines: src/packages/core/content-type/structure/content-type-property-structure-helper.class.ts
+7-7Lines changed: 7 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -21,7 +21,7 @@ export class UmbContentTypePropertyStructureHelper<T extends UmbContentTypeModel
21
21
22
22
#structure?: UmbContentTypeStructureManager<T>;
23
23
24
-
private_containerId?: string|null;
24
+
#containerId?: string|null;
25
25
26
26
// State which holds all the properties of the current container, this is a composition of all properties from the containers that matches our target [NL]
@@ -61,12 +64,12 @@ export class UmbContentTypeStructureManager<
61
64
super(host);
62
65
this.#repository =typeRepository;
63
66
64
-
this.observe(this.contentTypes,(contentTypes)=>{
65
-
contentTypes.forEach((contentType)=>{
66
-
this._loadContentTypeCompositions(contentType);
67
-
});
67
+
// Observe owner content type compositions, as we only allow one level of compositions at this moment. [NL]
68
+
// But, we could support more, we would just need to flatMap all compositions and make sure the entries are unique and then base the observation on that. [NL]
// Owner content type was undefined, so we can not load compositions. But at this point we neither offload existing compositions, this is most likely not a case that needs to be handled.
@@ -164,23 +183,19 @@ export class UmbContentTypeStructureManager<
164
183
165
184
// Notice we do not store the content type in the store here, cause it will happen shortly after when the observations gets its first initial callback. [NL]
166
185
167
-
// Load inherited and composed types:
168
-
//this._loadContentTypeCompositions(data);// Should not be necessary as this will be done when appended to the contentTypes state. [NL]
169
-
170
186
constctrl=this.observe(
171
187
// Then lets start observation of the content type:
172
188
awaitthis.#repository.byUnique(data.unique),
173
189
(docType)=>{
174
190
if(docType){
175
-
// TODO: Handle if there was changes made to the owner document type in this context. [NL]
176
-
/*
177
-
possible easy solutions could be to notify user wether they want to update(Discard the changes to accept the new ones). [NL]
178
-
*/
179
191
this.#contentTypes.appendOne(docType);
192
+
}else{
193
+
// Remove the content type from the store, if it does not exist anymore.
194
+
this.#contentTypes.removeOne(data.unique);
180
195
}
181
-
// TODO: Do we need to handle the undefined case? [NL]
182
196
},
183
197
'observeContentType_'+data.unique,
198
+
// Controller Alias is used to stop observation when no longer needed. [NL]
0 commit comments