Add confirmation dialog when deleting project.
This commit is contained in:
parent
c9103deb48
commit
1f577fc410
3 changed files with 17 additions and 8 deletions
|
|
@ -1059,8 +1059,14 @@ const ProjectDetails: React.FC = () => {
|
|||
)}
|
||||
{isConfirmDialogOpen && !noteToDelete && (
|
||||
<ConfirmDialog
|
||||
title="Delete Project"
|
||||
message={`Are you sure you want to delete the project "${project.name}"?`}
|
||||
title={t(
|
||||
'modals.deleteProject.title',
|
||||
'Delete Project'
|
||||
)}
|
||||
message={t(
|
||||
'modals.deleteProject.message',
|
||||
'Deleting this project will remove the project only. All items inside will be retained but will no longer belong to any project. Continue?'
|
||||
)}
|
||||
onConfirm={handleDeleteProject}
|
||||
onCancel={() => setIsConfirmDialogOpen(false)}
|
||||
/>
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@ const ProjectModal: React.FC<ProjectModalProps> = ({
|
|||
name: '',
|
||||
description: '',
|
||||
area_id: null,
|
||||
active: false,
|
||||
active: true,
|
||||
tags: [],
|
||||
priority: 'low',
|
||||
due_date_at: null,
|
||||
|
|
@ -80,7 +80,7 @@ const ProjectModal: React.FC<ProjectModalProps> = ({
|
|||
image: false,
|
||||
priority: false,
|
||||
dueDate: false,
|
||||
active: false,
|
||||
active: true,
|
||||
});
|
||||
|
||||
const { showSuccessToast, showErrorToast } = useToast();
|
||||
|
|
@ -132,7 +132,7 @@ const ProjectModal: React.FC<ProjectModalProps> = ({
|
|||
name: '',
|
||||
description: '',
|
||||
area_id: null,
|
||||
active: false,
|
||||
active: true,
|
||||
tags: [],
|
||||
priority: 'low',
|
||||
due_date_at: null,
|
||||
|
|
@ -904,8 +904,11 @@ const ProjectModal: React.FC<ProjectModalProps> = ({
|
|||
</div>
|
||||
{showConfirmDialog && (
|
||||
<ConfirmDialog
|
||||
title="Delete Project"
|
||||
message="Are you sure you want to delete this project? This action cannot be undone."
|
||||
title={t('modals.deleteProject.title', 'Delete Project')}
|
||||
message={t(
|
||||
'modals.deleteProject.message',
|
||||
'Deleting this project will remove the project only. All items inside will be retained but will no longer belong to any project. Continue?'
|
||||
)}
|
||||
onConfirm={handleDeleteConfirm}
|
||||
onCancel={() => setShowConfirmDialog(false)}
|
||||
/>
|
||||
|
|
|
|||
|
|
@ -355,7 +355,7 @@
|
|||
},
|
||||
"deleteProject": {
|
||||
"title": "Delete Project",
|
||||
"message": "Are you sure you want to delete the project \"{{projectName}}\"?"
|
||||
"message": "Deleting this project will remove the project only. All items inside will be retained but will no longer belong to any project. Continue?"
|
||||
}
|
||||
},
|
||||
"forms": {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue