mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-14 23:21:35 +00:00
fix(ui): project detail close replaces history to match the other detail pages
Adopts the close semantics from PR #36013 so browser Back after an in-page close leaves the Projects page instead of reopening the dismissed detail; the close test now pins the replace mode
This commit is contained in:
parent
dc178acf5b
commit
dbf9392f24
2 changed files with 7 additions and 1 deletions
|
|
@ -243,6 +243,7 @@ describe("ProjectsPage", () => {
|
|||
await waitFor(() => {
|
||||
expect(onUrlUpdate).toHaveBeenLastCalledWith(expect.objectContaining({ queryString: "" }));
|
||||
});
|
||||
expect(onUrlUpdate.mock.calls.at(-1)?.[0].options.history).toBe("replace");
|
||||
expect(screen.queryByTestId("project-detail")).not.toBeInTheDocument();
|
||||
expect(screen.getByText("Alpha Project")).toBeInTheDocument();
|
||||
});
|
||||
|
|
|
|||
|
|
@ -48,7 +48,12 @@ export function ProjectsPage() {
|
|||
}, [projects, searchText, teamAliasMap]);
|
||||
|
||||
if (selectedProjectId) {
|
||||
return <ProjectDetail projectId={selectedProjectId} onBack={() => void setSelectedProjectId(null)} />;
|
||||
return (
|
||||
<ProjectDetail
|
||||
projectId={selectedProjectId}
|
||||
onBack={() => void setSelectedProjectId(null, { history: "replace" })}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue