Skip to content

Commit

Permalink
a few notes
Browse files Browse the repository at this point in the history
  • Loading branch information
nielslyngsoe committed Dec 20, 2024
1 parent cca6676 commit 447abdc
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,9 @@ export abstract class UmbContentDetailWorkspaceContextBase<
abstract readonly contentTypeUnique: Observable<string | undefined>;

/* 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;
Expand Down Expand Up @@ -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.`);
}
Expand Down

0 comments on commit 447abdc

Please sign in to comment.