guan404ming commented on code in PR #51564:
URL: https://github.com/apache/airflow/pull/51564#discussion_r2140347820


##########
airflow-core/src/airflow/ui/src/pages/TaskInstances/DeleteTaskInstancesButton.tsx:
##########
@@ -0,0 +1,123 @@
+/*!
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+import { Code, Flex, Heading, Text, VStack, useDisclosure } from 
"@chakra-ui/react";
+import { FiTrash, FiTrash2 } from "react-icons/fi";
+
+import { ErrorAlert } from "src/components/ErrorAlert";
+import { Button, Dialog } from "src/components/ui";
+import { useBulkDeleteTaskInstances } from 
"src/queries/useBulkDeleteTaskInstances";
+
+type Props = {
+  readonly clearSelections: () => void;
+  readonly dagId: string;
+  readonly dagRunId: string;
+  readonly deleteKeys: Array<{
+    dagRunId: string;
+    taskId: string;
+  }>;
+};
+
+const DeleteTaskInstancesButton = ({ clearSelections, dagId, dagRunId, 
deleteKeys }: Props) => {
+  const { onClose, onOpen, open } = useDisclosure();
+  const { error, isPending, mutate } = useBulkDeleteTaskInstances({
+    clearSelections,
+    dagId,
+    dagRunId,
+    onSuccessConfirm: onClose,
+  });
+
+  if (deleteKeys.length === 0) {
+    return undefined;
+  }
+
+  const taskIds = deleteKeys.map((key) => key.taskId);
+
+  return (
+    <>
+      <Button aria-label="Delete selected task instances" onClick={onOpen} 
size="sm" variant="outline">
+        <FiTrash2 /> Delete
+      </Button>
+
+      <Dialog.Root onOpenChange={onClose} open={open} size="xl">
+        <Dialog.Content backdrop>
+          <Dialog.Header>
+            <VStack align="start" gap={4}>
+              <Heading size="xl">Delete Task Instance{deleteKeys.length > 1 ? 
"s" : ""}</Heading>

Review Comment:
   Sure, I consider to update translation patch after #51558 since it cover 
part of translation which would be used here and almost done.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to