瀏覽代碼

add bulk delete

pull/5/head
cyril.tsui 6 月之前
父節點
當前提交
7d6700db6a
共有 1 個文件被更改,包括 15 次插入0 次删除
  1. +15
    -0
      src/components/CreateProject/MilestoneSection.tsx

+ 15
- 0
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<Props> = ({ taskGroupId }) => {
setPayments((currentPayments) => [...currentPayments, ...entries]);
setBulkAddModalOpen(false);
}, []);
const onBulkDelete = useCallback(() => {
deleteDialog(() => {
setPayments([])
}, t)
}, []);

const footer = (
<Box display="flex" gap={2} alignItems="center">
@@ -311,6 +317,15 @@ const MilestoneSection: React.FC<Props> = ({ taskGroupId }) => {
>
{t("Bulk Add Payment Milestones")}
</Button>
<Button
variant="outlined"
startIcon={<Delete />}
color={"error"}
onClick={onBulkDelete}
size="small"
>
{t("Delete Payment Milestones")}
</Button>
</Box>
);



Loading…
取消
儲存