From bfc83b0cd71802322011cc80e7c28abae47039ce Mon Sep 17 00:00:00 2001 From: Lone Iversen <108085781+loivsen@users.noreply.github.com> Date: Tue, 6 Feb 2024 17:03:27 +0100 Subject: [PATCH] notes --- .../composition-picker-modal.element.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/packages/documents/document-types/modals/composition-picker/composition-picker-modal.element.ts b/src/Umbraco.Web.UI.Client/src/packages/documents/document-types/modals/composition-picker/composition-picker-modal.element.ts index 0bf2ccb908..c6f5b8aab0 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/documents/document-types/modals/composition-picker/composition-picker-modal.element.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/documents/document-types/modals/composition-picker/composition-picker-modal.element.ts @@ -11,7 +11,10 @@ export class UmbCompositionPickerModalElement extends UmbModalBaseElement< UmbCompositionPickerModalData, UmbCompositionPickerModalValue > { - // + // TODO: We need to make a filter for the tree that hides the items that can't be used for composition. + // From what I've observed in old BO: Document types that inherit from other document types cannot be picked as a composition. (document types that are made under other document types) + // As well as other document types that has a composition already. + // OBS: If a document type 1 has a composition document type 2, document type 2 cannot add any compositions. @state() private _selectionConfiguration = { @@ -24,7 +27,9 @@ export class UmbCompositionPickerModalElement extends UmbModalBaseElement< super(); } - firstUpdated() { + connectedCallback() { + super.connectedCallback(); + this._selectionConfiguration = { ...this._selectionConfiguration, selection: (this.data?.selection as []) ?? [] }; }