diff --git a/src/Umbraco.Web.UI.Client/src/backoffice/editors/data-type/views/edit/editor-view-data-type-edit.element.ts b/src/Umbraco.Web.UI.Client/src/backoffice/editors/data-type/views/edit/editor-view-data-type-edit.element.ts index 26a0f111e0..831ccf4f10 100644 --- a/src/Umbraco.Web.UI.Client/src/backoffice/editors/data-type/views/edit/editor-view-data-type-edit.element.ts +++ b/src/Umbraco.Web.UI.Client/src/backoffice/editors/data-type/views/edit/editor-view-data-type-edit.element.ts @@ -170,10 +170,12 @@ export class UmbEditorViewDataTypeEditElement extends UmbContextConsumerMixin(Li } private _openPropertyEditorUIPicker() { - if (!this._dataType) return; + if (!this._dataType || !this._dataType.propertyEditorAlias) return; - const selection = this._dataType.propertyEditorUIAlias ? [this._dataType.propertyEditorUIAlias] : []; - const modalHandler = this._modalService?.propertyEditorUIPicker({ selection }); + const modalHandler = this._modalService?.propertyEditorUIPicker({ + propertyEditorAlias: this._dataType.propertyEditorAlias, + selection: this._dataType.propertyEditorUIAlias ? [this._dataType.propertyEditorUIAlias] : [], + }); modalHandler?.onClose().then(({ selection } = {}) => { if (!selection) return; diff --git a/src/Umbraco.Web.UI.Client/src/core/services/modal/layouts/property-editor-ui-picker/modal-layout-property-editor-ui-picker.element.ts b/src/Umbraco.Web.UI.Client/src/core/services/modal/layouts/property-editor-ui-picker/modal-layout-property-editor-ui-picker.element.ts index 6d3d395714..7f528c1c05 100644 --- a/src/Umbraco.Web.UI.Client/src/core/services/modal/layouts/property-editor-ui-picker/modal-layout-property-editor-ui-picker.element.ts +++ b/src/Umbraco.Web.UI.Client/src/core/services/modal/layouts/property-editor-ui-picker/modal-layout-property-editor-ui-picker.element.ts @@ -4,13 +4,14 @@ import { customElement, property, state } from 'lit/decorators.js'; import { ifDefined } from 'lit-html/directives/if-defined.js'; import { UmbContextConsumerMixin } from '../../../../context'; -import type { Subscription } from 'rxjs'; +import { map, Subscription } from 'rxjs'; import type { UUIComboboxListElement, UUIComboboxListEvent } from '@umbraco-ui/uui'; import type { UmbModalHandler } from '../../modal-handler'; import type { UmbExtensionRegistry } from '../../../../extension'; import type { ManifestPropertyEditorUI } from '../../../../models'; export interface UmbModalPropertyEditorUIPickerData { + propertyEditorAlias: string; selection?: Array; } @@ -49,8 +50,17 @@ export class UmbModalLayoutPropertyEditorUIPickerElement extends UmbContextConsu } private _usePropertyEditorUIs() { + if (!this.data) return; + this._propertyEditorUIsSubscription = this._extensionRegistry ?.extensionsOfType('propertyEditorUI') + .pipe( + map((propertyEditorUIs) => + propertyEditorUIs.filter((propertyEditorUI) => + propertyEditorUI.meta.propertyEditors.includes(this.data?.propertyEditorAlias ?? '') + ) + ) + ) .subscribe((propertyEditorUIs) => { this._propertyEditorUIs = propertyEditorUIs; });