diff --git a/src/client/actions/ParticipantActions.js b/src/client/actions/ParticipantActions.js index 8a1c6042..a0573628 100644 --- a/src/client/actions/ParticipantActions.js +++ b/src/client/actions/ParticipantActions.js @@ -3,7 +3,7 @@ export function getParticipantActions(alt, participantResource, errorActions) { fetchParticipantById(participantId) { return dispatch => { dispatch(); - participantResource.findById(participantId, `filter=${JSON.stringify({ include: [ { presenceHistory: 'author' }, 'allergies', 'dates' ] })}` ) + participantResource.findById(participantId, `filter=${JSON.stringify({ include: [ { presenceHistory: 'author' }, 'allergies', 'dates', 'selections' ] })}` ) .then(participant => this.updateParticipantById(participant)) .catch(err =>errorActions.error(err, 'Osallistujan tietojen lataaminen epäonnistui')); }; diff --git a/src/client/components/ParticipantDetailsPage/ParticipantDetailsPage.jsx b/src/client/components/ParticipantDetailsPage/ParticipantDetailsPage.jsx index dd8bfd4c..0ee9ea63 100644 --- a/src/client/components/ParticipantDetailsPage/ParticipantDetailsPage.jsx +++ b/src/client/components/ParticipantDetailsPage/ParticipantDetailsPage.jsx @@ -91,6 +91,7 @@ export function getParticipantDetailsPage(participantStore, participantActions) childNaps, dates, allergies, + selections, } = this.state.participantDetails; const participantName = `${firstName} ${lastName}`; @@ -104,6 +105,13 @@ export function getParticipantDetailsPage(participantStore, participantActions) const allergyNames = _.map(allergies, row => row.name); + const familyCampSelections = _.groupBy(selections, row => row.kuksaGroupId); + + const renderedFamilyCampSelections = _.map(familyCampSelections, selection => { + const rows = _.map(selection, row =>
{ row.selectionName }
); + return
{ _.head(selection).groupName }
{ rows }
; + }); + return (
@@ -177,6 +185,7 @@ export function getParticipantDetailsPage(participantStore, participantActions)
Päiväunet
{ childNaps || '–' }
+ { renderedFamilyCampSelections } diff --git a/src/client/styles.scss b/src/client/styles.scss index 29282cf5..52421fef 100644 --- a/src/client/styles.scss +++ b/src/client/styles.scss @@ -396,6 +396,10 @@ textarea.form-control { dl { margin: -1em 0 0; + + &.margin-top-0 { + margin-top: 0; + } dt { font-weight: 400;