diff --git a/src/Umbraco.Web.UI.Client/src/packages/block/block-grid/context/block-grid-entries.context.ts b/src/Umbraco.Web.UI.Client/src/packages/block/block-grid/context/block-grid-entries.context.ts index 6c5ce9d51b..21ef577a45 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/block/block-grid/context/block-grid-entries.context.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/block/block-grid/context/block-grid-entries.context.ts @@ -490,7 +490,7 @@ export class UmbBlockGridEntriesContext .filter((blockType) => blockType.groupKey === rule.groupKey && blockType.allowInAreas === true) .map((x) => x.contentElementTypeKey) ?? []; const groupAmount = layoutEntries.filter((entry) => { - const contentTypeKey = this._manager!.getContentTypeKeyOf(entry.contentUdi); + const contentTypeKey = this._manager!.getContentTypeKeyOfContentUdi(entry.contentUdi); return contentTypeKey ? groupElementTypeKeys.indexOf(contentTypeKey) !== -1 : false; }).length; @@ -503,6 +503,7 @@ export class UmbBlockGridEntriesContext maxRequirement: maxAllowed, }; } + return undefined; } // For specific elementTypes: else if (rule.elementTypeKey) { @@ -519,6 +520,7 @@ export class UmbBlockGridEntriesContext maxRequirement: maxAllowed, }; } + return undefined; } // Lets fail cause the rule was bad. diff --git a/src/Umbraco.Web.UI.Client/src/packages/block/block-grid/workspace/block-grid-type-workspace.modal-token.ts b/src/Umbraco.Web.UI.Client/src/packages/block/block-grid/workspace/block-grid-type-workspace.modal-token.ts index f45bce646e..19d76caa88 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/block/block-grid/workspace/block-grid-type-workspace.modal-token.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/block/block-grid/workspace/block-grid-type-workspace.modal-token.ts @@ -14,7 +14,7 @@ export const UMB_BLOCK_GRID_TYPE_WORKSPACE_MODAL = new UmbModalToken< type: 'sidebar', size: 'large', }, - data: { entityType: UMB_BLOCK_GRID_TYPE, preset: { allowAtRoot: true } }, + data: { entityType: UMB_BLOCK_GRID_TYPE, preset: { allowAtRoot: true, allowInAreas: true } }, }, // Recast the type, so the entityType data prop is not required: ) as UmbModalToken, UmbWorkspaceModalValue>; diff --git a/src/Umbraco.Web.UI.Client/src/packages/block/block/context/block-manager.context.ts b/src/Umbraco.Web.UI.Client/src/packages/block/block/context/block-manager.context.ts index df113d9b81..f44da55be5 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/block/block/context/block-manager.context.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/block/block/context/block-manager.context.ts @@ -139,6 +139,9 @@ export abstract class UmbBlockManagerContext< this.#contentTypes.appendOne(data); } + getContentTypeKeyOfContentUdi(contentUdi: string) { + return this.getContentOf(contentUdi)?.contentTypeKey; + } contentTypeOf(contentTypeKey: string) { return this.#contentTypes.asObservablePart((source) => source.find((x) => x.unique === contentTypeKey)); } @@ -148,9 +151,6 @@ export abstract class UmbBlockManagerContext< getContentTypeNameOf(contentTypeKey: string) { return this.#contentTypes.getValue().find((x) => x.unique === contentTypeKey)?.name; } - getContentTypeKeyOf(contentTypeKey: string) { - return this.#contentTypes.getValue().find((x) => x.unique === contentTypeKey)?.unique; - } getContentTypeHasProperties(contentTypeKey: string) { const properties = this.#contentTypes.getValue().find((x) => x.unique === contentTypeKey)?.properties; return properties ? properties.length > 0 : false;