Skip to content

Commit

Permalink
CM-232: use IDs in mutation label (#11)
Browse files Browse the repository at this point in the history
  • Loading branch information
olewandowski1 authored Jul 24, 2023
1 parent beb3e3e commit b212763
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/components/groups-management/TaskGroupsSearcher.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ function TaskGroupsSearcher({
deleteTaskGroup(
taskGroupToDelete,
formatMessageWithValues('taskGroup.delete.mutationLabel', {
code: taskGroupToDelete.code,
id: taskGroupToDelete?.id,
}),
);
setDeletedTaskGroupsUuids([...deletedTaskGroupsUuids, taskGroupToDelete.id]);
Expand Down
16 changes: 12 additions & 4 deletions src/pages/TaskGroupPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,25 +54,33 @@ function TaskGroupPage({
if (taskGroup?.id) {
dispatch(updateTaskGroup(
editedTaskGroup,
formatMessageWithValues('taskGroup.update.mutationLabel', titleParams(editedTaskGroup)),
formatMessageWithValues('taskGroup.update.mutationLabel', {
id: editedTaskGroup?.id,
}),
));
} else {
dispatch(createTaskGroup(
editedTaskGroup,
formatMessageWithValues('taskGroup.create.mutationLabel', titleParams(editedTaskGroup)),
formatMessageWithValues('taskGroup.create.mutationLabel', {
id: editedTaskGroup?.id,
}),
));
}
};

const deleteTaskGroupCallback = () => dispatch(deleteTaskGroup(
taskGroup,
formatMessageWithValues('taskGroup.delete.mutationLabel', titleParams(taskGroup)),
formatMessageWithValues('taskGroup.delete.mutationLabel', {
id: taskGroup?.id,
}),
));

const openDeleteTaskGroupConfirmDialog = () => {
setConfirmedAction(() => deleteTaskGroupCallback);
coreConfirm(
formatMessageWithValues('taskGroup.delete.confirm.title', titleParams(editedTaskGroup)),
formatMessageWithValues('taskGroup.delete.confirm.title', {
id: taskGroup?.id,
}),
formatMessage('taskGroup.delete.confirm.message'),
);
};
Expand Down
6 changes: 3 additions & 3 deletions src/translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@
"tasksManagement.taskGroup.completionPolicy.N": "N",
"tasksManagement.taskGroup.delete.confirm.title": "Delete task group {code}",
"tasksManagement.taskGroup.delete.confirm.message": "Are you sure you want to delete the task group?",
"tasksManagement.taskGroup.delete.mutationLabel": "Delete task group {code}",
"tasksManagement.taskGroup.update.mutationLabel": "Update task group {code}",
"tasksManagement.taskGroup.create.mutationLabel": "Create task group {code}",
"tasksManagement.taskGroup.delete.mutationLabel": "Delete task group {id}",
"tasksManagement.taskGroup.update.mutationLabel": "Update task group {id}",
"tasksManagement.taskGroup.create.mutationLabel": "Create task group {id}",
"tasksManagement.TaskExecutorsPicker.label": "Task Executors",
"tasksManagement.TaskExecutorsPicker.placeholder": "Search for Task Executor...",
"tasksManagement.taskGroup.placeholder": "Not assigned",
Expand Down

0 comments on commit b212763

Please sign in to comment.