diff --git a/src/Umbraco.Web.UI.Client/src/packages/core/components/input-multi-url/input-multi-url.element.ts b/src/Umbraco.Web.UI.Client/src/packages/core/components/input-multi-url/input-multi-url.element.ts index 9cae53ef03..105c52c291 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/core/components/input-multi-url/input-multi-url.element.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/core/components/input-multi-url/input-multi-url.element.ts @@ -3,12 +3,8 @@ import { FormControlMixin } from '@umbraco-cms/backoffice/external/uui'; import type { UUIModalSidebarSize } from '@umbraco-cms/backoffice/external/uui'; import { UmbLitElement } from '@umbraco-cms/internal/lit-element'; import type { UmbVariantId } from '@umbraco-cms/backoffice/variant'; -import { - UMB_LINK_PICKER_MODAL, - UmbModalRouteRegistrationController, -} from '@umbraco-cms/backoffice/modal'; -import type { UmbModalRouteBuilder , - UmbLinkPickerLink} from '@umbraco-cms/backoffice/modal'; +import { UMB_LINK_PICKER_MODAL, UmbModalRouteRegistrationController } from '@umbraco-cms/backoffice/modal'; +import type { UmbModalRouteBuilder, UmbLinkPickerLink } from '@umbraco-cms/backoffice/modal'; /** * @element umb-input-multi-url @@ -109,6 +105,7 @@ export class UmbInputMultiUrlElement extends FormControlMixin(UmbLitElement) { constructor() { super(); + this.addValidator( 'rangeUnderflow', () => this.minMessage, @@ -155,7 +152,8 @@ export class UmbInputMultiUrlElement extends FormControlMixin(UmbLitElement) { queryString: data?.queryString, target: data?.target, trashed: data?.trashed, - udi: data?.udi, + type: data?.type, + unique: data?.unique, url: data?.url, }, }, diff --git a/src/Umbraco.Web.UI.Client/src/packages/core/modal/common/link-picker/link-picker-modal.element.ts b/src/Umbraco.Web.UI.Client/src/packages/core/modal/common/link-picker/link-picker-modal.element.ts index f0fa3a54cd..50ada2ee67 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/core/modal/common/link-picker/link-picker-modal.element.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/core/modal/common/link-picker/link-picker-modal.element.ts @@ -4,11 +4,11 @@ import type { UUIBooleanInputEvent, UUIInputElement } from '@umbraco-cms/backoff import type { UmbLinkPickerConfig, UmbLinkPickerLink, + UmbLinkPickerLinkType, UmbLinkPickerModalData, UmbLinkPickerModalValue, } from '@umbraco-cms/backoffice/modal'; import { UmbModalBaseElement } from '@umbraco-cms/backoffice/modal'; -import { buildUdi, getKeyFromUdi } from '@umbraco-cms/backoffice/utils'; import { UMB_DOCUMENT_TREE_ALIAS } from '@umbraco-cms/backoffice/document'; @customElement('umb-link-picker-modal') @@ -57,7 +57,7 @@ export class UmbLinkPickerModalElement extends UmbModalBaseElement { (this._link as any) = value.link; - this._selectedKey = this._link?.udi ? getKeyFromUdi(this._link.udi) : undefined; + this._selectedKey = this._link?.unique ?? undefined; this._selectionConfiguration.selection = this._selectedKey ? [this._selectedKey] : []; }); } @@ -88,18 +88,18 @@ export class UmbLinkPickerModalElement extends UmbModalBaseElement this.#partialUpdateLink({ url: this._linkInput.value as string })} - ?disabled="${this._link.udi ? true : false}"> + .value="${this._link.unique ?? this._link.url ?? ''}" + @input=${() => this.#partialUpdateLink({ type: 'external', url: this._linkInput.value as string })} + ?disabled="${this._link.unique ? true : false}"> `; } diff --git a/src/Umbraco.Web.UI.Client/src/packages/core/modal/token/link-picker-modal.token.ts b/src/Umbraco.Web.UI.Client/src/packages/core/modal/token/link-picker-modal.token.ts index 7c3b0f935d..8a2f3286c2 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/core/modal/token/link-picker-modal.token.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/core/modal/token/link-picker-modal.token.ts @@ -15,10 +15,13 @@ export interface UmbLinkPickerLink { queryString?: string | null; target?: string | null; trashed?: boolean | null; - udi?: string | null; + type?: UmbLinkPickerLinkType | null; + unique?: string | null; url?: string | null; } +export type UmbLinkPickerLinkType = 'document' | 'external' | 'media'; + // TODO: investigate: this looks more like a property editor configuration. Is this used in the correct way? export interface UmbLinkPickerConfig { hideAnchor?: boolean;