Pick any line to see why it is the way it is: the commit, the pull request and issue it came from, and what the agent was thinking.
| status.g1t.sh with incident management, invites that land you in the workspace, settings as pages, usage without quotas | 1 | import type { Route } from "./+types/invites"; |
| 2 | import { page } from "../../lib/meta"; | |
| 3 | import { assertSameOrigin, requireUser } from "../../lib/session.server"; | |
| 4 | import { InvitesSection } from "../../components/invites-section"; | |
| Merge workspace invitations: nobody joins a workspace without saying yes, people are found by username, your own invites can bring someone in, and nobody is left without a workspace (identity 0040) | 5 | import { inviteAction, loadBringInto, loadInvites } from "../../lib/invites.server"; |
| status.g1t.sh with incident management, invites that land you in the workspace, settings as pages, usage without quotas | 6 | |
| 7 | export function meta(args: Route.MetaArgs) { | |
| Merge two kinds of invite, kept apart: an invite to g1t (Settings, invite-only only, no workspace unless asked) and an invitation to a workspace (its People page) | 8 | return page(args, { title: "Invites to g1t · Settings · g1t" }); |
| status.g1t.sh with incident management, invites that land you in the workspace, settings as pages, usage without quotas | 9 | } |
| 10 | ||
| 11 | export async function loader({ request, context }: Route.LoaderArgs) { | |
| 12 | const user = requireUser(context, request); | |
| Merge workspace invitations: nobody joins a workspace without saying yes, people are found by username, your own invites can bring someone in, and nobody is left without a workspace (identity 0040) | 13 | const [invites, bringInto] = await Promise.all([loadInvites(user), loadBringInto(user, request)]); |
| 14 | return { invites, bringInto, origin: new URL(request.url).origin }; | |
| status.g1t.sh with incident management, invites that land you in the workspace, settings as pages, usage without quotas | 15 | } |
| 16 | ||
| 17 | export async function action({ request, context }: Route.ActionArgs) { | |
| 18 | assertSameOrigin(request); | |
| 19 | const user = requireUser(context, request); | |
| 20 | const form = await request.formData(); | |
| 21 | // Making and revoking invites (lib/invites.server.ts). | |
| 22 | const done = await inviteAction(user, form); | |
| 23 | return { inviteCreated: done?.inviteCreated, inviteError: done?.inviteError }; | |
| 24 | } | |
| 25 | ||
| 26 | export default function InviteSettings({ loaderData, actionData }: Route.ComponentProps) { | |
| 27 | return ( | |
| 28 | <InvitesSection | |
| 29 | overview={loaderData.invites} | |
| 30 | origin={loaderData.origin} | |
| Merge workspace invitations: nobody joins a workspace without saying yes, people are found by username, your own invites can bring someone in, and nobody is left without a workspace (identity 0040) | 31 | bringInto={loaderData.bringInto} |
| status.g1t.sh with incident management, invites that land you in the workspace, settings as pages, usage without quotas | 32 | created={actionData?.inviteCreated} |
| 33 | error={actionData?.inviteError} | |
| 34 | /> | |
| 35 | ); | |
| 36 | } |
This file's history is long; its oldest lines are credited to the oldest commit read.