From 7369ca59eb1c4f1298564ca466c24c12c0bcc1c9 Mon Sep 17 00:00:00 2001 From: Jan Date: Mon, 2 Oct 2023 14:30:31 +0200 Subject: [PATCH 1/2] CM-295: display group head --- src/actions.js | 1 + src/components/GroupSearcher.js | 2 ++ src/translations/en.json | 2 ++ 3 files changed, 5 insertions(+) diff --git a/src/actions.js b/src/actions.js index 3a6fc92..f43591c 100644 --- a/src/actions.js +++ b/src/actions.js @@ -35,6 +35,7 @@ const GROUP_INDIVIDUAL_FULL_PROJECTION = [ const GROUP_FULL_PROJECTION = [ 'id', 'isDeleted', + 'head {firstName, lastName}', 'dateCreated', 'dateUpdated', 'jsonExt', diff --git a/src/components/GroupSearcher.js b/src/components/GroupSearcher.js index be9ad36..e03bfb1 100644 --- a/src/components/GroupSearcher.js +++ b/src/components/GroupSearcher.js @@ -110,6 +110,7 @@ function GroupSearcher({ const headers = () => { const headers = [ 'group.id', + 'group.head', ]; if (rights.includes(RIGHT_GROUP_UPDATE)) { headers.push('emptyLabel'); @@ -120,6 +121,7 @@ function GroupSearcher({ const itemFormatters = () => { const formatters = [ (group) => group.id, + (group) => group?.head? `${group?.head?.firstName} ${group?.head?.lastName}` : formatMessage(intl, 'group', 'noHeadSpecified'), ]; if (rights.includes(RIGHT_GROUP_UPDATE)) { formatters.push((group) => ( diff --git a/src/translations/en.json b/src/translations/en.json index bb0a970..4aa95da 100644 --- a/src/translations/en.json +++ b/src/translations/en.json @@ -49,6 +49,8 @@ }, "group": { "id": "ID", + "head": "Head", + "noHeadSpecified": "head not specified", "individual.firstName": "Individual First Name", "individual.lastName": "Individual Last Name", "pageTitle": "Group {id}", From 43c1b6bb26427655f314d84270fad7b166186fe4 Mon Sep 17 00:00:00 2001 From: Jan Date: Mon, 2 Oct 2023 14:35:08 +0200 Subject: [PATCH 2/2] CM-295: fix eslint --- src/components/GroupSearcher.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/components/GroupSearcher.js b/src/components/GroupSearcher.js index e03bfb1..0299ac6 100644 --- a/src/components/GroupSearcher.js +++ b/src/components/GroupSearcher.js @@ -121,7 +121,9 @@ function GroupSearcher({ const itemFormatters = () => { const formatters = [ (group) => group.id, - (group) => group?.head? `${group?.head?.firstName} ${group?.head?.lastName}` : formatMessage(intl, 'group', 'noHeadSpecified'), + (group) => (group?.head + ? `${group?.head?.firstName} ${group?.head?.lastName}` + : formatMessage(intl, 'group', 'noHeadSpecified')), ]; if (rights.includes(RIGHT_GROUP_UPDATE)) { formatters.push((group) => (