Skip to content

Commit 0a65909

Browse files
committed
affiliations: render organization acronym in subheader
1 parent 18dbf6d commit 0a65909

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

src/lib/elements/contrib/invenioRDM/records/AffiliationsSuggestions.js

+8-2
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,14 @@ const makeSubheader = (creatibutor, isOrganization) => {
6060
}`.trim();
6161
} else {
6262
return (
63-
creatibutor?.affiliations?.map((affiliation) => affiliation.name)?.join(", ") ||
64-
""
63+
creatibutor?.affiliations
64+
?.map((affiliation) => {
65+
if (affiliation.acronym?.length > 0) {
66+
return `${affiliation.name} (${affiliation.acronym})`;
67+
}
68+
return affiliation.name;
69+
})
70+
?.join(", ") || ""
6571
);
6672
}
6773
};

src/lib/forms/RemoteSelectField.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@ export class RemoteSelectField extends Component {
4646

4747
onSelectValue = (event, { options, value, ...otherData }, callbackFunc) => {
4848
const { multiple } = this.props;
49-
const newSelectedSuggestions = options.filter(
50-
(item) => multiple ? value.includes(item.value) : item.value === value
49+
const newSelectedSuggestions = options.filter((item) =>
50+
multiple ? value.includes(item.value) : item.value === value
5151
);
5252

5353
this.setState(

0 commit comments

Comments
 (0)