diff --git a/prisma/migrations/20260221000000_add_test_isolation_anthropic_remove_locale/migration.sql b/prisma/migrations/20260221000000_add_test_isolation_anthropic_remove_locale/migration.sql new file mode 100644 index 0000000..d4cd587 --- /dev/null +++ b/prisma/migrations/20260221000000_add_test_isolation_anthropic_remove_locale/migration.sql @@ -0,0 +1,8 @@ +-- Add isTest field to User, Program, Project, Competition for test environment isolation +ALTER TABLE "User" ADD COLUMN "isTest" BOOLEAN NOT NULL DEFAULT false; +ALTER TABLE "Program" ADD COLUMN "isTest" BOOLEAN NOT NULL DEFAULT false; +ALTER TABLE "Project" ADD COLUMN "isTest" BOOLEAN NOT NULL DEFAULT false; +ALTER TABLE "Competition" ADD COLUMN "isTest" BOOLEAN NOT NULL DEFAULT false; + +-- Index for efficient test data filtering +CREATE INDEX "Competition_isTest_idx" ON "Competition"("isTest"); diff --git a/prisma/schema.prisma b/prisma/schema.prisma index 4c3a20f..dc18965 100644 --- a/prisma/schema.prisma +++ b/prisma/schema.prisma @@ -350,6 +350,9 @@ model User { preferredWorkload Int? availabilityJson Json? @db.JsonB // { startDate?: string, endDate?: string } + // Test environment isolation + isTest Boolean @default(false) + createdAt DateTime @default(now()) updatedAt DateTime @updatedAt lastLoginAt DateTime? @@ -494,6 +497,9 @@ model Program { description String? settingsJson Json? @db.JsonB + // Test environment isolation + isTest Boolean @default(false) + createdAt DateTime @default(now()) updatedAt DateTime @updatedAt @@ -618,6 +624,9 @@ model Project { metadataJson Json? @db.JsonB // Custom fields from Typeform, etc. externalIdsJson Json? @db.JsonB // Typeform ID, Notion ID, etc. + // Test environment isolation + isTest Boolean @default(false) + createdAt DateTime @default(now()) updatedAt DateTime @updatedAt @@ -2090,6 +2099,9 @@ model Competition { notifyOnDeadlineApproach Boolean @default(true) deadlineReminderDays Int[] @default([7, 3, 1]) + // Test environment isolation + isTest Boolean @default(false) + createdAt DateTime @default(now()) updatedAt DateTime @updatedAt @@ -2104,6 +2116,7 @@ model Competition { @@index([programId]) @@index([status]) + @@index([isTest]) } model Round { diff --git a/src/app/(admin)/admin/competitions/[competitionId]/assignments/page.tsx b/src/app/(admin)/admin/competitions/[competitionId]/assignments/page.tsx index b3edd71..39793f5 100644 --- a/src/app/(admin)/admin/competitions/[competitionId]/assignments/page.tsx +++ b/src/app/(admin)/admin/competitions/[competitionId]/assignments/page.tsx @@ -68,8 +68,19 @@ export default function AssignmentsDashboardPage() { if (!competition) { return ( -
Competition not found
+Competition not found
++ The requested competition does not exist or you don't have access. +
+ ++ Could not load competition or awards data. Please try again. +
++ Could not load competition or deliberation data. Please try again. +
+- File upload windows for this round -
-{window.name}
- {isPending && ( -{window.slug}
-+ Create a sandboxed test competition with dummy users, projects, jury assignments, + and partial evaluations. All test data is fully isolated from production. +
+ + {createMutation.isError && ( ++ {createMutation.error.message} +
+ )} +{rounds.length}
+Rounds
+{users.length}
+Test Users
++ {emailRedirect || '—'} +
+Email Redirect
++ +{roleUsers.length - 3} more (switch via banner) +
+ )} +
+ Type DELETE TEST to confirm:
+