Skip to content

Commit 4a3239a

Browse files
committed
feat(webapp): move Integrations settings onto the shared settings layout
Rebuilds the project Integrations page with the SettingsContainer, SettingsSection and SettingsRow primitives already used by the org SSO page, so GitHub, Vercel and build settings read as one consistent list of rows instead of headings over bordered boxes. The page now titles itself "Integrations" rather than inheriting "Project settings", via a pageTitle handle that the parent settings layout reads. Also fixes a nested form in the Vercel panel. Browsers drop a nested <form> when parsing server-rendered HTML, so any project with atomic production builds and auto-assign custom domains still enabled failed hydration and re-rendered the whole document on the client. Carries temporary development-only code (devRevealIntegrations.tsx plus the devReveal props) that forces every conditionally hidden state to render at once. That must be removed before this merges.
1 parent be45cf9 commit 4a3239a

7 files changed

Lines changed: 1018 additions & 513 deletions

File tree

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
export function PadlockRoundedIcon({ className }: { className?: string }) {
2+
return (
3+
<svg
4+
className={className}
5+
width="24"
6+
height="24"
7+
viewBox="0 0 24 24"
8+
fill="none"
9+
xmlns="http://www.w3.org/2000/svg"
10+
>
11+
<path
12+
d="M5 12C5 10.8954 5.89543 10 7 10H17C18.1046 10 19 10.8954 19 12V19C19 20.1046 18.1046 21 17 21H7C5.89543 21 5 20.1046 5 19V12Z"
13+
stroke="currentColor"
14+
strokeWidth="2"
15+
strokeLinecap="round"
16+
strokeLinejoin="round"
17+
/>
18+
<path
19+
d="M16 9.5V7C16 4.79086 14.2091 3 12 3C9.79086 3 8 4.79086 8 7V9.5"
20+
stroke="currentColor"
21+
strokeWidth="2"
22+
strokeLinecap="round"
23+
strokeLinejoin="round"
24+
/>
25+
<path
26+
d="M12 14V17"
27+
stroke="currentColor"
28+
strokeWidth="2"
29+
strokeLinecap="round"
30+
strokeLinejoin="round"
31+
/>
32+
</svg>
33+
);
34+
}
Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
/**
2+
* TEMPORARY — DEVELOPMENT ONLY. DELETE THIS FILE BEFORE MERGING.
3+
*
4+
* The project Integrations settings page hides most of its UI behind
5+
* environment config (a configured GitHub App, a configured Vercel
6+
* integration) and behind connection state (connected vs. not connected).
7+
* Locally that leaves almost nothing on screen, which makes it impossible to
8+
* style the page.
9+
*
10+
* When `DEV_REVEAL_ALL` is true, the page and its two panels render every
11+
* state at once using the placeholder data below. Nothing here is wired to a
12+
* real integration — the forms still post to their real actions and will fail.
13+
*
14+
* To revert: set `DEV_REVEAL_ALL` to false, delete this file, and remove every
15+
* `devReveal` prop and `DEV_REVEAL_ALL` reference. `rg "DEV_REVEAL_ALL|devReveal"`
16+
* finds all of them.
17+
*/
18+
19+
import { type ReactNode } from "react";
20+
import { type VercelProjectIntegrationData } from "~/v3/vercel/vercelProjectIntegrationSchema";
21+
22+
export const DEV_REVEAL_ALL = true;
23+
24+
/** Labels a placeholder state so it is obvious it isn't real data. */
25+
export function DevRevealLabel({ children }: { children: ReactNode }) {
26+
if (!DEV_REVEAL_ALL) return null;
27+
28+
return (
29+
<div className="flex items-center gap-2 border-b border-dashed border-amber-500/40 py-2">
30+
<span className="rounded-[2px] bg-amber-500/15 px-1.5 py-0.5 font-mono text-[0.625rem] uppercase tracking-wide text-amber-400">
31+
dev preview
32+
</span>
33+
<span className="text-xs text-amber-400/80">{children}</span>
34+
</div>
35+
);
36+
}
37+
38+
export const devRevealGitHubInstallations = [
39+
{
40+
id: "dev-installation",
41+
appInstallationId: BigInt(1),
42+
targetType: "Organization",
43+
accountHandle: "acme-inc",
44+
repositories: [
45+
{
46+
id: "dev-repo",
47+
name: "acme-app",
48+
fullName: "acme-inc/acme-app",
49+
private: true,
50+
htmlUrl: "https://github.com/acme-inc/acme-app",
51+
},
52+
],
53+
},
54+
];
55+
56+
/** Same repo, but public — so the globe/"This repo is public" state is visible too. */
57+
export const devRevealConnectedGitHubRepoPublic = {
58+
branchTracking: {
59+
prod: { branch: "main" },
60+
staging: { branch: "staging" },
61+
},
62+
previewDeploymentsEnabled: true,
63+
createdAt: new Date("2026-01-01T00:00:00.000Z"),
64+
repository: {
65+
...devRevealGitHubInstallations[0].repositories[0],
66+
private: false,
67+
},
68+
};
69+
70+
export const devRevealConnectedGitHubRepo = {
71+
branchTracking: {
72+
prod: { branch: "main" },
73+
staging: { branch: "staging" },
74+
},
75+
previewDeploymentsEnabled: true,
76+
createdAt: new Date("2026-01-01T00:00:00.000Z"),
77+
repository: devRevealGitHubInstallations[0].repositories[0],
78+
};
79+
80+
const devRevealVercelIntegrationData: VercelProjectIntegrationData = {
81+
vercelProjectId: "prj_dev",
82+
vercelProjectName: "acme-app",
83+
vercelTeamId: "team_dev",
84+
syncEnvVarsMapping: {},
85+
onboardingCompleted: true,
86+
config: {
87+
atomicBuilds: ["prod"],
88+
pullEnvVarsBeforeBuild: ["prod", "preview"],
89+
discoverEnvVars: ["prod"],
90+
vercelStagingEnvironment: { environmentId: "env_dev", displayName: "staging" },
91+
autoPromote: true,
92+
},
93+
};
94+
95+
export const devRevealConnectedVercelProject = {
96+
id: "dev-vercel-integration",
97+
vercelProjectId: "prj_dev",
98+
vercelProjectName: "acme-app",
99+
vercelTeamId: "team_dev" as string | null,
100+
createdAt: new Date("2026-01-01T00:00:00.000Z"),
101+
integrationData: devRevealVercelIntegrationData,
102+
};
103+
104+
export const devRevealVercelCustomEnvironments = [{ id: "env_dev", slug: "staging" }];

0 commit comments

Comments
 (0)