Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ export class UmbPropertyEditorUIBlockGridAreaTypePermissionElement
@state()
private _value: Array<UmbBlockGridTypeAreaTypePermission> = [];

_blockTypes: Array<UmbBlockTypeWithGroupKey> = [];
@state()
private _blockTypes?: Array<UmbBlockTypeWithGroupKey>;

@state()
private _blockTypesWithElementName: Array<{ type: UmbBlockTypeWithGroupKey; name: string }> = [];
Expand All @@ -48,7 +49,7 @@ export class UmbPropertyEditorUIBlockGridAreaTypePermissionElement
this.observe(this.#itemsManager.items, (items) => {
this._blockTypesWithElementName = items
.map((item) => {
const blockType = this._blockTypes.find((block) => block.contentElementTypeKey === item.unique);
const blockType = this._blockTypes?.find((block) => block.contentElementTypeKey === item.unique);
if (blockType) {
return { type: blockType, name: item.name };
}
Expand Down Expand Up @@ -123,9 +124,12 @@ export class UmbPropertyEditorUIBlockGridAreaTypePermissionElement
}

override render() {
if (this._blockTypesWithElementName.length === 0) {
if (this._blockTypes === undefined) {
return nothing;
}
if (this._blockTypesWithElementName.length === 0) {
return 'There must be one Block Type created before permissions can be configured.';
}
return html`<div id="permissions">
${repeat(
this._value,
Expand Down
Loading