pierrejeambrun commented on code in PR #72896:
URL: https://github.com/apache/airflow/pull/72896#discussion_r4071106342


##########
airflow-core/src/airflow/ui/src/pages/Dashboard/Stats/DagImportErrorsModal.tsx:
##########
@@ -20,23 +20,59 @@ import { useState } from "react";
 
 import { Box, ClipboardRoot, Heading, HStack, Text } from "@chakra-ui/react";
 import { useTranslation } from "react-i18next";
+import { AiOutlineFileSync } from "react-icons/ai";
 import { LuFileWarning } from "react-icons/lu";
 import { PiFilePy } from "react-icons/pi";
 
-import { useImportErrorServiceGetImportErrors } from "openapi/queries";
+import { useDagParsingServiceReparseDagFile, 
useImportErrorServiceGetImportErrors } from "openapi/queries";
 
-import { Accordion, ClipboardIconButton, Modal, Pagination } from 
"src/system-components";
+import {
+  Accordion,
+  ClipboardIconButton,
+  IconButton,
+  Modal,
+  Pagination,
+  toaster,
+} from "src/system-components";
 
 import { SearchBar } from "src/components/SearchBar";
 import Time from "src/components/Time";
 
+import { createErrorToaster } from "src/utils";
+
 type ImportDAGErrorModalProps = {
   readonly onClose: () => void;
   readonly open: boolean;
 };
 
 const PAGE_LIMIT = 15;
 
+const ReparseButton = ({ fileToken }: { readonly fileToken: string }) => {
+  const { t: translate } = useTranslation(["components", "dag"]);
+
+  const { isPending, mutate } = useDagParsingServiceReparseDagFile({
+    onError: (error) => createErrorToaster(error, { titleKey: 
"dag:parse.toaster.error.title" }, translate),
+    onSuccess: () =>
+      toaster.create({
+        description: translate("dag:parse.toaster.success.description"),
+        title: translate("dag:parse.toaster.success.title"),
+        type: "success",
+      }),
+  });

Review Comment:
   Reparse creates a request that is later on consumed by the dag processor.
   
   Instantly refreshing the list won't will race that and will most likely 
still display the previous state.



-- 
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