Skip to content

Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.

UI: fix minor bugs

adilson48d3b25a3441
diff --git a/frontend/src/pages/secret-manager/OverviewPage/components/FolderAccessSheet/FolderAccessRow.tsx b/frontend/src/pages/secret-manager/OverviewPage/components/FolderAccessSheet/FolderAccessRow.tsx
index 1a768037aa..8c332c4c7c 100644
--- a/frontend/src/pages/secret-manager/OverviewPage/components/FolderAccessSheet/FolderAccessRow.tsx
+++ b/frontend/src/pages/secret-manager/OverviewPage/components/FolderAccessSheet/FolderAccessRow.tsx
@@ -38,7 +38,7 @@ const ActorIdentity = ({ actor }: { actor: TFolderAccessActor }) => (
<div className="flex min-w-0 items-center gap-1.5">
<p className="truncate text-sm font-medium text-foreground">{actor.name}</p>
{actor.isProjectAdmin && (
- <Badge variant="neutral" className="shrink-0">
+ <Badge variant="neutral" iconPosition="left" className="min-h-0 shrink-0 py-0">
<ShieldIcon />
Admin
</Badge>
diff --git a/frontend/src/pages/secret-manager/OverviewPage/components/FolderAccessSheet/FolderAccessSheet.tsx b/frontend/src/pages/secret-manager/OverviewPage/components/FolderAccessSheet/FolderAccessSheet.tsx
index ac2aeece24..042adeb176 100644
--- a/frontend/src/pages/secret-manager/OverviewPage/components/FolderAccessSheet/FolderAccessSheet.tsx
+++ b/frontend/src/pages/secret-manager/OverviewPage/components/FolderAccessSheet/FolderAccessSheet.tsx
@@ -48,9 +48,7 @@ import {
import { FolderAccessRow } from "./FolderAccessRow";
import { RemoveFolderAccessDialog } from "./RemoveFolderAccessDialog";
-// users and identities come from two separately paginated endpoints, so the merged list is built
-// from one max-size page of each and paged client side
-const FETCH_LIMIT = 100;
+// users and identities come from two separately paginated endpoints that share this page
const PER_PAGE = 20;
type Props = {
@@ -80,7 +78,8 @@ export const FolderAccessSheet = ({
projectId,
environmentSlug,
secretPath: folderPath,
- limit: FETCH_LIMIT,
+ limit: PER_PAGE,
+ offset: (page - 1) * PER_PAGE,
search: debouncedSearch.trim() || undefined
};
const { data: users, isPending: isUsersPending } = useListFolderAccessUsers(listArgs);
@@ -104,9 +103,7 @@ export const FolderAccessSheet = ({
);
const isLoading = isUsersPending || isIdentitiesPending;
- const visibleActors = actors.slice((page - 1) * PER_PAGE, page * PER_PAGE);
- const isTruncated =
- (users?.totalCount ?? 0) > FETCH_LIMIT || (identities?.totalCount ?? 0) > FETCH_LIMIT;
+ const totalCount = Math.max(users?.totalCount ?? 0, identities?.totalCount ?? 0);
// failures are already surfaced by the global MutationCache.onError toast, which carries the
// server's own message, so only the success side is announced here
@@ -220,7 +217,7 @@ export const FolderAccessSheet = ({
</div>
)}
- {!isLoading && !actors.length && (
+ {!isLoading && totalCount === 0 && (
<Empty>
<EmptyHeader>
<EmptyMedia variant="icon">
@@ -238,7 +235,7 @@ export const FolderAccessSheet = ({
{!isLoading && Boolean(actors.length) && (
<div className="flex flex-col">
- {visibleActors.map((actor) => (
+ {actors.map((actor) => (
<FolderAccessRow
key={`${actor.type}-${actor.id}`}
actor={actor}
@@ -258,9 +255,9 @@ export const FolderAccessSheet = ({
</div>
)}
- {actors.length > PER_PAGE && (
+ {!isLoading && totalCount > PER_PAGE && (
<Pagination
- count={actors.length}
+ count={totalCount}
page={page}
perPage={PER_PAGE}
onChangePage={setPage}
@@ -268,13 +265,6 @@ export const FolderAccessSheet = ({
perPageList={[PER_PAGE]}
/>
)}
-
- {isTruncated && (
- <p className="text-xs text-muted">
- Showing the first {FETCH_LIMIT} users and {FETCH_LIMIT} machine identities. Use
- search to narrow the list.
- </p>
- )}
</div>
</SheetContent>
</Sheet>
diff --git a/frontend/src/pages/secret-manager/OverviewPage/components/FolderAccessSheet/folder-access.utils.ts b/frontend/src/pages/secret-manager/OverviewPage/components/FolderAccessSheet/folder-access.utils.ts
index 40c0f7ceb8..611d9a230e 100644
--- a/frontend/src/pages/secret-manager/OverviewPage/components/FolderAccessSheet/folder-access.utils.ts
+++ b/frontend/src/pages/secret-manager/OverviewPage/components/FolderAccessSheet/folder-access.utils.ts
@@ -111,6 +111,7 @@ export const formatExpirationTime = (expiresAt: string, now: number, suffix?: st
};
}
return {
+ expiresAt: new Date(expiresAt),
isExpired: false,
value: `${minutes}m ${seconds}s${suffix ? ` ${suffix}` : ""}`
};