Skip to content

Commit

Permalink
records: allow to override affiliations display
Browse files Browse the repository at this point in the history
  • Loading branch information
jrcastro2 committed Nov 14, 2024
1 parent 6d80d79 commit f361ae3
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 13 deletions.
20 changes: 13 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
"semantic-ui-css": "^2.4.0",
"semantic-ui-react": "^2.1.0",
"tinymce": "^6.7.2",
"react-overridable": "^0.0.3",
"yup": "^0.32.11"
},
"devDependencies": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import React from "react";
import { Image } from "../../../Image";
import { Header } from "semantic-ui-react";
import Overridable from "react-overridable";

const makeIdEntry = (identifier) => {
let icon, link;
Expand Down Expand Up @@ -85,14 +86,23 @@ export const AffiliationsSuggestions = (creatibutors, isOrganization) => {
text: creatibutor.name,
value: creatibutor.name,
extra: creatibutor,
key: creatibutor.name,
name: creatibutor.name,
key: creatibutor.id,
id: creatibutor.id,
content: (
<Header>
{name} {idString.length > 0 && <>({idString})</>}
{subheader.length > 0 && <Header.Subheader>{subheader}</Header.Subheader>}
</Header>
<Overridable
id="ReactInvenioForms.AffiliationsSuggestions.content"
creatibutor={creatibutor}
isOrganization={isOrganization}
idString={idString}
makeSubheader={makeSubheader}
makeIdEntry={makeIdEntry}
>
<Header>
{name} {idString.length > 0 && <>({idString})</>}
{subheader.length > 0 && <Header.Subheader>{subheader}</Header.Subheader>}
</Header>
</Overridable>
),
};
});
Expand Down
2 changes: 1 addition & 1 deletion src/lib/forms/RemoteSelectField.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ export class RemoteSelectField extends Component {
this.setState((prevState) => ({
suggestions: _uniqBy(
[...prevState.selectedSuggestions, ...serializedSuggestions],
"value"
"key"
),
isFetching: false,
error: false,
Expand Down

0 comments on commit f361ae3

Please sign in to comment.