Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 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
3 changes: 3 additions & 0 deletions frontend/src/App.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ describe("App, unauthenticated", () => {
state: expect.objectContaining({ returnUrl: expect.stringMatching(/^\//) }),
}),
);
// Persisted as a fallback in case the OIDC state round-trip is dropped
// (see oidcReturnUrl.ts's restoreOidcReturnUrl, consumed in main.tsx).
expect(window.sessionStorage.getItem("lineageweave.oidc.returnUrl")).toMatch(/^\//);
});
});

Expand Down
4 changes: 2 additions & 2 deletions frontend/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4610,7 +4610,8 @@ export default function App({ showLabPanels = false }: { showLabPanels?: boolean
</div>
<div className="login-controls">
<button className="btn-primary" onClick={() => {
const returnUrl = window.location.pathname + window.location.search;
const returnUrl = returnUrlFromLocation();
rememberOidcReturnUrl(returnUrl);
Comment thread
seonghobae marked this conversation as resolved.
void auth.signinRedirect({ state: { returnUrl } });
}}>
{t("Log in")}
Expand All @@ -4620,7 +4621,6 @@ export default function App({ showLabPanels = false }: { showLabPanels?: boolean
<small>Enterprise SSO Authentication</small>
</div>
</div>
{destination === "admin" ? <AdminPanel currentBrandName={brandName} onBrandNameChange={setBrandName} accessToken={accessToken} /> : null}
Comment thread
seonghobae marked this conversation as resolved.
Outdated
</main>
<footer className="app-footer" role="contentinfo">
<div className="app-footer-title">
Expand Down
34 changes: 34 additions & 0 deletions frontend/src/components/BuyerNav.stories.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import type { Meta, StoryObj } from "@storybook/react-vite";
import { BuyerNav } from "./BuyerNav";
Comment thread
seonghobae marked this conversation as resolved.
Outdated

const meta = {
title: "Navigation/BuyerNav",
component: BuyerNav,
args: {
destination: "board",
onChange: () => undefined,
},
} satisfies Meta<typeof BuyerNav>;

export default meta;

type Story = StoryObj<typeof meta>;

export const Board: Story = {};

export const AskAgent: Story = {
args: { destination: "ask" },
};

export const Admin: Story = {
args: { destination: "admin" },
};

// Edge case: an extra tools slot (e.g. a settings or logout control) rendered
// alongside the nav items.
export const WithTools: Story = {
args: {
destination: "customers",
tools: <button type="button">Sign out</button>,
},
};
Loading