Skip to content
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
8 changes: 5 additions & 3 deletions scripts/screenshots/checks.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,13 @@ try {
if (!res.ok()) throw new Error(`dev-login: HTTP ${res.status()}`)
const page = await ctx.newPage()
await page.goto('/#start')
await page.getByRole('heading', { name: 'How did you hear about VisualCI?' }).waitFor({ timeout: 10000 })
await page.getByRole('heading', { name: /Set up VisualCI/ }).waitFor()
await page.getByRole('heading', { name: /Set up VisualCI/ }).waitFor({ timeout: 10000 })
// The survey waits until the GitHub App is installed: a new account's first step is the App.
if ((await page.getByRole('heading', { name: 'How did you hear about VisualCI?' }).count()) > 0)
throw new Error('a new account sees the "How did you hear" survey before installing the GitHub App')
const url = new URL(page.url())
if (url.pathname === '/' || url.hash) throw new Error(`a new account stayed on ${page.url()}`)
console.log(`new account: lands on ${url.pathname} with the card and the checklist`)
console.log(`new account: lands on ${url.pathname} with the checklist and no survey yet`)

// Sign out from there.
await page.locator('summary[aria-label="Account"]').click()
Expand Down
9 changes: 7 additions & 2 deletions server/frontend/src/pages/OrgPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ export function OrgPage() {
const o = q.data
const canCreate = o.role === 'admin'
const showSetup = !o.setup.complete && !o.setup.dismissed
const appInstalled = o.setup.steps.some((s) => s.key === 'install_github_app' && s.done)

return (
<div className="page">
Expand All @@ -46,8 +47,6 @@ export function OrgPage() {
</Link>
</div>

{me.data?.heard_about_pending && me.data.heard_about_options && <HeardAboutCard options={me.data.heard_about_options} />}

{showSetup && (
<SetupChecklist
key={`${focus ?? ''}-${installation ?? ''}`}
Expand All @@ -59,6 +58,12 @@ export function OrgPage() {
/>
)}

{/* "How did you hear about VisualCI?" waits until the GitHub App step is done (or setup steps aren't shown),
below the checklist, so a new person's first step is installing the App */}
{me.data?.heard_about_pending && me.data.heard_about_options && (!showSetup || appInstalled) && (
<HeardAboutCard options={me.data.heard_about_options} />
)}

<section>
<div className="section-head">
<h2>Projects</h2>
Expand Down
Loading