clear out the pickableFilter as it could cause trouble and is not used now.
This commit is contained in:
@@ -29,11 +29,23 @@ export class UmbBlockTypeListWorkspaceViewSettingsElement extends UmbLitElement
|
||||
<umb-property
|
||||
label="Content Model"
|
||||
alias="contentElementTypeKey"
|
||||
property-editor-ui-alias="Umb.PropertyEditorUi.ElementTypePicker"></umb-property>
|
||||
property-editor-ui-alias="Umb.PropertyEditorUi.DocumentTypePicker"
|
||||
.config=${[
|
||||
{
|
||||
alias: 'onlyPickElementTypes',
|
||||
value: true,
|
||||
},
|
||||
]}></umb-property>
|
||||
<umb-property
|
||||
label="Settings Model"
|
||||
alias="settingsElementTypeKey"
|
||||
property-editor-ui-alias="Umb.PropertyEditorUi.ElementTypePicker"></umb-property>
|
||||
property-editor-ui-alias="Umb.PropertyEditorUi.DocumentTypePicker"
|
||||
.config=${[
|
||||
{
|
||||
alias: 'onlyPickElementTypes',
|
||||
value: true,
|
||||
},
|
||||
]}></umb-property>
|
||||
</uui-box>
|
||||
<uui-box headline="Catalogue appearance">
|
||||
<umb-property
|
||||
|
||||
@@ -66,14 +66,6 @@ export class UmbDataTypeInputElement extends FormControlMixin(UmbLitElement) {
|
||||
this.selectedIds = splitStringToArray(idsString);
|
||||
}
|
||||
|
||||
@property()
|
||||
get pickableFilter() {
|
||||
return this.#pickerContext.pickableFilter;
|
||||
}
|
||||
set pickableFilter(newVal) {
|
||||
this.#pickerContext.pickableFilter = newVal;
|
||||
}
|
||||
|
||||
@state()
|
||||
private _items?: Array<DataTypeItemResponseModel>;
|
||||
|
||||
|
||||
@@ -19,8 +19,6 @@ export class UmbPickerInputContext<ItemType extends { name: string }> extends Um
|
||||
|
||||
public modalManager?: UmbModalManagerContext;
|
||||
|
||||
public pickableFilter?: (item: ItemType) => boolean = () => true;
|
||||
|
||||
#init: Promise<unknown>;
|
||||
|
||||
#itemManager;
|
||||
@@ -74,7 +72,6 @@ export class UmbPickerInputContext<ItemType extends { name: string }> extends Um
|
||||
const modalContext = this.modalManager.open(this.modalAlias, {
|
||||
data: {
|
||||
multiple: this.max === 1 ? false : true,
|
||||
pickableFilter: this.pickableFilter,
|
||||
...pickerData,
|
||||
},
|
||||
value: {
|
||||
|
||||
@@ -75,14 +75,6 @@ export class UmbInputDocumentTypeElement extends FormControlMixin(UmbLitElement)
|
||||
this.selectedIds = splitStringToArray(idsString);
|
||||
}
|
||||
|
||||
@property()
|
||||
get pickableFilter() {
|
||||
return this.#pickerContext.pickableFilter;
|
||||
}
|
||||
set pickableFilter(newVal) {
|
||||
this.#pickerContext.pickableFilter = newVal;
|
||||
}
|
||||
|
||||
@state()
|
||||
private _items?: Array<DocumentTypeItemResponseModel>;
|
||||
|
||||
|
||||
@@ -17,6 +17,12 @@ export const manifest: ManifestPropertyEditorUi = {
|
||||
description: 'Opens the node in a dialog',
|
||||
propertyEditorUiAlias: 'Umb.PropertyEditorUi.Toggle',
|
||||
},
|
||||
{
|
||||
alias: 'onlyPickElementTypes',
|
||||
label: 'Only Element Types',
|
||||
description: 'Limit to only pick Element Types',
|
||||
propertyEditorUiAlias: 'Umb.PropertyEditorUi.Toggle',
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
|
||||
@@ -18,16 +18,21 @@ export class UmbPropertyEditorUIDocumentTypePickerElement extends UmbLitElement
|
||||
|
||||
@property({ attribute: false })
|
||||
public set config(config: UmbPropertyEditorConfigCollection | undefined) {
|
||||
const validationLimit = config?.find((x) => x.alias === 'validationLimit');
|
||||
if (config) {
|
||||
const validationLimit = config.getValueByAlias<any>('validationLimit');
|
||||
this._limitMin = validationLimit?.min;
|
||||
this._limitMax = validationLimit?.max;
|
||||
|
||||
this._limitMin = (validationLimit?.value as any)?.min;
|
||||
this._limitMax = (validationLimit?.value as any)?.max;
|
||||
this._onlyElementTypes = config.getValueByAlias('onlyPickElementTypes');
|
||||
}
|
||||
}
|
||||
|
||||
@state()
|
||||
private _limitMin?: number;
|
||||
@state()
|
||||
private _limitMax?: number;
|
||||
@state()
|
||||
private _onlyElementTypes?: boolean;
|
||||
|
||||
private _onChange(event: CustomEvent) {
|
||||
this.value = (event.target as UmbInputDocumentTypeElement).selectedIds;
|
||||
@@ -42,6 +47,7 @@ export class UmbPropertyEditorUIDocumentTypePickerElement extends UmbLitElement
|
||||
.selectedIds=${this._value}
|
||||
.min=${this._limitMin ?? 0}
|
||||
.max=${this._limitMax ?? Infinity}
|
||||
.element-types-only=${this._onlyElementTypes}
|
||||
>Add</umb-input-document-type
|
||||
>
|
||||
`;
|
||||
|
||||
@@ -66,14 +66,6 @@ export class UmbMediaTypeInputElement extends FormControlMixin(UmbLitElement) {
|
||||
this.selectedIds = splitStringToArray(idsString);
|
||||
}
|
||||
|
||||
@property()
|
||||
get pickableFilter() {
|
||||
return this.#pickerContext.pickableFilter;
|
||||
}
|
||||
set pickableFilter(newVal) {
|
||||
this.#pickerContext.pickableFilter = newVal;
|
||||
}
|
||||
|
||||
@state()
|
||||
private _items?: Array<MediaTypeItemResponseModel>;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user