Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CM-134: use id in mutation labels to avoid mutation errors #25

Merged
merged 1 commit into from
Jul 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions src/components/GroupIndividualSearcher.js
Original file line number Diff line number Diff line change
Expand Up @@ -151,8 +151,7 @@ function GroupIndividualSearcher({
updateGroupIndividual(
editedGroupIndividual,
formatMessageWithValues(intl, 'individual', 'groupIndividual.update.mutationLabel', {
firstName: editedGroupIndividual.individual.firstName,
lastName: editedGroupIndividual.individual.lastName,
id: editedGroupIndividual?.individual?.id,
}),
);
}
Expand Down
3 changes: 1 addition & 2 deletions src/components/IndividualSearcher.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,7 @@ function IndividualSearcher({
deleteIndividual(
individualToDelete,
formatMessageWithValues(intl, 'individual', 'individual.delete.mutationLabel', {
firstName: individualToDelete.firstName,
lastName: individualToDelete.lastName,
id: individualToDelete?.id,
}),
);
setDeletedIndividualUuids([...deletedIndividualUuids, individualToDelete.id]);
Expand Down
6 changes: 2 additions & 4 deletions src/pages/IndividualPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,17 +106,15 @@ function IndividualPage({
updateIndividual(
editedIndividual,
formatMessageWithValues(intl, 'individual', 'individual.update.mutationLabel', {
firstName: individual?.firstName,
lastName: individual?.lastName,
id: individual?.id,
}),
);
};

const deleteIndividualCallback = () => deleteIndividual(
individual,
formatMessageWithValues(intl, 'individual', 'individual.delete.mutationLabel', {
firstName: individual?.firstName,
lastName: individual?.lastName,
id: individual?.id,
}),
);

Expand Down
6 changes: 3 additions & 3 deletions src/translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@
"title": "Delete {firstName} {lastName}?",
"message": "Deleting data does not mean erasing it from OpenIMIS database. The data will only be deactivated from the viewed list."
},
"mutationLabel": "Delete Individual {firstName} {lastName}"
"mutationLabel": "Delete Individual {id}"
},
"update": {
"label": "Update Individual",
"mutationLabel":"Update Individual {firstName} {lastName}"
"mutationLabel":"Update Individual {id}"
},
"saveButton.tooltip.enabled": "Save changes",
"saveButton.tooltip.disabled": "Please fill General Information fields first",
Expand Down Expand Up @@ -96,7 +96,7 @@
},
"update": {
"label": "Update Individual",
"mutationLabel":"Update Individual {firstName} {lastName}"
"mutationLabel":"Update Individual {id}"
},
"groupIndividualRolePicker.HEAD": "HEAD",
"groupIndividualRolePicker.RECIPIENT": "RECIPIENT",
Expand Down
Loading