diff --git a/src/Umbraco.Web.UI.Client/src/packages/core/property-editor/schemas/Umbraco.ListView.ts b/src/Umbraco.Web.UI.Client/src/packages/core/property-editor/schemas/Umbraco.ListView.ts index d4d84e4408..9a879ae4fc 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/core/property-editor/schemas/Umbraco.ListView.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/core/property-editor/schemas/Umbraco.ListView.ts @@ -5,7 +5,7 @@ export const manifest: ManifestPropertyEditorSchema = { name: 'List View', alias: 'Umbraco.ListView', meta: { - defaultPropertyEditorUiAlias: 'Umb.PropertyEditorUi.ListView', + defaultPropertyEditorUiAlias: 'Umb.PropertyEditorUi.CollectionView', settings: { properties: [ { diff --git a/src/Umbraco.Web.UI.Client/src/packages/core/property-editor/uis/collection-view/config/bulk-action-permissions/property-editor-ui-collection-view-bulk-action-permissions.element.ts b/src/Umbraco.Web.UI.Client/src/packages/core/property-editor/uis/collection-view/config/bulk-action-permissions/property-editor-ui-collection-view-bulk-action-permissions.element.ts index 6d0506b9fc..4e15d171a8 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/core/property-editor/uis/collection-view/config/bulk-action-permissions/property-editor-ui-collection-view-bulk-action-permissions.element.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/core/property-editor/uis/collection-view/config/bulk-action-permissions/property-editor-ui-collection-view-bulk-action-permissions.element.ts @@ -1,5 +1,5 @@ import { UmbPropertyEditorUiElement } from '@umbraco-cms/backoffice/extension-registry'; -import { html, customElement, property } from '@umbraco-cms/backoffice/external/lit'; +import { html, customElement, property, css } from '@umbraco-cms/backoffice/external/lit'; import { UUIBooleanInputEvent } from '@umbraco-cms/backoffice/external/uui'; import { UmbPropertyEditorConfigCollection, @@ -16,11 +16,11 @@ type BulkActionPermissionType = | 'allowBulkUnpublish'; interface BulkActionPermissions { - allowBulkCopy?: boolean; - allowBulkDelete?: boolean; - allowBulkMove?: boolean; - allowBulkPublish?: boolean; - allowBulkUnpublish?: boolean; + allowBulkCopy: boolean; + allowBulkDelete: boolean; + allowBulkMove: boolean; + allowBulkPublish: boolean; + allowBulkUnpublish: boolean; } /** @@ -31,8 +31,22 @@ export class UmbPropertyEditorUICollectionViewBulkActionPermissionsElement extends UmbLitElement implements UmbPropertyEditorUiElement { + private _value: BulkActionPermissions = { + allowBulkPublish: false, + allowBulkUnpublish: false, + allowBulkCopy: false, + allowBulkDelete: false, + allowBulkMove: false, + }; + @property({ type: Object }) - value: BulkActionPermissions = {}; + public set value(obj: BulkActionPermissions) { + if (!obj) return; + this._value = obj; + } + public get value() { + return this._value; + } @property({ type: Object, attribute: false }) public config?: UmbPropertyEditorConfigCollection; @@ -40,43 +54,56 @@ export class UmbPropertyEditorUICollectionViewBulkActionPermissionsElement #onChange(e: UUIBooleanInputEvent, type: BulkActionPermissionType) { switch (type) { case 'allowBulkPublish': - this.value.allowBulkPublish = e.target.checked; + this.value = { ...this.value, allowBulkPublish: e.target.checked }; break; case 'allowBulkUnpublish': - this.value.allowBulkUnpublish = e.target.checked; + this.value = { ...this.value, allowBulkUnpublish: e.target.checked }; break; case 'allowBulkMove': - this.value.allowBulkMove = e.target.checked; + this.value = { ...this.value, allowBulkMove: e.target.checked }; break; case 'allowBulkCopy': - this.value.allowBulkCopy = e.target.checked; + this.value = { ...this.value, allowBulkCopy: e.target.checked }; break; case 'allowBulkDelete': - this.value.allowBulkDelete = e.target.checked; + this.value = { ...this.value, allowBulkDelete: e.target.checked }; break; } this.dispatchEvent(new UmbPropertyValueChangeEvent()); } render() { - return html` this.#onChange(e, 'allowBulkPublish')} - label="Allow bulk publish (content only)"> - + this.#onChange(e, 'allowBulkUnpublish')} - label="Allow bulk unpublish (content only)"> - + this.#onChange(e, 'allowBulkCopy')} - label="Allow bulk copy (content only)"> - + this.#onChange(e, 'allowBulkMove')} - label="Allow bulk move"> - + this.#onChange(e, 'allowBulkDelete')} - label="Allow bulk delete"> `; + label="Allow bulk delete"> `; } - static styles = [UmbTextStyles]; + static styles = [ + UmbTextStyles, + css` + :host { + display: flex; + flex-direction: column; + } + `, + ]; } export default UmbPropertyEditorUICollectionViewBulkActionPermissionsElement;