fix issue where the entered value couldn't be used as a query in the entity lookup for oneboxes

This commit is contained in:
Art Lowel
2020-04-29 15:18:56 +02:00
parent 766015d64c
commit db169826d5
2 changed files with 17 additions and 2 deletions

View File

@@ -379,7 +379,14 @@ export class DsDynamicFormControlContainerComponent extends DynamicFormControlCo
});
const modalComp = this.modalRef.componentInstance;
modalComp.query = this.model.value && !this.model.readOnly ? this.model.value.value : '';
if (hasValue(this.model.value) && !this.model.readOnly) {
if (typeof this.model.value === 'string') {
modalComp.query = this.model.value;
} else if (typeof this.model.value.value === 'string') {
modalComp.query = this.model.value.value;
}
}
if (hasValue(this.model.value)) {
this.model.value = '';
this.onChange({

View File

@@ -79,7 +79,15 @@ export class DsDynamicLookupRelationModalComponent implements OnInit, OnDestroy
*/
metadataFields: string;
query: string;
_query: string;
set query(q: string) {
console.log('set query', q);
this._query = q;
};
get query(): string {
return this._query;
}
/**
* A map of subscriptions within this component