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.
| Webhooks: every event, to your own addresses, signed and retried | 1 | import type { Route } from "./+types/webhooks"; |
| Social cards for every page: og.g1t.sh | 2 | import { page } from "../../lib/meta"; |
| Project settings move into the sidebar, grouped, with a heading per page | 3 | import { RepoSettingsHeading } from "../../components/repo-settings-heading"; |
| Webhooks: every event, to your own addresses, signed and retried | 4 | import { WebhooksPanel } from "../../components/webhooks"; |
| 5 | import { actOnWebhooks, loadWebhooks } from "../../lib/webhooks.server"; | |
| Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look | 6 | import { assertSameOrigin, getViewer, requireUser } from "../../lib/session.server"; |
| 7 | import { requireCapability, requireInsider } from "../../lib/access.server"; | |
| Webhooks: every event, to your own addresses, signed and retried | 8 | |
| Social cards for every page: og.g1t.sh | 9 | export function meta({ params, ...args }: Route.MetaArgs) { |
| 10 | return page(args, { title: `Webhooks · ${params.owner}/${params.repo} · g1t` }); | |
| Webhooks: every event, to your own addresses, signed and retried | 11 | } |
| 12 | ||
| 13 | function ownerOf(params: { owner: string; repo: string }) { | |
| 14 | return { workspace: params.owner.toLowerCase(), repo: { namespace: params.owner, name: params.repo } }; | |
| 15 | } | |
| 16 | ||
| 17 | export async function loader({ params, context, request }: Route.LoaderArgs) { | |
| 18 | const viewer = getViewer(context); | |
| Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look | 19 | // Admins; to anyone without a role here the page does not exist. |
| 20 | await requireInsider(context, params, "manage_integrations"); | |
| Webhooks: every event, to your own addresses, signed and retried | 21 | return loadWebhooks(ownerOf(params), viewer, request); |
| 22 | } | |
| 23 | ||
| 24 | export async function action({ request, params, context }: Route.ActionArgs) { | |
| 25 | assertSameOrigin(request); | |
| 26 | const user = requireUser(context, request); | |
| Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look | 27 | await requireCapability(context, params, "manage_integrations"); |
| Webhooks: every event, to your own addresses, signed and retried | 28 | return actOnWebhooks(ownerOf(params), user, await request.formData()); |
| 29 | } | |
| 30 | ||
| 31 | export default function RepoWebhooks({ loaderData, actionData, params }: Route.ComponentProps) { | |
| 32 | return ( | |
| 33 | <div> | |
| Project settings move into the sidebar, grouped, with a heading per page | 34 | <RepoSettingsHeading base={`/${params.owner}/${params.repo}`} /> |
| Webhooks: every event, to your own addresses, signed and retried | 35 | <WebhooksPanel data={loaderData} action={actionData} manage scope={`${params.owner}/${params.repo}`} /> |
| 36 | </div> | |
| 37 | ); | |
| 38 | } |