From f86a6a10accbc2789dd2f0e1f2feacdbba5393eb Mon Sep 17 00:00:00 2001 From: MartinBraquet Date: Sat, 25 Oct 2025 15:32:16 +0200 Subject: [PATCH] Add political_details --- backend/email/emails/functions/mock.ts | 2 ++ backend/supabase/profiles.sql | 1 + common/src/api/zod-types.ts | 1 + common/src/supabase/schema.ts | 3 +++ web/components/optional-profile-form.tsx | 8 ++++++++ web/components/profile-about.tsx | 1 + 6 files changed, 16 insertions(+) diff --git a/backend/email/emails/functions/mock.ts b/backend/email/emails/functions/mock.ts index 7616992d..e04352b5 100644 --- a/backend/email/emails/functions/mock.ts +++ b/backend/email/emails/functions/mock.ts @@ -51,6 +51,7 @@ export const sinclairProfile: ProfileRow = { political_beliefs: ['e/acc', 'libertarian'], religious_belief_strength: null, religious_beliefs: null, + political_details: '', photo_urls: [ 'https://firebasestorage.googleapis.com/v0/b/mantic-markets.appspot.com/o/user-images%2FSinclair%2Flove-images%2FnJz22lr3Bl.jpg?alt=media&token=f1e99ba3-39cc-4637-8702-16a3a8dd49db', 'https://firebasestorage.googleapis.com/v0/b/mantic-markets.appspot.com/o/user-images%2FSinclair%2Flove-images%2FygM0mGgP_j.HEIC?alt=media&token=573b23d9-693c-4d6e-919b-097309f370e1', @@ -153,6 +154,7 @@ export const jamesProfile: ProfileRow = { political_beliefs: ['libertarian'], religious_belief_strength: null, religious_beliefs: '', + political_details: '', photo_urls: [ 'https://firebasestorage.googleapis.com/v0/b/mantic-markets.appspot.com/o/user-images%2FJamesGrugett%2Flove-images%2FKl0WtbZsZW.jpg?alt=media&token=c928604f-e5ff-4406-a229-152864a4aa48', 'https://firebasestorage.googleapis.com/v0/b/mantic-markets.appspot.com/o/user-images%2FJamesGrugett%2Flove-images%2Fsii17zOItz.jpg?alt=media&token=474034b9-0d23-4005-97ad-5864abfd85fe', diff --git a/backend/supabase/profiles.sql b/backend/supabase/profiles.sql index 3ac92114..1c52f57b 100644 --- a/backend/supabase/profiles.sql +++ b/backend/supabase/profiles.sql @@ -35,6 +35,7 @@ CREATE TABLE IF NOT EXISTS profiles ( occupation_title TEXT, photo_urls TEXT[], pinned_url TEXT, + political_details TEXT, political_beliefs TEXT[], pref_age_max INTEGER NULL, pref_age_min INTEGER NULL, diff --git a/common/src/api/zod-types.ts b/common/src/api/zod-types.ts index ba031fc6..fac9751e 100644 --- a/common/src/api/zod-types.ts +++ b/common/src/api/zod-types.ts @@ -77,6 +77,7 @@ const optionalProfilesSchema = z.object({ political_beliefs: z.array(z.string()).optional(), religious_belief_strength: z.number().optional(), religious_beliefs: z.string().optional(), + political_details: z.string().optional(), religion: z.array(z.string()).optional(), ethnicity: z.array(z.string()).optional(), born_in_location: z.string().optional(), diff --git a/common/src/supabase/schema.ts b/common/src/supabase/schema.ts index 05bf5cba..7c115f63 100644 --- a/common/src/supabase/schema.ts +++ b/common/src/supabase/schema.ts @@ -558,6 +558,7 @@ export type Database = { photo_urls: string[] | null pinned_url: string | null political_beliefs: string[] | null + political_details: string | null pref_age_max: number | null pref_age_min: number | null pref_gender: string[] @@ -607,6 +608,7 @@ export type Database = { photo_urls?: string[] | null pinned_url?: string | null political_beliefs?: string[] | null + political_details?: string | null pref_age_max?: number | null pref_age_min?: number | null pref_gender: string[] @@ -656,6 +658,7 @@ export type Database = { photo_urls?: string[] | null pinned_url?: string | null political_beliefs?: string[] | null + political_details?: string | null pref_age_max?: number | null pref_age_min?: number | null pref_gender?: string[] diff --git a/web/components/optional-profile-form.tsx b/web/components/optional-profile-form.tsx index 61314928..425cca2d 100644 --- a/web/components/optional-profile-form.tsx +++ b/web/components/optional-profile-form.tsx @@ -403,6 +403,13 @@ export const OptionalProfileUserForm = (props: { selected={profile['political_beliefs'] ?? []} onChange={(selected) => setProfile('political_beliefs', selected)} /> +

Details:

+ setProfile('political_details', e.target.value)} + className={'w-full sm:w-96'} + value={profile['political_details'] ?? undefined} + /> @@ -412,6 +419,7 @@ export const OptionalProfileUserForm = (props: { selected={profile['religion'] ?? []} onChange={(selected) => setProfile('religion', selected)} /> +

Details:

setProfile('religious_beliefs', e.target.value)} diff --git a/web/components/profile-about.tsx b/web/components/profile-about.tsx index 0ac02130..713c4b77 100644 --- a/web/components/profile-about.tsx +++ b/web/components/profile-about.tsx @@ -79,6 +79,7 @@ export default function ProfileAbout(props: { } text={profile.political_beliefs?.map(belief => REVERTED_POLITICAL_CHOICES[belief])} + suffix={profile.political_details} /> }