Bugfix: Document Picker: Ensures max=1

This is to support the legacy data format of the Content Picker,
as the backend will only accept a single `Guid` (`string`) value,
not a comma-separated string.
This commit is contained in:
leekelleher
2024-05-23 10:34:37 +01:00
parent 07c2ec7f22
commit 086c8b6422

View File

@@ -19,7 +19,7 @@ export class UmbPropertyEditorUIDocumentPickerElement extends UmbLitElement impl
const minMax = config.getValueByAlias<NumberRangeValueType>('validationLimit');
if (minMax) {
this._min = minMax.min && minMax.min > 0 ? minMax.min : 0;
this._max = minMax.max && minMax.max > 0 ? minMax.max : Infinity;
this._max = minMax.max && minMax.max > 0 ? minMax.max : 1;
}
this._startNodeId = config.getValueByAlias('startNodeId');
@@ -29,8 +29,10 @@ export class UmbPropertyEditorUIDocumentPickerElement extends UmbLitElement impl
@state()
private _min = 0;
// NOTE: The legacy "Content Picker" property-editor only supported 1 item,
// so that's why it's being enforced here. We'll evolve this in a future version. [LK]
@state()
private _max = Infinity;
private _max = 1;
@state()
private _startNodeId?: string;