@burdenoff/microfe-govcitizenhub 2026.720.4 → 2026.720.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (30) hide show
  1. package/dist/govcitizenhub/components/DynamicFormFields.d.ts +17 -0
  2. package/dist/govcitizenhub/components/DynamicFormFields.d.ts.map +1 -0
  3. package/dist/govcitizenhub/components/DynamicFormFields.js +101 -0
  4. package/dist/govcitizenhub/components/DynamicFormFields.js.map +1 -0
  5. package/dist/govcitizenhub/hooks/useGovApi.d.ts +3 -4
  6. package/dist/govcitizenhub/hooks/useGovApi.d.ts.map +1 -1
  7. package/dist/govcitizenhub/hooks/useGovApi.js +10 -4
  8. package/dist/govcitizenhub/hooks/useGovApi.js.map +1 -1
  9. package/dist/govcitizenhub/pages/agencies/AgenciesPage.d.ts +3 -2
  10. package/dist/govcitizenhub/pages/agencies/AgenciesPage.d.ts.map +1 -1
  11. package/dist/govcitizenhub/pages/agencies/AgenciesPage.js.map +1 -1
  12. package/dist/govcitizenhub/pages/applications/ApplicationsPage.d.ts.map +1 -1
  13. package/dist/govcitizenhub/pages/applications/ApplicationsPage.js +170 -150
  14. package/dist/govcitizenhub/pages/applications/ApplicationsPage.js.map +1 -1
  15. package/dist/govcitizenhub/pages/applications/NewApplicationPage.d.ts +9 -5
  16. package/dist/govcitizenhub/pages/applications/NewApplicationPage.d.ts.map +1 -1
  17. package/dist/govcitizenhub/pages/applications/NewApplicationPage.js +148 -244
  18. package/dist/govcitizenhub/pages/applications/NewApplicationPage.js.map +1 -1
  19. package/dist/govcitizenhub/pages/services/FormFieldBuilder.d.ts +7 -28
  20. package/dist/govcitizenhub/pages/services/FormFieldBuilder.d.ts.map +1 -1
  21. package/dist/govcitizenhub/pages/services/FormFieldBuilder.js +203 -136
  22. package/dist/govcitizenhub/pages/services/FormFieldBuilder.js.map +1 -1
  23. package/dist/govcitizenhub/pages/services/ServiceFormDialog.d.ts.map +1 -1
  24. package/dist/govcitizenhub/pages/services/ServiceFormDialog.js +156 -114
  25. package/dist/govcitizenhub/pages/services/ServiceFormDialog.js.map +1 -1
  26. package/dist/govcitizenhub/utils/dynamicForm.d.ts +46 -0
  27. package/dist/govcitizenhub/utils/dynamicForm.d.ts.map +1 -0
  28. package/dist/govcitizenhub/utils/dynamicForm.js +59 -0
  29. package/dist/govcitizenhub/utils/dynamicForm.js.map +1 -0
  30. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"ApplicationsPage.js","names":[],"sources":["../../../../src/govcitizenhub/pages/applications/ApplicationsPage.tsx"],"sourcesContent":["/**\n * ApplicationsPage — the casework queue (citizen filings + officer review).\n * @module govcitizenhub/pages/applications\n *\n * Reads `govListApplications` filtered by status with cursor pagination, and joins\n * `govListServices` for the service name column and `govDashboardSummary` for the\n * authoritative per-status tab counts. Each row surfaces reference + filed date,\n * service, a priority chip, an SLA badge computed from dueDate + status, the\n * assigned officer (real identity only — self shows you, others show a neutral id\n * chip, unassigned is explicit), and the status pill. A SummaryStrip above the\n * list reports On-track / Due-soon / Overdue for the CURRENT page (honest window).\n * Rows link to the casework workspace where the full lifecycle is managed.\n */\n\nimport { useMemo, useState } from 'react';\nimport {\n Plus,\n ChevronRight,\n Search,\n CircleCheck,\n Clock,\n TriangleAlert,\n UserCheck,\n} from 'lucide-react';\nimport { Button, GlassCard, Skeleton, Input } from '@burdenoff/fe-libs/ui';\n\nimport { PageLayout } from '../../components/PageLayout';\nimport { FilterTabs, type FilterOption } from '../../components/FilterTabs';\nimport { StatusBadge } from '../../components/StatusBadge';\nimport { SlaBadge } from '../../components/SlaBadge';\nimport { AssigneeChip } from '../../components/Avatar';\nimport { SummaryStrip, type SummaryStat } from '../../components/SummaryStrip';\nimport { EmptyState } from '../../components/EmptyState';\nimport { ErrorView } from '../../components/StateViews';\nimport { Pagination } from '../../components/Pagination';\nimport { cn } from '../../utils/cn';\nimport {\n useGovApplications,\n useGovServices,\n useGovDashboardSummary,\n useGovApplicationSlaSummary,\n useCursorPager,\n} from '../../hooks';\nimport { useGovCitizenHub } from '../../context';\nimport { formatDate } from '../../utils/formatters';\nimport type { GovApplication, GovApplicationStatus, CurrentUser } from '../../types';\n\nconst PAGE_SIZE = 15;\n\n/** Best available display name for the signed-in officer (never fabricated for others). */\nfunction userDisplayName(user?: CurrentUser | null): string | undefined {\n if (!user) return undefined;\n const full = [user.firstName, user.lastName].filter(Boolean).join(' ').trim();\n return user.name?.trim() || full || user.username?.trim() || user.email;\n}\n\n/** First 8 chars of an opaque actor id — an honest reference, not a name. */\nconst shortId = (id: string): string => id.slice(0, 8);\n\ntype StatusFilter = 'ALL' | GovApplicationStatus;\n\nconst STATUS_OPTIONS: { value: StatusFilter; label: string }[] = [\n { value: 'ALL', label: 'All' },\n { value: 'SUBMITTED', label: 'Submitted' },\n { value: 'IN_REVIEW', label: 'In review' },\n { value: 'INFO_REQUESTED', label: 'Info requested' },\n { value: 'APPROVED', label: 'Approved' },\n { value: 'REJECTED', label: 'Rejected' },\n { value: 'DRAFT', label: 'Draft' },\n];\n\n/** Statuses whose SLA clock has stopped — excluded from the page SLA summary. */\nconst TERMINAL = new Set<GovApplicationStatus>(['APPROVED', 'REJECTED', 'WITHDRAWN']);\n\n/** Whole calendar days until `due` (>0 future, 0 today, <0 overdue). */\nfunction daysUntilDue(due: Date): number {\n const startOfDay = (d: Date) => new Date(d.getFullYear(), d.getMonth(), d.getDate()).getTime();\n return Math.round((startOfDay(due) - startOfDay(new Date())) / 86_400_000);\n}\n\ntype SlaBucket = 'ontrack' | 'duesoon' | 'overdue' | 'none';\n\nfunction slaBucketOf(app: GovApplication): SlaBucket {\n if (TERMINAL.has(app.status) || !app.dueDate) return 'none';\n const due = new Date(app.dueDate);\n if (Number.isNaN(due.getTime())) return 'none';\n const days = daysUntilDue(due);\n if (days < 0) return 'overdue';\n if (days <= 2) return 'duesoon';\n return 'ontrack';\n}\n\n// ---------------------------------------------------------------------------\n// Assigned-officer cell — real identity only, never a fabricated name.\n// ---------------------------------------------------------------------------\n\nfunction AssignedCell({\n assignedToId,\n currentUser,\n}: {\n assignedToId?: string | null;\n currentUser?: CurrentUser | null;\n}) {\n if (!assignedToId) {\n return (\n <span className=\"inline-flex items-center gap-2 text-sm text-text-muted\">\n <span\n aria-hidden=\"true\"\n className=\"inline-flex size-8 items-center justify-center rounded-full border border-dashed border-border-seam text-text-muted\"\n >\n <Plus className=\"size-3.5\" />\n </span>\n Unassigned\n </span>\n );\n }\n if (currentUser?.id && assignedToId === currentUser.id) {\n return (\n <AssigneeChip\n name={userDisplayName(currentUser) ?? 'You'}\n src={currentUser.avatar}\n subtitle=\"You\"\n />\n );\n }\n return <AssigneeChip name=\"Assigned officer\" subtitle={`#${shortId(assignedToId)}`} />;\n}\n\n// ---------------------------------------------------------------------------\n// Queue rows — desktop <table> + mobile stacked cards.\n//\n// We use a NATIVE <table> (display:table) gated by `hidden md:block`, NOT a\n// Tailwind grid. Build-time MFE composition means only the utility classes the\n// host shell itself emits are available to this MFE, and `md:grid` / `md:table`\n// are not among them (verified: they fall back to `display:block`), whereas\n// `md:block` / `md:hidden` / `md:flex` are. A grid-based responsive row would\n// therefore silently collapse to the mobile layout at desktop width.\n// ---------------------------------------------------------------------------\n\nfunction QueueTableRow({\n app,\n serviceName,\n currentUser,\n onOpen,\n}: {\n app: GovApplication;\n serviceName?: string;\n currentUser?: CurrentUser | null;\n onOpen: () => void;\n}) {\n return (\n <tr\n role=\"button\"\n tabIndex={0}\n aria-label={`Open application ${app.reference}`}\n onClick={onOpen}\n onKeyDown={(e) => {\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault();\n onOpen();\n }\n }}\n className=\"group cursor-pointer align-middle outline-none transition-colors hover:bg-bg-sunken focus-visible:bg-bg-sunken\"\n >\n <td className=\"px-4 py-3\">\n <span className=\"block truncate font-medium text-action-primary-text\">{app.reference}</span>\n <span className=\"text-xs text-text-muted\">Filed {formatDate(app.createdAt)}</span>\n </td>\n <td className=\"px-4 py-3 text-sm text-text-secondary\">\n <span className=\"line-clamp-1\">{serviceName ?? '—'}</span>\n </td>\n <td className=\"px-4 py-3\">\n <StatusBadge status={app.priority} />\n </td>\n <td className=\"px-4 py-3\">\n <AssignedCell assignedToId={app.assignedToId} currentUser={currentUser} />\n </td>\n <td className=\"px-4 py-3\">\n <div className=\"flex flex-col gap-0.5\">\n <SlaBadge dueDate={app.dueDate} status={app.status} />\n {app.dueDate && (\n <span className=\"text-xs text-text-muted\">Due {formatDate(app.dueDate)}</span>\n )}\n </div>\n </td>\n <td className=\"px-4 py-3\">\n <StatusBadge status={app.status} />\n </td>\n <td className=\"px-4 py-3 text-right\">\n <ChevronRight className=\"ml-auto size-4 shrink-0 text-text-muted transition-transform group-hover:translate-x-0.5\" />\n </td>\n </tr>\n );\n}\n\nfunction QueueCard({\n app,\n serviceName,\n currentUser,\n onOpen,\n}: {\n app: GovApplication;\n serviceName?: string;\n currentUser?: CurrentUser | null;\n onOpen: () => void;\n}) {\n return (\n <button\n type=\"button\"\n onClick={onOpen}\n aria-label={`Open application ${app.reference}`}\n className=\"flex w-full flex-col gap-2 px-4 py-4 text-left outline-none transition-colors hover:bg-bg-sunken focus-visible:bg-bg-sunken\"\n >\n <div className=\"flex items-center justify-between gap-2\">\n <span className=\"min-w-0\">\n <span className=\"block truncate font-medium text-action-primary-text\">\n {app.reference}\n </span>\n <span className=\"text-xs text-text-muted\">Filed {formatDate(app.createdAt)}</span>\n </span>\n <StatusBadge status={app.status} />\n </div>\n <div className=\"text-sm text-text-secondary\">{serviceName ?? '—'}</div>\n <div className=\"flex flex-wrap items-center gap-2\">\n <StatusBadge status={app.priority} />\n <SlaBadge dueDate={app.dueDate} status={app.status} />\n <AssignedCell assignedToId={app.assignedToId} currentUser={currentUser} />\n </div>\n </button>\n );\n}\n\nexport function ApplicationsPage() {\n const { navigateTo, currentUser } = useGovCitizenHub();\n const pager = useCursorPager();\n const [status, setStatus] = useState<StatusFilter>('ALL');\n const [search, setSearch] = useState('');\n const [mineOnly, setMineOnly] = useState(false);\n\n const { data, isLoading, isError, refetch } = useGovApplications({\n status: status === 'ALL' ? undefined : status,\n assignedToId: mineOnly ? currentUser?.id : undefined,\n pagination: { limit: PAGE_SIZE, cursor: pager.cursor },\n });\n const servicesQuery = useGovServices({ pagination: { limit: 100 } });\n const summary = useGovDashboardSummary();\n // Corpus-wide SLA breakdown — accurate regardless of pagination/filters, unlike\n // the page-level strip below which can only see whatever page is loaded.\n const corpusSla = useGovApplicationSlaSummary();\n\n const applications = useMemo(() => data?.items ?? [], [data]);\n\n const serviceName = useMemo(() => {\n const map = new Map<string, string>();\n servicesQuery.data?.items.forEach((svc) => map.set(svc.id, svc.name));\n return map;\n }, [servicesQuery.data]);\n\n // Authoritative per-status tab counts from the backend-computed dashboard.\n const statusCount = useMemo(() => {\n const map = new Map<GovApplicationStatus, number>();\n summary.data?.applicationsByStatus.forEach((entry) => map.set(entry.status, entry.count));\n return map;\n }, [summary.data]);\n\n const tabs: FilterOption<StatusFilter>[] = STATUS_OPTIONS.map((opt) => ({\n ...opt,\n count:\n opt.value === 'ALL'\n ? summary.data?.applicationsTotal\n : statusCount.get(opt.value as GovApplicationStatus),\n }));\n\n // SLA summary over the CURRENT page (honest window — not the whole corpus).\n const sla = useMemo(() => {\n let ontrack = 0;\n let duesoon = 0;\n let overdue = 0;\n for (const app of applications) {\n const bucket = slaBucketOf(app);\n if (bucket === 'ontrack') ontrack += 1;\n else if (bucket === 'duesoon') duesoon += 1;\n else if (bucket === 'overdue') overdue += 1;\n }\n return { ontrack, duesoon, overdue };\n }, [applications]);\n\n const slaStats: SummaryStat[] = [\n { label: 'On track', value: sla.ontrack, icon: <CircleCheck />, tone: 'success' },\n { label: 'Due soon', value: sla.duesoon, icon: <Clock />, tone: 'warning' },\n { label: 'Overdue', value: sla.overdue, icon: <TriangleAlert />, tone: 'error' },\n ];\n\n // Corpus-wide SLA summary — every non-terminal application, not just this page.\n const corpusSlaStats: SummaryStat[] = [\n {\n label: 'On track',\n value: corpusSla.data?.onTrack ?? 0,\n icon: <CircleCheck />,\n tone: 'success',\n },\n {\n label: 'Due soon',\n value: corpusSla.data?.dueSoon ?? 0,\n icon: <Clock />,\n tone: 'warning',\n },\n {\n label: 'Overdue',\n value: corpusSla.data?.overdue ?? 0,\n icon: <TriangleAlert />,\n tone: 'error',\n },\n ];\n\n const visible = useMemo(() => {\n const term = search.trim().toLowerCase();\n if (!term) return applications;\n return applications.filter((app) => {\n const svc = serviceName.get(app.serviceId) ?? '';\n return (\n app.reference.toLowerCase().includes(term) ||\n svc.toLowerCase().includes(term) ||\n app.status.toLowerCase().includes(term)\n );\n });\n }, [applications, search, serviceName]);\n\n const changeStatus = (next: StatusFilter) => {\n setStatus(next);\n setSearch('');\n pager.reset();\n };\n\n const toggleMineOnly = () => {\n setMineOnly((prev) => !prev);\n pager.reset();\n };\n\n return (\n <PageLayout\n title=\"Applications\"\n titleGradient\n description=\"Citizen applications moving through review, decision, and fulfilment.\"\n actions={\n <Button onClick={() => navigateTo('applications/new')}>\n <Plus className=\"mr-1.5 h-4 w-4\" /> New application\n </Button>\n }\n >\n {/* Toolbar: status tabs + My queue toggle + search */}\n <div className=\"mb-5 flex flex-col gap-3 lg:flex-row lg:items-center lg:justify-between\">\n <div className=\"flex flex-wrap items-center gap-2\">\n <FilterTabs options={tabs} value={status} onChange={changeStatus} />\n <button\n type=\"button\"\n disabled={!currentUser?.id}\n aria-pressed={mineOnly}\n onClick={toggleMineOnly}\n title={currentUser?.id ? undefined : 'Sign in to filter your queue'}\n className={cn(\n 'inline-flex items-center gap-1.5 rounded-xl border px-3 py-1.5 text-sm font-medium transition-colors disabled:cursor-not-allowed disabled:opacity-50',\n mineOnly\n ? 'border-transparent bg-action-primary-bg text-action-primary-text'\n : 'border-border-seam bg-bg-surface text-text-secondary hover:bg-bg-sunken hover:text-text-primary'\n )}\n >\n <UserCheck className=\"size-3.5\" aria-hidden=\"true\" />\n My queue\n </button>\n </div>\n <div className=\"relative lg:w-80\">\n <Search\n className=\"pointer-events-none absolute left-3 top-1/2 size-4 -translate-y-1/2 text-text-muted\"\n aria-hidden=\"true\"\n />\n <Input\n value={search}\n onChange={(e) => setSearch(e.target.value)}\n placeholder=\"Search by reference or service…\"\n aria-label=\"Search applications on this page\"\n className=\"pl-9\"\n />\n </div>\n </div>\n\n {/* Corpus-wide SLA summary — every non-terminal application, not just this page. */}\n <div className=\"mb-5\">\n <div className=\"mb-2 flex items-center gap-2\">\n <h2 className=\"text-sm font-semibold text-text-primary\">SLA across all applications</h2>\n <span className=\"text-xs text-text-muted\">Corpus-wide, backend-computed</span>\n </div>\n {corpusSla.isLoading ? (\n <Skeleton className=\"h-16 w-full rounded-card\" />\n ) : (\n <SummaryStrip stats={corpusSlaStats} />\n )}\n </div>\n\n {isLoading ? (\n <div className=\"space-y-3\">\n {Array.from({ length: 6 }, (_, i) => (\n <Skeleton key={i} className=\"h-16 w-full rounded-card\" />\n ))}\n </div>\n ) : isError ? (\n <ErrorView message=\"We couldn't load applications.\" onRetry={() => refetch()} />\n ) : applications.length === 0 && pager.page === 0 ? (\n <EmptyState\n illustration=\"empty-data\"\n title=\"No applications found\"\n description={\n mineOnly\n ? 'Nothing is currently assigned to you for this status.'\n : status === 'ALL'\n ? 'File the first application from a published service.'\n : 'No applications match this status.'\n }\n action={\n <Button onClick={() => navigateTo('applications/new')}>\n <Plus className=\"mr-1.5 h-4 w-4\" /> New application\n </Button>\n }\n />\n ) : (\n <>\n {/* SLA summary for the current page */}\n <div className=\"mb-4\">\n <div className=\"mb-2 flex items-center gap-2\">\n <h2 className=\"text-sm font-semibold text-text-primary\">SLA on this page</h2>\n <span className=\"text-xs text-text-muted\">\n Based on due date · {applications.length} shown\n </span>\n </div>\n <SummaryStrip stats={slaStats} />\n </div>\n\n {/* Queue list */}\n <GlassCard treatment=\"plain\" className=\"overflow-hidden border-border-seam p-0\">\n {visible.length === 0 ? (\n <p className=\"px-5 py-10 text-center text-sm text-text-secondary\">\n No applications on this page match “{search}”.\n </p>\n ) : (\n <>\n {/* Desktop table */}\n <div className=\"hidden overflow-x-auto md:block\">\n <table className=\"w-full text-left text-sm\">\n <thead>\n <tr className=\"border-b border-border-seam text-xs font-medium uppercase tracking-wide text-text-muted\">\n <th className=\"px-4 py-2.5 font-medium\">Reference</th>\n <th className=\"px-4 py-2.5 font-medium\">Service</th>\n <th className=\"px-4 py-2.5 font-medium\">Priority</th>\n <th className=\"px-4 py-2.5 font-medium\">Assigned officer</th>\n <th className=\"px-4 py-2.5 font-medium\">Due date (SLA)</th>\n <th className=\"px-4 py-2.5 font-medium\">Status</th>\n <th className=\"px-4 py-2.5\" aria-hidden=\"true\" />\n </tr>\n </thead>\n <tbody className=\"divide-y divide-border-subtle\">\n {visible.map((app) => (\n <QueueTableRow\n key={app.id}\n app={app}\n serviceName={serviceName.get(app.serviceId)}\n currentUser={currentUser}\n onOpen={() => navigateTo(`applications/${app.id}`)}\n />\n ))}\n </tbody>\n </table>\n </div>\n\n {/* Mobile stacked cards */}\n <ul className=\"divide-y divide-border-subtle md:hidden\">\n {visible.map((app) => (\n <li key={app.id}>\n <QueueCard\n app={app}\n serviceName={serviceName.get(app.serviceId)}\n currentUser={currentUser}\n onOpen={() => navigateTo(`applications/${app.id}`)}\n />\n </li>\n ))}\n </ul>\n </>\n )}\n </GlassCard>\n\n <Pagination\n page={pager.page}\n pageSize={PAGE_SIZE}\n itemCount={applications.length}\n hasMore={data?.pageInfo.hasMore ?? false}\n onPageChange={(target) => pager.onPageChange(target, data?.pageInfo.cursor)}\n />\n </>\n )}\n </PageLayout>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AA+CA,IAAM,IAAY;AAGlB,SAAS,EAAgB,GAA+C;CACtE,IAAI,CAAC,GAAM;CACX,IAAM,IAAO,CAAC,EAAK,WAAW,EAAK,QAAQ,EAAE,OAAO,OAAO,EAAE,KAAK,GAAG,EAAE,KAAK;CAC5E,OAAO,EAAK,MAAM,KAAK,KAAK,KAAQ,EAAK,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eAAe,MAAW,EAAM,aAAa,GAAQ,GAAM,SAAS,MAAM;IAC3E,CAAA;GACD,EAAA,CAAA;EAEM;;AAEhB"}
