-
Notifications
You must be signed in to change notification settings - Fork 514
Onboarding redo #1308
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
Onboarding redo #1308
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
0eefc62
Enhance Create Team dialog styling and layout in PageClient component
Developing-Gamer 83563e0
Add neutral theme styles for AuthPage preview and enhance onboarding …
Developing-Gamer 864e3c0
Merge branch 'dev' into onboarding-redo
Developing-Gamer cf00aa2
Merge branch 'dev' into onboarding-redo
Developing-Gamer d45afdd
Merge branch 'dev' into onboarding-redo
Developing-Gamer ac81a10
Fix pr comments
Developing-Gamer 0acfc66
Refactor project onboarding components and logic
Developing-Gamer 9ea0c78
Updated copy in onboarding payments page
Developing-Gamer 63c14c2
- Updated the `ProjectOnboardingWizard` component to automatically fi…
Developing-Gamer 308e819
Merge branch 'dev' into onboarding-redo
Developing-Gamer 33d9e8e
Merge branch 'dev' into onboarding-redo
Developing-Gamer 1a54d90
Merge branch 'dev' into onboarding-redo
Developing-Gamer 07c07a2
Link local config
N2D4 aba4177
Merge remote-tracking branch 'origin/dev' into onboarding-redo
N2D4 da69beb
Merge branch 'dev' into onboarding-redo
N2D4 b8da14b
Review some PR comments
N2D4 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
18 changes: 18 additions & 0 deletions
18
apps/backend/prisma/migrations/20260415000000_add_welcome_onboarding_status/migration.sql
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| -- Add 'welcome' to the allowed onboarding status values. | ||
| -- Drop the old constraint and add a new one (NOT VALID for speed), | ||
| -- then validate in the next migration. | ||
| ALTER TABLE "Project" | ||
| DROP CONSTRAINT "Project_onboardingStatus_valid", | ||
| ADD CONSTRAINT "Project_onboardingStatus_valid" | ||
| CHECK ( | ||
| "onboardingStatus" IN ( | ||
| 'config_choice', | ||
| 'apps_selection', | ||
| 'auth_setup', | ||
| 'domain_setup', | ||
| 'email_theme_setup', | ||
| 'payments_setup', | ||
| 'welcome', | ||
| 'completed' | ||
| ) | ||
| ) NOT VALID; |
70 changes: 70 additions & 0 deletions
70
...a/migrations/20260415000000_add_welcome_onboarding_status/tests/welcome-status-allowed.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,70 @@ | ||
| import { randomUUID } from "crypto"; | ||
| import type { Sql } from "postgres"; | ||
| import { expect } from "vitest"; | ||
|
|
||
| export const preMigration = async (sql: Sql) => { | ||
| const projectId = `test-${randomUUID()}`; | ||
| await sql` | ||
| INSERT INTO "Project" ( | ||
| "id", "createdAt", "updatedAt", "displayName", "description", | ||
| "isProductionMode", "onboardingStatus" | ||
| ) | ||
| VALUES (${projectId}, NOW(), NOW(), 'Welcome Test', '', false, 'completed') | ||
| `; | ||
|
|
||
| await expect(sql` | ||
| UPDATE "Project" | ||
| SET "onboardingStatus" = 'welcome' | ||
| WHERE "id" = ${projectId} | ||
| `).rejects.toThrow(/Project_onboardingStatus_valid/); | ||
|
|
||
| return { projectId }; | ||
| }; | ||
|
|
||
| export const postMigration = async (sql: Sql, ctx: Awaited<ReturnType<typeof preMigration>>) => { | ||
| await sql` | ||
| UPDATE "Project" | ||
| SET "onboardingStatus" = 'welcome' | ||
| WHERE "id" = ${ctx.projectId} | ||
| `; | ||
|
|
||
| const rows = await sql` | ||
| SELECT "onboardingStatus" | ||
| FROM "Project" | ||
| WHERE "id" = ${ctx.projectId} | ||
| `; | ||
| expect(rows).toHaveLength(1); | ||
| expect(rows[0].onboardingStatus).toBe("welcome"); | ||
|
|
||
| const insertWelcomeProjectId = `test-${randomUUID()}`; | ||
| await sql` | ||
| INSERT INTO "Project" ( | ||
| "id", "createdAt", "updatedAt", "displayName", "description", | ||
| "isProductionMode", "onboardingStatus" | ||
| ) | ||
| VALUES (${insertWelcomeProjectId}, NOW(), NOW(), 'Welcome Insert Test', '', false, 'welcome') | ||
| `; | ||
|
|
||
| const insertedRows = await sql` | ||
| SELECT "onboardingStatus" | ||
| FROM "Project" | ||
| WHERE "id" = ${insertWelcomeProjectId} | ||
| `; | ||
| expect(insertedRows).toHaveLength(1); | ||
| expect(insertedRows[0].onboardingStatus).toBe("welcome"); | ||
|
|
||
| const insertInvalidProjectId = `test-${randomUUID()}`; | ||
| await expect(sql` | ||
| INSERT INTO "Project" ( | ||
| "id", "createdAt", "updatedAt", "displayName", "description", | ||
| "isProductionMode", "onboardingStatus" | ||
| ) | ||
| VALUES (${insertInvalidProjectId}, NOW(), NOW(), 'Invalid Status Insert', '', false, 'invalid_status') | ||
| `).rejects.toThrow(/Project_onboardingStatus_valid/); | ||
|
|
||
| await expect(sql` | ||
| UPDATE "Project" | ||
| SET "onboardingStatus" = 'invalid_status' | ||
| WHERE "id" = ${ctx.projectId} | ||
| `).rejects.toThrow(/Project_onboardingStatus_valid/); | ||
| }; | ||
2 changes: 2 additions & 0 deletions
2
...backend/prisma/migrations/20260415000001_validate_welcome_onboarding_status/migration.sql
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| ALTER TABLE "Project" | ||
| VALIDATE CONSTRAINT "Project_onboardingStatus_valid"; |
12 changes: 12 additions & 0 deletions
12
...ations/20260415000001_validate_welcome_onboarding_status/tests/constraint-is-validated.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| import type { Sql } from "postgres"; | ||
| import { expect } from "vitest"; | ||
|
|
||
| export const postMigration = async (sql: Sql) => { | ||
| const rows = await sql` | ||
| SELECT convalidated | ||
| FROM pg_constraint | ||
| WHERE conname = 'Project_onboardingStatus_valid' | ||
| `; | ||
| expect(rows).toHaveLength(1); | ||
| expect(rows[0].convalidated).toBe(true); | ||
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.