Skip to content

Commit 05e4ac9

Browse files
committed
Attempt to improve performance by getting all extension of types once in context constructor and filtering from that.
1 parent 0774248 commit 05e4ac9

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

src/Umbraco.Web.UI.Client/src/packages/documents/documents/collection/document-collection.context.ts

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,19 @@ export class UmbDocumentCollectionContext extends UmbDefaultCollectionContext<
3131
#displayCulture = new UmbStringState(undefined);
3232
#displayCultureObservable = this.#displayCulture.asObservable();
3333

34+
#propertyValuePresentationManifests: ManifestPropertyValuePresentation[] = [];
35+
3436
constructor(host: UmbControllerHost) {
3537
super(host, UMB_DOCUMENT_TABLE_COLLECTION_VIEW_ALIAS);
3638

3739
this.consumeContext(UMB_VARIANT_CONTEXT, async (variantContext) => {
3840
this.#variantContext = variantContext;
3941
this.#observeDisplayCulture();
4042
});
43+
44+
this.#propertyValuePresentationManifests = umbExtensionsRegistry.getByType(
45+
'propertyValuePresentation',
46+
);
4147
}
4248

4349
#observeDisplayCulture() {
@@ -116,10 +122,7 @@ export class UmbDocumentCollectionContext extends UmbDefaultCollectionContext<
116122
}
117123

118124
#getPropertyValuePresentationManifest(propertyEditorAlias: string) {
119-
return umbExtensionsRegistry.getByTypeAndFilter(
120-
'propertyValuePresentation',
121-
(manifest) => manifest.propertyEditorAlias === propertyEditorAlias,
122-
);
125+
return this.#propertyValuePresentationManifests.filter((manifest) => manifest.propertyEditorAlias === propertyEditorAlias);
123126
}
124127
}
125128

0 commit comments

Comments
 (0)