1
+ {"version":3,"file":"ApplicationsPage.js","names":[],"sources":["../../../../src/govcitizenhub/pages/applications/ApplicationsPage.tsx"],"sourcesContent":["/**\n * ApplicationsPage — the casework queue (citizen filings + officer review).\n * @module govcitizenhub/pages/applications\n *\n * Reads `govListApplications` filtered by status with cursor pagination, and joins\n * `govListServices` for the service name column and `govDashboardSummary` for the\n * authoritative per-status tab counts. Each row surfaces reference + filed date,\n * service, a priority chip, an SLA badge computed from dueDate + status, the\n * assigned officer (real identity only — self shows you, others show a neutral id\n * chip, unassigned is explicit), and the status pill. A SummaryStrip above the\n * list reports On-track / Due-soon / Overdue for the CURRENT page (honest window).\n * Rows link to the casework workspace where the full lifecycle is managed.\n */\n\nimport { useMemo, useState } from 'react';\nimport {\n Plus,\n ChevronRight,\n Search,\n CircleCheck,\n Clock,\n TriangleAlert,\n UserCheck,\n} from 'lucide-react';\nimport { Button, GlassCard, Skeleton, Input } from '@burdenoff/fe-libs/ui';\nimport { useActorProfiles, type ActorInput, type ActorProfileMap } from '@burdenoff/fe-libs/shared';\n\nimport { PageLayout } from '../../components/PageLayout';\nimport { FilterTabs, type FilterOption } from '../../components/FilterTabs';\nimport { StatusBadge } from '../../components/StatusBadge';\nimport { SlaBadge } from '../../components/SlaBadge';\nimport { AssigneeChip } from '../../components/Avatar';\nimport { SummaryStrip, type SummaryStat } from '../../components/SummaryStrip';\nimport { EmptyState } from '../../components/EmptyState';\nimport { ErrorView } from '../../components/StateViews';\nimport { Pagination } from '../../components/Pagination';\nimport { cn } from '../../utils/cn';\nimport {\n useGovApplications,\n useGovServices,\n useGovDashboardSummary,\n useGovApplicationSlaSummary,\n useCursorPager,\n} from '../../hooks';\nimport { useGovCitizenHub } from '../../context';\nimport { formatDate } from '../../utils/formatters';\nimport type { GovApplication, GovApplicationStatus, CurrentUser } from '../../types';\n\nconst PAGE_SIZE = 15;\n\n/** Best available display name for the signed-in officer (never fabricated for others). */\nfunction userDisplayName(user?: CurrentUser | null): string | undefined {\n if (!user) return undefined;\n const full = [user.firstName, user.lastName].filter(Boolean).join(' ').trim();\n return user.name?.trim() || full || user.username?.trim() || user.email;\n}\n\n/** First 8 chars of an opaque actor id — an honest reference, not a name. */\nconst shortId = (id: string): string => id.slice(0, 8);\n\ntype StatusFilter = 'ALL' | GovApplicationStatus;\n\nconst STATUS_OPTIONS: { value: StatusFilter; label: string }[] = [\n { value: 'ALL', label: 'All' },\n { value: 'SUBMITTED', label: 'Submitted' },\n { value: 'IN_REVIEW', label: 'In review' },\n { value: 'INFO_REQUESTED', label: 'Info requested' },\n { value: 'APPROVED', label: 'Approved' },\n { value: 'REJECTED', label: 'Rejected' },\n { value: 'DRAFT', label: 'Draft' },\n];\n\n/** Statuses whose SLA clock has stopped — excluded from the page SLA summary. */\nconst TERMINAL = new Set<GovApplicationStatus>(['APPROVED', 'REJECTED', 'WITHDRAWN']);\n\n/** Whole calendar days until `due` (>0 future, 0 today, <0 overdue). */\nfunction daysUntilDue(due: Date): number {\n const startOfDay = (d: Date) => new Date(d.getFullYear(), d.getMonth(), d.getDate()).getTime();\n return Math.round((startOfDay(due) - startOfDay(new Date())) / 86_400_000);\n}\n\ntype SlaBucket = 'ontrack' | 'duesoon' | 'overdue' | 'none';\n\nfunction slaBucketOf(app: GovApplication): SlaBucket {\n if (TERMINAL.has(app.status) || !app.dueDate) return 'none';\n const due = new Date(app.dueDate);\n if (Number.isNaN(due.getTime())) return 'none';\n const days = daysUntilDue(due);\n if (days < 0) return 'overdue';\n if (days <= 2) return 'duesoon';\n return 'ontrack';\n}\n\n// ---------------------------------------------------------------------------\n// Assigned-officer cell — real identity only, never a fabricated name.\n//\n// Other officers' names/avatars are resolved via the platform's shared\n// `useActorProfiles` (fe-libs), which the User federation type intentionally\n// doesn't expose firstName/lastName for directly (BOFF-4058) — the id chip\n// this replaced is a graceful, honest fallback while resolution is pending\n// or fails, never a fabricated name.\n// ---------------------------------------------------------------------------\n\nfunction AssignedCell({\n assignedToId,\n currentUser,\n officerProfiles,\n}: {\n assignedToId?: string | null;\n currentUser?: CurrentUser | null;\n officerProfiles: ActorProfileMap;\n}) {\n if (!assignedToId) {\n return (\n <span className=\"inline-flex items-center gap-2 text-sm text-text-muted\">\n <span\n aria-hidden=\"true\"\n className=\"inline-flex size-8 items-center justify-center rounded-full border border-dashed border-border-seam text-text-muted\"\n >\n <Plus className=\"size-3.5\" />\n </span>\n Unassigned\n </span>\n );\n }\n if (currentUser?.id && assignedToId === currentUser.id) {\n return (\n <AssigneeChip\n name={userDisplayName(currentUser) ?? 'You'}\n src={currentUser.avatar}\n subtitle=\"You\"\n />\n );\n }\n const profile = officerProfiles[assignedToId];\n return (\n <AssigneeChip\n name={profile?.resolved ? profile.displayName : `Officer #${shortId(assignedToId)}`}\n src={profile?.avatarUrl}\n subtitle={(profile?.resolved && profile.email) || 'Assigned officer'}\n />\n );\n}\n\n// ---------------------------------------------------------------------------\n// Queue rows — desktop <table> + mobile stacked cards.\n//\n// We use a NATIVE <table> (display:table) gated by `hidden md:block`, NOT a\n// Tailwind grid. Build-time MFE composition means only the utility classes the\n// host shell itself emits are available to this MFE, and `md:grid` / `md:table`\n// are not among them (verified: they fall back to `display:block`), whereas\n// `md:block` / `md:hidden` / `md:flex` are. A grid-based responsive row would\n// therefore silently collapse to the mobile layout at desktop width.\n// ---------------------------------------------------------------------------\n\nfunction QueueTableRow({\n app,\n serviceName,\n currentUser,\n officerProfiles,\n onOpen,\n}: {\n app: GovApplication;\n serviceName?: string;\n currentUser?: CurrentUser | null;\n officerProfiles: ActorProfileMap;\n onOpen: () => void;\n}) {\n return (\n <tr\n role=\"button\"\n tabIndex={0}\n aria-label={`Open application ${app.reference}`}\n onClick={onOpen}\n onKeyDown={(e) => {\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault();\n onOpen();\n }\n }}\n className=\"group cursor-pointer align-middle outline-none transition-colors hover:bg-bg-sunken focus-visible:bg-bg-sunken\"\n >\n <td className=\"px-4 py-3\">\n <span className=\"block truncate font-medium text-action-primary-text\">{app.reference}</span>\n <span className=\"text-xs text-text-muted\">Filed {formatDate(app.createdAt)}</span>\n </td>\n <td className=\"px-4 py-3 text-sm text-text-secondary\">\n <span className=\"line-clamp-1\">{serviceName ?? '—'}</span>\n </td>\n <td className=\"px-4 py-3\">\n <StatusBadge status={app.priority} />\n </td>\n <td className=\"px-4 py-3\">\n <AssignedCell\n assignedToId={app.assignedToId}\n currentUser={currentUser}\n officerProfiles={officerProfiles}\n />\n </td>\n <td className=\"px-4 py-3\">\n <div className=\"flex flex-col gap-0.5\">\n <SlaBadge dueDate={app.dueDate} status={app.status} />\n {app.dueDate && (\n <span className=\"text-xs text-text-muted\">Due {formatDate(app.dueDate)}</span>\n )}\n </div>\n </td>\n <td className=\"px-4 py-3\">\n <StatusBadge status={app.status} />\n </td>\n <td className=\"px-4 py-3 text-right\">\n <ChevronRight className=\"ml-auto size-4 shrink-0 text-text-muted transition-transform group-hover:translate-x-0.5\" />\n </td>\n </tr>\n );\n}\n\nfunction QueueCard({\n app,\n serviceName,\n currentUser,\n officerProfiles,\n onOpen,\n}: {\n app: GovApplication;\n serviceName?: string;\n currentUser?: CurrentUser | null;\n officerProfiles: ActorProfileMap;\n onOpen: () => void;\n}) {\n return (\n <button\n type=\"button\"\n onClick={onOpen}\n aria-label={`Open application ${app.reference}`}\n className=\"flex w-full flex-col gap-2 px-4 py-4 text-left outline-none transition-colors hover:bg-bg-sunken focus-visible:bg-bg-sunken\"\n >\n <div className=\"flex items-center justify-between gap-2\">\n <span className=\"min-w-0\">\n <span className=\"block truncate font-medium text-action-primary-text\">\n {app.reference}\n </span>\n <span className=\"text-xs text-text-muted\">Filed {formatDate(app.createdAt)}</span>\n </span>\n <StatusBadge status={app.status} />\n </div>\n <div className=\"text-sm text-text-secondary\">{serviceName ?? '—'}</div>\n <div className=\"flex flex-wrap items-center gap-2\">\n <StatusBadge status={app.priority} />\n <SlaBadge dueDate={app.dueDate} status={app.status} />\n <AssignedCell\n assignedToId={app.assignedToId}\n currentUser={currentUser}\n officerProfiles={officerProfiles}\n />\n </div>\n </button>\n );\n}\n\nexport function ApplicationsPage() {\n const { navigateTo, currentUser, apiGatewayUrl, authToken, workspaceId } = useGovCitizenHub();\n const pager = useCursorPager();\n const [status, setStatus] = useState<StatusFilter>('ALL');\n const [search, setSearch] = useState('');\n const [mineOnly, setMineOnly] = useState(false);\n\n const { data, isLoading, isError, refetch } = useGovApplications({\n status: status === 'ALL' ? undefined : status,\n assignedToId: mineOnly ? currentUser?.id : undefined,\n pagination: { limit: PAGE_SIZE, cursor: pager.cursor },\n });\n const servicesQuery = useGovServices({ pagination: { limit: 100 } });\n const summary = useGovDashboardSummary();\n // Corpus-wide SLA breakdown — accurate regardless of pagination/filters, unlike\n // the page-level strip below which can only see whatever page is loaded.\n const corpusSla = useGovApplicationSlaSummary();\n\n const applications = useMemo(() => data?.items ?? [], [data]);\n\n // Distinct OTHER officers assigned on this page — resolved once, batched, and\n // cached by the shared hook (BOFF-4058) rather than per-row.\n const otherOfficerActors = useMemo<ActorInput[]>(() => {\n const ids = new Set<string>();\n for (const app of applications) {\n if (app.assignedToId && app.assignedToId !== currentUser?.id) ids.add(app.assignedToId);\n }\n return [...ids].map((actorId) => ({ actorId, actorType: 'user' }));\n }, [applications, currentUser?.id]);\n const officerProfiles = useActorProfiles(otherOfficerActors, {\n apiGatewayUrl,\n authToken,\n workspaceId,\n });\n\n const serviceName = useMemo(() => {\n const map = new Map<string, string>();\n servicesQuery.data?.items.forEach((svc) => map.set(svc.id, svc.name));\n return map;\n }, [servicesQuery.data]);\n\n // Authoritative per-status tab counts from the backend-computed dashboard.\n const statusCount = useMemo(() => {\n const map = new Map<GovApplicationStatus, number>();\n summary.data?.applicationsByStatus.forEach((entry) => map.set(entry.status, entry.count));\n return map;\n }, [summary.data]);\n\n const tabs: FilterOption<StatusFilter>[] = STATUS_OPTIONS.map((opt) => ({\n ...opt,\n count:\n opt.value === 'ALL'\n ? summary.data?.applicationsTotal\n : statusCount.get(opt.value as GovApplicationStatus),\n }));\n\n // SLA summary over the CURRENT page (honest window — not the whole corpus).\n const sla = useMemo(() => {\n let ontrack = 0;\n let duesoon = 0;\n let overdue = 0;\n for (const app of applications) {\n const bucket = slaBucketOf(app);\n if (bucket === 'ontrack') ontrack += 1;\n else if (bucket === 'duesoon') duesoon += 1;\n else if (bucket === 'overdue') overdue += 1;\n }\n return { ontrack, duesoon, overdue };\n }, [applications]);\n\n const slaStats: SummaryStat[] = [\n { label: 'On track', value: sla.ontrack, icon: <CircleCheck />, tone: 'success' },\n { label: 'Due soon', value: sla.duesoon, icon: <Clock />, tone: 'warning' },\n { label: 'Overdue', value: sla.overdue, icon: <TriangleAlert />, tone: 'error' },\n ];\n\n // Corpus-wide SLA summary — every non-terminal application, not just this page.\n const corpusSlaStats: SummaryStat[] = [\n {\n label: 'On track',\n value: corpusSla.data?.onTrack ?? 0,\n icon: <CircleCheck />,\n tone: 'success',\n },\n {\n label: 'Due soon',\n value: corpusSla.data?.dueSoon ?? 0,\n icon: <Clock />,\n tone: 'warning',\n },\n {\n label: 'Overdue',\n value: corpusSla.data?.overdue ?? 0,\n icon: <TriangleAlert />,\n tone: 'error',\n },\n ];\n\n const visible = useMemo(() => {\n const term = search.trim().toLowerCase();\n if (!term) return applications;\n return applications.filter((app) => {\n const svc = serviceName.get(app.serviceId) ?? '';\n return (\n app.reference.toLowerCase().includes(term) ||\n svc.toLowerCase().includes(term) ||\n app.status.toLowerCase().includes(term)\n );\n });\n }, [applications, search, serviceName]);\n\n const changeStatus = (next: StatusFilter) => {\n setStatus(next);\n setSearch('');\n pager.reset();\n };\n\n const toggleMineOnly = () => {\n setMineOnly((prev) => !prev);\n pager.reset();\n };\n\n return (\n <PageLayout\n title=\"Applications\"\n titleGradient\n description=\"Citizen applications moving through review, decision, and fulfilment.\"\n actions={\n <Button onClick={() => navigateTo('applications/new')}>\n <Plus className=\"mr-1.5 h-4 w-4\" /> New application\n </Button>\n }\n >\n {/* Toolbar: status tabs + My queue toggle + search */}\n <div className=\"mb-5 flex flex-col gap-3 lg:flex-row lg:items-center lg:justify-between\">\n <div className=\"flex flex-wrap items-center gap-2\">\n <FilterTabs options={tabs} value={status} onChange={changeStatus} />\n <button\n type=\"button\"\n disabled={!currentUser?.id}\n aria-pressed={mineOnly}\n onClick={toggleMineOnly}\n title={currentUser?.id ? undefined : 'Sign in to filter your queue'}\n className={cn(\n 'inline-flex items-center gap-1.5 rounded-xl border px-3 py-1.5 text-sm font-medium transition-colors disabled:cursor-not-allowed disabled:opacity-50',\n mineOnly\n ? 'border-transparent bg-action-primary-bg text-action-primary-text'\n : 'border-border-seam bg-bg-surface text-text-secondary hover:bg-bg-sunken hover:text-text-primary'\n )}\n >\n <UserCheck className=\"size-3.5\" aria-hidden=\"true\" />\n My queue\n </button>\n </div>\n <div className=\"relative lg:w-80\">\n <Search\n className=\"pointer-events-none absolute left-3 top-1/2 size-4 -translate-y-1/2 text-text-muted\"\n aria-hidden=\"true\"\n />\n <Input\n value={search}\n onChange={(e) => setSearch(e.target.value)}\n placeholder=\"Search by reference or service…\"\n aria-label=\"Search applications on this page\"\n className=\"pl-9\"\n />\n </div>\n </div>\n\n {/* Corpus-wide SLA summary — every non-terminal application, not just this page. */}\n <div className=\"mb-5\">\n <div className=\"mb-2 flex items-center gap-2\">\n <h2 className=\"text-sm font-semibold text-text-primary\">SLA across all applications</h2>\n <span className=\"text-xs text-text-muted\">Corpus-wide, backend-computed</span>\n </div>\n {corpusSla.isLoading ? (\n <Skeleton className=\"h-16 w-full rounded-card\" />\n ) : (\n <SummaryStrip stats={corpusSlaStats} />\n )}\n </div>\n\n {isLoading ? (\n <div className=\"space-y-3\">\n {Array.from({ length: 6 }, (_, i) => (\n <Skeleton key={i} className=\"h-16 w-full rounded-card\" />\n ))}\n </div>\n ) : isError ? (\n <ErrorView message=\"We couldn't load applications.\" onRetry={() => refetch()} />\n ) : applications.length === 0 && pager.page === 0 ? (\n <EmptyState\n illustration=\"empty-data\"\n title=\"No applications found\"\n description={\n mineOnly\n ? 'Nothing is currently assigned to you for this status.'\n : status === 'ALL'\n ? 'File the first application from a published service.'\n : 'No applications match this status.'\n }\n action={\n <Button onClick={() => navigateTo('applications/new')}>\n <Plus className=\"mr-1.5 h-4 w-4\" /> New application\n </Button>\n }\n />\n ) : (\n <>\n {/* SLA summary for the current page */}\n <div className=\"mb-4\">\n <div className=\"mb-2 flex items-center gap-2\">\n <h2 className=\"text-sm font-semibold text-text-primary\">SLA on this page</h2>\n <span className=\"text-xs text-text-muted\">\n Based on due date · {applications.length} shown\n </span>\n </div>\n <SummaryStrip stats={slaStats} />\n </div>\n\n {/* Queue list */}\n <GlassCard treatment=\"plain\" className=\"overflow-hidden border-border-seam p-0\">\n {visible.length === 0 ? (\n <p className=\"px-5 py-10 text-center text-sm text-text-secondary\">\n No applications on this page match “{search}”.\n </p>\n ) : (\n <>\n {/* Desktop table */}\n <div className=\"hidden overflow-x-auto md:block\">\n <table className=\"w-full text-left text-sm\">\n <thead>\n <tr className=\"border-b border-border-seam text-xs font-medium uppercase tracking-wide text-text-muted\">\n <th className=\"px-4 py-2.5 font-medium\">Reference</th>\n <th className=\"px-4 py-2.5 font-medium\">Service</th>\n <th className=\"px-4 py-2.5 font-medium\">Priority</th>\n <th className=\"px-4 py-2.5 font-medium\">Assigned officer</th>\n <th className=\"px-4 py-2.5 font-medium\">Due date (SLA)</th>\n <th className=\"px-4 py-2.5 font-medium\">Status</th>\n <th className=\"px-4 py-2.5\" aria-hidden=\"true\" />\n </tr>\n </thead>\n <tbody className=\"divide-y divide-border-subtle\">\n {visible.map((app) => (\n <QueueTableRow\n key={app.id}\n app={app}\n serviceName={serviceName.get(app.serviceId)}\n currentUser={currentUser}\n officerProfiles={officerProfiles}\n onOpen={() => navigateTo(`applications/${app.id}`)}\n />\n ))}\n </tbody>\n </table>\n </div>\n\n {/* Mobile stacked cards */}\n <ul className=\"divide-y divide-border-subtle md:hidden\">\n {visible.map((app) => (\n <li key={app.id}>\n <QueueCard\n app={app}\n serviceName={serviceName.get(app.serviceId)}\n currentUser={currentUser}\n officerProfiles={officerProfiles}\n onOpen={() => navigateTo(`applications/${app.id}`)}\n />\n </li>\n ))}\n </ul>\n </>\n )}\n </GlassCard>\n\n <Pagination\n page={pager.page}\n pageSize={PAGE_SIZE}\n itemCount={applications.length}\n hasMore={data?.pageInfo.hasMore ?? false}\n onPageChange={(target) => pager.onPageChange(target, data?.pageInfo.cursor)}\n />\n </>\n )}\n </PageLayout>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAgDA,IAAM,IAAY;AAGlB,SAAS,EAAgB,GAA+C;CACtE,IAAI,CAAC,GAAM;CACX,IAAM,IAAO,CAAC,EAAK,WAAW,EAAK,QAAQ,EAAE,OAAO,OAAO,EAAE,KAAK,GAAG,EAAE,KAAK;CAC5E,OAAO,EAAK,MAAM,KAAK,KAAK,KAAQ,EAAK,UAAU,KAAK,KAAK,EAAK;AACpE;AAGA,IAAM,KAAW,MAAuB,EAAG,MAAM,GAAG,CAAC,GAI/C,KAA2D;CAC/D;EAAE,OAAO;EAAO,OAAO;CAAM;CAC7B;EAAE,OAAO;EAAa,OAAO;CAAY;CACzC;EAAE,OAAO;EAAa,OAAO;CAAY;CACzC;EAAE,OAAO;EAAkB,OAAO;CAAiB;CACnD;EAAE,OAAO;EAAY,OAAO;CAAW;CACvC;EAAE,OAAO;EAAY,OAAO;CAAW;CACvC;EAAE,OAAO;EAAS,OAAO;CAAQ;AACnC,GAGM,IAAW,IAAI,IAA0B;CAAC;CAAY;CAAY;AAAW,CAAC;AAGpF,SAAS,EAAa,GAAmB;CACvC,IAAM,KAAc,MAAY,IAAI,KAAK,EAAE,YAAY,GAAG,EAAE,SAAS,GAAG,EAAE,QAAQ,CAAC,EAAE,QAAQ;CAC7F,OAAO,KAAK,OAAO,EAAW,CAAG,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 @@
4
4
  *
5
5
  * Three-step wizard (Choose service → Fill form → Review & submit), tracked with
6
6
  * the shared {@link StatusStepper}. The fill step renders the selected service's
7
- * dynamic form derived from its `formSchema` JSON — the SAME array shape produced
8
- * by the service builder (`FormFieldBuilder`): an array of
9
- * `{ key, label, type, required, options? }` where `type` ∈
10
- * text | textarea | number | date | select | file. Older/foreign schemas
11
- * (`{ fields }` / json-schema `{ properties }`) are still accepted defensively.
7
+ * dynamic form derived from its `formSchema` JSON via the shared
8
+ * {@link DynamicFormFields} renderer — the SAME renderer the no-code service
9
+ * builder uses for its live preview (`ServiceFormDialog`), parsed by
10
+ * {@link parseFormFields} — an array of `{ key, label, type, required, options?,
11
+ * showIf? }` where `type` ∈ text | textarea | number | date | select | file.
12
+ * Older/foreign schemas (`{ fields }` / json-schema `{ properties }`) are still
13
+ * accepted defensively. Fields with a `showIf` condition (BOFF-4540) are hidden
14
+ * — and excluded from both the required-check and the submitted `formData` —
15
+ * until their referenced field's answer matches.
12
16
  *
13
17
  * Values become `formData`; a `file` field uploads to wspace-files-svc and stores
14
18
  * the returned file id. `govCreateApplication` files the draft; "Submit" chains
@@ -1 +1 @@
1
- {"version":3,"file":"NewApplicationPage.d.ts","sourceRoot":"","sources":["../../../../src/govcitizenhub/pages/applications/NewApplicationPage.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAqIH,wBAAgB,kBAAkB,4CAuXjC"}
1
+ {"version":3,"file":"NewApplicationPage.d.ts","sourceRoot":"","sources":["../../../../src/govcitizenhub/pages/applications/NewApplicationPage.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAsEH,wBAAgB,kBAAkB,4CA2UjC"}