Skip to content

Commit

Permalink
CM-809: display group code
Browse files Browse the repository at this point in the history
  • Loading branch information
jdolkowski committed May 21, 2024
1 parent af76d2a commit dfd303c
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 6 deletions.
3 changes: 2 additions & 1 deletion src/actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand All @@ -60,6 +60,7 @@ const GROUP_INDIVIDUAL_FULL_PROJECTION = [

const GROUP_FULL_PROJECTION = [
'id',
'code',
'isDeleted',
'head {firstName, lastName}',
'dateCreated',
Expand Down
8 changes: 8 additions & 0 deletions src/components/GroupFilter.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,14 @@ function GroupFilter({

return (
<Grid container className={classes.form}>
<Grid item xs={2} className={classes.item}>
<TextInput
module="individual"
label="group.code"
value={filterTextFieldValue('code')}
onChange={onChangeStringFilter('code')}
/>
</Grid>
<Grid item xs={2} className={classes.item}>
<TextInput
module="individual"
Expand Down
6 changes: 3 additions & 3 deletions src/components/GroupHeadPanel.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,9 @@ class GroupHeadPanel extends FormPanel {
<TextInput
readOnly
module="individual"
label="group.id"
onChange={(v) => this.updateAttribute('id', v)}
value={group?.id ?? EMPTY_STRING}
label="group.code"
onChange={(v) => this.updateAttribute('code', v)}
value={group?.code ?? EMPTY_STRING}
/>
</Grid>
</Grid>
Expand Down
4 changes: 2 additions & 2 deletions src/components/GroupSearcher.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ function GroupSearcher({

const headers = () => {
const headers = [
'group.id',
'group.code',
'group.head',
];
if (rights.includes(RIGHT_GROUP_UPDATE)) {
Expand All @@ -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')),
Expand Down
1 change: 1 addition & 0 deletions src/translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit dfd303c

Please sign in to comment.