From c2f5274b9e588231a2b9dc60f98fef8e12769393 Mon Sep 17 00:00:00 2001 From: JesmoDev <26099018+JesmoDev@users.noreply.github.com> Date: Tue, 7 May 2024 10:44:48 +0200 Subject: [PATCH 1/2] move request collection to ctor --- .../core/collection/default/collection-default.element.ts | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/packages/core/collection/default/collection-default.element.ts b/src/Umbraco.Web.UI.Client/src/packages/core/collection/default/collection-default.element.ts index 6a60bd56aa..f57b0043b8 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/core/collection/default/collection-default.element.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/core/collection/default/collection-default.element.ts @@ -32,15 +32,11 @@ export class UmbCollectionDefaultElement extends UmbLitElement { super(); this.consumeContext(UMB_COLLECTION_CONTEXT, (context) => { this.#collectionContext = context; + this.#collectionContext?.requestCollection(); this.#observeCollectionRoutes(); }); } - protected firstUpdated(_changedProperties: PropertyValueMap | Map): void { - super.firstUpdated(_changedProperties); - this.#collectionContext?.requestCollection(); - } - #observeCollectionRoutes() { if (!this.#collectionContext) return; From b4e0547a2e613f0e5dae297f8862d65b6606af89 Mon Sep 17 00:00:00 2001 From: JesmoDev <26099018+JesmoDev@users.noreply.github.com> Date: Tue, 7 May 2024 10:48:25 +0200 Subject: [PATCH 2/2] action bundle fix --- .../collection-action-bundle.element.ts | 23 ++----------------- 1 file changed, 2 insertions(+), 21 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/packages/core/collection/components/collection-action-bundle.element.ts b/src/Umbraco.Web.UI.Client/src/packages/core/collection/components/collection-action-bundle.element.ts index 618bd45126..048cc93bae 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/core/collection/components/collection-action-bundle.element.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/core/collection/components/collection-action-bundle.element.ts @@ -1,29 +1,10 @@ -import type { UmbDefaultCollectionContext } from '../default/collection-default.context.js'; -import { UMB_COLLECTION_CONTEXT } from '../default/collection-default.context.js'; -import { html, customElement, state, nothing } from '@umbraco-cms/backoffice/external/lit'; +import { html, customElement } from '@umbraco-cms/backoffice/external/lit'; import { UmbLitElement } from '@umbraco-cms/backoffice/lit-element'; @customElement('umb-collection-action-bundle') export class UmbCollectionActionBundleElement extends UmbLitElement { - #collectionContext?: UmbDefaultCollectionContext; - - @state() - _collectionAlias? = ''; - - constructor() { - super(); - - this.consumeContext(UMB_COLLECTION_CONTEXT, (context) => { - this.#collectionContext = context; - if (!this.#collectionContext) return; - this._collectionAlias = this.#collectionContext.getManifest()?.alias; - }); - } - render() { - return html` - ${this._collectionAlias ? html`` : nothing} - `; + return html``; } }