Skip to content

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

improvement(projects): make project list table rows real links (#7714)

claude[bot]9a62ff93c57f
diff --git a/frontend/src/pages/organization/ProjectsPage/ProjectTypePage/ProjectTypePage.tsx b/frontend/src/pages/organization/ProjectsPage/ProjectTypePage/ProjectTypePage.tsx
index 0ddb94ced3..83bfa64261 100644
--- a/frontend/src/pages/organization/ProjectsPage/ProjectTypePage/ProjectTypePage.tsx
+++ b/frontend/src/pages/organization/ProjectsPage/ProjectTypePage/ProjectTypePage.tsx
@@ -273,7 +273,6 @@ const MyProjectsForType = ({
onUpgradePlan,
isAddingProjectsAllowed
}: SubViewProps) => {
- const navigate = useNavigate();
const { currentOrg } = useOrganization();
const [searchFilter, setSearchFilter] = useState("");
const [projectsViewMode, setProjectsViewMode] = useState<ProjectsViewMode>(
@@ -358,13 +357,6 @@ const MyProjectsForType = ({
}
};
- const navigateToProject = (workspace: Project) => {
- navigate({
- to: getProjectHomePage(workspace.type, workspace.environments),
- params: { orgId: currentOrg?.id || "", projectId: workspace.id }
- });
- };
-
const renderFavoriteButton = (workspace: Project & { isFavorite: boolean }) =>
workspace.isFavorite ? (
<IconButton
@@ -545,28 +537,28 @@ const MyProjectsForType = ({
{workspacesWithFaveProp.map((workspace) => {
const WorkspaceIcon = getProjectLucideIcon(workspace.type);
return (
- <TableRow
- key={workspace.id}
- className="group"
- onClick={() => navigateToProject(workspace)}
- onKeyDown={(e) => {
- if (e.key === "Enter") navigateToProject(workspace);
- }}
- tabIndex={0}
- >
+ <TableRow key={workspace.id} className="group relative cursor-pointer">
<TableCell className="w-0 pr-0">
<div className="inline-flex shrink-0 items-center justify-center rounded-sm border border-border bg-muted/10 p-1 transition-colors group-hover:border-project/20 group-hover:bg-gradient-to-br group-hover:from-project/5 group-hover:to-transparent">
<WorkspaceIcon className="h-3.5 w-3.5 shrink-0 text-accent transition-colors duration-200 group-hover:text-project" />
</div>
</TableCell>
- <TableCell isTruncatable>{workspace.name}</TableCell>
+ <TableCell isTruncatable>
+ <Link
+ to={getProjectHomePage(workspace.type, workspace.environments)}
+ params={{ orgId: currentOrg?.id || "", projectId: workspace.id }}
+ className="block truncate outline-0 after:absolute after:inset-0 after:content-[''] focus-visible:after:ring-2 focus-visible:after:ring-ring"
+ >
+ {workspace.name}
+ </Link>
+ </TableCell>
<TableCell isTruncatable>
{workspace.description || <span className="text-muted">—</span>}
</TableCell>
<TableCell className="w-0 text-xs whitespace-nowrap">
{format(new Date(workspace.createdAt), "MMM d, yyyy")}
</TableCell>
- <TableCell className="w-0 pr-3 text-right">
+ <TableCell className="relative z-10 w-0 pr-3 text-right">
{renderFavoriteButton(workspace)}
</TableCell>
</TableRow>
@@ -600,12 +592,7 @@ const MyProjectsForType = ({
}
return (
- <Card
- className={twMerge(
- projectsViewMode === ProjectsViewMode.GRID ? "border-transparent bg-transparent p-0" : "",
- "transition-all duration-100"
- )}
- >
+ <Card>
<CardHeader>
<Toolbar
searchFilter={searchFilter}
@@ -773,34 +760,38 @@ const AllProjectsForType = ({
<TableBody>
{searchedProjects?.projects?.map((workspace) => {
const WorkspaceIcon = getProjectLucideIcon(workspace.type);
- const goToProject = () =>
- navigate({
- to: getProjectHomePage(workspace.type, workspace.environments),
- params: { orgId: currentOrg?.id || "", projectId: workspace.id }
- });
return (
<TableRow
key={workspace.id}
- className="group"
- onClick={workspace.isMember ? goToProject : undefined}
- onKeyDown={(evt) => {
- if (evt.key === "Enter" && workspace.isMember) goToProject();
- }}
- tabIndex={workspace.isMember ? 0 : -1}
+ className={twMerge("group relative", workspace.isMember && "cursor-pointer")}
>
<TableCell className="w-0 pr-0">
<div className="inline-flex shrink-0 items-center justify-center rounded-sm border border-border bg-muted/10 p-1 transition-colors group-hover:border-project/20 group-hover:bg-gradient-to-br group-hover:from-project/5 group-hover:to-transparent">
<WorkspaceIcon className="h-3.5 w-3.5 shrink-0 text-accent transition-colors duration-200 group-hover:text-project" />
</div>
</TableCell>
- <TableCell isTruncatable>{workspace.name}</TableCell>
+ <TableCell isTruncatable>
+ {/* Only members can open the project, so only their rows get the stretched
+ anchor; everyone else sees plain text with no navigation. */}
+ {workspace.isMember ? (
+ <Link
+ to={getProjectHomePage(workspace.type, workspace.environments)}
+ params={{ orgId: currentOrg?.id || "", projectId: workspace.id }}
+ className="block truncate outline-0 after:absolute after:inset-0 after:content-[''] focus-visible:after:ring-2 focus-visible:after:ring-ring"
+ >
+ {workspace.name}
+ </Link>
+ ) : (
+ workspace.name
+ )}
+ </TableCell>
<TableCell isTruncatable>
{workspace.description || <span className="text-muted">—</span>}
</TableCell>
<TableCell className="w-0 text-xs whitespace-nowrap">
{format(new Date(workspace.createdAt), "MMM d, yyyy")}
</TableCell>
- <TableCell className="w-0 pr-3 text-right">
+ <TableCell className="relative z-10 w-0 pr-3 text-right">
{(() => {
const joinedBadge = (
<Badge variant="info">
@@ -1026,7 +1017,13 @@ const Toolbar = ({
<Tooltip>
<TooltipTrigger tabIndex={-1} asChild>
<span className="cursor-not-allowed">
- <IconButton variant="outline" size="sm" aria-label="Grid view" isDisabled>
+ <IconButton
+ variant="outline"
+ size="sm"
+ aria-label="Grid view"
+ className="rounded-r-none"
+ isDisabled
+ >
<LayoutGridIcon />
</IconButton>
</span>