diff --git a/src/api/config.ts b/src/api/config.ts index 0d55fe8..2541411 100644 --- a/src/api/config.ts +++ b/src/api/config.ts @@ -176,7 +176,7 @@ export const SUPER_ROLES = ['Super Admin', 'Admin']; // is an Aria-only screen — managers oversee agent meetings, agents see theirs. export const SCREEN_ACCESS: Record = { '/pipeline': ['Sales Agent', 'Underwriter', 'Branch Manager'], - '/qualify': ['Sales Agent', 'Branch Manager'], + '/qualify': ['Branch Manager'], '/engage': ['Sales Agent'], '/documents': ['Underwriter'], '/underwriting': ['Underwriter', 'Branch Manager'], diff --git a/src/api/forms.ts b/src/api/forms.ts index 8cd8877..e30d2af 100644 --- a/src/api/forms.ts +++ b/src/api/forms.ts @@ -40,6 +40,9 @@ export interface FieldDef { /** Designer `field_defaults[id].disabled` — render read-only; the value is * computed (e.g. premium_amount written by the custom_js). */ disabled?: boolean; + /** Designer `field_defaults[id].value` — a server-supplied default to seed + * with (e.g. a hidden preferred_language defaulting to "english"). */ + prefill?: unknown; options?: FieldOption[]; prefix?: string; placeholder?: string; diff --git a/src/api/schema.ts b/src/api/schema.ts index 6a6cca4..abb9fbe 100644 --- a/src/api/schema.ts +++ b/src/api/schema.ts @@ -72,6 +72,7 @@ export function schemaToFields(resp: FormScreenResponse): FieldDef[] { ...d, hidden: !!resp.field_defaults?.[d.id]?.hidden, disabled: !!resp.field_defaults?.[d.id]?.disabled, + prefill: resp.field_defaults?.[d.id]?.value, })); } @@ -89,5 +90,6 @@ export function fieldFromSchema( ...def, hidden: !!resp?.field_defaults?.[id]?.hidden, disabled: !!resp?.field_defaults?.[id]?.disabled, + prefill: resp?.field_defaults?.[id]?.value, }; } diff --git a/src/components/ZinoLogo.tsx b/src/components/ZinoLogo.tsx new file mode 100644 index 0000000..17b6fe5 --- /dev/null +++ b/src/components/ZinoLogo.tsx @@ -0,0 +1,22 @@ +// Zino wordmark (copied from sm2 renderer assets/zino-logo.svg). Inlined as a +// component so it works under both the dev root and the /lead-to-policy/ build +// base without an asset-path dance. Brand orange (#ed563b) by default; pass a +// className with a `text-*` colour + `fill-current` to recolour. +export function ZinoLogo({ className }: { className?: string }) { + return ( + + + + + + + + + ); +} diff --git a/src/components/form/ActivityForm.tsx b/src/components/form/ActivityForm.tsx index f7a1486..09349ee 100644 --- a/src/components/form/ActivityForm.tsx +++ b/src/components/form/ActivityForm.tsx @@ -41,6 +41,9 @@ function seedFor(field: FieldDef, record?: LeadRecord | null): unknown { const key = field.seedKey ?? field.id.replace(/_input$/, ''); const fromRecord = record ? (record as Record)[key] : undefined; if (fromRecord !== undefined && fromRecord !== null) return fromRecord; + // Designer-supplied default (field_defaults.value) — lets a hidden field like + // preferred_language submit a fixed value (e.g. "english") with no UI. + if (field.prefill !== undefined && field.prefill !== null && field.prefill !== '') return field.prefill; switch (field.type) { case 'multiselect': return []; diff --git a/src/layout/Shell.tsx b/src/layout/Shell.tsx index d94ba36..8f7d4a7 100644 --- a/src/layout/Shell.tsx +++ b/src/layout/Shell.tsx @@ -1,9 +1,10 @@ import { useEffect, useMemo, useState } from 'react'; import { Outlet, useLocation, useNavigate } from 'react-router-dom'; import type { LucideIcon } from 'lucide-react'; -import { ArrowLeft, Bell, CalendarClock, FileText, LogOut, Menu, Search, ShieldCheck, Sparkles, UserCheck, Users, X } from 'lucide-react'; +import { ArrowLeft, CalendarClock, FileText, LogOut, Menu, ShieldCheck, Sparkles, UserCheck, Users, X } from 'lucide-react'; import { cn } from '../lib/cn'; import { Avatar } from '../components/core'; +import { ZinoLogo } from '../components/ZinoLogo'; import { canSeeScreen } from '../api/config'; import { useZino } from '../api/provider'; import { useLeads } from '../api/leads'; @@ -35,13 +36,10 @@ function pipelineSubtitle(leads: Lead[]): string { return `${total.toLocaleString('en-IN')} leads · ${hot}% hot · ${ai}% AI-handled`; } -function AriaLogo() { +function BrandLogo() { return ( -
- - A - - aria +
+
); } @@ -51,7 +49,7 @@ function SidebarInner({ items, activeTo, onNav }: { items: NavItem[]; activeTo: return ( <>
- +