From 7d6700db6a5e3a497547bb244fa67113f55be554 Mon Sep 17 00:00:00 2001 From: "cyril.tsui" Date: Wed, 26 Feb 2025 17:08:00 +0800 Subject: [PATCH] add bulk delete --- src/components/CreateProject/MilestoneSection.tsx | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/components/CreateProject/MilestoneSection.tsx b/src/components/CreateProject/MilestoneSection.tsx index ea050eb..fa96fb7 100644 --- a/src/components/CreateProject/MilestoneSection.tsx +++ b/src/components/CreateProject/MilestoneSection.tsx @@ -39,6 +39,7 @@ import { } from "@/app/utils/formatUtil"; import isDate from "lodash/isDate"; import BulkAddPaymentModal from "./BulkAddPaymentModal"; +import { deleteDialog } from "../Swal/CustomAlerts"; interface Props { taskGroupId: TaskGroup["id"]; @@ -292,6 +293,11 @@ const MilestoneSection: React.FC = ({ taskGroupId }) => { setPayments((currentPayments) => [...currentPayments, ...entries]); setBulkAddModalOpen(false); }, []); + const onBulkDelete = useCallback(() => { + deleteDialog(() => { + setPayments([]) + }, t) + }, []); const footer = ( @@ -311,6 +317,15 @@ const MilestoneSection: React.FC = ({ taskGroupId }) => { > {t("Bulk Add Payment Milestones")} + );