From 447abdc048f269e04b969b3d569b98167b90942d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niels=20Lyngs=C3=B8?= Date: Fri, 20 Dec 2024 22:15:55 +0100 Subject: [PATCH] a few notes --- .../core/content/workspace/content-detail-workspace-base.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/Umbraco.Web.UI.Client/src/packages/core/content/workspace/content-detail-workspace-base.ts b/src/Umbraco.Web.UI.Client/src/packages/core/content/workspace/content-detail-workspace-base.ts index f1e63e4900ed..abbe8669623e 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/core/content/workspace/content-detail-workspace-base.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/core/content/workspace/content-detail-workspace-base.ts @@ -112,6 +112,9 @@ export abstract class UmbContentDetailWorkspaceContextBase< abstract readonly contentTypeUnique: Observable; /* Data Type */ + // This dataTypeItemManager is used to load the data type items for this content type, so we have all data-types for this content type up front. [NL] + // But once we have a propert application cache this could be solved in a way where we ask the cache for the data type items. [NL] + // And then we do not need to store them here in a local manager, but instead just request them here up-front and then again needed(which would get them from the cache, which as well could be update while this runs) [NL] readonly #dataTypeItemManager = new UmbDataTypeItemRepositoryManager(this); #varies?: boolean; @@ -410,8 +413,10 @@ export abstract class UmbContentDetailWorkspaceContextBase< throw new Error(`Property alias "${alias}" not found.`); } + // the getItemByUnique is a async method that first resolves once the item is loaded. const editorAlias = (await this.#dataTypeItemManager.getItemByUnique(property.dataType.unique)) .propertyEditorSchemaAlias; + // This means if its not loaded this will never resolve and the error below will never happen. if (!editorAlias) { throw new Error(`Editor Alias of "${property.dataType.unique}" not found.`); }