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