From 709c1dcb5abe82a77cb0b9b3c2565ea117e41000 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niels=20Lyngs=C3=B8?= Date: Sat, 24 Feb 2024 21:46:39 +0100 Subject: [PATCH] fix model issue --- ...rty-editor-ui-block-grid-type-configuration.element.ts | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/packages/block/block-grid/property-editors/block-grid-type-configuration/property-editor-ui-block-grid-type-configuration.element.ts b/src/Umbraco.Web.UI.Client/src/packages/block/block-grid/property-editors/block-grid-type-configuration/property-editor-ui-block-grid-type-configuration.element.ts index 701c21a229..359b4998b2 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/block/block-grid/property-editors/block-grid-type-configuration/property-editor-ui-block-grid-type-configuration.element.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/block/block-grid/property-editors/block-grid-type-configuration/property-editor-ui-block-grid-type-configuration.element.ts @@ -35,7 +35,6 @@ export class UmbPropertyEditorUIBlockGridTypeConfigurationElement extends UmbLitElement implements UmbPropertyEditorUiElement { - #model: Array = []; #sorter = new UmbSorterController(this, { getUniqueOfElement: (element) => element.getAttribute('data-umb-group-key'), getUniqueOfModel: (modelEntry) => modelEntry.key!, @@ -44,12 +43,11 @@ export class UmbPropertyEditorUIBlockGridTypeConfigurationElement containerSelector: '#groups', onChange: ({ model }) => { this._groupsWithBlockTypes = model; - this.#model = model; }, onEnd: () => { this.#datasetContext?.setPropertyValue( 'blockGroups', - this.#model.map((group) => ({ key: group.key, name: group.name })), + this._groupsWithBlockTypes.map((group) => ({ key: group.key, name: group.name })), ); }, }); @@ -136,10 +134,10 @@ export class UmbPropertyEditorUIBlockGridTypeConfigurationElement this.dispatchEvent(new UmbPropertyValueChangeEvent()); } - #onCreate(e: CustomEvent, groupKey: string | null) { + #onCreate(e: CustomEvent, groupKey?: string) { const selectedElementType = e.detail.contentElementTypeKey; if (selectedElementType) { - this.#blockTypeWorkspaceModalRegistration?.open({}, 'create/' + selectedElementType + '/' + groupKey); + this.#blockTypeWorkspaceModalRegistration?.open({}, 'create/' + selectedElementType + '/' + (groupKey ?? null)); } }