mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-19 07:53:02 +00:00
fix issue where the entered value couldn't be used as a query in the entity lookup for oneboxes
This commit is contained in:
@@ -379,7 +379,14 @@ export class DsDynamicFormControlContainerComponent extends DynamicFormControlCo
|
|||||||
});
|
});
|
||||||
const modalComp = this.modalRef.componentInstance;
|
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)) {
|
if (hasValue(this.model.value)) {
|
||||||
this.model.value = '';
|
this.model.value = '';
|
||||||
this.onChange({
|
this.onChange({
|
||||||
|
@@ -79,7 +79,15 @@ export class DsDynamicLookupRelationModalComponent implements OnInit, OnDestroy
|
|||||||
*/
|
*/
|
||||||
metadataFields: string;
|
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
|
* A map of subscriptions within this component
|
||||||
|
Reference in New Issue
Block a user