Skip to content

🪢 Open source agent evals & observability: Trace, evaluate, and improve LLM applications with one open platform.

refactor(web): Migrate gateway api keys table to design system (#17922)

Ben Bachemc4da913009bc
diff --git a/web/src/components/design-system/PaginationBar/PaginationBar.stories.tsx b/web/src/components/design-system/PaginationBar/PaginationBar.stories.tsx
index 589dd5f131..40a9931ba2 100644
--- a/web/src/components/design-system/PaginationBar/PaginationBar.stories.tsx
+++ b/web/src/components/design-system/PaginationBar/PaginationBar.stories.tsx
@@ -7,7 +7,27 @@ import { PaginationBar } from "./PaginationBar";
function PaginationBarStory() {
const [state, setState] = useState({ pageIndex: 0, pageSize: 20 });
- return <PaginationBar totalCount={45} state={state} onChange={setState} />;
+ return (
+ <PaginationBar
+ mode="offset"
+ totalCount={45}
+ state={state}
+ onChange={setState}
+ />
+ );
+}
+
+function CursorPaginationStory() {
+ const [state, setState] = useState({ pageIndex: 0, pageSize: 50 });
+
+ return (
+ <PaginationBar
+ mode="cursor"
+ state={state}
+ onChange={setState}
+ hasNextPage={state.pageIndex === 0}
+ />
+ );
}
const meta = preview.meta({
@@ -34,3 +54,24 @@ export const Default = meta.story({
).toHaveValue(2);
},
});
+
+export const Cursor = meta.story({
+ name: "(Test) Navigates cursor pages",
+ render: () => <CursorPaginationStory />,
+ play: async ({ canvasElement }) => {
+ const canvas = within(canvasElement);
+ await expect(canvas.getByText("1")).toBeVisible();
+ await expect(canvas.queryByRole("spinbutton")).not.toBeInTheDocument();
+ await userEvent.click(
+ canvas.getByRole("button", { name: "Go to next page" }),
+ );
+ await expect(canvas.getByText("2")).toBeVisible();
+ await expect(
+ canvas.getByRole("button", { name: "Go to next page" }),
+ ).toBeDisabled();
+ await userEvent.click(
+ canvas.getByRole("button", { name: "Go to previous page" }),
+ );
+ await expect(canvas.getByText("1")).toBeVisible();
+ },
+});
diff --git a/web/src/components/design-system/PaginationBar/PaginationBar.tsx b/web/src/components/design-system/PaginationBar/PaginationBar.tsx
index 1b254dc2bd..e254976aef 100644
--- a/web/src/components/design-system/PaginationBar/PaginationBar.tsx
+++ b/web/src/components/design-system/PaginationBar/PaginationBar.tsx
@@ -22,12 +22,25 @@ export type PaginationBarState = {
pageSize: number;
};
-export type PaginationBarProps = {
- totalCount: number | null;
- state: PaginationBarState;
- onChange: (state: PaginationBarState) => void;
- pageSizeOptions?: number[];
-};
+export type PaginationBarProps =
+ | {
+ mode: "offset";
+ totalCount: number | null;
+ state: PaginationBarState;
+ onChange: (state: PaginationBarState) => void;
+ pageSizeOptions?: number[];
+ hasNextPage?: never;
+ isLoadingNextPage?: never;
+ }
+ | {
+ mode: "cursor";
+ totalCount?: never;
+ state: PaginationBarState;
+ onChange: (state: PaginationBarState) => void;
+ hasNextPage: boolean;
+ isLoadingNextPage?: boolean;
+ pageSizeOptions?: number[];
+ };
function PageNumberInput({
currentPage,
@@ -73,73 +86,84 @@ function PageNumberInput({
);
}
-export function PaginationBar({
- totalCount,
- state,
- onChange,
- pageSizeOptions = [10, 20, 30, 40, 50],
-}: PaginationBarProps) {
+export function PaginationBar(props: PaginationBarProps) {
+ const { state, onChange, pageSizeOptions = [10, 20, 30, 40, 50] } = props;
+ const totalCount = props.totalCount ?? null;
+ const isCursorPagination = props.mode === "cursor";
const pageCount = Math.max(1, Math.ceil((totalCount ?? 0) / state.pageSize));
const currentPage = state.pageIndex + 1;
const canGoBack = state.pageIndex > 0;
- const canGoForward = totalCount !== null && state.pageIndex < pageCount - 1;
+ const canGoForward =
+ props.mode === "cursor"
+ ? props.hasNextPage && !props.isLoadingNextPage
+ : totalCount !== null && state.pageIndex < pageCount - 1;
return (
<div className="bg-background @container/pagination sticky bottom-0 z-10 flex w-full min-w-0 justify-end border-t py-2 pr-2 font-bold">
<div className="flex min-w-0 flex-wrap items-center justify-end gap-x-4 gap-y-2 @min-[520px]/pagination:gap-x-6 @min-[720px]/pagination:gap-x-8">
- <div className="flex shrink-0 items-center gap-2">
- <span className="text-sm whitespace-nowrap @min-[440px]/pagination:hidden">
- Rows
- </span>
- <span className="hidden text-sm whitespace-nowrap @min-[440px]/pagination:block">
- Rows per page
- </span>
- <Select
- value={`${state.pageSize}`}
- onValueChange={(value) => {
- const pageSize = Number(value);
- const firstVisibleRow = state.pageIndex * state.pageSize;
- onChange({
- pageIndex: Math.floor(firstVisibleRow / pageSize),
- pageSize,
- });
- }}
- >
- <SelectTrigger className="h-8 w-[70px]">
- <SelectValue placeholder={state.pageSize} />
- </SelectTrigger>
- <SelectContent side="top">
- {pageSizeOptions.map((pageSize) => (
- <SelectItem key={pageSize} value={`${pageSize}`}>
- {pageSize}
- </SelectItem>
- ))}
- </SelectContent>
- </Select>
- </div>
+ {!isCursorPagination && (
+ <div className="flex shrink-0 items-center gap-2">
+ <span className="text-sm whitespace-nowrap @min-[440px]/pagination:hidden">
+ Rows
+ </span>
+ <span className="hidden text-sm whitespace-nowrap @min-[440px]/pagination:block">
+ Rows per page
+ </span>
+ <Select
+ value={`${state.pageSize}`}
+ onValueChange={(value) => {
+ const pageSize = Number(value);
+ const firstVisibleRow = state.pageIndex * state.pageSize;
+ onChange({
+ pageIndex: Math.floor(firstVisibleRow / pageSize),
+ pageSize,
+ });
+ }}
+ >
+ <SelectTrigger className="h-8 w-[70px]">
+ <SelectValue placeholder={state.pageSize} />
+ </SelectTrigger>
+ <SelectContent side="top">
+ {pageSizeOptions.map((pageSize) => (
+ <SelectItem key={pageSize} value={`${pageSize}`}>
+ {pageSize}
+ </SelectItem>
+ ))}
+ </SelectContent>
+ </Select>
+ </div>
+ )}
<div className="flex shrink-0 flex-nowrap items-center gap-x-4 @min-[520px]/pagination:gap-x-6">
<div className="flex items-center justify-center gap-1 text-sm whitespace-nowrap">
Page
- <PageNumberInput
- key={`${currentPage}-${pageCount}`}
- currentPage={currentPage}
- pageCount={pageCount}
- onNavigate={(pageIndex) => onChange({ ...state, pageIndex })}
- />
- <span>of {totalCount === null ? "…" : pageCount}</span>
+ {isCursorPagination ? (
+ <span>{currentPage}</span>
+ ) : (
+ <>
+ <PageNumberInput
+ key={`${currentPage}-${pageCount}`}
+ currentPage={currentPage}
+ pageCount={pageCount}
+ onNavigate={(pageIndex) => onChange({ ...state, pageIndex })}
+ />
+ <span>of {totalCount === null ? "…" : pageCount}</span>
+ </>
+ )}
</div>
<div className="flex items-center gap-2">
- <span className="hidden @min-[560px]/pagination:inline-flex">
- <IconButton
- icon={ChevronsLeft}
- onClick={() => onChange({ ...state, pageIndex: 0 })}
- disabled={!canGoBack}
- label="Go to first page"
- variant="outline"
- />
- </span>
+ {!isCursorPagination && (
+ <span className="hidden @min-[560px]/pagination:inline-flex">
+ <IconButton
+ icon={ChevronsLeft}
+ onClick={() => onChange({ ...state, pageIndex: 0 })}
+ disabled={!canGoBack}
+ label="Go to first page"
+ variant="outline"
+ />
+ </span>
+ )}
<IconButton
icon={ChevronLeft}
onClick={() =>
@@ -158,15 +182,19 @@ export function PaginationBar({
label="Go to next page"
variant="outline"
/>
- <span className="hidden @min-[560px]/pagination:inline-flex">
- <IconButton
- icon={ChevronsRight}
- onClick={() => onChange({ ...state, pageIndex: pageCount - 1 })}
- disabled={!canGoForward}
- label="Go to last page"
- variant="outline"
- />
- </span>
+ {!isCursorPagination && (
+ <span className="hidden @min-[560px]/pagination:inline-flex">
+ <IconButton
+ icon={ChevronsRight}
+ onClick={() =>
+ onChange({ ...state, pageIndex: pageCount - 1 })
+ }
+ disabled={!canGoForward}
+ label="Go to last page"
+ variant="outline"
+ />
+ </span>
+ )}
</div>
</div>
</div>
diff --git a/web/src/components/design-system/table/Table.tsx b/web/src/components/design-system/table/Table.tsx
index 5ed97e0546..e3ebb6375c 100644
--- a/web/src/components/design-system/table/Table.tsx
+++ b/web/src/components/design-system/table/Table.tsx
@@ -278,6 +278,7 @@ export function Table<TData extends object>({
? "p-0"
: "p-2",
column.columnDef.cellClassName,
+ column.columnDef.sensitive && "ph-no-capture",
column.columnDef.hideBelowMd &&
"hidden md:table-cell",
)}
@@ -342,6 +343,7 @@ export function Table<TData extends object>({
"h-full overflow-hidden border-b align-middle text-xs whitespace-nowrap",
column.cellPadding === "none" ? "p-0" : "p-2",
column.cellClassName,
+ column.sensitive && "ph-no-capture",
column.hideBelowMd && "hidden md:table-cell",
)}
>
diff --git a/web/src/components/design-system/table/columns/createBadgeListTableColumn.tsx b/web/src/components/design-system/table/columns/createBadgeListTableColumn.tsx
index 39a5ebd978..0dccf991e9 100644
--- a/web/src/components/design-system/table/columns/createBadgeListTableColumn.tsx
+++ b/web/src/components/design-system/table/columns/createBadgeListTableColumn.tsx
@@ -2,6 +2,8 @@
import { type CellContext, type RowData } from "@tanstack/react-table";
import { type LucideIcon } from "lucide-react";
+import { SingleLineOverflowList } from "@/src/components/SingleLineOverflowList";
+import { CustomTooltip } from "@/src/components/design-system/CustomTooltip/CustomTooltip";
import { Badge, type BadgeProps } from "@/src/components/ui/badge";
import { Skeleton } from "@/src/components/ui/skeleton";
import { cn } from "@/src/utils/tailwind";
@@ -59,11 +61,9 @@ export function createBadgeListTableColumn<TData extends RowData>({
getBadge,
nullValue,
range,
- shouldWrap,
...options
}: BadgeListTableColumnOptions<TData> & {
nullValue?: string;
- shouldWrap: boolean;
}) {
return createTableColumn<TData, string[]>({
...options,
@@ -71,33 +71,64 @@ export function createBadgeListTableColumn<TData extends RowData>({
renderCell: (values, context) => {
if (!values?.length) return nullValue ?? null;
- return (
- <div className={cn("flex gap-1", shouldWrap && "flex-wrap")}>
- {values.map((value, index) => {
- const badge =
- range === "semantic" || range === "decorative"
- ? getBadge(value, context)
- : (getBadge?.(value, context) ?? {
- value,
- variant: "secondary",
- });
- const Icon = badge.icon;
+ const badges = values.map((value, index) => ({
+ key: String(index),
+ ...(range === "semantic" || range === "decorative"
+ ? getBadge(value, context)
+ : (getBadge?.(value, context) ?? {
+ value,
+ variant: "secondary" as const,
+ })),
+ }));
+ const renderBadge = (badge: (typeof badges)[number]) => {
+ const Icon = badge.icon;
+ return (
+ <Badge
+ variant={badge.variant}
+ className="max-w-fit gap-1 truncate rounded-sm px-1 font-normal"
+ title={badge.value}
+ >
+ {Icon && <Icon className="size-3 shrink-0" aria-hidden />}
+ <span className="truncate" title={badge.value}>
+ {badge.value}
+ </span>
+ </Badge>
+ );
+ };
- return (
- <Badge
- key={`${value}-${index}`}
- variant={badge.variant}
- className="max-w-fit gap-1 truncate rounded-sm px-1 font-normal"
- title={badge.value}
- >
- {Icon && <Icon className="size-3 shrink-0" aria-hidden />}
- <span className="truncate" title={badge.value}>
- {badge.value}
+ return (
+ <SingleLineOverflowList
+ items={badges}
+ additionalOverflowCount={0}
+ getKey={(badge) => badge.key}
+ renderItem={renderBadge}
+ renderOverflow={({ hiddenItems, overflowItemCount }) => (
+ <CustomTooltip
+ content={
+ <div
+ className={cn(
+ "flex flex-wrap gap-1",
+ options.sensitive && "ph-no-capture",
+ )}
+ >
+ {hiddenItems.map((badge) => (
+ <span key={badge.key}>{renderBadge(badge)}</span>
+ ))}
+ </div>
+ }
+ >
+ {({ getTriggerProps }) => (
+ <span
+ {...getTriggerProps()}
+ className="inline-flex"
+ tabIndex={0}
+ >
+ <Badge variant="secondary">+{overflowItemCount}</Badge>
</span>
- </Badge>
- );
- })}
- </div>
+ )}
+ </CustomTooltip>
+ )}
+ />
);
},
});
diff --git a/web/src/components/table/types.ts b/web/src/components/table/types.ts
index 4daf83c140..4a4f8d3026 100644
--- a/web/src/components/table/types.ts
+++ b/web/src/components/table/types.ts
@@ -31,6 +31,7 @@ declare module "@tanstack/react-table" {
cellPadding?: DataTableCellPadding;
cellBackground?: DataTableCellBackground;
cellClassName?: string;
+ sensitive?: boolean;
headerClassName?: string;
hideBelowMd?: boolean;
}
diff --git a/web/src/ee/features/audit-log-viewer/AuditLogsTable/AuditLogsTable.stories.tsx b/web/src/ee/features/audit-log-viewer/AuditLogsTable/AuditLogsTable.stories.tsx
index a75f9f3e30..32d9fa6044 100644
--- a/web/src/ee/features/audit-log-viewer/AuditLogsTable/AuditLogsTable.stories.tsx
+++ b/web/src/ee/features/audit-log-viewer/AuditLogsTable/AuditLogsTable.stories.tsx
@@ -82,6 +82,7 @@ export const Default = meta.story({
tableName: "auditLogs",
data: { status: "success", data: rows },
pagination: {
+ mode: "offset",
totalCount: rows.length,
state: { pageIndex: 0, pageSize: 50 },
onChange: fn(),
diff --git a/web/src/ee/features/audit-log-viewer/AuditLogsTable/ConnectedAuditLogsTable.tsx b/web/src/ee/features/audit-log-viewer/AuditLogsTable/ConnectedAuditLogsTable.tsx
index 4cf24f3e48..c26b557f24 100644
--- a/web/src/ee/features/audit-log-viewer/AuditLogsTable/ConnectedAuditLogsTable.tsx
+++ b/web/src/ee/features/audit-log-viewer/AuditLogsTable/ConnectedAuditLogsTable.tsx
@@ -119,6 +119,7 @@ export function ConnectedAuditLogsTable(props: AuditLogsTableProps) {
onRowHeightChange={setRowHeight}
toolbarActions={toolbarActions}
pagination={{
+ mode: "offset",
totalCount: auditLogs.data?.totalCount ?? 0,
onChange: setPaginationState,
state: paginationState,
diff --git a/web/src/features/ai-gateway/components/GatewayApiKeysPage/GatewayApiKeysPage.tsx b/web/src/features/ai-gateway/components/GatewayApiKeysPage/GatewayApiKeysPage.tsx
index 5a6d963d6d..0499b88cee 100644
--- a/web/src/features/ai-gateway/components/GatewayApiKeysPage/GatewayApiKeysPage.tsx
+++ b/web/src/features/ai-gateway/components/GatewayApiKeysPage/GatewayApiKeysPage.tsx
@@ -1,80 +1,21 @@
-import { Plus } from "lucide-react";
-
import Header from "@/src/components/layouts/header";
-import { Alert } from "@/src/components/design-system/Alert/Alert";
-import { Button } from "@/src/components/ui/button";
-import { Skeleton } from "@/src/components/ui/skeleton";
-import { CreateGatewayApiKeyDialogController } from "@/src/features/ai-gateway/components/GatewayApiKeysPage/components/CreateGatewayApiKeyDialogController/CreateGatewayApiKeyDialogController";
-import { GatewayApiKeysView } from "@/src/features/ai-gateway/components/GatewayApiKeysPage/components/GatewayApiKeysView/GatewayApiKeysView";
-import { RevokeGatewayApiKeyDialog } from "@/src/features/ai-gateway/components/GatewayApiKeysPage/components/RevokeGatewayApiKeyDialog";
-import { api } from "@/src/utils/api";
+import { ConnectedGatewayApiKeysTable } from "./components/GatewayApiKeysTable/ConnectedGatewayApiKeysTable";
export function GatewayApiKeysPage({
organizationId,
}: {
organizationId: string;
}) {
- const apiKeysQuery = api.aiGateway.listApiKeys.useInfiniteQuery(
- { orgId: organizationId, limit: 50 },
- { getNextPageParam: (lastPage) => lastPage.nextCursor ?? undefined },
- );
-
- if (apiKeysQuery.isPending) {
- return <ApiKeysSkeleton />;
- }
-
- if (apiKeysQuery.isError) {
- return (
- <div className="flex flex-col gap-4">
- <Header title="Gateway API keys" />
- <Alert variant="destructive">
- <Alert.Title>Gateway API keys could not be loaded</Alert.Title>
- <Alert.Description>
- Retry to manage keys for this organization.
- </Alert.Description>
- </Alert>
- <Button
- className="w-fit"
- variant="secondary"
- onClick={() => apiKeysQuery.refetch()}
- >
- Retry
- </Button>
- </div>
- );
- }
-
- return (
- <GatewayApiKeysView
- apiKeys={apiKeysQuery.data?.pages.flatMap((page) => page.data) ?? []}
- hasMore={Boolean(apiKeysQuery.hasNextPage)}
- isLoadingMore={apiKeysQuery.isFetchingNextPage}
- onLoadMore={() => apiKeysQuery.fetchNextPage()}
- createAction={
- <CreateGatewayApiKeyDialogController organizationId={organizationId}>
- {({ openDialog }) => (
- <Button onClick={openDialog}>
- <Plus className="mr-1.5 size-4" />
- Create key
- </Button>
- )}
- </CreateGatewayApiKeyDialogController>
- }
- renderRevokeAction={(apiKeyId) => (
- <RevokeGatewayApiKeyDialog
- organizationId={organizationId}
- apiKeyId={apiKeyId}
- />
- )}
- />
- );
-}
-
-function ApiKeysSkeleton() {
return (
- <div className="flex flex-col gap-4" data-testid="gateway-api-keys-loading">
- <Skeleton className="h-7 w-48" />
- <Skeleton className="h-48 w-full" />
+ <div className="flex flex-col gap-4">
+ <Header title="Gateway API keys" />
+ <p className="text-muted-foreground text-sm">
+ These organization keys authenticate requests to the AI Gateway only.
+ </p>
+ <ConnectedGatewayApiKeysTable
+ key={organizationId}
+ organizationId={organizationId}
+ />
</div>
);
}
diff --git a/web/src/features/ai-gateway/components/GatewayApiKeysPage/components/GatewayApiKeysTable/ConnectedGatewayApiKeysTable.tsx b/web/src/features/ai-gateway/components/GatewayApiKeysPage/components/GatewayApiKeysTable/ConnectedGatewayApiKeysTable.tsx
new file mode 100644
index 0000000000..d2f89cf5ff
--- /dev/null
+++ b/web/src/features/ai-gateway/components/GatewayApiKeysPage/components/GatewayApiKeysTable/ConnectedGatewayApiKeysTable.tsx
@@ -0,0 +1,102 @@
+import { useState } from "react";
+import { Alert } from "@/src/components/design-system/Alert/Alert";
+import { Button } from "@/src/components/ui/button";
+import { CreateGatewayApiKeyDialogController } from "@/src/features/ai-gateway/components/GatewayApiKeysPage/components/CreateGatewayApiKeyDialogController/CreateGatewayApiKeyDialogController";
+import { ConfirmationDialogController } from "@/src/components/design-system/ConfirmationDialogController/ConfirmationDialogController";
+import { api } from "@/src/utils/api";
+import { GatewayApiKeysTable } from "./GatewayApiKeysTable";
+
+export function ConnectedGatewayApiKeysTable({
+ organizationId,
+}: {
+ organizationId: string;
+}) {
+ const apiKeysQuery = api.aiGateway.listApiKeys.useInfiniteQuery(
+ { orgId: organizationId, limit: 50 },
+ { getNextPageParam: (lastPage) => lastPage.nextCursor ?? undefined },
+ );
+ const [pageIndex, setPageIndex] = useState(0);
+ const utils = api.useUtils();
+ const revoke = api.aiGateway.revokeApiKey.useMutation();
+
+ if (apiKeysQuery.isError) {
+ return (
+ <div className="flex flex-col gap-4">
+ <Alert variant="destructive">
+ <Alert.Title>Gateway API keys could not be loaded</Alert.Title>
+ <Alert.Description>
+ Retry to manage keys for this organization.
+ </Alert.Description>
+ </Alert>
+ <Button
+ className="w-fit"
+ variant="secondary"
+ onClick={() => apiKeysQuery.refetch()}
+ >
+ Retry
+ </Button>
+ </div>
+ );
+ }
+
+ const pages = apiKeysQuery.data?.pages ?? [];
+ const currentPageIndex = Math.min(pageIndex, Math.max(0, pages.length - 1));
+
+ return (
+ <ConfirmationDialogController<string>
+ title="Revoke gateway API key"
+ text="Requests using this key will immediately be rejected. This action cannot be undone."
+ confirmLabel="Revoke key"
+ variant="destructive"
+ loading={revoke.isPending}
+ error={revoke.error?.message}
+ onAfterDismiss={revoke.reset}
+ onConfirm={async (apiKeyId) => {
+ await revoke.mutateAsync({ orgId: organizationId, id: apiKeyId });
+ await utils.aiGateway.listApiKeys.invalidate({ orgId: organizationId });
+ }}
+ >
+ {({ openDialog: openRevokeDialog }) => (
+ <CreateGatewayApiKeyDialogController organizationId={organizationId}>
+ {({ openDialog }) => {
+ return (
+ <GatewayApiKeysTable
+ data={
+ apiKeysQuery.isPending
+ ? { status: "loading" }
+ : {
+ status: "success",
+ data: pages[currentPageIndex]?.data ?? [],
+ }
+ }
+ pagination={{
+ mode: "cursor",
+ state: { pageIndex: currentPageIndex, pageSize: 50 },
+ pageSizeOptions: [50],
+ hasNextPage:
+ currentPageIndex < pages.length - 1 ||
+ Boolean(apiKeysQuery.hasNextPage),
+ isLoadingNextPage: apiKeysQuery.isFetchingNextPage,
+ onChange: (state) => {
+ if (state.pageIndex < pages.length) {
+ setPageIndex(state.pageIndex);
+ return;
+ }
+ if (!apiKeysQuery.hasNextPage) return;
+ apiKeysQuery.fetchNextPage().then((result) => {
+ if (result.data?.pages[state.pageIndex]) {
+ setPageIndex(state.pageIndex);
+ }
+ });
+ },
+ }}
+ createAction={openDialog}
+ onRevoke={openRevokeDialog}
+ />
+ );
+ }}
+ </CreateGatewayApiKeyDialogController>
+ )}
+ </ConfirmationDialogController>
+ );
+}
diff --git a/web/src/features/ai-gateway/components/GatewayApiKeysPage/components/GatewayApiKeysTable/GatewayApiKeysTable.stories.tsx b/web/src/features/ai-gateway/components/GatewayApiKeysPage/components/GatewayApiKeysTable/GatewayApiKeysTable.stories.tsx
new file mode 100644
index 0000000000..3f11a15790
--- /dev/null
+++ b/web/src/features/ai-gateway/components/GatewayApiKeysPage/components/GatewayApiKeysTable/GatewayApiKeysTable.stories.tsx
@@ -0,0 +1,199 @@
+import type { ComponentProps } from "react";
+import { expect, fn, screen, userEvent, waitFor } from "storybook/test";
+
+import preview from "@/.storybook/preview";
+import { GatewayApiKeysTable } from "./GatewayApiKeysTable";
+
+const meta = preview.meta({ component: GatewayApiKeysTable });
+
+const onCreate = fn();
+const onRevoke = fn();
+const onPageChange = fn();
+
+const apiKeys = [
+ {
+ metadata: { environment: "production", region: "eu" },
+ apiKey: {
+ id: "gateway-key-production",
+ publicKey: "pk-lf-gw-...4fa2",
+ displaySecretKey: "sk-lf-gw-...91bc",
+ note: "Production application",
+ createdAt: new Date("2026-09-04T12:00:00.000Z"),
+ },
+ },
+] satisfies Extract<
+ ComponentProps<typeof GatewayApiKeysTable>["data"],
+ { status: "success" }
+>["data"];
+
+const manyApiKeys = Array.from({ length: 30 }, (_, index) => ({
+ metadata: {
+ environment: index % 2 === 0 ? "production" : "staging",
+ region: index % 3 === 0 ? "us" : "eu",
+ },
+ apiKey: {
+ id: `gateway-key-${index + 1}`,
+ publicKey: `pk-lf-gw-${String(index + 1).padStart(4, "0")}`,
+ displaySecretKey: `sk-lf-gw-...${String(index + 1).padStart(4, "0")}`,
+ note: `Application ${index + 1}`,
+ createdAt: new Date(Date.UTC(2026, 8, 4 - (index % 28))),
+ },
+})) satisfies Extract<
+ ComponentProps<typeof GatewayApiKeysTable>["data"],
+ { status: "success" }
+>["data"];
+
+const actions = {
+ createAction: onCreate,
+ onRevoke,
+ pagination: {
+ mode: "cursor",
+ state: { pageIndex: 0, pageSize: 50 },
+ pageSizeOptions: [50],
+ hasNextPage: false,
+ onChange: onPageChange,
+ },
+} satisfies Pick<
+ ComponentProps<typeof GatewayApiKeysTable>,
+ "createAction" | "onRevoke" | "pagination"
+>;
+
+export const PopulatedMetadata = meta.story({
+ name: "(Test) Populated metadata excludes key data from recordings",
+ args: {
+ data: { status: "success", data: apiKeys },
+ ...actions,
+ },
+ play: async ({ canvas }) => {
+ const cells = canvas.getAllByRole("row")[1]!.querySelectorAll("td");
+ await expect(cells[1]).toHaveClass("ph-no-capture");
+ await expect(cells[3]).toHaveClass("ph-no-capture");
+ },
+});
+
+export const OverflowingMetadata = meta.story({
+ name: "(Test) Metadata badges collapse when the cell is narrow",
+ args: {
+ data: {
+ status: "success",
+ data: [
+ {
+ ...apiKeys[0]!,
+ metadata: {
+ environment: "production",
+ region: "eu",
+ team: "platform",
+ service: "gateway",
+ },
+ },
+ ],
+ },
+ ...actions,
+ },
+ render: (args) => (
+ <div className="w-[420px]">
+ <GatewayApiKeysTable {...args} />
+ </div>
+ ),
+ play: async ({ canvas }) => {
+ const metadataCell = canvas
+ .getAllByRole("row")[1]!
+ .querySelectorAll("td")[3]!;
+ await waitFor(() => {
+ expect(metadataCell).toHaveTextContent(/\+\d+/);
+ });
+ const overflow = metadataCell.querySelector("[tabindex='0']")!;
+ await userEvent.hover(overflow);
+ const tooltip = await screen.findByRole("tooltip");
+ await expect(tooltip.firstElementChild).toHaveClass("ph-no-capture");
+ },
+});
+
+export const ManyRowsWithMoreAvailable = meta.story({
+ args: {
+ data: { status: "success", data: manyApiKeys },
+ ...actions,
+ pagination: { ...actions.pagination, hasNextPage: true },
+ },
+});
+
+export const Empty = meta.story({
+ args: {
+ data: { status: "success", data: [] },
+ ...actions,
+ },
+});
+
+export const Loading = meta.story({
+ args: {
+ data: { status: "loading" },
+ ...actions,
+ },
+});
+
+export const MissingDescription = meta.story({
+ name: "(Test) Missing description shows empty marker",
+ args: {
+ data: {
+ status: "success",
+ data: [{ ...apiKeys[0]!, apiKey: { ...apiKeys[0]!.apiKey, note: null } }],
+ },
+ ...actions,
+ },
+ play: async ({ canvas }) => {
+ const row = canvas.getAllByRole("row")[1]!;
+ await expect(row.querySelectorAll("td")[2]).toHaveTextContent(/^\s*-\s*$/);
+ },
+});
+
+export const MoreAvailable = meta.story({
+ args: {
+ data: { status: "success", data: apiKeys },
+ ...actions,
+ pagination: { ...actions.pagination, hasNextPage: true },
+ },
+});
+
+export const LoadingMore = meta.story({
+ args: {
+ data: { status: "success", data: apiKeys },
+ ...actions,
+ pagination: {
+ ...actions.pagination,
+ hasNextPage: true,
+ isLoadingNextPage: true,
+ },
+ },
+});
+
+export const NextPage = meta.story({
+ name: "(Test) Next page",
+ args: {
+ data: { status: "success", data: apiKeys },
+ ...actions,
+ pagination: { ...actions.pagination, hasNextPage: true },
+ },
+ play: async ({ canvas }) => {
+ onPageChange.mockClear();
+ await userEvent.click(
+ canvas.getByRole("button", { name: "Go to next page" }),
+ );
+ await expect(onPageChange).toHaveBeenCalledWith({
+ pageIndex: 1,
+ pageSize: 50,
+ });
+ },
+});
+
+export const CreatesKey = meta.story({
+ name: "(Test) Creates key",
+ args: {
+ data: { status: "success", data: apiKeys },
+ ...actions,
+ },
+ play: async ({ canvas }) => {
+ onCreate.mockClear();
+ await userEvent.click(canvas.getByRole("button", { name: "Create key" }));
+ await expect(onCreate).toHaveBeenCalledOnce();
+ },
+});
diff --git a/web/src/features/ai-gateway/components/GatewayApiKeysPage/components/GatewayApiKeysTable/GatewayApiKeysTable.tsx b/web/src/features/ai-gateway/components/GatewayApiKeysPage/components/GatewayApiKeysTable/GatewayApiKeysTable.tsx
new file mode 100644
index 0000000000..5c22821a9d
--- /dev/null
+++ b/web/src/features/ai-gateway/components/GatewayApiKeysPage/components/GatewayApiKeysTable/GatewayApiKeysTable.tsx
@@ -0,0 +1,102 @@
+import { Plus, Trash } from "lucide-react";
+
+import { SettingsTable } from "@/src/components/SettingsTable/SettingsTable";
+import type { PaginationBarProps } from "@/src/components/design-system/PaginationBar/PaginationBar";
+import { createDateTableColumn } from "@/src/components/design-system/table/columns/createDateTableColumn";
+import { createBadgeListTableColumn } from "@/src/components/design-system/table/columns/createBadgeListTableColumn";
+import { createTextTableColumn } from "@/src/components/design-system/table/columns/createTextTableColumn";
+import type { AsyncTableData } from "@/src/components/design-system/table/Table";
+import type { LangfuseColumnDef } from "@/src/components/table/types";
+
+type GatewayApiKey = {
+ metadata: unknown;
+ apiKey: {
+ id: string;
+ publicKey: string;
+ displaySecretKey: string;
+ note: string | null;
+ createdAt: Date;
+ };
+};
+
+export function GatewayApiKeysTable({
+ data,
+ createAction,
+ onRevoke,
+ pagination,
+}: {
+ data: AsyncTableData<GatewayApiKey[]>;
+ createAction: () => void;
+ onRevoke: (apiKeyId: string) => void;
+ pagination: PaginationBarProps;
+}) {
+ const columns: LangfuseColumnDef<GatewayApiKey>[] = [
+ createDateTableColumn<GatewayApiKey>({
+ accessorFn: (row) => row.apiKey.createdAt,
+ id: "createdAt",
+ header: "Created",
+ enableResizing: false,
+ }),
+ createTextTableColumn<GatewayApiKey>({
+ accessorFn: (row) => row.apiKey.displaySecretKey,
+ id: "key",
+ header: "Key",
+ sensitive: true,
+ enableResizing: false,
+ }),
+ createTextTableColumn<GatewayApiKey>({
+ accessorFn: (row) => row.apiKey.note,
+ id: "description",
+ header: "Description",
+ nullValue: "-",
+ enableResizing: false,
+ }),
+ createBadgeListTableColumn<GatewayApiKey>({
+ accessorFn: (row) => getMetadataEntries(row.metadata),
+ id: "metadata",
+ header: "Metadata",
+ sensitive: true,
+ enableResizing: false,
+ }),
+ ];
+
+ return (
+ <SettingsTable
+ tableName="gatewayApiKeys"
+ columns={columns}
+ data={data}
+ actions={(row) => [
+ {
+ id: "revoke",
+ type: "item",
+ title: "Revoke key",
+ icon: Trash,
+ variant: "destructive",
+ onClick: () => onRevoke(row.apiKey.id),
+ },
+ ]}
+ pagination={pagination}
+ toolbarActions={[
+ {
+ id: "create-key",
+ label: "Create key",
+ icon: <Plus className="size-4" aria-hidden="true" />,
+ onClick: createAction,
+ },
+ ]}
+ noResultsMessage="No gateway API keys created."
+ />
+ );
+}
+
+function getMetadataEntries(value: unknown) {
+ if (!value || typeof value !== "object" || Array.isArray(value)) return [];
+ return Object.entries(value).flatMap(([key, item]) =>
+ item === null ||
+ typeof item === "string" ||
+ typeof item === "number" ||
+ typeof item === "boolean"
+ ? [`${key}: ${String(item)}`]
+ : [],
+ );
+}
diff --git a/web/src/features/ai-gateway/components/GatewayApiKeysPage/components/GatewayApiKeysView/GatewayApiKeysView.stories.tsx b/web/src/features/ai-gateway/components/GatewayApiKeysPage/components/GatewayApiKeysView/GatewayApiKeysView.stories.tsx
deleted file mode 100644
index 32cd85d79e..0000000000
--- a/web/src/features/ai-gateway/components/GatewayApiKeysPage/components/GatewayApiKeysView/GatewayApiKeysView.stories.tsx
+++ /dev/null
@@ -1,111 +0,0 @@
-import type { ComponentProps } from "react";
-import { Button } from "@/src/components/ui/button";
-import { expect, fn, userEvent } from "storybook/test";
-
-import preview from "@/.storybook/preview";
-import { GatewayApiKeysView } from "./GatewayApiKeysView";
-
-const meta = preview.meta({ component: GatewayApiKeysView });
-
-const onCreate = fn();
-const onRevoke = fn();
-const onLoadMore = fn();
-
-const apiKeys = [
- {
- metadata: { environment: "production", region: "eu" },
- apiKey: {
- id: "gateway-key-production",
- publicKey: "pk-lf-gw-...4fa2",
- displaySecretKey: "sk-lf-gw-...91bc",
- note: "Production application",
- createdAt: new Date("2026-09-04T12:00:00.000Z"),
- },
- },
-] satisfies ComponentProps<typeof GatewayApiKeysView>["apiKeys"];
-
-const manyApiKeys = Array.from({ length: 30 }, (_, index) => ({
- metadata: {
- environment: index % 2 === 0 ? "production" : "staging",
- region: index % 3 === 0 ? "us" : "eu",
- },
- apiKey: {
- id: `gateway-key-${index + 1}`,
- publicKey: `pk-lf-gw-${String(index + 1).padStart(4, "0")}`,
- displaySecretKey: `sk-lf-gw-...${String(index + 1).padStart(4, "0")}`,
- note: `Application ${index + 1}`,
- createdAt: new Date(Date.UTC(2026, 8, 4 - (index % 28))),
- },
-})) satisfies ComponentProps<typeof GatewayApiKeysView>["apiKeys"];
-
-const actions = {
- createAction: <Button onClick={onCreate}>Create key</Button>,
- renderRevokeAction: (apiKeyId: string) => (
- <Button variant="ghost" onClick={() => onRevoke(apiKeyId)}>
- Revoke
- </Button>
- ),
- hasMore: false,
- isLoadingMore: false,
- onLoadMore,
-} satisfies Pick<
- ComponentProps<typeof GatewayApiKeysView>,
- | "createAction"
- | "renderRevokeAction"
- | "hasMore"
- | "isLoadingMore"
- | "onLoadMore"
->;
-
-export const PopulatedMetadata = meta.story({
- args: {
- apiKeys,
- ...actions,
- },
-});
-
-export const ManyRowsWithMoreAvailable = meta.story({
- args: {
- apiKeys: manyApiKeys,
- ...actions,
- hasMore: true,
- },
-});
-
-export const Empty = meta.story({
- args: {
- apiKeys: [],
- ...actions,
- },
-});
-
-export const MoreAvailable = meta.story({
- args: {
- apiKeys,
- ...actions,
- hasMore: true,
- },
-});
-
-export const LoadingMore = meta.story({
- args: {
- apiKeys,
- ...actions,
- hasMore: true,
- isLoadingMore: true,
- },
-});
-
-export const LoadsMore = meta.story({
- name: "(Test) Loads More",
- args: {
- apiKeys,
- ...actions,
- hasMore: true,
- },
- play: async ({ canvas }) => {
- onLoadMore.mockClear();
- await userEvent.click(canvas.getByRole("button", { name: "Load more" }));
- await expect(onLoadMore).toHaveBeenCalledOnce();
- },
-});
diff --git a/web/src/features/ai-gateway/components/GatewayApiKeysPage/components/GatewayApiKeysView/GatewayApiKeysView.tsx b/web/src/features/ai-gateway/components/GatewayApiKeysPage/components/GatewayApiKeysView/GatewayApiKeysView.tsx
deleted file mode 100644
index 4408610837..0000000000
--- a/web/src/features/ai-gateway/components/GatewayApiKeysPage/components/GatewayApiKeysView/GatewayApiKeysView.tsx
+++ /dev/null
@@ -1,164 +0,0 @@
-import type { ReactNode } from "react";
-
-import Header from "@/src/components/layouts/header";
-import { DataTable } from "@/src/components/table/data-table";
-import type { LangfuseColumnDef } from "@/src/components/table/types";
-import { Badge } from "@/src/components/design-system/Badge/Badge";
-import { SingleLineOverflowList } from "@/src/components/SingleLineOverflowList";
-import { Button } from "@/src/components/ui/button";
-import {
- Tooltip,
- TooltipContent,
- TooltipTrigger,
-} from "@/src/components/ui/tooltip";
-
-type GatewayApiKey = {
- metadata: unknown;
- apiKey: {
- id: string;
- publicKey: string;
- displaySecretKey: string;
- note: string | null;
- createdAt: Date;
- };
-};
-
-export function GatewayApiKeysView({
- apiKeys,
- createAction,
- renderRevokeAction,
- hasMore,
- isLoadingMore,
- onLoadMore,
-}: {
- apiKeys: GatewayApiKey[];
- createAction: ReactNode;
- renderRevokeAction: (apiKeyId: string) => ReactNode;
- hasMore: boolean;
- isLoadingMore: boolean;
- onLoadMore: () => unknown;
-}) {
- const columns: LangfuseColumnDef<GatewayApiKey>[] = [
- {
- accessorKey: "apiKey.createdAt",
- id: "createdAt",
- header: "Created",
- cell: ({ row }) => row.original.apiKey.createdAt.toLocaleDateString(),
- size: 120,
- },
- {
- accessorKey: "apiKey.displaySecretKey",
- id: "key",
- header: "Key",
- cell: ({ row }) => (
- <div className="ph-no-capture font-mono">
- {row.original.apiKey.displaySecretKey}
- </div>
- ),
- },
- {
- accessorKey: "apiKey.note",
- id: "description",
- header: "Description",
- cell: ({ row }) => row.original.apiKey.note || "—",
- },
- {
- accessorKey: "metadata",
- header: "Metadata",
- cell: ({ row }) => <MetadataCell metadata={row.original.metadata} />,
- },
- {
- accessorKey: "apiKey.id",
- id: "actions",
- header: "Actions",
- cell: ({ row }) => renderRevokeAction(row.original.apiKey.id),
- size: 100,
- isFixedPosition: true,
- enableSorting: false,
- enableResizing: false,
- },
- ];
-
- return (
- <div className="flex flex-col gap-4">
- <Header title="Gateway API keys" actionButtons={createAction} />
- <p className="text-muted-foreground text-sm">
- These organization keys authenticate requests to the AI Gateway only.
- </p>
- <div className="flex max-h-[60dvh] flex-col overflow-hidden rounded-md border [&>:first-child>:first-child]:border-t-0">
- <DataTable
- tableName="gatewayApiKeys"
- columns={columns}
- data={{ isLoading: false, isError: false, data: apiKeys }}
- hidePagination
- footer={
- hasMore ? (
- <Button
- variant="secondary"
- loading={isLoadingMore}
- disabled={isLoadingMore}
- aria-label="Load more"
- onClick={() => {
- onLoadMore();
- }}
- >
- Load more
- </Button>
- ) : undefined
- }
- noResultsMessage="No gateway API keys created."
- getRowClassName={() => "h-9"}
- cellPadding="comfortable"
- />
- </div>
- </div>
- );
-}
-
-function MetadataCell({ metadata }: { metadata: unknown }) {
- const entries = getMetadataEntries(metadata);
-
- if (entries.length === 0) {
- return <span className="text-muted-foreground">—</span>;
- }
-
- // Rendered without a wrapper element: the list measures against its own
- // width, so it has to stretch inside the table cell's flex row rather than
- // shrink to the width of the badges it is measuring.
- return (
- <SingleLineOverflowList
- items={entries}
- additionalOverflowCount={0}
- getKey={([key]) => key}
- renderItem={([key, value]) => (
- <span className="ph-no-capture inline-flex min-w-0">
- <Badge text={`${key}: ${value}`} />
- </span>
- )}
- renderOverflow={({ hiddenItems, overflowItemCount }) => (
- <Tooltip>
- <TooltipTrigger asChild>
- <span className="inline-flex" tabIndex={0}>
- <Badge text={`+${overflowItemCount}`} />
- </span>
- </TooltipTrigger>
- <TooltipContent className="ph-no-capture max-w-xs">
- {hiddenItems.map(([key, value]) => `${key}: ${value}`).join(", ")}
- </TooltipContent>
- </Tooltip>
- )}
- />
- );
-}
-
-function getMetadataEntries(value: unknown): Array<[string, string]> {
- if (!value || typeof value !== "object" || Array.isArray(value)) return [];
- return Object.entries(value).flatMap(([key, item]) =>
- item === null ||
- typeof item === "string" ||
- typeof item === "number" ||
- typeof item === "boolean"
- ? [[key, String(item)]]
- : [],
- );
-}
diff --git a/web/src/features/ai-gateway/components/GatewayApiKeysPage/components/RevokeGatewayApiKeyDialog.tsx b/web/src/features/ai-gateway/components/GatewayApiKeysPage/components/RevokeGatewayApiKeyDialog.tsx
deleted file mode 100644
index 93fcf382fc..0000000000
--- a/web/src/features/ai-gateway/components/GatewayApiKeysPage/components/RevokeGatewayApiKeyDialog.tsx
+++ /dev/null
@@ -1,51 +0,0 @@
-import { useState } from "react";
-
-import { Button } from "@/src/components/ui/button";
-import { ConfirmDialog } from "@/src/components/ui/confirm-dialog";
-import { api, reportNonTrpcError } from "@/src/utils/api";
-
-export function RevokeGatewayApiKeyDialog({
- organizationId,
- apiKeyId,
-}: {
- organizationId: string;
- apiKeyId: string;
-}) {
- const [open, setOpen] = useState(false);
- const utils = api.useUtils();
- const revoke = api.aiGateway.revokeApiKey.useMutation();
-
- const submit = async () => {
- try {
- await revoke.mutateAsync({ orgId: organizationId, id: apiKeyId });
- await utils.aiGateway.listApiKeys.invalidate({
- orgId: organizationId,
- });
- setOpen(false);
- } catch (error) {
- reportNonTrpcError(error, "ai-gateway-api-keys");
- }
- };
-
- return (
- <ConfirmDialog
- open={open}
- onOpenChange={setOpen}
- trigger={
- <Button
- type="button"
- variant="link"
- size="sm"
- className="text-foreground hover:text-foreground h-auto px-0 py-0"
- >
- Revoke
- </Button>
- }
- title="Revoke gateway API key"
- description="Requests using this key will immediately be rejected. This action cannot be undone."
- confirmLabel="Revoke key"
- loading={revoke.isPending}
- onConfirm={submit}
- />
- );
-}
diff --git a/web/src/features/batch-actions/components/BatchActionsTable/BatchActionsTable.stories.tsx b/web/src/features/batch-actions/components/BatchActionsTable/BatchActionsTable.stories.tsx
index 46f7d4f2f8..f071e047d6 100644
--- a/web/src/features/batch-actions/components/BatchActionsTable/BatchActionsTable.stories.tsx
+++ b/web/src/features/batch-actions/components/BatchActionsTable/BatchActionsTable.stories.tsx
@@ -39,6 +39,7 @@ export const Default = meta.story({
],
},
pagination: {
+ mode: "offset",
totalCount: 2,
state: { pageIndex: 0, pageSize: 10 },
onChange: fn(),
@@ -50,6 +51,7 @@ export const Loading = meta.story({
args: {
data: { status: "loading" },
pagination: {
+ mode: "offset",
totalCount: 0,
state: { pageIndex: 0, pageSize: 10 },
onChange: fn(),
diff --git a/web/src/features/batch-actions/components/BatchActionsTable/ConnectedBatchActionsTable.tsx b/web/src/features/batch-actions/components/BatchActionsTable/ConnectedBatchActionsTable.tsx
index beebf4c74f..6b7c89f55a 100644
--- a/web/src/features/batch-actions/components/BatchActionsTable/ConnectedBatchActionsTable.tsx
+++ b/web/src/features/batch-actions/components/BatchActionsTable/ConnectedBatchActionsTable.tsx
@@ -42,6 +42,7 @@ export function ConnectedBatchActionsTable({
<BatchActionsTable
data={tableData}
pagination={{
+ mode: "offset",
totalCount: batchActions.data?.totalCount ?? 0,
onChange: setPaginationState,
state: paginationState,
diff --git a/web/src/features/batch-exports/components/BatchExportsTable/BatchExportsTable.stories.tsx b/web/src/features/batch-exports/components/BatchExportsTable/BatchExportsTable.stories.tsx
index 8997301601..43c5de28b3 100644
--- a/web/src/features/batch-exports/components/BatchExportsTable/BatchExportsTable.stories.tsx
+++ b/web/src/features/batch-exports/components/BatchExportsTable/BatchExportsTable.stories.tsx
@@ -24,6 +24,7 @@ const completedExport: BatchExportRow = {
};
const pagination = {
+ mode: "offset" as const,
totalCount: 3,
state: { pageIndex: 0, pageSize: 10 },
onChange: fn(),
diff --git a/web/src/features/batch-exports/components/BatchExportsTable/ConnectedBatchExportsTable.tsx b/web/src/features/batch-exports/components/BatchExportsTable/ConnectedBatchExportsTable.tsx
index 4bd98310ae..cf5e8604df 100644
--- a/web/src/features/batch-exports/components/BatchExportsTable/ConnectedBatchExportsTable.tsx
+++ b/web/src/features/batch-exports/components/BatchExportsTable/ConnectedBatchExportsTable.tsx
@@ -88,6 +88,7 @@ export function ConnectedBatchExportsTable({
<BatchExportsTable
data={tableData}
pagination={{
+ mode: "offset",
totalCount: batchExports.data?.totalCount ?? null,
onChange: setPaginationState,
state: paginationState,
diff --git a/web/src/features/dashboard/components/DashboardTable/ConnectedDashboardTable.tsx b/web/src/features/dashboard/components/DashboardTable/ConnectedDashboardTable.tsx
index 0d8b728ace..6dd4ddc275 100644
--- a/web/src/features/dashboard/components/DashboardTable/ConnectedDashboardTable.tsx
+++ b/web/src/features/dashboard/components/DashboardTable/ConnectedDashboardTable.tsx
@@ -211,6 +211,7 @@ export function ConnectedDashboardTable() {
}}
/>
<PaginationBar
+ mode="offset"
totalCount={dashboards.data?.totalCount ?? null}
onChange={setPaginationState}
state={paginationState}
diff --git a/web/src/features/rbac/components/MembersSettingsTable/ConnectedMembersSettingsTable.tsx b/web/src/features/rbac/components/MembersSettingsTable/ConnectedMembersSettingsTable.tsx
index bbf16710d9..2255b90ef9 100644
--- a/web/src/features/rbac/components/MembersSettingsTable/ConnectedMembersSettingsTable.tsx
+++ b/web/src/features/rbac/components/MembersSettingsTable/ConnectedMembersSettingsTable.tsx
@@ -319,6 +319,7 @@ export function ConnectedMembersSettingsTable({
},
]}
pagination={{
+ mode: "offset",
totalCount: members.data?.totalCount ?? null,
onChange: (state) => setPaginationState({ ...state, rolesKey }),
state: paginationState,
diff --git a/web/src/features/rbac/components/MembersSettingsTable/MembersSettingsTable.stories.tsx b/web/src/features/rbac/components/MembersSettingsTable/MembersSettingsTable.stories.tsx
index fe0311b462..af90d0e11d 100644
--- a/web/src/features/rbac/components/MembersSettingsTable/MembersSettingsTable.stories.tsx
+++ b/web/src/features/rbac/components/MembersSettingsTable/MembersSettingsTable.stories.tsx
@@ -79,6 +79,7 @@ export const Default = meta.story({
{ id: "add-member", label: "Add new member", onClick: fn() },
],
pagination: {
+ mode: "offset",
totalCount: 5,
state: { pageIndex: 0, pageSize: 10 },
onChange: fn(),
@@ -105,6 +106,7 @@ export const FilteredByRole = meta.story({
{ id: "add-member", label: "Add new member", onClick: fn() },
],
pagination: {
+ mode: "offset",
totalCount: 2,
state: { pageIndex: 0, pageSize: 10 },
onChange: fn(),
@@ -134,6 +136,7 @@ export const Loading = meta.story({
{ id: "add-member", label: "Add new member", onClick: fn() },
],
pagination: {
+ mode: "offset",
totalCount: null,
state: { pageIndex: 0, pageSize: 10 },
onChange: fn(),
diff --git a/web/src/features/rbac/components/MembersSettingsTable/MembersSettingsTable.tsx b/web/src/features/rbac/components/MembersSettingsTable/MembersSettingsTable.tsx
index 94c0920c84..f0acc47029 100644
--- a/web/src/features/rbac/components/MembersSettingsTable/MembersSettingsTable.tsx
+++ b/web/src/features/rbac/components/MembersSettingsTable/MembersSettingsTable.tsx
@@ -119,7 +119,6 @@ export function MembersSettingsTable({
header: "SSO Provider",
enableHiding: true,
nullValue: "-",
- shouldWrap: true,
}),
{
accessorKey: "orgRole",
diff --git a/web/src/features/rbac/components/MembershipInvitesSettingsTable/ConnectedMembershipInvitesSettingsTable.tsx b/web/src/features/rbac/components/MembershipInvitesSettingsTable/ConnectedMembershipInvitesSettingsTable.tsx
index 642cb476eb..5fa8f7fa20 100644
--- a/web/src/features/rbac/components/MembershipInvitesSettingsTable/ConnectedMembershipInvitesSettingsTable.tsx
+++ b/web/src/features/rbac/components/MembershipInvitesSettingsTable/ConnectedMembershipInvitesSettingsTable.tsx
@@ -96,6 +96,7 @@ export function ConnectedMembershipInvitesSettingsTable({
data={tableData}
loadingRowCount={paginationState.pageSize}
pagination={{
+ mode: "offset",
totalCount: query.data?.totalCount ?? null,
onChange: setPaginationState,
state: paginationState,
diff --git a/web/src/features/rbac/components/MembershipInvitesSettingsTable/MembershipInvitesSettingsTable.stories.tsx b/web/src/features/rbac/components/MembershipInvitesSettingsTable/MembershipInvitesSettingsTable.stories.tsx
index c4fb76a6f5..46190f9770 100644
--- a/web/src/features/rbac/components/MembershipInvitesSettingsTable/MembershipInvitesSettingsTable.stories.tsx
+++ b/web/src/features/rbac/components/MembershipInvitesSettingsTable/MembershipInvitesSettingsTable.stories.tsx
@@ -11,6 +11,7 @@ export const Default = meta.story({
hasCudAccess: true,
onDelete: fn(),
pagination: {
+ mode: "offset",
totalCount: 5,
state: { pageIndex: 0, pageSize: 10 },
onChange: fn(),
@@ -64,6 +65,7 @@ export const Loading = meta.story({
hasCudAccess: true,
onDelete: fn(),
pagination: {
+ mode: "offset",
totalCount: null,
state: { pageIndex: 0, pageSize: 10 },
onChange: fn(),
diff --git a/web/src/features/score-configs/ScoreConfigsTable/ConnectedScoreConfigsTable.tsx b/web/src/features/score-configs/ScoreConfigsTable/ConnectedScoreConfigsTable.tsx
index f877d0b1c6..4dae29b1ae 100644
--- a/web/src/features/score-configs/ScoreConfigsTable/ConnectedScoreConfigsTable.tsx
+++ b/web/src/features/score-configs/ScoreConfigsTable/ConnectedScoreConfigsTable.tsx
@@ -78,6 +78,7 @@ export function ConnectedScoreConfigsTable({
<ScoreConfigsTable
data={tableData}
pagination={{
+ mode: "offset",
totalCount: configs.data?.totalCount ?? null,
onChange: setPaginationState,
state: paginationState,
diff --git a/web/src/features/score-configs/ScoreConfigsTable/ScoreConfigsTable.stories.tsx b/web/src/features/score-configs/ScoreConfigsTable/ScoreConfigsTable.stories.tsx
index 928cb17ea3..aed5155648 100644
--- a/web/src/features/score-configs/ScoreConfigsTable/ScoreConfigsTable.stories.tsx
+++ b/web/src/features/score-configs/ScoreConfigsTable/ScoreConfigsTable.stories.tsx
@@ -18,6 +18,7 @@ const actions = {
openDialog: fn(),
},
pagination: {
+ mode: "offset" as const,
totalCount: 2,
state: { pageIndex: 0, pageSize: 50 },
onChange: fn(),
diff --git a/web/src/features/widgets/components/WidgetTable/ConnectedWidgetTable.tsx b/web/src/features/widgets/components/WidgetTable/ConnectedWidgetTable.tsx
index 994d6e3942..87fea51249 100644
--- a/web/src/features/widgets/components/WidgetTable/ConnectedWidgetTable.tsx
+++ b/web/src/features/widgets/components/WidgetTable/ConnectedWidgetTable.tsx
@@ -280,6 +280,7 @@ function ConnectedDashboardWidgetTableContent({
}}
/>
<PaginationBar
+ mode="offset"
totalCount={widgets.data?.totalCount ?? null}
onChange={setPaginationState}
state={paginationState}