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
2 changes: 1 addition & 1 deletion airflow-core/src/airflow/ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
"react-markdown": "^9.1.0",
"react-resizable": "^3.0.5",
"react-resizable-panels": "^3.0.6",
"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 Down
49 changes: 27 additions & 22 deletions airflow-core/src/airflow/ui/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

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 @@ -168,7 +168,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 @@ -109,7 +109,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 @@ -52,9 +52,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
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ const DeleteRunButton = ({ dagRun, variant, withText = true, ...rest }: DeleteRu
onSuccessConfirm: () => {
onClose();
if (isOnRunDetailPage) {
navigate(`/dags/${dagRun.dag_id}/runs`);
void Promise.resolve(navigate(`/dags/${dagRun.dag_id}/runs`));
}
},
});
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
9 changes: 9 additions & 0 deletions airflow-core/src/airflow/ui/tests/e2e/pages/DagsPage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,15 +62,24 @@ export class DagsPage extends BasePage {
* Click next page button
*/
public async clickNextPage(): Promise<void> {
const initialDagNames = await this.getDagNames();

await this.paginationNextButton.click();

await expect.poll(() => this.getDagNames(), { timeout: 10_000 }).not.toEqual(initialDagNames);

await this.waitForDagList();
}

/**
* Click previous page button
*/
public async clickPrevPage(): Promise<void> {
const initialDagNames = await this.getDagNames();

await this.paginationPrevButton.click();

await expect.poll(() => this.getDagNames(), { timeout: 10_000 }).not.toEqual(initialDagNames);
await this.waitForDagList();
}

Expand Down
Loading