Skip to content

Copyable admin area table fields and autofocus search #2280

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 18, 2025
Merged
Show file tree
Hide file tree
Changes from all 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
18 changes: 13 additions & 5 deletions apps/webapp/app/routes/admin._index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { redirect } from "@remix-run/server-runtime";
import { typedjson, useTypedLoaderData } from "remix-typedjson";
import { z } from "zod";
import { Button, LinkButton } from "~/components/primitives/Buttons";
import { CopyableText } from "~/components/primitives/CopyableText";
import { Header1 } from "~/components/primitives/Headers";
import { Input } from "~/components/primitives/Input";
import { PaginationControls } from "~/components/primitives/Pagination";
Expand Down Expand Up @@ -69,13 +70,14 @@ export default function AdminDashboardRoute() {
<Form className="flex items-center gap-2">
<Input
placeholder="Search users or orgs"
variant="small"
variant="medium"
icon={MagnifyingGlassIcon}
fullWidth={true}
name="search"
defaultValue={filters.search}
autoFocus
/>
<Button type="submit" variant="tertiary/small">
<Button type="submit" variant="secondary/medium">
Search
</Button>
</Form>
Expand All @@ -101,7 +103,9 @@ export default function AdminDashboardRoute() {
users.map((user) => {
return (
<TableRow key={user.id}>
<TableCell>{user.email}</TableCell>
<TableCell>
<CopyableText value={user.email} />
</TableCell>
<TableCell>
{user.orgMemberships.map((org) => (
<LinkButton
Expand All @@ -124,8 +128,12 @@ export default function AdminDashboardRoute() {
{user.displayName}
</a>
</TableCell>
<TableCell>{user.id}</TableCell>
<TableCell>{user.createdAt.toISOString()}</TableCell>
<TableCell>
<CopyableText value={user.id} />
</TableCell>
<TableCell>
<CopyableText value={user.createdAt.toISOString()} />
</TableCell>
<TableCell>{user.admin ? "✅" : ""}</TableCell>
<TableCell isSticky={true}>
<Form method="post" reloadDocument>
Expand Down
20 changes: 14 additions & 6 deletions apps/webapp/app/routes/admin.orgs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import type { LoaderFunctionArgs } from "@remix-run/server-runtime";
import { redirect, typedjson, useTypedLoaderData } from "remix-typedjson";
import { z } from "zod";
import { Button, LinkButton } from "~/components/primitives/Buttons";
import { CopyableText } from "~/components/primitives/CopyableText";
import { Input } from "~/components/primitives/Input";
import { PaginationControls } from "~/components/primitives/Pagination";
import { Paragraph } from "~/components/primitives/Paragraph";
Expand Down Expand Up @@ -54,13 +55,14 @@ export default function AdminDashboardRoute() {
<Form className="flex items-center gap-2">
<Input
placeholder="Search users or orgs"
variant="small"
variant="medium"
icon={MagnifyingGlassIcon}
fullWidth={true}
name="search"
defaultValue={filters.search}
autoFocus
/>
<Button type="submit" variant="tertiary/small">
<Button type="submit" variant="secondary/medium">
Search
</Button>
</Form>
Expand All @@ -87,20 +89,26 @@ export default function AdminDashboardRoute() {
organizations.map((org) => {
return (
<TableRow key={org.id}>
<TableCell>{org.title}</TableCell>
<TableCell>{org.slug}</TableCell>
<TableCell>
<CopyableText value={org.title} />
</TableCell>
<TableCell>
<CopyableText value={org.slug} />
</TableCell>
<TableCell>
{org.members.map((member) => (
<LinkButton
key={member.user.email}
variant="minimal/small"
to={`/admin?search=${encodeURIComponent(member.user.email)}`}
>
{member.user.email}
<CopyableText value={member.user.email} />
</LinkButton>
))}
</TableCell>
<TableCell>{org.id}</TableCell>
<TableCell>
<CopyableText value={org.id} />
</TableCell>
<TableCell>{org.v2Enabled ? "✅" : ""}</TableCell>
<TableCell>{org.v3Enabled ? "✅" : ""}</TableCell>
<TableCell>{org.deletedAt ? "☠️" : ""}</TableCell>
Expand Down