Skip to content

Commit

Permalink
UI: display all affiliations
Browse files Browse the repository at this point in the history
  • Loading branch information
carlinmack authored and ntarocco committed Nov 18, 2024
1 parent 0765abb commit 0e2f834
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import PropTypes from "prop-types";
import { getIn, FieldArray } from "formik";
import { Button, Form, Label, List, Icon } from "semantic-ui-react";
import _get from "lodash/get";
import _map from "lodash/map";
import { FieldLabel } from "react-invenio-forms";
import { HTML5Backend } from "react-dnd-html5-backend";
import { DndProvider } from "react-dnd";
Expand All @@ -27,10 +28,10 @@ const creatibutorNameDisplay = (value) => {

const familyName = _get(value, "person_or_org.family_name", "");
const givenName = _get(value, "person_or_org.given_name", "");
const affiliationName = _get(value, `affiliations[0].name`, "");
const affiliations = _map(value?.affiliations, "name");
const name = _get(value, `person_or_org.name`);

const affiliation = affiliationName ? ` (${affiliationName})` : "";
const affiliation = affiliations.length ? ` (${affiliations.join(", ")})` : "";

if (isPerson) {
const givenNameSuffix = givenName ? `, ${givenName}` : "";
Expand Down

0 comments on commit 0e2f834

Please sign in to comment.