From 578dcef7f40a05091c410699e4117d21ba87ac54 Mon Sep 17 00:00:00 2001 From: Theodore Li Date: Thu, 26 Mar 2026 19:31:18 -0700 Subject: [PATCH 1/3] Change modal field to be company size --- .../(home)/components/demo-request/consts.ts | 30 +++++++++---------- .../demo-request/demo-request-modal.tsx | 20 ++++++------- apps/sim/app/api/demo-requests/route.ts | 8 ++--- 3 files changed, 29 insertions(+), 29 deletions(-) diff --git a/apps/sim/app/(home)/components/demo-request/consts.ts b/apps/sim/app/(home)/components/demo-request/consts.ts index 5e36e6bb17b..1e0e3f7d623 100644 --- a/apps/sim/app/(home)/components/demo-request/consts.ts +++ b/apps/sim/app/(home)/components/demo-request/consts.ts @@ -14,13 +14,13 @@ export const DEMO_REQUEST_REGION_VALUES = [ 'other', ] as const -export const DEMO_REQUEST_USER_COUNT_VALUES = [ +export const DEMO_REQUEST_COMPANY_SIZE_VALUES = [ '1_10', '11_50', '51_200', - '201_500', - '501_1000', - '1000_plus', + '201_1000', + '1001_10000', + '10000_plus', ] as const export const DEMO_REQUEST_REGION_OPTIONS = [ @@ -32,13 +32,13 @@ export const DEMO_REQUEST_REGION_OPTIONS = [ { value: 'other', label: 'Other' }, ] as const -export const DEMO_REQUEST_USER_COUNT_OPTIONS = [ - { value: '1_10', label: '1-10' }, - { value: '11_50', label: '11-50' }, - { value: '51_200', label: '51-200' }, - { value: '201_500', label: '201-500' }, - { value: '501_1000', label: '501-1,000' }, - { value: '1000_plus', label: '1,000+' }, +export const DEMO_REQUEST_COMPANY_SIZE_OPTIONS = [ + { value: '1_10', label: '1–10' }, + { value: '11_50', label: '11–50' }, + { value: '51_200', label: '51–200' }, + { value: '201_1000', label: '201–1,000' }, + { value: '1001_10000', label: '1,001–10,000' }, + { value: '10000_plus', label: '10,000+' }, ] as const export const demoRequestSchema = z.object({ @@ -74,8 +74,8 @@ export const demoRequestSchema = z.object({ region: z.enum(DEMO_REQUEST_REGION_VALUES, { errorMap: () => ({ message: 'Please select a region' }), }), - userCount: z.enum(DEMO_REQUEST_USER_COUNT_VALUES, { - errorMap: () => ({ message: 'Please select the number of users' }), + companySize: z.enum(DEMO_REQUEST_COMPANY_SIZE_VALUES, { + errorMap: () => ({ message: 'Please select company size' }), }), details: z.string().trim().min(1, 'Details are required').max(2000), }) @@ -86,6 +86,6 @@ export function getDemoRequestRegionLabel(value: DemoRequestPayload['region']): return DEMO_REQUEST_REGION_OPTIONS.find((option) => option.value === value)?.label ?? value } -export function getDemoRequestUserCountLabel(value: DemoRequestPayload['userCount']): string { - return DEMO_REQUEST_USER_COUNT_OPTIONS.find((option) => option.value === value)?.label ?? value +export function getDemoRequestCompanySizeLabel(value: DemoRequestPayload['companySize']): string { + return DEMO_REQUEST_COMPANY_SIZE_OPTIONS.find((option) => option.value === value)?.label ?? value } diff --git a/apps/sim/app/(home)/components/demo-request/demo-request-modal.tsx b/apps/sim/app/(home)/components/demo-request/demo-request-modal.tsx index 0d5e7ff9ed8..d5349d6b8d3 100644 --- a/apps/sim/app/(home)/components/demo-request/demo-request-modal.tsx +++ b/apps/sim/app/(home)/components/demo-request/demo-request-modal.tsx @@ -17,7 +17,7 @@ import { import { Check } from '@/components/emcn/icons' import { DEMO_REQUEST_REGION_OPTIONS, - DEMO_REQUEST_USER_COUNT_OPTIONS, + DEMO_REQUEST_COMPANY_SIZE_OPTIONS, type DemoRequestPayload, demoRequestSchema, } from '@/app/(home)/components/demo-request/consts' @@ -36,13 +36,13 @@ interface DemoRequestFormState { companyEmail: string phoneNumber: string region: DemoRequestPayload['region'] | '' - userCount: DemoRequestPayload['userCount'] | '' + companySize: DemoRequestPayload['companySize'] | '' details: string } const SUBMIT_SUCCESS_MESSAGE = "We'll be in touch soon!" const COMBOBOX_REGIONS = [...DEMO_REQUEST_REGION_OPTIONS] -const COMBOBOX_USER_COUNTS = [...DEMO_REQUEST_USER_COUNT_OPTIONS] +const COMBOBOX_COMPANY_SIZES = [...DEMO_REQUEST_COMPANY_SIZE_OPTIONS] const INITIAL_FORM_STATE: DemoRequestFormState = { firstName: '', @@ -50,7 +50,7 @@ const INITIAL_FORM_STATE: DemoRequestFormState = { companyEmail: '', phoneNumber: '', region: '', - userCount: '', + companySize: '', details: '', } @@ -118,7 +118,7 @@ export function DemoRequestModal({ children, theme = 'dark' }: DemoRequestModalP companyEmail: fieldErrors.companyEmail?.[0], phoneNumber: fieldErrors.phoneNumber?.[0], region: fieldErrors.region?.[0], - userCount: fieldErrors.userCount?.[0], + companySize: fieldErrors.companySize?.[0], details: fieldErrors.details?.[0], }) return @@ -235,13 +235,13 @@ export function DemoRequestModal({ children, theme = 'dark' }: DemoRequestModalP filterOptions={false} /> - + - updateField('userCount', value as DemoRequestPayload['userCount']) + updateField('companySize', value as DemoRequestPayload['companySize']) } placeholder='Select' editable={false} diff --git a/apps/sim/app/api/demo-requests/route.ts b/apps/sim/app/api/demo-requests/route.ts index 8ca458f6cbc..ef76e3916c2 100644 --- a/apps/sim/app/api/demo-requests/route.ts +++ b/apps/sim/app/api/demo-requests/route.ts @@ -10,7 +10,7 @@ import { getFromEmailAddress } from '@/lib/messaging/email/utils' import { demoRequestSchema, getDemoRequestRegionLabel, - getDemoRequestUserCountLabel, + getDemoRequestCompanySizeLabel, } from '@/app/(home)/components/demo-request/consts' const logger = createLogger('DemoRequestAPI') @@ -58,13 +58,13 @@ export async function POST(req: NextRequest) { ) } - const { firstName, lastName, companyEmail, phoneNumber, region, userCount, details } = + const { firstName, lastName, companyEmail, phoneNumber, region, companySize, details } = validationResult.data logger.info(`[${requestId}] Processing demo request`, { email: `${companyEmail.substring(0, 3)}***`, region, - userCount, + companySize, }) const emailText = `Demo request submitted @@ -73,7 +73,7 @@ Name: ${firstName} ${lastName} Email: ${companyEmail} Phone: ${phoneNumber ?? 'Not provided'} Region: ${getDemoRequestRegionLabel(region)} -Users: ${getDemoRequestUserCountLabel(userCount)} +Company size: ${getDemoRequestCompanySizeLabel(companySize)} Details: ${details} From a38f572663d555c94b572b0ee5fa0f3f75048bb6 Mon Sep 17 00:00:00 2001 From: Theodore Li Date: Thu, 26 Mar 2026 19:34:47 -0700 Subject: [PATCH 2/3] Adjust dropdown options --- apps/sim/app/(home)/components/demo-request/consts.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/apps/sim/app/(home)/components/demo-request/consts.ts b/apps/sim/app/(home)/components/demo-request/consts.ts index 1e0e3f7d623..25532056230 100644 --- a/apps/sim/app/(home)/components/demo-request/consts.ts +++ b/apps/sim/app/(home)/components/demo-request/consts.ts @@ -18,7 +18,8 @@ export const DEMO_REQUEST_COMPANY_SIZE_VALUES = [ '1_10', '11_50', '51_200', - '201_1000', + '201_500', + '501_1000', '1001_10000', '10000_plus', ] as const @@ -36,7 +37,8 @@ export const DEMO_REQUEST_COMPANY_SIZE_OPTIONS = [ { value: '1_10', label: '1–10' }, { value: '11_50', label: '11–50' }, { value: '51_200', label: '51–200' }, - { value: '201_1000', label: '201–1,000' }, + { value: '201_500', label: '201–500' }, + { value: '501_1000', label: '501–1,000' }, { value: '1001_10000', label: '1,001–10,000' }, { value: '10000_plus', label: '10,000+' }, ] as const From bf0389b5d057f8a4e021c7f2236c1668bb7b0d9b Mon Sep 17 00:00:00 2001 From: Theodore Li Date: Thu, 26 Mar 2026 19:35:19 -0700 Subject: [PATCH 3/3] Fix lint --- .../app/(home)/components/demo-request/demo-request-modal.tsx | 2 +- apps/sim/app/api/demo-requests/route.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/sim/app/(home)/components/demo-request/demo-request-modal.tsx b/apps/sim/app/(home)/components/demo-request/demo-request-modal.tsx index d5349d6b8d3..5a6ea1dc817 100644 --- a/apps/sim/app/(home)/components/demo-request/demo-request-modal.tsx +++ b/apps/sim/app/(home)/components/demo-request/demo-request-modal.tsx @@ -16,8 +16,8 @@ import { } from '@/components/emcn' import { Check } from '@/components/emcn/icons' import { - DEMO_REQUEST_REGION_OPTIONS, DEMO_REQUEST_COMPANY_SIZE_OPTIONS, + DEMO_REQUEST_REGION_OPTIONS, type DemoRequestPayload, demoRequestSchema, } from '@/app/(home)/components/demo-request/consts' diff --git a/apps/sim/app/api/demo-requests/route.ts b/apps/sim/app/api/demo-requests/route.ts index ef76e3916c2..f53d0359f87 100644 --- a/apps/sim/app/api/demo-requests/route.ts +++ b/apps/sim/app/api/demo-requests/route.ts @@ -9,8 +9,8 @@ import { sendEmail } from '@/lib/messaging/email/mailer' import { getFromEmailAddress } from '@/lib/messaging/email/utils' import { demoRequestSchema, - getDemoRequestRegionLabel, getDemoRequestCompanySizeLabel, + getDemoRequestRegionLabel, } from '@/app/(home)/components/demo-request/consts' const logger = createLogger('DemoRequestAPI')