Skip to content

Commit 667fe26

Browse files
committed
Fix program create, update and delete mutation labels
To display program name correctly
1 parent 49de9ad commit 667fe26

4 files changed

Lines changed: 9 additions & 9 deletions

File tree

src/components/BenefitPlanSearcher.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ function BenefitPlanSearcher({
8181
deleteBenefitPlan(
8282
benefitPlanToDelete,
8383
formatMessageWithValues(intl, 'socialProtection', 'benefitPlan.delete.mutationLabel', {
84-
id: benefitPlanToDelete?.id,
84+
name: benefitPlanToDelete?.name,
8585
}),
8686
);
8787
setDeletedBenefitPlanUuids([...deletedBenefitPlanUuids, benefitPlanToDelete.id]);

src/components/BenefitPlanSearcherForEntities.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ function BenefitPlanSearcherForEntities({
8484
deleteBenefitPlan(
8585
benefitPlanToDelete,
8686
formatMessageWithValues(intl, 'socialProtection', 'benefitPlan.delete.mutationLabel', {
87-
id: benefitPlanToDelete?.id,
87+
name: benefitPlanToDelete?.name,
8888
}),
8989
);
9090
setDeletedBenefitPlanUuids([...deletedBenefitPlanUuids, benefitPlanToDelete.id]);

src/pages/BenefitPlanPage.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -141,27 +141,27 @@ function BenefitPlanPage({
141141
if (benefitPlan?.id) {
142142
updateBenefitPlan(
143143
editedBenefitPlan,
144-
formatMessageWithValues(intl, 'socialProtection', 'benefitPlan.update.mutationLabel', titleParams(benefitPlan)),
144+
formatMessageWithValues(intl, 'socialProtection', 'benefitPlan.update.mutationLabel', titleParams(editedBenefitPlan)),
145145
);
146146
} else {
147147
createBenefitPlan(
148148
editedBenefitPlan,
149-
formatMessageWithValues(intl, 'socialProtection', 'benefitPlan.create.mutationLabel', titleParams(benefitPlan)),
149+
formatMessageWithValues(intl, 'socialProtection', 'benefitPlan.create.mutationLabel', titleParams(editedBenefitPlan)),
150150
);
151151
}
152152
};
153153

154154
const deleteBenefitPlanCallback = () => deleteBenefitPlan(
155155
benefitPlan,
156156
formatMessageWithValues(intl, 'socialProtection', 'benefitPlan.delete.mutationLabel', {
157-
id: benefitPlan?.id,
157+
name: benefitPlan?.name,
158158
}),
159159
);
160160

161161
const stopBenefitPlanCallback = () => closeBenefitPlan(
162162
benefitPlan,
163163
formatMessageWithValues(intl, 'socialProtection', 'benefitPlan.delete.mutationLabel', {
164-
id: benefitPlan?.id,
164+
name: benefitPlan?.name,
165165
}),
166166
);
167167

src/translations/en.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22
"socialProtection.BenefitPlan": "Program",
33
"socialProtection.benefitPlan.delete.confirm.title": "Delete program {code} {name}",
44
"socialProtection.benefitPlan.delete.confirm.message": "Are you sure you want to delete the program?",
5-
"socialProtection.benefitPlan.delete.mutationLabel": "Delete program {id}",
5+
"socialProtection.benefitPlan.delete.mutationLabel": "Delete program {name}",
66
"socialProtection.benefitPlan.undo.confirm.title": "Restore program {code} {name}?",
77
"socialProtection.benefitPlan.undo.confirm.message": "This will undo the deletion and make the program active again. Do you want to continue?",
88
"socialProtection.benefitPlan.undo.mutationLabel": "Restore program {name}",
9-
"socialProtection.benefitPlan.update.mutationLabel": "Update program {id}",
10-
"socialProtection.benefitPlan.create.mutationLabel": "Create program {id}",
9+
"socialProtection.benefitPlan.update.mutationLabel": "Update program {name}",
10+
"socialProtection.benefitPlan.create.mutationLabel": "Create program {name}",
1111
"socialProtection.benefitPlan.searcherResultsTitle": "{benefitPlansTotalCount} Programs",
1212
"socialProtection.benefitPlan.pageTitle": "Program {code} {name}",
1313
"socialProtection.menu.socialProtection.benefitPlans": "Programs",

0 commit comments

Comments
 (0)