Merge pull request #1950 from umbraco/feature/structure-manager-expose-content-type-aliases

expose uniques and aliases in structure manager
This commit is contained in:
Niels Lyngsø
2024-05-29 14:45:04 +02:00
committed by GitHub

View File

@@ -46,6 +46,8 @@ export class UmbContentTypeStructureManager<
private readonly _contentTypeContainers = this.#contentTypes.asObservablePart((x) =>
x.flatMap((x) => x.containers ?? []),
);
readonly contentTypeUniques = this.#contentTypes.asObservablePart((x) => x.map((y) => y.unique));
readonly contentTypeAliases = this.#contentTypes.asObservablePart((x) => x.map((y) => y.alias));
#containers: UmbArrayState<UmbPropertyTypeContainerModel> = new UmbArrayState<UmbPropertyTypeContainerModel>(
[],
@@ -205,6 +207,12 @@ export class UmbContentTypeStructureManager<
getContentTypes() {
return this.#contentTypes.getValue();
}
getContentTypeUniques() {
return this.#contentTypes.getValue().map((x) => x.unique);
}
getContentTypeAliases() {
return this.#contentTypes.getValue().map((x) => x.alias);
}
// TODO: We could move the actions to another class?