mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-07 18:14:17 +00:00
only use name variant after modal closes
This commit is contained in:
@@ -75,7 +75,7 @@ export class OrgUnitSearchResultListSubmissionElementComponent extends SearchRes
|
|||||||
if (!this.allSuggestions.includes(value)) {
|
if (!this.allSuggestions.includes(value)) {
|
||||||
this.openModal(value)
|
this.openModal(value)
|
||||||
.then(() => {
|
.then(() => {
|
||||||
|
// user clicked ok: store the name variant in the item
|
||||||
const newName: MetadataValue = new MetadataValue();
|
const newName: MetadataValue = new MetadataValue();
|
||||||
newName.value = value;
|
newName.value = value;
|
||||||
|
|
||||||
@@ -89,9 +89,12 @@ export class OrgUnitSearchResultListSubmissionElementComponent extends SearchRes
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
this.itemDataService.update(updatedItem).pipe(take(1)).subscribe();
|
this.itemDataService.update(updatedItem).pipe(take(1)).subscribe();
|
||||||
})
|
}).catch(() => {
|
||||||
|
// user clicked cancel: use the name variant only for this relation, no further action required
|
||||||
|
}).finally(() => {
|
||||||
|
this.select(value);
|
||||||
|
})
|
||||||
}
|
}
|
||||||
this.select(value);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
openModal(value): Promise<any> {
|
openModal(value): Promise<any> {
|
||||||
|
@@ -75,7 +75,7 @@ export class PersonSearchResultListSubmissionElementComponent extends SearchResu
|
|||||||
if (!this.allSuggestions.includes(value)) {
|
if (!this.allSuggestions.includes(value)) {
|
||||||
this.openModal(value)
|
this.openModal(value)
|
||||||
.then(() => {
|
.then(() => {
|
||||||
|
// user clicked ok: store the name variant in the item
|
||||||
const newName: MetadataValue = new MetadataValue();
|
const newName: MetadataValue = new MetadataValue();
|
||||||
newName.value = value;
|
newName.value = value;
|
||||||
|
|
||||||
@@ -89,12 +89,12 @@ export class PersonSearchResultListSubmissionElementComponent extends SearchResu
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
this.itemDataService.update(updatedItem).pipe(take(1)).subscribe();
|
this.itemDataService.update(updatedItem).pipe(take(1)).subscribe();
|
||||||
}
|
}).catch(() => {
|
||||||
).catch(() => {
|
// user clicked cancel: use the name variant only for this relation, no further action required
|
||||||
/* empty, don't throw console error */
|
}).finally(() => {
|
||||||
|
this.select(value);
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
this.select(value);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
openModal(value): Promise<any> {
|
openModal(value): Promise<any> {
|
||||||
|
Reference in New Issue
Block a user