mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-15 14:03:06 +00:00
Fixed an issue with save of repeatable scrollable-dropdown fields
This commit is contained in:
@@ -15,7 +15,8 @@
|
||||
class="ds-form-input-btn btn btn-outline-primary"
|
||||
id="scrollableDropdownMenuButton_{{model.id}}"
|
||||
ngbDropdownToggle
|
||||
[disabled]="model.readOnly"></button>
|
||||
[disabled]="model.readOnly"
|
||||
(click)="onToggle(sdRef); $event.stopPropagation();"></button>
|
||||
|
||||
<div ngbDropdownMenu
|
||||
class="dropdown-menu scrollable-dropdown-menu w-100"
|
||||
|
@@ -118,6 +118,14 @@ export class DsDynamicScrollableDropdownComponent extends DynamicFormControlComp
|
||||
this.setCurrentValue(event);
|
||||
}
|
||||
|
||||
onToggle(sdRef: NgbDropdown) {
|
||||
if (sdRef.isOpen()) {
|
||||
this.focus.emit(event);
|
||||
} else {
|
||||
this.blur.emit(event);
|
||||
}
|
||||
}
|
||||
|
||||
setCurrentValue(value): void {
|
||||
let result: string;
|
||||
if (isUndefined(value) || isNull(value)) {
|
||||
|
@@ -138,20 +138,22 @@ export class FormSectionComponent extends SectionModelComponent {
|
||||
|
||||
updateForm(sectionData: WorkspaceitemSectionDataType, errors: SubmissionSectionError[]) {
|
||||
|
||||
if (isNotEmpty(sectionData) && !isEqual(sectionData, this.sectionData.data) && this.hasMetadataEnrichment(sectionData)) {
|
||||
this.translate.get('submission.sections.general.metadata-extracted', {sectionId: this.sectionData.id})
|
||||
.pipe(take(1))
|
||||
.subscribe((m) => {
|
||||
this.notificationsService.info(null, m, null, true);
|
||||
});
|
||||
this.isUpdating = true;
|
||||
this.formModel = null;
|
||||
this.cdr.detectChanges();
|
||||
this.initForm(sectionData);
|
||||
this.checksForErrors(errors);
|
||||
if (isNotEmpty(sectionData) && !isEqual(sectionData, this.sectionData.data)) {
|
||||
this.sectionData.data = sectionData;
|
||||
this.isUpdating = false;
|
||||
this.cdr.detectChanges();
|
||||
if (this.hasMetadataEnrichment(sectionData)) {
|
||||
this.translate.get('submission.sections.general.metadata-extracted', { sectionId: this.sectionData.id })
|
||||
.pipe(take(1))
|
||||
.subscribe((m) => {
|
||||
this.notificationsService.info(null, m, null, true);
|
||||
});
|
||||
this.isUpdating = true;
|
||||
this.formModel = null;
|
||||
this.cdr.detectChanges();
|
||||
this.initForm(sectionData);
|
||||
this.checksForErrors(errors);
|
||||
this.isUpdating = false;
|
||||
this.cdr.detectChanges();
|
||||
}
|
||||
} else if (isNotEmpty(errors) || isNotEmpty(this.sectionData.errors)) {
|
||||
this.checksForErrors(errors);
|
||||
}
|
||||
|
Reference in New Issue
Block a user