Skip to content

Commit a479062

Browse files
Mattia VianelliAndrea Barbasso
authored andcommitted
Merged in task/dspace-cris-2024_02_x/DSC-2471 (pull request DSpace#5003)
DSC-2471 Fixed the bug of the add more button, if the user clicks add more the entire string is shown instead of the single leaf label Approved-by: Andrea Barbasso
2 parents 2b5aaa8 + 445cb7e commit a479062

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

src/app/shared/form/builder/ds-dynamic-form-ui/models/onebox/dynamic-onebox.component.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -201,8 +201,12 @@ export class DsDynamicOneboxComponent extends DsDynamicVocabularyComponent imple
201201
);
202202
this.subs.push(this.group.get(this.model.id).valueChanges.pipe(
203203
filter((value) => this.currentValue !== value))
204-
.subscribe((value) => {
205-
this.setCurrentValue(this.model.value);
204+
.subscribe(() => {
205+
const raw = this.model.value as any;
206+
const sameEntry = hasValue(raw?.authority) ? raw.authority === this.currentValue?.authority : raw?.value === this.currentValue?.value;
207+
if (!sameEntry) {
208+
this.setCurrentValue(raw);
209+
}
206210
}));
207211
}
208212

0 commit comments

Comments
 (0)