From dfd303c2a160c91ed43ed952c0b302ab29bcb582 Mon Sep 17 00:00:00 2001 From: Jan Date: Tue, 21 May 2024 11:20:53 +0200 Subject: [PATCH] CM-809: display group code --- src/actions.js | 3 ++- src/components/GroupFilter.js | 8 ++++++++ src/components/GroupHeadPanel.js | 6 +++--- src/components/GroupSearcher.js | 4 ++-- src/translations/en.json | 1 + 5 files changed, 16 insertions(+), 6 deletions(-) diff --git a/src/actions.js b/src/actions.js index 10eb12a..b6719c9 100644 --- a/src/actions.js +++ b/src/actions.js @@ -50,7 +50,7 @@ const INDIVIDUAL_FULL_PROJECTION = [ const GROUP_INDIVIDUAL_FULL_PROJECTION = [ 'id', 'individual {id, firstName, lastName, dob}', - 'group {id}', + 'group {id, code}', 'role', 'isDeleted', 'dateCreated', @@ -60,6 +60,7 @@ const GROUP_INDIVIDUAL_FULL_PROJECTION = [ const GROUP_FULL_PROJECTION = [ 'id', + 'code', 'isDeleted', 'head {firstName, lastName}', 'dateCreated', diff --git a/src/components/GroupFilter.js b/src/components/GroupFilter.js index 449b33d..c2005d2 100644 --- a/src/components/GroupFilter.js +++ b/src/components/GroupFilter.js @@ -26,6 +26,14 @@ function GroupFilter({ return ( + + + this.updateAttribute('id', v)} - value={group?.id ?? EMPTY_STRING} + label="group.code" + onChange={(v) => this.updateAttribute('code', v)} + value={group?.code ?? EMPTY_STRING} /> diff --git a/src/components/GroupSearcher.js b/src/components/GroupSearcher.js index adf71e1..1100419 100644 --- a/src/components/GroupSearcher.js +++ b/src/components/GroupSearcher.js @@ -114,7 +114,7 @@ function GroupSearcher({ const headers = () => { const headers = [ - 'group.id', + 'group.code', 'group.head', ]; if (rights.includes(RIGHT_GROUP_UPDATE)) { @@ -125,7 +125,7 @@ function GroupSearcher({ const itemFormatters = () => { const formatters = [ - (group) => group.id, + (group) => group.code, (group) => (group?.head ? `${group?.head?.firstName} ${group?.head?.lastName}` : formatMessage(intl, 'group', 'noHeadSpecified')), diff --git a/src/translations/en.json b/src/translations/en.json index d0eb603..d67254a 100644 --- a/src/translations/en.json +++ b/src/translations/en.json @@ -143,6 +143,7 @@ "group": { "id": "ID", "head": "Head", + "code": "Code", "noHeadSpecified": "head not specified", "individual.firstName": "Individual First Name", "individual.lastName": "Individual Last Name",