Skip to content

Commit

Permalink
CM-809: update group_code (#77)
Browse files Browse the repository at this point in the history
* CM-809: update group_code

* CM-809: display group code
  • Loading branch information
jdolkowski authored May 21, 2024
1 parent 373688b commit 2cdb563
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 8 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
2 changes: 1 addition & 1 deletion src/components/dialogs/IndividualsUploadDialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ function IndividualsUploadDialog({
try {
const fileHeaders = await getHeadersFromCSV(selectedFile);
const filteredHeaders = fileHeaders.filter(
(header) => header !== 'recipient_info' && header !== 'group_id',
(header) => header !== 'recipient_info' && header !== 'group_code',
);
setHeaders(filteredHeaders);
} catch (error) {
Expand Down
3 changes: 2 additions & 1 deletion 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 Expand Up @@ -246,5 +247,5 @@
"changeGroupButtonTooltip": "Move to another group.",
"moveToNewGroup": "New Group",
"createGroupFromColumns": "Create groups from column:",
"groupAggregationInfo": "To specify recipients include header 'recipient_info' with possible values: '1' - head, '2' - recipient, '0' or empty - not a recipient."
"groupAggregationInfo": "To specify recipients include header 'recipient_info' with possible values: '1' - head, '0' or empty - recipient."
}

0 comments on commit 2cdb563

Please sign in to comment.