amliq-dashboard 2.0.0
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.
- package/.env.example +3 -0
- package/.env.production +1 -0
- package/Dockerfile +26 -0
- package/QUICK_START.md +267 -0
- package/README.md +161 -0
- package/TESTING_GUIDE.md +322 -0
- package/dist/.well-known/ai-plugin.json +15 -0
- package/dist/_headers +8 -0
- package/dist/_redirects +1 -0
- package/dist/assets/APIKeys-BvwFauIs.js +6 -0
- package/dist/assets/APIKeys-DaMSBZQL.js +1 -0
- package/dist/assets/AdverseMedia-DckXfMzS.js +4 -0
- package/dist/assets/AlertDetailPage-Bc2_zwu_.js +1 -0
- package/dist/assets/AlertQueue-DFtBiRoM.js +8 -0
- package/dist/assets/Analytics-DtruB5lQ.js +1 -0
- package/dist/assets/AuditTrail-BK68ePu0.js +1 -0
- package/dist/assets/AuthDivider-gRHEt7gx.js +1 -0
- package/dist/assets/Badge-B9VFkofy.js +1 -0
- package/dist/assets/BatchJobs-Bz6KFnXD.js +6 -0
- package/dist/assets/BillingPage-R9nQ5nFb.js +11 -0
- package/dist/assets/Card-Cw-T_-oU.js +1 -0
- package/dist/assets/CaseDetail-DYs7Zg_y.js +7 -0
- package/dist/assets/CaseManagement-B1Q4Dp1Y.js +1 -0
- package/dist/assets/ComplianceReport-Dhssqc9T.js +1 -0
- package/dist/assets/Configuration-B92kl9T0.js +1 -0
- package/dist/assets/CryptoScreening-C7yFlskC.js +1 -0
- package/dist/assets/Dashboard-w4-Nhv9q.js +17 -0
- package/dist/assets/DataSources-u3-Ri_5_.js +3 -0
- package/dist/assets/EDDWorkflow-CFzlEO0e.js +1 -0
- package/dist/assets/EmptyState-Do0xJAT9.js +6 -0
- package/dist/assets/ForgotPassword-BPYyQFQp.js +1 -0
- package/dist/assets/LandingPage-CjaP0zw4.js +41 -0
- package/dist/assets/ListsMarketplace-CG6KkT9B.js +6 -0
- package/dist/assets/Login-677LEGP1.js +1 -0
- package/dist/assets/MFASetup-BxqCPvui.js +1 -0
- package/dist/assets/Monitoring-9TN9MK4y.js +1 -0
- package/dist/assets/Onboarding-Cf0Y83lX.js +1 -0
- package/dist/assets/Operations-CcXwc2xw.js +10 -0
- package/dist/assets/Overview-B_Ky0VWV.js +1 -0
- package/dist/assets/PEPScreening-pUQjTH9c.js +1 -0
- package/dist/assets/PageHeader-BObHFn0i.js +1 -0
- package/dist/assets/PrivacyPolicy-DZ2xrKir.js +1 -0
- package/dist/assets/ResetPassword-AtxtpIG1.js +1 -0
- package/dist/assets/RiskAssessment-Dzuh1Usv.js +1 -0
- package/dist/assets/SARForm-D8w2ZGe-.js +1 -0
- package/dist/assets/SanctionsLists-CPA3UH2v.js +1 -0
- package/dist/assets/ScheduledTasks-Dsjk-6UR.js +1 -0
- package/dist/assets/ScreenEntity-D1U0YL7v.js +3 -0
- package/dist/assets/ScreeningProgress-BW49PzoB.js +66 -0
- package/dist/assets/SearchField-CulFKdiI.js +1 -0
- package/dist/assets/Signup-C0FmFOo_.js +1 -0
- package/dist/assets/SystemHealth-B_8u4eva.js +1 -0
- package/dist/assets/TaskHistory-BCmEM89q.js +3 -0
- package/dist/assets/Team-CUo_FlU7.js +1 -0
- package/dist/assets/TenantDetail-CgZQHUY8.js +1 -0
- package/dist/assets/Tenants-RB9E9ick.js +2 -0
- package/dist/assets/TermsOfService-BfL-kndX.js +1 -0
- package/dist/assets/TransactionMonitoring-DGh_T22s.js +14 -0
- package/dist/assets/TxnScreening-B7cm2-eh.js +1 -0
- package/dist/assets/UBOChain-falXAsCo.js +1 -0
- package/dist/assets/Users-Doakpg9c.js +1 -0
- package/dist/assets/Webhooks-BZpAfaxv.js +1 -0
- package/dist/assets/alert-triangle-YCFVm7B_.js +6 -0
- package/dist/assets/alerts-COUnTwWY.js +1 -0
- package/dist/assets/arrow-left-9ApLqP95.js +6 -0
- package/dist/assets/check-VTcvVtIU.js +6 -0
- package/dist/assets/check-circle-2-Dn-lG5YQ.js +6 -0
- package/dist/assets/code-DIJRWFVv.js +6 -0
- package/dist/assets/fingerprint-C0MGVtax.js +6 -0
- package/dist/assets/flag-B8_Gwxh6.js +6 -0
- package/dist/assets/index-CfdYcqRM.js +289 -0
- package/dist/assets/index-HPU_Rhdu.css +1 -0
- package/dist/assets/layers-zHz2o4vo.js +6 -0
- package/dist/assets/loader-B9_dNihg.js +6 -0
- package/dist/assets/mail-BijL2qwp.js +6 -0
- package/dist/assets/plus-i0oBIIPS.js +6 -0
- package/dist/assets/refresh-cw-CSuAwutt.js +6 -0
- package/dist/assets/useAnalytics-Bj8IONcw.js +72 -0
- package/dist/assets/x-circle-DLGKvijE.js +6 -0
- package/dist/favicon.svg +15 -0
- package/dist/index.html +51 -0
- package/dist/llms.txt +28 -0
- package/dist/logo.png +0 -0
- package/dist/logo.svg +17 -0
- package/dist/manifest.json +44 -0
- package/dist/robots.txt +15 -0
- package/dist/schema.json +13 -0
- package/dist/sitemap.xml +28 -0
- package/dist/sw.js +67 -0
- package/e2e/auth-setup.ts +20 -0
- package/e2e/billing.spec.ts +50 -0
- package/e2e/cases.spec.ts +53 -0
- package/e2e/compliance.spec.ts +65 -0
- package/e2e/config.spec.ts +56 -0
- package/e2e/dashboard.spec.ts +47 -0
- package/e2e/fixtures.ts +33 -0
- package/e2e/lists.spec.ts +43 -0
- package/e2e/login.spec.ts +64 -0
- package/e2e/media.spec.ts +48 -0
- package/e2e/mocks.ts +51 -0
- package/e2e/monitoring.spec.ts +44 -0
- package/e2e/navigation.spec.ts +56 -0
- package/e2e/onboarding.spec.ts +49 -0
- package/e2e/responsive.spec.ts +40 -0
- package/e2e/risk.spec.ts +61 -0
- package/e2e/screening.spec.ts +76 -0
- package/e2e/team.spec.ts +53 -0
- package/index.html +50 -0
- package/package.json +47 -0
- package/playwright.config.ts +35 -0
- package/postcss.config.js +6 -0
- package/public/.well-known/ai-plugin.json +15 -0
- package/public/_headers +8 -0
- package/public/_redirects +1 -0
- package/public/favicon.svg +15 -0
- package/public/llms.txt +28 -0
- package/public/logo.png +0 -0
- package/public/logo.svg +17 -0
- package/public/manifest.json +44 -0
- package/public/robots.txt +15 -0
- package/public/schema.json +13 -0
- package/public/sitemap.xml +28 -0
- package/public/sw.js +67 -0
- package/scripts/test-runner.sh +152 -0
- package/src/App.tsx +48 -0
- package/src/api/alerts.ts +19 -0
- package/src/api/analytics.ts +6 -0
- package/src/api/audit.ts +11 -0
- package/src/api/auth.ts +26 -0
- package/src/api/billing.ts +54 -0
- package/src/api/cases.ts +48 -0
- package/src/api/client.ts +50 -0
- package/src/api/config.ts +30 -0
- package/src/api/edd.ts +25 -0
- package/src/api/enforcement.ts +33 -0
- package/src/api/lists.ts +24 -0
- package/src/api/monitoring.ts +82 -0
- package/src/api/pep.ts +30 -0
- package/src/api/risk.ts +26 -0
- package/src/api/screening.ts +37 -0
- package/src/api/team.ts +27 -0
- package/src/api/transactions.ts +37 -0
- package/src/components/admin/TenantCards.tsx +51 -0
- package/src/components/alerts/AlertActions.test.tsx +80 -0
- package/src/components/alerts/AlertActions.tsx +68 -0
- package/src/components/alerts/AlertCard.test.tsx +86 -0
- package/src/components/alerts/AlertCard.tsx +60 -0
- package/src/components/alerts/AlertDetailSidebar.tsx +63 -0
- package/src/components/alerts/AlertFilters.test.tsx +73 -0
- package/src/components/alerts/AlertFilters.tsx +88 -0
- package/src/components/alerts/EntityDetailsCard.test.tsx +61 -0
- package/src/components/alerts/EntityDetailsCard.tsx +37 -0
- package/src/components/alerts/NotesCard.test.tsx +39 -0
- package/src/components/alerts/NotesCard.tsx +28 -0
- package/src/components/auth/AuthDivider.tsx +18 -0
- package/src/components/auth/LoginForm.tsx +62 -0
- package/src/components/auth/LoginLeftPanel.tsx +43 -0
- package/src/components/auth/PasswordStrength.tsx +26 -0
- package/src/components/auth/SignInButtons.tsx +46 -0
- package/src/components/auth/SignupLeftPanel.tsx +35 -0
- package/src/components/auth/countries.ts +17 -0
- package/src/components/charts/AreaChart.tsx +45 -0
- package/src/components/charts/BarChart.tsx +48 -0
- package/src/components/charts/DonutChart.tsx +47 -0
- package/src/components/compliance/CaseActions.tsx +74 -0
- package/src/components/compliance/CaseTimeline.tsx +68 -0
- package/src/components/compliance/MediaResultCard.tsx +87 -0
- package/src/components/compliance/PEPResultCard.tsx +78 -0
- package/src/components/config/MatchingModesCard.test.tsx +75 -0
- package/src/components/config/MatchingModesCard.tsx +40 -0
- package/src/components/config/ScreeningLayersCard.test.tsx +57 -0
- package/src/components/config/ScreeningLayersCard.tsx +36 -0
- package/src/components/config/ThresholdsCard.test.tsx +79 -0
- package/src/components/config/ThresholdsCard.tsx +51 -0
- package/src/components/dashboard/ActivityFeed.tsx +93 -0
- package/src/components/dashboard/DashboardGreeting.tsx +23 -0
- package/src/components/dashboard/DashboardSkeleton.tsx +35 -0
- package/src/components/dashboard/QuickActions.tsx +52 -0
- package/src/components/dashboard/TopEntitiesTable.tsx +63 -0
- package/src/components/data/ComplianceMetrics.test.tsx +32 -0
- package/src/components/data/ComplianceMetrics.tsx +40 -0
- package/src/components/data/ConfidenceScore.test.tsx +62 -0
- package/src/components/data/ConfidenceScore.tsx +27 -0
- package/src/components/data/StatCard.test.tsx +72 -0
- package/src/components/data/StatCard.tsx +63 -0
- package/src/components/data/StatusBadge.test.tsx +63 -0
- package/src/components/data/StatusBadge.tsx +39 -0
- package/src/components/layout/AppShell.tsx +48 -0
- package/src/components/layout/Breadcrumbs.tsx +48 -0
- package/src/components/layout/CommandPalette.tsx +81 -0
- package/src/components/layout/DashboardLayout.tsx +19 -0
- package/src/components/layout/MobileHeader.tsx +30 -0
- package/src/components/layout/NavGroup.test.tsx +63 -0
- package/src/components/layout/NavGroup.tsx +64 -0
- package/src/components/layout/NotificationBell.tsx +89 -0
- package/src/components/layout/PageHeader.test.tsx +61 -0
- package/src/components/layout/PageHeader.tsx +19 -0
- package/src/components/layout/ProtectedRoute.tsx +31 -0
- package/src/components/layout/PublicLayout.tsx +17 -0
- package/src/components/layout/Sidebar.test.tsx +67 -0
- package/src/components/layout/Sidebar.tsx +92 -0
- package/src/components/layout/Toolbar.test.tsx +47 -0
- package/src/components/layout/Toolbar.tsx +68 -0
- package/src/components/layout/navItems.ts +94 -0
- package/src/components/lists/ListCard.tsx +78 -0
- package/src/components/lists/ListMarketplaceCard.tsx +77 -0
- package/src/components/screening/CircularConfidence.tsx +38 -0
- package/src/components/screening/LimitReachedBanner.tsx +31 -0
- package/src/components/screening/ListSelector.tsx +64 -0
- package/src/components/screening/MatchDetailHeader.tsx +64 -0
- package/src/components/screening/MatchEntityInfo.tsx +56 -0
- package/src/components/screening/MatchEvidenceBars.tsx +65 -0
- package/src/components/screening/MatchMetadata.tsx +95 -0
- package/src/components/screening/ScreenResults.tsx +49 -0
- package/src/components/screening/ScreeningForm.test.tsx +83 -0
- package/src/components/screening/ScreeningForm.tsx +100 -0
- package/src/components/screening/ScreeningLayersList.test.tsx +33 -0
- package/src/components/screening/ScreeningLayersList.tsx +46 -0
- package/src/components/screening/ScreeningProgress.tsx +91 -0
- package/src/components/screening/ScreeningQuotaBanner.tsx +64 -0
- package/src/components/screening/ScreeningResultCard.tsx +47 -0
- package/src/components/screening/ScreeningResultRow.tsx +45 -0
- package/src/components/screening/ScreeningResults.test.tsx +37 -0
- package/src/components/screening/ScreeningResults.tsx +33 -0
- package/src/components/screening/ShareResults.tsx +103 -0
- package/src/components/screening/ThresholdSlider.tsx +23 -0
- package/src/components/transactions/WebhookCTA.tsx +63 -0
- package/src/components/ui/Avatar.test.tsx +47 -0
- package/src/components/ui/Avatar.tsx +35 -0
- package/src/components/ui/Badge.test.tsx +49 -0
- package/src/components/ui/Badge.tsx +33 -0
- package/src/components/ui/Button.test.tsx +56 -0
- package/src/components/ui/Button.tsx +46 -0
- package/src/components/ui/Card.test.tsx +61 -0
- package/src/components/ui/Card.tsx +29 -0
- package/src/components/ui/ConfirmModal.tsx +67 -0
- package/src/components/ui/Divider.test.tsx +24 -0
- package/src/components/ui/Divider.tsx +5 -0
- package/src/components/ui/EmptyState.test.tsx +49 -0
- package/src/components/ui/EmptyState.tsx +22 -0
- package/src/components/ui/ErrorBoundary.tsx +44 -0
- package/src/components/ui/ExportMenu.tsx +71 -0
- package/src/components/ui/LanguageSwitcher.tsx +37 -0
- package/src/components/ui/LoadingSpinner.test.tsx +41 -0
- package/src/components/ui/LoadingSpinner.tsx +21 -0
- package/src/components/ui/MetricCard.tsx +63 -0
- package/src/components/ui/ScoreRing.tsx +51 -0
- package/src/components/ui/SearchField.test.tsx +55 -0
- package/src/components/ui/SearchField.tsx +31 -0
- package/src/components/ui/SeverityBadge.tsx +57 -0
- package/src/components/ui/ThemeToggle.tsx +37 -0
- package/src/components/ui/Toast.test.tsx +79 -0
- package/src/components/ui/Toast.tsx +75 -0
- package/src/components/ui/Toggle.test.tsx +85 -0
- package/src/components/ui/Toggle.tsx +46 -0
- package/src/context/AuthContext.tsx +71 -0
- package/src/data/pepProfiles.ts +76 -0
- package/src/data/pepProfilesExtra.ts +58 -0
- package/src/hooks/useAlerts.ts +36 -0
- package/src/hooks/useAnalytics.ts +23 -0
- package/src/hooks/useApi.test.ts +79 -0
- package/src/hooks/useApi.ts +33 -0
- package/src/hooks/useAudit.ts +28 -0
- package/src/hooks/useBilling.ts +38 -0
- package/src/hooks/useConfig.ts +35 -0
- package/src/hooks/useDebounce.test.ts +84 -0
- package/src/hooks/useDebounce.ts +15 -0
- package/src/hooks/useDirection.ts +15 -0
- package/src/hooks/useLists.ts +34 -0
- package/src/hooks/useMediaQuery.test.ts +97 -0
- package/src/hooks/useMediaQuery.ts +28 -0
- package/src/hooks/useScreening.ts +33 -0
- package/src/hooks/useSidebar.ts +18 -0
- package/src/hooks/useUsage.ts +27 -0
- package/src/i18n/config.ts +33 -0
- package/src/i18n/locales/ar/admin.json +19 -0
- package/src/i18n/locales/ar/alerts.json +52 -0
- package/src/i18n/locales/ar/analytics.json +9 -0
- package/src/i18n/locales/ar/audit.json +12 -0
- package/src/i18n/locales/ar/auth.json +60 -0
- package/src/i18n/locales/ar/batch.json +5 -0
- package/src/i18n/locales/ar/billing.json +41 -0
- package/src/i18n/locales/ar/common.json +65 -0
- package/src/i18n/locales/ar/compliance.json +83 -0
- package/src/i18n/locales/ar/config.json +13 -0
- package/src/i18n/locales/ar/dashboard.json +19 -0
- package/src/i18n/locales/ar/errors.json +9 -0
- package/src/i18n/locales/ar/index.ts +29 -0
- package/src/i18n/locales/ar/legal.json +10 -0
- package/src/i18n/locales/ar/lists.json +6 -0
- package/src/i18n/locales/ar/marketing.json +110 -0
- package/src/i18n/locales/ar/monitoring.json +15 -0
- package/src/i18n/locales/ar/nav.json +35 -0
- package/src/i18n/locales/ar/onboarding.json +25 -0
- package/src/i18n/locales/ar/platform.json +23 -0
- package/src/i18n/locales/ar/screening.json +26 -0
- package/src/i18n/locales/ar/team.json +11 -0
- package/src/i18n/locales/en/admin.json +21 -0
- package/src/i18n/locales/en/alerts.json +52 -0
- package/src/i18n/locales/en/analytics.json +9 -0
- package/src/i18n/locales/en/audit.json +12 -0
- package/src/i18n/locales/en/auth.json +60 -0
- package/src/i18n/locales/en/batch.json +5 -0
- package/src/i18n/locales/en/billing.json +87 -0
- package/src/i18n/locales/en/common.json +65 -0
- package/src/i18n/locales/en/compliance.json +83 -0
- package/src/i18n/locales/en/config.json +29 -0
- package/src/i18n/locales/en/dashboard.json +23 -0
- package/src/i18n/locales/en/errors.json +9 -0
- package/src/i18n/locales/en/index.ts +29 -0
- package/src/i18n/locales/en/legal.json +114 -0
- package/src/i18n/locales/en/lists.json +6 -0
- package/src/i18n/locales/en/marketing.json +174 -0
- package/src/i18n/locales/en/monitoring.json +15 -0
- package/src/i18n/locales/en/nav.json +35 -0
- package/src/i18n/locales/en/onboarding.json +31 -0
- package/src/i18n/locales/en/platform.json +25 -0
- package/src/i18n/locales/en/screening.json +26 -0
- package/src/i18n/locales/en/team.json +12 -0
- package/src/i18n/locales/he/admin.json +19 -0
- package/src/i18n/locales/he/alerts.json +52 -0
- package/src/i18n/locales/he/analytics.json +9 -0
- package/src/i18n/locales/he/audit.json +12 -0
- package/src/i18n/locales/he/auth.json +60 -0
- package/src/i18n/locales/he/batch.json +5 -0
- package/src/i18n/locales/he/billing.json +41 -0
- package/src/i18n/locales/he/common.json +65 -0
- package/src/i18n/locales/he/compliance.json +83 -0
- package/src/i18n/locales/he/config.json +13 -0
- package/src/i18n/locales/he/dashboard.json +19 -0
- package/src/i18n/locales/he/errors.json +9 -0
- package/src/i18n/locales/he/index.ts +29 -0
- package/src/i18n/locales/he/legal.json +10 -0
- package/src/i18n/locales/he/lists.json +6 -0
- package/src/i18n/locales/he/marketing.json +110 -0
- package/src/i18n/locales/he/monitoring.json +15 -0
- package/src/i18n/locales/he/nav.json +35 -0
- package/src/i18n/locales/he/onboarding.json +25 -0
- package/src/i18n/locales/he/platform.json +23 -0
- package/src/i18n/locales/he/screening.json +26 -0
- package/src/i18n/locales/he/team.json +11 -0
- package/src/index.css +112 -0
- package/src/main.tsx +15 -0
- package/src/pages/APIKeys.tsx +120 -0
- package/src/pages/AddMonitorModal.tsx +30 -0
- package/src/pages/AdverseMedia.test.tsx +18 -0
- package/src/pages/AdverseMedia.tsx +89 -0
- package/src/pages/AlertDetailPage.tsx +64 -0
- package/src/pages/AlertQueue.test.tsx +48 -0
- package/src/pages/AlertQueue.tsx +63 -0
- package/src/pages/Analytics.tsx +50 -0
- package/src/pages/AuditTrail.tsx +64 -0
- package/src/pages/BatchJobs.tsx +79 -0
- package/src/pages/CaseDetail.tsx +72 -0
- package/src/pages/CaseManagement.test.tsx +31 -0
- package/src/pages/CaseManagement.tsx +92 -0
- package/src/pages/Configuration.test.tsx +96 -0
- package/src/pages/Configuration.tsx +123 -0
- package/src/pages/CryptoScreening.tsx +109 -0
- package/src/pages/Dashboard.test.tsx +51 -0
- package/src/pages/Dashboard.tsx +66 -0
- package/src/pages/EDDWorkflow.test.tsx +29 -0
- package/src/pages/EDDWorkflow.tsx +73 -0
- package/src/pages/ForgotPassword.test.tsx +49 -0
- package/src/pages/ForgotPassword.tsx +67 -0
- package/src/pages/ListsMarketplace.tsx +102 -0
- package/src/pages/Login.test.tsx +100 -0
- package/src/pages/Login.tsx +57 -0
- package/src/pages/MFASetup.tsx +114 -0
- package/src/pages/MonitorProfileCard.tsx +27 -0
- package/src/pages/Monitoring.tsx +68 -0
- package/src/pages/Onboarding.test.tsx +36 -0
- package/src/pages/Onboarding.tsx +60 -0
- package/src/pages/PEPScreening.test.tsx +15 -0
- package/src/pages/PEPScreening.tsx +100 -0
- package/src/pages/ResetPassword.tsx +81 -0
- package/src/pages/RiskAssessment.test.tsx +15 -0
- package/src/pages/RiskAssessment.tsx +108 -0
- package/src/pages/SanctionsLists.tsx +74 -0
- package/src/pages/ScreenEntity.test.tsx +82 -0
- package/src/pages/ScreenEntity.tsx +76 -0
- package/src/pages/Signup.test.tsx +98 -0
- package/src/pages/Signup.tsx +92 -0
- package/src/pages/TaskHistory.tsx +183 -0
- package/src/pages/Team.test.tsx +15 -0
- package/src/pages/Team.tsx +140 -0
- package/src/pages/TransactionMonitoring.test.tsx +18 -0
- package/src/pages/TransactionMonitoring.tsx +118 -0
- package/src/pages/TxnScreening.tsx +125 -0
- package/src/pages/UBOChain.test.tsx +35 -0
- package/src/pages/UBOChain.tsx +65 -0
- package/src/pages/Webhooks.tsx +137 -0
- package/src/pages/admin/DataSources.tsx +230 -0
- package/src/pages/admin/Operations.tsx +103 -0
- package/src/pages/admin/ScheduledTasks.tsx +155 -0
- package/src/pages/admin/SystemHealth.tsx +58 -0
- package/src/pages/admin/TenantDetail.tsx +62 -0
- package/src/pages/admin/Tenants.test.tsx +20 -0
- package/src/pages/admin/Tenants.tsx +63 -0
- package/src/pages/admin/opsRunners.ts +81 -0
- package/src/pages/admin/opsTerminal.tsx +63 -0
- package/src/pages/billing/ActiveSubscriptions.tsx +41 -0
- package/src/pages/billing/AddProductModal.tsx +99 -0
- package/src/pages/billing/BillingPage.test.tsx +30 -0
- package/src/pages/billing/BillingPage.tsx +67 -0
- package/src/pages/billing/CurrentPlan.tsx +50 -0
- package/src/pages/billing/InvoiceList.tsx +104 -0
- package/src/pages/billing/InvoiceRow.tsx +37 -0
- package/src/pages/billing/LemonSqueezySetup.tsx +51 -0
- package/src/pages/billing/PaymentAlert.tsx +33 -0
- package/src/pages/billing/PlanComparison.tsx +53 -0
- package/src/pages/billing/ProductUsage.tsx +43 -0
- package/src/pages/billing/PromoCodeInput.tsx +58 -0
- package/src/pages/billing/SeatManager.tsx +80 -0
- package/src/pages/billing/SeatRow.tsx +32 -0
- package/src/pages/billing/SubscriptionCard.tsx +73 -0
- package/src/pages/billing/UpgradeModal.tsx +53 -0
- package/src/pages/billing/UsageHistory.tsx +37 -0
- package/src/pages/billing/UsageMeter.tsx +26 -0
- package/src/pages/billing/UsageOverview.tsx +38 -0
- package/src/pages/legal/PrivacyPolicy.tsx +25 -0
- package/src/pages/legal/TermsOfService.tsx +25 -0
- package/src/pages/marketing/BundleCallout.tsx +24 -0
- package/src/pages/marketing/CTASection.tsx +48 -0
- package/src/pages/marketing/CaseStudy.tsx +37 -0
- package/src/pages/marketing/ComparisonTable.tsx +66 -0
- package/src/pages/marketing/CompetitiveEdge.tsx +55 -0
- package/src/pages/marketing/DataCoverage.tsx +54 -0
- package/src/pages/marketing/DataRain.tsx +30 -0
- package/src/pages/marketing/EnterpriseCTA.tsx +26 -0
- package/src/pages/marketing/FAQItem.tsx +27 -0
- package/src/pages/marketing/FAQSchema.tsx +43 -0
- package/src/pages/marketing/FAQSection.tsx +19 -0
- package/src/pages/marketing/FeatureDetail.tsx +19 -0
- package/src/pages/marketing/FeaturesGrid.tsx +60 -0
- package/src/pages/marketing/FeaturesSpotlight.tsx +68 -0
- package/src/pages/marketing/FooterSection.tsx +92 -0
- package/src/pages/marketing/GradientOrbs.tsx +26 -0
- package/src/pages/marketing/HeroSearch.tsx +113 -0
- package/src/pages/marketing/HeroSection.tsx +72 -0
- package/src/pages/marketing/LandingPage.tsx +45 -0
- package/src/pages/marketing/LogoCloud.tsx +31 -0
- package/src/pages/marketing/LogoMarquee.tsx +45 -0
- package/src/pages/marketing/MarketingNav.tsx +80 -0
- package/src/pages/marketing/MatchingLayers.tsx +78 -0
- package/src/pages/marketing/MobileMenu.tsx +45 -0
- package/src/pages/marketing/PricingCard.tsx +57 -0
- package/src/pages/marketing/PricingFeatureRow.tsx +16 -0
- package/src/pages/marketing/PricingSection.tsx +103 -0
- package/src/pages/marketing/PricingToggle.tsx +40 -0
- package/src/pages/marketing/ProductPricingCards.tsx +23 -0
- package/src/pages/marketing/ProductShowcase.tsx +81 -0
- package/src/pages/marketing/ProductTabs.tsx +45 -0
- package/src/pages/marketing/QuoteRotator.tsx +56 -0
- package/src/pages/marketing/StatsBar.tsx +81 -0
- package/src/pages/marketing/StatsSection.tsx +44 -0
- package/src/pages/marketing/TestimonialCard.tsx +38 -0
- package/src/pages/marketing/TestimonialsSection.tsx +32 -0
- package/src/pages/marketing/animations.tsx +56 -0
- package/src/pages/onboarding/CountryStep.tsx +38 -0
- package/src/pages/onboarding/ListsStep.tsx +44 -0
- package/src/pages/onboarding/StepIndicator.tsx +34 -0
- package/src/pages/onboarding/ThresholdStep.tsx +49 -0
- package/src/pages/platform/APIKeys.tsx +102 -0
- package/src/pages/platform/Overview.tsx +58 -0
- package/src/pages/platform/Users.tsx +110 -0
- package/src/pages/reporting/ComplianceReport.tsx +99 -0
- package/src/pages/reporting/SARForm.tsx +99 -0
- package/src/routes/appRoutes.tsx +60 -0
- package/src/routes/compliance.tsx +28 -0
- package/src/routes/lazyCompliance.ts +34 -0
- package/src/routes/lazyPages.ts +35 -0
- package/src/routes/lazyPlatform.ts +5 -0
- package/src/routes/platform.tsx +15 -0
- package/src/styles/effects.css +76 -0
- package/src/test/setup.ts +25 -0
- package/src/test/utils.tsx +49 -0
- package/src/types/alert.ts +31 -0
- package/src/types/analytics.ts +16 -0
- package/src/types/audit.ts +11 -0
- package/src/types/billing.ts +60 -0
- package/src/types/common.ts +15 -0
- package/src/types/config.ts +19 -0
- package/src/types/entity.ts +34 -0
- package/src/types/index.ts +8 -0
- package/src/types/list.ts +15 -0
- package/src/types/screening.ts +32 -0
- package/src/vite-env.d.ts +1 -0
- package/tailwind.config.js +65 -0
- package/tsconfig.json +22 -0
- package/vite.config.ts +11 -0
- package/vitest.config.ts +19 -0
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import React, { useState } from 'react';
|
|
2
|
+
import { useTranslation } from 'react-i18next';
|
|
3
|
+
import { CheckCircle2, XCircle, AlertTriangle, Zap } from 'lucide-react';
|
|
4
|
+
import { Button } from '../ui/Button';
|
|
5
|
+
import { Card } from '../ui/Card';
|
|
6
|
+
|
|
7
|
+
interface AlertActionsProps {
|
|
8
|
+
onConfirm?: () => void;
|
|
9
|
+
onFalsePositive?: () => void;
|
|
10
|
+
onEscalate?: () => void;
|
|
11
|
+
onDraftAI?: () => void;
|
|
12
|
+
disabled?: boolean;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export function AlertActions({
|
|
16
|
+
onConfirm,
|
|
17
|
+
onFalsePositive,
|
|
18
|
+
onEscalate,
|
|
19
|
+
onDraftAI,
|
|
20
|
+
disabled,
|
|
21
|
+
}: AlertActionsProps) {
|
|
22
|
+
const { t } = useTranslation('alerts');
|
|
23
|
+
const [showReason, setShowReason] = useState(false);
|
|
24
|
+
|
|
25
|
+
return (
|
|
26
|
+
<Card>
|
|
27
|
+
<h3 className="sf-headline mb-lg">{t('actions.title')}</h3>
|
|
28
|
+
<div className="grid grid-cols-2 md:grid-cols-4 gap-md">
|
|
29
|
+
<Button
|
|
30
|
+
variant="primary"
|
|
31
|
+
onClick={onConfirm}
|
|
32
|
+
disabled={disabled}
|
|
33
|
+
className="flex items-center justify-center gap-sm"
|
|
34
|
+
>
|
|
35
|
+
<CheckCircle2 className="w-4 h-4" />
|
|
36
|
+
<span className="hidden md:inline">{t('actions.confirm')}</span>
|
|
37
|
+
</Button>
|
|
38
|
+
<Button
|
|
39
|
+
variant="secondary"
|
|
40
|
+
onClick={onFalsePositive}
|
|
41
|
+
disabled={disabled}
|
|
42
|
+
className="flex items-center justify-center gap-sm"
|
|
43
|
+
>
|
|
44
|
+
<XCircle className="w-4 h-4" />
|
|
45
|
+
<span className="hidden md:inline">{t('actions.false_positive')}</span>
|
|
46
|
+
</Button>
|
|
47
|
+
<Button
|
|
48
|
+
variant="secondary"
|
|
49
|
+
onClick={onEscalate}
|
|
50
|
+
disabled={disabled}
|
|
51
|
+
className="flex items-center justify-center gap-sm"
|
|
52
|
+
>
|
|
53
|
+
<AlertTriangle className="w-4 h-4" />
|
|
54
|
+
<span className="hidden md:inline">{t('actions.escalate')}</span>
|
|
55
|
+
</Button>
|
|
56
|
+
<Button
|
|
57
|
+
variant="secondary"
|
|
58
|
+
onClick={onDraftAI}
|
|
59
|
+
disabled={disabled}
|
|
60
|
+
className="flex items-center justify-center gap-sm"
|
|
61
|
+
>
|
|
62
|
+
<Zap className="w-4 h-4" />
|
|
63
|
+
<span className="hidden md:inline">{t('actions.ai_draft')}</span>
|
|
64
|
+
</Button>
|
|
65
|
+
</div>
|
|
66
|
+
</Card>
|
|
67
|
+
);
|
|
68
|
+
}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { render, screen } from '@testing-library/react'
|
|
2
|
+
import userEvent from '@testing-library/user-event'
|
|
3
|
+
import { describe, it, expect, vi } from 'vitest'
|
|
4
|
+
import { AlertCard } from './AlertCard'
|
|
5
|
+
import { createMockAlert } from '../../test/utils'
|
|
6
|
+
|
|
7
|
+
describe('AlertCard', () => {
|
|
8
|
+
it('renders alert name', () => {
|
|
9
|
+
const alert = createMockAlert({
|
|
10
|
+
entity: {
|
|
11
|
+
id: 'ent1',
|
|
12
|
+
type: 'individual',
|
|
13
|
+
name: {
|
|
14
|
+
firstName: 'John',
|
|
15
|
+
lastName: 'Doe',
|
|
16
|
+
aliases: [],
|
|
17
|
+
},
|
|
18
|
+
identifiers: [],
|
|
19
|
+
createdAt: new Date().toISOString(),
|
|
20
|
+
updatedAt: new Date().toISOString(),
|
|
21
|
+
},
|
|
22
|
+
})
|
|
23
|
+
render(<AlertCard alert={alert} />)
|
|
24
|
+
expect(screen.getByText('John Doe')).toBeInTheDocument()
|
|
25
|
+
})
|
|
26
|
+
|
|
27
|
+
it('renders entity type', () => {
|
|
28
|
+
const alert = createMockAlert({ entity: { id: 'ent1', type: 'company', name: { firstName: '', lastName: '', aliases: [] }, identifiers: [], createdAt: new Date().toISOString(), updatedAt: new Date().toISOString() } })
|
|
29
|
+
render(<AlertCard alert={alert} />)
|
|
30
|
+
expect(screen.getByText('company')).toBeInTheDocument()
|
|
31
|
+
})
|
|
32
|
+
|
|
33
|
+
it('renders status badge', () => {
|
|
34
|
+
const alert = createMockAlert({ status: 'investigating' })
|
|
35
|
+
render(<AlertCard alert={alert} />)
|
|
36
|
+
expect(screen.getByText('Investigating')).toBeInTheDocument()
|
|
37
|
+
})
|
|
38
|
+
|
|
39
|
+
it('renders priority badge', () => {
|
|
40
|
+
const alert = createMockAlert({ priority: 'critical' })
|
|
41
|
+
render(<AlertCard alert={alert} />)
|
|
42
|
+
expect(screen.getByText('CRITICAL')).toBeInTheDocument()
|
|
43
|
+
})
|
|
44
|
+
|
|
45
|
+
it('renders risk level badge', () => {
|
|
46
|
+
const alert = createMockAlert({ riskLevel: 'high' })
|
|
47
|
+
render(<AlertCard alert={alert} />)
|
|
48
|
+
expect(screen.getByText('Risk: high')).toBeInTheDocument()
|
|
49
|
+
})
|
|
50
|
+
|
|
51
|
+
it('renders alert notes', () => {
|
|
52
|
+
const alert = createMockAlert({ notes: 'Suspicious transaction pattern detected' })
|
|
53
|
+
render(<AlertCard alert={alert} />)
|
|
54
|
+
expect(screen.getByText('Suspicious transaction pattern detected')).toBeInTheDocument()
|
|
55
|
+
})
|
|
56
|
+
|
|
57
|
+
it('renders matched count', () => {
|
|
58
|
+
const alert = createMockAlert({ matchedCount: 5 })
|
|
59
|
+
render(<AlertCard alert={alert} />)
|
|
60
|
+
expect(screen.getByText('5 matches')).toBeInTheDocument()
|
|
61
|
+
})
|
|
62
|
+
|
|
63
|
+
it('renders creation date', () => {
|
|
64
|
+
const dateStr = '2024-01-15T10:00:00.000Z'
|
|
65
|
+
const alert = createMockAlert({ createdAt: dateStr })
|
|
66
|
+
render(<AlertCard alert={alert} />)
|
|
67
|
+
const date = new Date(dateStr).toLocaleDateString()
|
|
68
|
+
expect(screen.getByText(date)).toBeInTheDocument()
|
|
69
|
+
})
|
|
70
|
+
|
|
71
|
+
it('calls onClick handler when clicked', async () => {
|
|
72
|
+
const handler = vi.fn()
|
|
73
|
+
const alert = createMockAlert()
|
|
74
|
+
render(<AlertCard alert={alert} onClick={handler} />)
|
|
75
|
+
await userEvent.click(screen.getByText(alert.entity.name.firstName + ' ' + alert.entity.name.lastName).closest('div')!)
|
|
76
|
+
expect(handler).toHaveBeenCalledOnce()
|
|
77
|
+
})
|
|
78
|
+
|
|
79
|
+
it('renders different risk level colors', () => {
|
|
80
|
+
const { rerender } = render(<AlertCard alert={createMockAlert({ riskLevel: 'critical' })} />)
|
|
81
|
+
expect(screen.getByText('Risk: critical')).toHaveClass('bg-apple-red/20', 'text-apple-red')
|
|
82
|
+
|
|
83
|
+
rerender(<AlertCard alert={createMockAlert({ riskLevel: 'low' })} />)
|
|
84
|
+
expect(screen.getByText('Risk: low')).toHaveClass('bg-apple-green/20', 'text-apple-green')
|
|
85
|
+
})
|
|
86
|
+
})
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { useTranslation } from 'react-i18next';
|
|
3
|
+
import { ChevronRight } from 'lucide-react';
|
|
4
|
+
import { Badge } from '../ui/Badge';
|
|
5
|
+
import { StatusBadge } from '../data/StatusBadge';
|
|
6
|
+
import type { Alert } from '../../types';
|
|
7
|
+
|
|
8
|
+
interface AlertCardProps {
|
|
9
|
+
alert: Alert;
|
|
10
|
+
onClick?: () => void;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
const borderColors: Record<string, string> = {
|
|
14
|
+
critical: 'border-l-apple-red',
|
|
15
|
+
high: 'border-l-apple-orange',
|
|
16
|
+
medium: 'border-l-apple-yellow',
|
|
17
|
+
low: 'border-l-apple-green',
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
const glowColors: Record<string, string> = {
|
|
21
|
+
critical: 'hover:shadow-[0_0_24px_rgba(255,69,58,0.12)]',
|
|
22
|
+
high: 'hover:shadow-[0_0_24px_rgba(255,159,10,0.12)]',
|
|
23
|
+
medium: 'hover:shadow-[0_0_20px_rgba(255,214,10,0.08)]',
|
|
24
|
+
low: 'hover:shadow-[0_0_20px_rgba(48,209,88,0.08)]',
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
const riskBadgeColor: Record<string, 'red' | 'orange' | 'green'> = {
|
|
28
|
+
critical: 'red', high: 'orange', medium: 'orange', low: 'green',
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
export function AlertCard({ alert, onClick }: AlertCardProps) {
|
|
32
|
+
const { t } = useTranslation('alerts');
|
|
33
|
+
const fullName = alert.entity.name.fullName
|
|
34
|
+
|| `${alert.entity.name.firstName} ${alert.entity.name.lastName}`;
|
|
35
|
+
|
|
36
|
+
return (
|
|
37
|
+
<button type="button" onClick={onClick}
|
|
38
|
+
className={`w-full text-left card-vibrancy p-lg border-l-[3px] ${borderColors[alert.riskLevel]}
|
|
39
|
+
${glowColors[alert.riskLevel]} hover:bg-white/[0.04] hover:-translate-y-0.5
|
|
40
|
+
transition-all cursor-pointer group`}>
|
|
41
|
+
<div className="flex items-center justify-between gap-lg mb-md">
|
|
42
|
+
<div className="flex-1 min-w-0">
|
|
43
|
+
<h3 className="sf-headline truncate" title={fullName}>{fullName}</h3>
|
|
44
|
+
<p className="sf-caption mt-xs">{alert.entity.type}</p>
|
|
45
|
+
</div>
|
|
46
|
+
<ChevronRight className="w-5 h-5 text-apple-label-tertiary flex-shrink-0 group-hover:text-white transition-colors" />
|
|
47
|
+
</div>
|
|
48
|
+
<div className="flex flex-wrap gap-sm mb-md">
|
|
49
|
+
<StatusBadge status={alert.status} type="status" />
|
|
50
|
+
<StatusBadge priority={alert.priority} type="priority" />
|
|
51
|
+
<Badge color={riskBadgeColor[alert.riskLevel]} size="sm">{t('card.risk')} {alert.riskLevel}</Badge>
|
|
52
|
+
</div>
|
|
53
|
+
<p className="sf-caption line-clamp-2 mb-md" title={alert.notes}>{alert.notes}</p>
|
|
54
|
+
<div className="flex justify-between">
|
|
55
|
+
<p className="sf-caption">{alert.matchedCount} matches</p>
|
|
56
|
+
<p className="sf-caption text-apple-label-tertiary/60">{new Date(alert.createdAt).toLocaleDateString()}</p>
|
|
57
|
+
</div>
|
|
58
|
+
</button>
|
|
59
|
+
);
|
|
60
|
+
}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { useTranslation } from 'react-i18next';
|
|
3
|
+
import { Card } from '../ui/Card';
|
|
4
|
+
import { Badge } from '../ui/Badge';
|
|
5
|
+
import { StatusBadge } from '../data/StatusBadge';
|
|
6
|
+
import type { Alert } from '../../types';
|
|
7
|
+
|
|
8
|
+
interface SidebarProps {
|
|
9
|
+
alert: Alert;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export function AlertDetailSidebar({ alert }: SidebarProps) {
|
|
13
|
+
const { t } = useTranslation('alerts');
|
|
14
|
+
const riskColor = { critical: 'red', high: 'orange', medium: 'orange', low: 'green' } as any;
|
|
15
|
+
|
|
16
|
+
return (
|
|
17
|
+
<div className="space-y-lg">
|
|
18
|
+
<Card>
|
|
19
|
+
<h3 className="sf-headline mb-lg">{t('sidebar.status')}</h3>
|
|
20
|
+
<div className="space-y-md">
|
|
21
|
+
<div>
|
|
22
|
+
<p className="sf-caption mb-xs">{t('sidebar.current_status')}</p>
|
|
23
|
+
<StatusBadge status={alert.status} type="status" />
|
|
24
|
+
</div>
|
|
25
|
+
<div>
|
|
26
|
+
<p className="sf-caption mb-xs">{t('sidebar.priority')}</p>
|
|
27
|
+
<StatusBadge priority={alert.priority} type="priority" />
|
|
28
|
+
</div>
|
|
29
|
+
<div>
|
|
30
|
+
<p className="sf-caption mb-xs">{t('sidebar.risk_level')}</p>
|
|
31
|
+
<Badge color={riskColor[alert.riskLevel]}>{alert.riskLevel}</Badge>
|
|
32
|
+
</div>
|
|
33
|
+
{alert.investigator && (
|
|
34
|
+
<div>
|
|
35
|
+
<p className="sf-caption mb-xs">{t('sidebar.investigator')}</p>
|
|
36
|
+
<p className="sf-body">{alert.investigator}</p>
|
|
37
|
+
</div>
|
|
38
|
+
)}
|
|
39
|
+
</div>
|
|
40
|
+
</Card>
|
|
41
|
+
|
|
42
|
+
<Card>
|
|
43
|
+
<h3 className="sf-headline mb-lg">{t('sidebar.timeline')}</h3>
|
|
44
|
+
<div className="space-y-md text-sm">
|
|
45
|
+
<div>
|
|
46
|
+
<p className="sf-caption">Created</p>
|
|
47
|
+
<p className="sf-body">{new Date(alert.createdAt).toLocaleString()}</p>
|
|
48
|
+
</div>
|
|
49
|
+
<div>
|
|
50
|
+
<p className="sf-caption">Updated</p>
|
|
51
|
+
<p className="sf-body">{new Date(alert.updatedAt).toLocaleString()}</p>
|
|
52
|
+
</div>
|
|
53
|
+
{alert.duoAt && (
|
|
54
|
+
<div>
|
|
55
|
+
<p className="sf-caption">Due</p>
|
|
56
|
+
<p className="sf-body">{new Date(alert.duoAt).toLocaleString()}</p>
|
|
57
|
+
</div>
|
|
58
|
+
)}
|
|
59
|
+
</div>
|
|
60
|
+
</Card>
|
|
61
|
+
</div>
|
|
62
|
+
);
|
|
63
|
+
}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { render, screen } from '@testing-library/react'
|
|
2
|
+
import userEvent from '@testing-library/user-event'
|
|
3
|
+
import { describe, it, expect, vi } from 'vitest'
|
|
4
|
+
import { AlertFilters } from './AlertFilters'
|
|
5
|
+
|
|
6
|
+
describe('AlertFilters', () => {
|
|
7
|
+
const renderFilters = () => render(
|
|
8
|
+
<AlertFilters
|
|
9
|
+
selectedStatus={[]}
|
|
10
|
+
selectedPriority={[]}
|
|
11
|
+
onStatusChange={vi.fn()}
|
|
12
|
+
onPriorityChange={vi.fn()}
|
|
13
|
+
onReset={vi.fn()}
|
|
14
|
+
/>
|
|
15
|
+
)
|
|
16
|
+
|
|
17
|
+
it('renders all filter buttons', () => {
|
|
18
|
+
renderFilters()
|
|
19
|
+
expect(screen.getByRole('button', { name: /open/i })).toBeInTheDocument()
|
|
20
|
+
expect(screen.getByRole('button', { name: /critical/i })).toBeInTheDocument()
|
|
21
|
+
expect(screen.getByRole('button', { name: /reset/i })).toBeInTheDocument()
|
|
22
|
+
})
|
|
23
|
+
|
|
24
|
+
it('calls filter handlers on button click', async () => {
|
|
25
|
+
const statusHandler = vi.fn()
|
|
26
|
+
const priorityHandler = vi.fn()
|
|
27
|
+
render(
|
|
28
|
+
<AlertFilters
|
|
29
|
+
selectedStatus={[]}
|
|
30
|
+
selectedPriority={[]}
|
|
31
|
+
onStatusChange={statusHandler}
|
|
32
|
+
onPriorityChange={priorityHandler}
|
|
33
|
+
onReset={vi.fn()}
|
|
34
|
+
/>
|
|
35
|
+
)
|
|
36
|
+
const openBtn = Array.from(screen.getAllByRole('button')).find(btn => btn.textContent === 'open')
|
|
37
|
+
const criticalBtn = Array.from(screen.getAllByRole('button')).find(btn => btn.textContent === 'critical')
|
|
38
|
+
await userEvent.click(openBtn!)
|
|
39
|
+
await userEvent.click(criticalBtn!)
|
|
40
|
+
expect(statusHandler).toHaveBeenCalled()
|
|
41
|
+
expect(priorityHandler).toHaveBeenCalled()
|
|
42
|
+
})
|
|
43
|
+
|
|
44
|
+
it('highlights selected filters and renders reset', () => {
|
|
45
|
+
render(
|
|
46
|
+
<AlertFilters
|
|
47
|
+
selectedStatus={['open']}
|
|
48
|
+
selectedPriority={['critical']}
|
|
49
|
+
onStatusChange={vi.fn()}
|
|
50
|
+
onPriorityChange={vi.fn()}
|
|
51
|
+
onReset={vi.fn()}
|
|
52
|
+
/>
|
|
53
|
+
)
|
|
54
|
+
const openBtn = Array.from(screen.getAllByRole('button')).find(btn => btn.textContent === 'open')
|
|
55
|
+
expect(openBtn).toHaveClass('bg-apple-blue')
|
|
56
|
+
expect(screen.getByRole('button', { name: /reset/i })).toBeInTheDocument()
|
|
57
|
+
})
|
|
58
|
+
|
|
59
|
+
it('calls onReset when reset button clicked', async () => {
|
|
60
|
+
const handler = vi.fn()
|
|
61
|
+
render(
|
|
62
|
+
<AlertFilters
|
|
63
|
+
selectedStatus={['open']}
|
|
64
|
+
selectedPriority={['critical']}
|
|
65
|
+
onStatusChange={vi.fn()}
|
|
66
|
+
onPriorityChange={vi.fn()}
|
|
67
|
+
onReset={handler}
|
|
68
|
+
/>
|
|
69
|
+
)
|
|
70
|
+
await userEvent.click(screen.getByRole('button', { name: /reset/i }))
|
|
71
|
+
expect(handler).toHaveBeenCalledOnce()
|
|
72
|
+
})
|
|
73
|
+
})
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { useTranslation } from 'react-i18next';
|
|
3
|
+
import { Badge } from '../ui/Badge';
|
|
4
|
+
import { Button } from '../ui/Button';
|
|
5
|
+
import { Card } from '../ui/Card';
|
|
6
|
+
import type { AlertStatus, AlertPriority } from '../../types';
|
|
7
|
+
|
|
8
|
+
interface AlertFiltersProps {
|
|
9
|
+
selectedStatus: AlertStatus[];
|
|
10
|
+
selectedPriority: AlertPriority[];
|
|
11
|
+
onStatusChange: (status: AlertStatus[]) => void;
|
|
12
|
+
onPriorityChange: (priority: AlertPriority[]) => void;
|
|
13
|
+
onReset: () => void;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
const statuses: AlertStatus[] = ['open', 'investigating', 'resolved', 'archived'];
|
|
17
|
+
const priorities: AlertPriority[] = ['critical', 'high', 'medium', 'low'];
|
|
18
|
+
|
|
19
|
+
export function AlertFilters({
|
|
20
|
+
selectedStatus,
|
|
21
|
+
selectedPriority,
|
|
22
|
+
onStatusChange,
|
|
23
|
+
onPriorityChange,
|
|
24
|
+
onReset,
|
|
25
|
+
}: AlertFiltersProps) {
|
|
26
|
+
const { t } = useTranslation('alerts');
|
|
27
|
+
const toggleStatus = (status: AlertStatus) => {
|
|
28
|
+
if (selectedStatus.includes(status)) {
|
|
29
|
+
onStatusChange(selectedStatus.filter((s) => s !== status));
|
|
30
|
+
} else {
|
|
31
|
+
onStatusChange([...selectedStatus, status]);
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
const togglePriority = (priority: AlertPriority) => {
|
|
36
|
+
if (selectedPriority.includes(priority)) {
|
|
37
|
+
onPriorityChange(selectedPriority.filter((p) => p !== priority));
|
|
38
|
+
} else {
|
|
39
|
+
onPriorityChange([...selectedPriority, priority]);
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
return (
|
|
44
|
+
<Card>
|
|
45
|
+
<div className="space-y-lg">
|
|
46
|
+
<div>
|
|
47
|
+
<p className="sf-caption mb-md">{t('filters.status')}</p>
|
|
48
|
+
<div className="flex flex-wrap gap-sm">
|
|
49
|
+
{statuses.map((status) => (
|
|
50
|
+
<button
|
|
51
|
+
key={status}
|
|
52
|
+
onClick={() => toggleStatus(status)}
|
|
53
|
+
aria-pressed={selectedStatus.includes(status)}
|
|
54
|
+
className={`px-md py-xs rounded-full transition-all text-sf-caption font-semibold cursor-pointer text-white focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-apple-blue ${
|
|
55
|
+
selectedStatus.includes(status) ? 'bg-apple-blue' : 'bg-white/10 hover:bg-white/15'
|
|
56
|
+
}`}
|
|
57
|
+
>
|
|
58
|
+
{t(`filters.${status}`)}
|
|
59
|
+
</button>
|
|
60
|
+
))}
|
|
61
|
+
</div>
|
|
62
|
+
</div>
|
|
63
|
+
|
|
64
|
+
<div>
|
|
65
|
+
<p className="sf-caption mb-md">{t('filters.priority')}</p>
|
|
66
|
+
<div className="flex flex-wrap gap-sm">
|
|
67
|
+
{priorities.map((priority) => (
|
|
68
|
+
<button
|
|
69
|
+
key={priority}
|
|
70
|
+
onClick={() => togglePriority(priority)}
|
|
71
|
+
aria-pressed={selectedPriority.includes(priority)}
|
|
72
|
+
className={`px-md py-xs rounded-full transition-all text-sf-caption font-semibold cursor-pointer text-white focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-apple-blue ${
|
|
73
|
+
selectedPriority.includes(priority) ? 'bg-apple-blue' : 'bg-white/10 hover:bg-white/15'
|
|
74
|
+
}`}
|
|
75
|
+
>
|
|
76
|
+
{t(`filters.${priority}`)}
|
|
77
|
+
</button>
|
|
78
|
+
))}
|
|
79
|
+
</div>
|
|
80
|
+
</div>
|
|
81
|
+
|
|
82
|
+
<Button variant="secondary" size="sm" onClick={onReset} className="w-full">
|
|
83
|
+
Reset
|
|
84
|
+
</Button>
|
|
85
|
+
</div>
|
|
86
|
+
</Card>
|
|
87
|
+
);
|
|
88
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { render, screen } from '@testing-library/react'
|
|
2
|
+
import { describe, it, expect } from 'vitest'
|
|
3
|
+
import { EntityDetailsCard } from './EntityDetailsCard'
|
|
4
|
+
import { createMockAlert } from '../../test/utils'
|
|
5
|
+
|
|
6
|
+
describe('EntityDetailsCard', () => {
|
|
7
|
+
it('renders entity type', () => {
|
|
8
|
+
const alert = createMockAlert()
|
|
9
|
+
render(<EntityDetailsCard alert={alert} />)
|
|
10
|
+
expect(screen.getByText('individual')).toBeInTheDocument()
|
|
11
|
+
})
|
|
12
|
+
|
|
13
|
+
it('renders match count', () => {
|
|
14
|
+
const alert = createMockAlert({ matchedCount: 7 })
|
|
15
|
+
render(<EntityDetailsCard alert={alert} />)
|
|
16
|
+
expect(screen.getByText('7')).toBeInTheDocument()
|
|
17
|
+
})
|
|
18
|
+
|
|
19
|
+
it('shows N/A when nationality is missing', () => {
|
|
20
|
+
const alert = createMockAlert()
|
|
21
|
+
render(<EntityDetailsCard alert={alert} />)
|
|
22
|
+
expect(screen.getByText('N/A')).toBeInTheDocument()
|
|
23
|
+
})
|
|
24
|
+
|
|
25
|
+
it('renders nationality when provided', () => {
|
|
26
|
+
const alert = createMockAlert({
|
|
27
|
+
entity: {
|
|
28
|
+
id: 'e-1', type: 'individual',
|
|
29
|
+
name: { firstName: 'John', lastName: 'Doe', aliases: [] },
|
|
30
|
+
identifiers: [], nationality: 'US',
|
|
31
|
+
createdAt: '2026-01-01T00:00:00Z', updatedAt: '2026-01-01T00:00:00Z',
|
|
32
|
+
},
|
|
33
|
+
})
|
|
34
|
+
render(<EntityDetailsCard alert={alert} />)
|
|
35
|
+
expect(screen.getByText('US')).toBeInTheDocument()
|
|
36
|
+
})
|
|
37
|
+
|
|
38
|
+
it('renders date of birth when provided', () => {
|
|
39
|
+
const alert = createMockAlert({
|
|
40
|
+
entity: {
|
|
41
|
+
id: 'e-1', type: 'individual',
|
|
42
|
+
name: { firstName: 'John', lastName: 'Doe', aliases: [] },
|
|
43
|
+
identifiers: [], dob: '1990-01-15',
|
|
44
|
+
createdAt: '2026-01-01T00:00:00Z', updatedAt: '2026-01-01T00:00:00Z',
|
|
45
|
+
},
|
|
46
|
+
})
|
|
47
|
+
render(<EntityDetailsCard alert={alert} />)
|
|
48
|
+
expect(screen.getByText(/1990/)).toBeInTheDocument()
|
|
49
|
+
})
|
|
50
|
+
|
|
51
|
+
it('hides dob section when not provided', () => {
|
|
52
|
+
const alert = createMockAlert()
|
|
53
|
+
render(<EntityDetailsCard alert={alert} />)
|
|
54
|
+
expect(screen.queryByText(/date of birth/i)).not.toBeInTheDocument()
|
|
55
|
+
})
|
|
56
|
+
|
|
57
|
+
it('renders heading', () => {
|
|
58
|
+
render(<EntityDetailsCard alert={createMockAlert()} />)
|
|
59
|
+
expect(screen.getByText(/entity details/i)).toBeInTheDocument()
|
|
60
|
+
})
|
|
61
|
+
})
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { useTranslation } from 'react-i18next';
|
|
3
|
+
import { Card } from '../ui/Card';
|
|
4
|
+
import type { Alert } from '../../types';
|
|
5
|
+
|
|
6
|
+
interface Props {
|
|
7
|
+
alert: Alert;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export function EntityDetailsCard({ alert }: Props) {
|
|
11
|
+
const { t } = useTranslation('alerts');
|
|
12
|
+
return (
|
|
13
|
+
<Card>
|
|
14
|
+
<h3 className="sf-headline mb-lg">{t('entity_details.title')}</h3>
|
|
15
|
+
<div className="grid grid-cols-2 gap-lg">
|
|
16
|
+
<div>
|
|
17
|
+
<p className="sf-caption mb-xs">{t('entity_details.type')}</p>
|
|
18
|
+
<p className="sf-body capitalize">{alert.entity.type}</p>
|
|
19
|
+
</div>
|
|
20
|
+
<div>
|
|
21
|
+
<p className="sf-caption mb-xs">{t('entity_details.nationality')}</p>
|
|
22
|
+
<p className="sf-body">{alert.entity.nationality || 'N/A'}</p>
|
|
23
|
+
</div>
|
|
24
|
+
{alert.entity.dob && (
|
|
25
|
+
<div>
|
|
26
|
+
<p className="sf-caption mb-xs">{t('entity_details.dob')}</p>
|
|
27
|
+
<p className="sf-body">{new Date(alert.entity.dob).toLocaleDateString()}</p>
|
|
28
|
+
</div>
|
|
29
|
+
)}
|
|
30
|
+
<div>
|
|
31
|
+
<p className="sf-caption mb-xs">{t('entity_details.matches_found')}</p>
|
|
32
|
+
<p className="sf-body">{alert.matchedCount}</p>
|
|
33
|
+
</div>
|
|
34
|
+
</div>
|
|
35
|
+
</Card>
|
|
36
|
+
);
|
|
37
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { render, screen } from '@testing-library/react'
|
|
2
|
+
import userEvent from '@testing-library/user-event'
|
|
3
|
+
import { describe, it, expect, vi } from 'vitest'
|
|
4
|
+
import { NotesCard } from './NotesCard'
|
|
5
|
+
|
|
6
|
+
describe('NotesCard', () => {
|
|
7
|
+
it('renders textarea with notes value', () => {
|
|
8
|
+
render(<NotesCard notes="Existing notes" onNotesChange={vi.fn()} />)
|
|
9
|
+
expect(screen.getByDisplayValue('Existing notes')).toBeInTheDocument()
|
|
10
|
+
})
|
|
11
|
+
|
|
12
|
+
it('renders empty textarea when notes empty', () => {
|
|
13
|
+
render(<NotesCard notes="" onNotesChange={vi.fn()} />)
|
|
14
|
+
const textarea = screen.getByRole('textbox')
|
|
15
|
+
expect(textarea).toHaveValue('')
|
|
16
|
+
})
|
|
17
|
+
|
|
18
|
+
it('calls onNotesChange when typing', async () => {
|
|
19
|
+
const handler = vi.fn()
|
|
20
|
+
render(<NotesCard notes="" onNotesChange={handler} />)
|
|
21
|
+
await userEvent.type(screen.getByRole('textbox'), 'new note')
|
|
22
|
+
expect(handler).toHaveBeenCalled()
|
|
23
|
+
})
|
|
24
|
+
|
|
25
|
+
it('renders save button', () => {
|
|
26
|
+
render(<NotesCard notes="" onNotesChange={vi.fn()} />)
|
|
27
|
+
expect(screen.getByRole('button', { name: /save notes/i })).toBeInTheDocument()
|
|
28
|
+
})
|
|
29
|
+
|
|
30
|
+
it('has accessible label on textarea', () => {
|
|
31
|
+
render(<NotesCard notes="" onNotesChange={vi.fn()} />)
|
|
32
|
+
expect(screen.getByLabelText(/investigation notes/i)).toBeInTheDocument()
|
|
33
|
+
})
|
|
34
|
+
|
|
35
|
+
it('renders title heading', () => {
|
|
36
|
+
render(<NotesCard notes="" onNotesChange={vi.fn()} />)
|
|
37
|
+
expect(screen.getByText(/investigation notes/i)).toBeInTheDocument()
|
|
38
|
+
})
|
|
39
|
+
})
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { useTranslation } from 'react-i18next';
|
|
3
|
+
import { Card } from '../ui/Card';
|
|
4
|
+
import { Button } from '../ui/Button';
|
|
5
|
+
|
|
6
|
+
interface NotesCardProps {
|
|
7
|
+
notes: string;
|
|
8
|
+
onNotesChange: (notes: string) => void;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export function NotesCard({ notes, onNotesChange }: NotesCardProps) {
|
|
12
|
+
const { t } = useTranslation('alerts');
|
|
13
|
+
return (
|
|
14
|
+
<Card>
|
|
15
|
+
<h3 className="sf-headline mb-lg">{t('notes.title')}</h3>
|
|
16
|
+
<textarea
|
|
17
|
+
value={notes}
|
|
18
|
+
onChange={(e) => onNotesChange(e.target.value)}
|
|
19
|
+
aria-label={t('notes.title')}
|
|
20
|
+
className="input-field w-full h-24 mb-md"
|
|
21
|
+
placeholder={t('notes.placeholder')}
|
|
22
|
+
/>
|
|
23
|
+
<Button variant="primary" size="sm">
|
|
24
|
+
{t('notes.save')}
|
|
25
|
+
</Button>
|
|
26
|
+
</Card>
|
|
27
|
+
);
|
|
28
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import { useTranslation } from 'react-i18next'
|
|
3
|
+
|
|
4
|
+
export default function AuthDivider() {
|
|
5
|
+
const { t } = useTranslation('auth')
|
|
6
|
+
return (
|
|
7
|
+
<div className="relative my-6">
|
|
8
|
+
<div className="absolute inset-0 flex items-center">
|
|
9
|
+
<div className="w-full border-t border-white/10" />
|
|
10
|
+
</div>
|
|
11
|
+
<div className="relative flex justify-center text-sm">
|
|
12
|
+
<span className="px-4 bg-apple-bg-secondary text-apple-label-secondary">
|
|
13
|
+
{t('oauth.or_continue_email')}
|
|
14
|
+
</span>
|
|
15
|
+
</div>
|
|
16
|
+
</div>
|
|
17
|
+
)
|
|
18
|
+
}
|