pierrejeambrun commented on code in PR #72896:
URL: https://github.com/apache/airflow/pull/72896#discussion_r4071390687
##########
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:
Dashboard are 'auto refreshed' when something is running. (same for dags
list).
The import error modal is unmounted and remounted on close / open, will
refresh the list. Also added polling, starting after the first 'reparse' button
is clicked, and stopping after the modal is closed.
--
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]