Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions airflow-core/src/airflow/ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
"react-markdown": "^9.1.0",
"react-resizable": "^3.0.5",
"react-resizable-panels": "^2.1.7",
"react-router-dom": "^6.30.0",
"react-router-dom": "^7.12.0",
"react-syntax-highlighter": "^15.6.1",
"remark-gfm": "^4.0.1",
"use-debounce": "^10.0.4",
Expand All @@ -78,6 +78,9 @@
"@types/react": "^18.3.19",
"@types/react-dom": "^18.3.5",
"@types/react-syntax-highlighter": "^15.5.13",
"@typescript-eslint/eslint-plugin": "^8.50.0",
"@typescript-eslint/parser": "^8.50.0",
"@typescript-eslint/utils": "^8.50.0",
"@vitejs/plugin-react-swc": "^3.9.0",
"@vitest/coverage-v8": "^2.1.9",
"eslint": "^9.25.1",
Expand All @@ -102,10 +105,7 @@
"vite": "^5.4.19",
"vite-plugin-css-injected-by-js": "^3.5.2",
"vitest": "^2.1.9",
"web-worker": "^1.5.0",
"@typescript-eslint/eslint-plugin": "^8.50.0",
"@typescript-eslint/utils": "^8.50.0",
"@typescript-eslint/parser": "^8.50.0"
"web-worker": "^1.5.0"
},
"pnpm": {
"onlyBuiltDependencies": [
Expand Down
133 changes: 83 additions & 50 deletions airflow-core/src/airflow/ui/pnpm-lock.yaml

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ const DeleteDagButton = ({ dagDisplayName, dagId, width, withText = true }: Dele
onSuccessConfirm: () => {
onClose();
if (isOnDagDetailPage) {
navigate("/dags");
void Promise.resolve(navigate("/dags"));
}
},
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ export const DurationChart = ({
const entry = entries[element.index] as GridRunsResponse | undefined;
const baseUrl = `/dags/${entry?.dag_id}/runs/${entry?.run_id}`;

navigate(baseUrl);
void Promise.resolve(navigate(baseUrl));
break;
}
case "Task Instance": {
Expand All @@ -206,7 +206,7 @@ export const DurationChart = ({
taskId: entry.task_id,
});

navigate(baseUrl);
void Promise.resolve(navigate(baseUrl));
break;
}
default:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export const SearchDags = ({
const onSelect = (selected: SingleValue<Option>) => {
if (selected) {
setIsOpen(false);
navigate(`/dags/${selected.value}`);
void Promise.resolve(navigate(`/dags/${selected.value}`));
}
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ export const useNavigation = ({ onToggleGroup, runs, tasks }: UseNavigationProps
if (run && task) {
const path = buildPath({ dagId, mapIndex, mode, pathname: location.pathname, run, task });

navigate(path, { replace: true });
void Promise.resolve(navigate(path, { replace: true }));

const grid = document.querySelector(`[id='grid-${run.run_id}-${task.id}']`);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ export const useRequiredActionTabs = (

useEffect(() => {
if (autoRedirect && !hasHitlData && !isLoadingHitl && location.pathname.includes("required_actions")) {
navigate(redirectPath);
void Promise.resolve(navigate(redirectPath));
}
}, [autoRedirect, hasHitlData, isLoadingHitl, location.pathname, navigate, redirectPath]);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,11 @@ export const DagRunSelect = forwardRef<HTMLDivElement, DagRunSelectProps>(({ lim
const selectDagRun = ({ items }: SelectValueChangeDetails<DagRunSelected>) => {
const runPartialPath = items.length > 0 ? `/runs/${items[0]?.run.run_id}` : "";

navigate({
pathname: `/dags/${dagId}${runPartialPath}/${taskId === undefined ? "" : `tasks/${taskId}`}`,
});
void Promise.resolve(
navigate({
pathname: `/dags/${dagId}${runPartialPath}/${taskId === undefined ? "" : `tasks/${taskId}`}`,
}),
);
};

const selectedRun = (gridRuns ?? []).find((dr) => dr.run_id === runId);
Expand Down
14 changes: 8 additions & 6 deletions airflow-core/src/airflow/ui/src/layouts/Details/Gantt/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,12 +75,14 @@ export const createHandleBarClick =
taskId,
});

navigate(
{
pathname: taskUrl,
search: location.search,
},
{ replace: true },
void Promise.resolve(
navigate(
{
pathname: taskUrl,
search: location.search,
},
{ replace: true },
),
);
}
}
Expand Down
17 changes: 15 additions & 2 deletions airflow-core/src/airflow/ui/src/pages/Error.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,23 @@ export const ErrorPage = () => {
</VStack>

<HStack gap={4}>
<Button colorPalette="brand" onClick={() => navigate(-1)} size="lg">
<Button
colorPalette="brand"
onClick={() => {
void Promise.resolve(navigate(-1));
}}
size="lg"
>
{translate("error.back")}
</Button>
<Button colorPalette="brand" onClick={() => navigate("/")} size="lg" variant="outline">
<Button
colorPalette="brand"
onClick={() => {
void Promise.resolve(navigate("/"));
}}
size="lg"
variant="outline"
>
{translate("error.home")}
</Button>
</HStack>
Expand Down
2 changes: 1 addition & 1 deletion airflow-core/src/airflow/ui/src/pages/Security.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export const Security = () => {
const iframe: HTMLIFrameElement | null = document.querySelector("#security-iframe");

if (iframe?.contentWindow && !iframe.contentWindow.location.pathname.startsWith("/auth/")) {
navigate("/");
void Promise.resolve(navigate("/"));
}
};

Expand Down
2 changes: 1 addition & 1 deletion airflow-core/src/airflow/ui/src/queries/useTrigger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ export const useTrigger = ({ dagId, onSuccessConfirm }: { dagId: string; onSucce

// Only redirect if we're already on the dag page
if (selectedDagId === dagRun.dag_id) {
navigate(`/dags/${dagRun.dag_id}/runs/${dagRun.dag_run_id}`);
void Promise.resolve(navigate(`/dags/${dagRun.dag_id}/runs/${dagRun.dag_run_id}`));
}
};

Expand Down