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,120 @@
|
|
|
1
|
+
import { useState, useEffect, useCallback } from 'react'
|
|
2
|
+
import { PageHeader } from '../components/layout/PageHeader'
|
|
3
|
+
import { Card } from '../components/ui/Card'
|
|
4
|
+
import { Button } from '../components/ui/Button'
|
|
5
|
+
import { Badge } from '../components/ui/Badge'
|
|
6
|
+
import { LoadingSpinner } from '../components/ui/LoadingSpinner'
|
|
7
|
+
import { EmptyState } from '../components/ui/EmptyState'
|
|
8
|
+
import { api } from '../api/client'
|
|
9
|
+
|
|
10
|
+
interface APIKey {
|
|
11
|
+
id: string; product: string; prefix: string;
|
|
12
|
+
rate_limit: number; created_at: string; revoked: boolean;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export function APIKeys() {
|
|
16
|
+
const [keys, setKeys] = useState<APIKey[]>([])
|
|
17
|
+
const [loading, setLoading] = useState(true)
|
|
18
|
+
const [error, setError] = useState('')
|
|
19
|
+
const [newKey, setNewKey] = useState('')
|
|
20
|
+
const [generating, setGenerating] = useState(false)
|
|
21
|
+
|
|
22
|
+
const load = useCallback(async () => {
|
|
23
|
+
try {
|
|
24
|
+
const d = await api.get<{ keys: APIKey[] }>('/keys')
|
|
25
|
+
setKeys(d?.keys ?? [])
|
|
26
|
+
} catch (err) {
|
|
27
|
+
setError(err instanceof Error ? err.message : 'Failed to load keys')
|
|
28
|
+
} finally {
|
|
29
|
+
setLoading(false)
|
|
30
|
+
}
|
|
31
|
+
}, [])
|
|
32
|
+
|
|
33
|
+
useEffect(() => { load() }, [load])
|
|
34
|
+
|
|
35
|
+
const generate = async () => {
|
|
36
|
+
setGenerating(true); setNewKey(''); setError('')
|
|
37
|
+
try {
|
|
38
|
+
const d = await api.post<{ key: string }>('/keys', { product: 'api' })
|
|
39
|
+
setNewKey(d.key)
|
|
40
|
+
load()
|
|
41
|
+
} catch (err) {
|
|
42
|
+
setError(err instanceof Error ? err.message : 'Generate failed')
|
|
43
|
+
} finally {
|
|
44
|
+
setGenerating(false)
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
const revoke = async (id: string) => {
|
|
49
|
+
if (!confirm('Revoke this key? This cannot be undone.')) return
|
|
50
|
+
try {
|
|
51
|
+
await api.del(`/keys/${id}`)
|
|
52
|
+
load()
|
|
53
|
+
} catch (err) {
|
|
54
|
+
setError(err instanceof Error ? err.message : 'Revoke failed')
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
return (
|
|
59
|
+
<div>
|
|
60
|
+
<PageHeader title="API Keys" description="Generate and manage API keys for your integrations" />
|
|
61
|
+
<Card className="mb-lg">
|
|
62
|
+
<div className="flex items-center justify-between">
|
|
63
|
+
<p className="sf-body text-white/60">Generate a new API key for your application</p>
|
|
64
|
+
<Button onClick={generate} disabled={generating}>
|
|
65
|
+
{generating ? 'Generating...' : 'Generate Key'}
|
|
66
|
+
</Button>
|
|
67
|
+
</div>
|
|
68
|
+
{newKey && <NewKeyBanner keyValue={newKey} />}
|
|
69
|
+
</Card>
|
|
70
|
+
|
|
71
|
+
{error && <Card className="mb-lg"><p role="alert" className="text-apple-red sf-body">{error}</p></Card>}
|
|
72
|
+
{loading && <LoadingSpinner />}
|
|
73
|
+
{!loading && keys.length === 0 && <EmptyState title="No API keys yet" />}
|
|
74
|
+
|
|
75
|
+
{!loading && keys.length > 0 && (
|
|
76
|
+
<Card>
|
|
77
|
+
{keys.map(k => (
|
|
78
|
+
<KeyRow key={k.id} apiKey={k} onRevoke={revoke} />
|
|
79
|
+
))}
|
|
80
|
+
</Card>
|
|
81
|
+
)}
|
|
82
|
+
</div>
|
|
83
|
+
)
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
function NewKeyBanner({ keyValue }: { keyValue: string }) {
|
|
87
|
+
const [copied, setCopied] = useState(false)
|
|
88
|
+
const copy = () => { navigator.clipboard.writeText(keyValue); setCopied(true) }
|
|
89
|
+
return (
|
|
90
|
+
<div className="mt-lg p-lg rounded-apple-md bg-apple-green/10 border border-apple-green/20">
|
|
91
|
+
<p className="sf-caption text-apple-green font-semibold mb-sm">Key generated — save it now!</p>
|
|
92
|
+
<div className="flex items-center gap-md">
|
|
93
|
+
<code className="text-sm text-white bg-black/30 px-md py-sm rounded flex-1 font-mono truncate">{keyValue}</code>
|
|
94
|
+
<Button size="sm" onClick={copy}>{copied ? 'Copied!' : 'Copy'}</Button>
|
|
95
|
+
</div>
|
|
96
|
+
</div>
|
|
97
|
+
)
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
function KeyRow({ apiKey, onRevoke }: { apiKey: APIKey; onRevoke: (id: string) => void }) {
|
|
101
|
+
return (
|
|
102
|
+
<div className="flex items-center justify-between px-lg py-md border-b border-white/[0.04] last:border-0">
|
|
103
|
+
<div>
|
|
104
|
+
<code className="text-sm text-white/80 font-mono">{apiKey.prefix}</code>
|
|
105
|
+
<p className="sf-caption text-white/40 mt-xs">{new Date(apiKey.created_at).toLocaleDateString()}</p>
|
|
106
|
+
</div>
|
|
107
|
+
<div className="flex items-center gap-md">
|
|
108
|
+
<Badge color="blue" size="sm">{apiKey.product}</Badge>
|
|
109
|
+
{apiKey.revoked ? (
|
|
110
|
+
<Badge color="red" size="sm">Revoked</Badge>
|
|
111
|
+
) : (
|
|
112
|
+
<button onClick={() => onRevoke(apiKey.id)}
|
|
113
|
+
className="text-apple-red/60 hover:text-apple-red text-sm cursor-pointer">Revoke</button>
|
|
114
|
+
)}
|
|
115
|
+
</div>
|
|
116
|
+
</div>
|
|
117
|
+
)
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
export default APIKeys
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { useState } from 'react';
|
|
2
|
+
interface Props { onClose: () => void; onAdd?: (p: { name: string; riskLevel: string; frequency: string }) => void; onCreated?: () => void; onUpdate?: () => void }
|
|
3
|
+
export default function AddMonitorModal({ onClose, onAdd, onCreated }: Props) {
|
|
4
|
+
const [name, setName] = useState('');
|
|
5
|
+
const [risk, setRisk] = useState('medium');
|
|
6
|
+
const [freq, setFreq] = useState('daily');
|
|
7
|
+
return (
|
|
8
|
+
<div className="fixed inset-0 bg-black/60 flex items-center justify-center z-50" onClick={onClose}>
|
|
9
|
+
<div className="bg-zinc-900 border border-white/10 rounded-xl p-6 w-full max-w-md" onClick={e => e.stopPropagation()}>
|
|
10
|
+
<h2 className="text-white text-lg font-semibold mb-4">Add to Monitoring</h2>
|
|
11
|
+
<input value={name} onChange={e => setName(e.target.value)} placeholder="Entity name"
|
|
12
|
+
className="w-full bg-zinc-800 border border-zinc-700 rounded px-3 py-2 text-sm text-white mb-3" />
|
|
13
|
+
<select value={risk} onChange={e => setRisk(e.target.value)}
|
|
14
|
+
className="w-full bg-zinc-800 border border-zinc-700 rounded px-3 py-2 text-sm text-white mb-3">
|
|
15
|
+
<option value="low">Low Risk</option><option value="medium">Medium Risk</option>
|
|
16
|
+
<option value="high">High Risk</option><option value="critical">Critical</option>
|
|
17
|
+
</select>
|
|
18
|
+
<select value={freq} onChange={e => setFreq(e.target.value)}
|
|
19
|
+
className="w-full bg-zinc-800 border border-zinc-700 rounded px-3 py-2 text-sm text-white mb-3">
|
|
20
|
+
<option value="realtime">Real-time</option><option value="daily">Daily</option><option value="weekly">Weekly</option>
|
|
21
|
+
</select>
|
|
22
|
+
<div className="flex gap-3 mt-4">
|
|
23
|
+
<button type="button" onClick={onClose} className="flex-1 px-4 py-2 border border-zinc-700 rounded text-sm text-zinc-300">Cancel</button>
|
|
24
|
+
<button type="button" onClick={() => { if (name) { onAdd?.({ name, riskLevel: risk, frequency: freq }); onCreated?.(); } }}
|
|
25
|
+
className="flex-1 px-4 py-2 bg-blue-600 rounded text-sm text-white">Add</button>
|
|
26
|
+
</div>
|
|
27
|
+
</div>
|
|
28
|
+
</div>
|
|
29
|
+
);
|
|
30
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { render, screen } from '@testing-library/react'
|
|
2
|
+
import { describe, it, expect, vi, beforeEach } from 'vitest'
|
|
3
|
+
import { AdverseMedia } from './AdverseMedia'
|
|
4
|
+
|
|
5
|
+
beforeEach(() => {
|
|
6
|
+
global.fetch = vi.fn(() =>
|
|
7
|
+
Promise.resolve({
|
|
8
|
+
json: () => Promise.resolve({ data: { hits: [] } }),
|
|
9
|
+
})
|
|
10
|
+
) as any
|
|
11
|
+
})
|
|
12
|
+
|
|
13
|
+
describe('AdverseMedia', () => {
|
|
14
|
+
it('renders title', () => {
|
|
15
|
+
render(<AdverseMedia />)
|
|
16
|
+
expect(screen.getByText('Adverse Media')).toBeInTheDocument()
|
|
17
|
+
})
|
|
18
|
+
})
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { useState, useEffect } from 'react'
|
|
2
|
+
import { useTranslation } from 'react-i18next'
|
|
3
|
+
import { api } from '../api/client'
|
|
4
|
+
import { MediaResultCard } from '../components/compliance/MediaResultCard'
|
|
5
|
+
|
|
6
|
+
interface MediaHit {
|
|
7
|
+
id: string
|
|
8
|
+
entity_name: string
|
|
9
|
+
category: string
|
|
10
|
+
categories: string[]
|
|
11
|
+
title: string
|
|
12
|
+
snippet: string
|
|
13
|
+
url: string
|
|
14
|
+
risk_score: number
|
|
15
|
+
severity: number
|
|
16
|
+
review_status: string
|
|
17
|
+
detected_at: string
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
const CATEGORIES = [
|
|
21
|
+
'fraud', 'money_laundering', 'terrorism', 'sanctions',
|
|
22
|
+
'bribery', 'tax_evasion', 'cybercrime', 'human_trafficking',
|
|
23
|
+
'drug_trafficking', 'corruption',
|
|
24
|
+
]
|
|
25
|
+
|
|
26
|
+
export function AdverseMedia() {
|
|
27
|
+
const { t } = useTranslation('compliance')
|
|
28
|
+
const [hits, setHits] = useState<MediaHit[]>([])
|
|
29
|
+
const [searchName, setSearchName] = useState('')
|
|
30
|
+
const [activeFilter, setActiveFilter] = useState<string | null>(null)
|
|
31
|
+
|
|
32
|
+
useEffect(() => {
|
|
33
|
+
api.get<{ hits: MediaHit[] }>('/media/unreviewed')
|
|
34
|
+
.then(d => setHits(d?.hits ?? []))
|
|
35
|
+
.catch(() => setHits([]))
|
|
36
|
+
}, [])
|
|
37
|
+
|
|
38
|
+
const handleScan = async () => {
|
|
39
|
+
if (!searchName.trim()) return
|
|
40
|
+
const d = await api.post<{ hits: MediaHit[] }>('/media/scan', { entity_name: searchName })
|
|
41
|
+
setHits(d?.hits ?? [])
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
const handleReview = async (hitId: string, status: string) => {
|
|
45
|
+
await api.put(`/media/results/${hitId}/review`, { status })
|
|
46
|
+
setHits(prev => prev.filter(h => h.id !== hitId))
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
const filtered = activeFilter
|
|
50
|
+
? hits.filter(h => h.category === activeFilter || h.categories?.includes(activeFilter!))
|
|
51
|
+
: hits
|
|
52
|
+
|
|
53
|
+
return (
|
|
54
|
+
<div className="px-md py-lg sm:p-8 max-w-6xl mx-auto">
|
|
55
|
+
<h1 className="text-xl sm:text-2xl font-semibold mb-6">{t('adverse_media.title')}</h1>
|
|
56
|
+
<div className="flex flex-col sm:flex-row gap-2 mb-6">
|
|
57
|
+
<input value={searchName} onChange={e => setSearchName(e.target.value)}
|
|
58
|
+
placeholder={t('adverse_media.search_entity')}
|
|
59
|
+
className="flex-1 px-4 py-2 rounded-apple-md bg-apple-bg-secondary text-sm
|
|
60
|
+
border border-white/10 focus:outline-apple-blue"
|
|
61
|
+
onKeyDown={e => e.key === 'Enter' && handleScan()} />
|
|
62
|
+
<button onClick={handleScan} aria-label={t('adverse_media.scan')}
|
|
63
|
+
className="px-6 py-2 bg-apple-blue text-white rounded-apple-md text-sm
|
|
64
|
+
cursor-pointer hover:opacity-80">
|
|
65
|
+
{t('adverse_media.scan')}
|
|
66
|
+
</button>
|
|
67
|
+
</div>
|
|
68
|
+
<div className="flex gap-2 mb-6 flex-wrap">
|
|
69
|
+
{CATEGORIES.map(cat => (
|
|
70
|
+
<button key={cat} onClick={() => setActiveFilter(activeFilter === cat ? null : cat)}
|
|
71
|
+
className={`px-3 py-1 rounded-full text-xs cursor-pointer transition-colors
|
|
72
|
+
${activeFilter === cat
|
|
73
|
+
? 'bg-apple-blue text-white'
|
|
74
|
+
: 'bg-apple-bg-tertiary text-apple-label-secondary hover:bg-apple-bg-secondary'}`}>
|
|
75
|
+
{cat.replace(/_/g, ' ')}
|
|
76
|
+
</button>
|
|
77
|
+
))}
|
|
78
|
+
</div>
|
|
79
|
+
<div className="space-y-3">
|
|
80
|
+
{filtered.map(h => (
|
|
81
|
+
<MediaResultCard key={h.id} hit={h} onReview={handleReview} />
|
|
82
|
+
))}
|
|
83
|
+
{filtered.length === 0 && (
|
|
84
|
+
<p className="text-apple-label-secondary text-center py-8">{t('adverse_media.no_hits')}</p>
|
|
85
|
+
)}
|
|
86
|
+
</div>
|
|
87
|
+
</div>
|
|
88
|
+
)
|
|
89
|
+
}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import React, { useState, useEffect } from 'react';
|
|
2
|
+
import { useParams, useNavigate } from 'react-router-dom';
|
|
3
|
+
import { useTranslation } from 'react-i18next';
|
|
4
|
+
import { ArrowLeft } from 'lucide-react';
|
|
5
|
+
import { PageHeader } from '../components/layout/PageHeader';
|
|
6
|
+
import { Card } from '../components/ui/Card';
|
|
7
|
+
import { Button } from '../components/ui/Button';
|
|
8
|
+
import { AlertActions } from '../components/alerts/AlertActions';
|
|
9
|
+
import { AlertDetailSidebar } from '../components/alerts/AlertDetailSidebar';
|
|
10
|
+
import { EntityDetailsCard } from '../components/alerts/EntityDetailsCard';
|
|
11
|
+
import { NotesCard } from '../components/alerts/NotesCard';
|
|
12
|
+
import { alertsApi } from '../api/alerts';
|
|
13
|
+
import { LoadingSpinner } from '../components/ui/LoadingSpinner';
|
|
14
|
+
import type { Alert } from '../types';
|
|
15
|
+
|
|
16
|
+
export function AlertDetailPage() {
|
|
17
|
+
const navigate = useNavigate();
|
|
18
|
+
const { t } = useTranslation('alerts');
|
|
19
|
+
const { id } = useParams();
|
|
20
|
+
const [alert, setAlert] = useState<Alert | null>(null);
|
|
21
|
+
const [loading, setLoading] = useState(true);
|
|
22
|
+
const [notes, setNotes] = useState('');
|
|
23
|
+
|
|
24
|
+
useEffect(() => {
|
|
25
|
+
if (!id) return;
|
|
26
|
+
alertsApi.get(id).then((a) => { setAlert(a); setNotes(a.notes || ''); })
|
|
27
|
+
.catch(() => setAlert(null))
|
|
28
|
+
.finally(() => setLoading(false));
|
|
29
|
+
}, [id]);
|
|
30
|
+
|
|
31
|
+
if (loading) return <div className="flex justify-center h-96"><LoadingSpinner /></div>;
|
|
32
|
+
if (!alert) {
|
|
33
|
+
return (
|
|
34
|
+
<div>
|
|
35
|
+
<Button onClick={() => navigate('/alerts')} className="mb-lg">
|
|
36
|
+
<ArrowLeft className="w-4 h-4 mr-sm" /> Back
|
|
37
|
+
</Button>
|
|
38
|
+
<Card>{t('detail.not_found')}</Card>
|
|
39
|
+
</div>
|
|
40
|
+
);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
const name = alert.entity?.name?.fullName || alert.id;
|
|
44
|
+
|
|
45
|
+
return (
|
|
46
|
+
<div>
|
|
47
|
+
<div className="mb-lg">
|
|
48
|
+
<Button variant="secondary" onClick={() => navigate('/alerts')}>
|
|
49
|
+
<ArrowLeft className="w-4 h-4 mr-sm" /> Back
|
|
50
|
+
</Button>
|
|
51
|
+
</div>
|
|
52
|
+
<PageHeader title={name} />
|
|
53
|
+
<div className="grid grid-cols-1 lg:grid-cols-3 gap-lg mb-xxl">
|
|
54
|
+
<div className="lg:col-span-2 space-y-lg">
|
|
55
|
+
<EntityDetailsCard alert={alert} />
|
|
56
|
+
<NotesCard notes={notes} onNotesChange={setNotes} />
|
|
57
|
+
<AlertActions onConfirm={() => {}} onFalsePositive={() => {}}
|
|
58
|
+
onEscalate={() => {}} onDraftAI={() => {}} />
|
|
59
|
+
</div>
|
|
60
|
+
<AlertDetailSidebar alert={alert} />
|
|
61
|
+
</div>
|
|
62
|
+
</div>
|
|
63
|
+
);
|
|
64
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { render, screen, waitFor } from '@testing-library/react'
|
|
2
|
+
import { describe, it, expect, vi } from 'vitest'
|
|
3
|
+
import { AlertQueue } from './AlertQueue'
|
|
4
|
+
import { createMockAlert } from '../test/utils'
|
|
5
|
+
|
|
6
|
+
vi.mock('react-router-dom', async () => ({
|
|
7
|
+
...(await vi.importActual('react-router-dom')),
|
|
8
|
+
useNavigate: () => vi.fn(),
|
|
9
|
+
}))
|
|
10
|
+
|
|
11
|
+
vi.mock('../hooks/useAlerts', () => ({
|
|
12
|
+
useAlerts: vi.fn(() => ({
|
|
13
|
+
alerts: [
|
|
14
|
+
createMockAlert({ id: '1', status: 'open', priority: 'critical' }),
|
|
15
|
+
createMockAlert({ id: '2', status: 'investigating', priority: 'high' }),
|
|
16
|
+
createMockAlert({ id: '3', status: 'resolved', priority: 'medium' }),
|
|
17
|
+
],
|
|
18
|
+
loading: false,
|
|
19
|
+
error: null,
|
|
20
|
+
refetch: vi.fn(),
|
|
21
|
+
resolve: vi.fn(),
|
|
22
|
+
})),
|
|
23
|
+
}))
|
|
24
|
+
|
|
25
|
+
describe('AlertQueue', () => {
|
|
26
|
+
it('renders page title', () => {
|
|
27
|
+
render(<AlertQueue />)
|
|
28
|
+
expect(screen.getByText('Alert Queue')).toBeInTheDocument()
|
|
29
|
+
})
|
|
30
|
+
|
|
31
|
+
it('renders alert cards', async () => {
|
|
32
|
+
render(<AlertQueue />)
|
|
33
|
+
await waitFor(() => {
|
|
34
|
+
expect(screen.getAllByText(/John Doe/i).length).toBeGreaterThan(0)
|
|
35
|
+
})
|
|
36
|
+
})
|
|
37
|
+
|
|
38
|
+
it('renders alert filters component', () => {
|
|
39
|
+
render(<AlertQueue />)
|
|
40
|
+
expect(screen.getByText('Status')).toBeInTheDocument()
|
|
41
|
+
expect(screen.getByText('Priority')).toBeInTheDocument()
|
|
42
|
+
})
|
|
43
|
+
|
|
44
|
+
it('renders reset button in filters', () => {
|
|
45
|
+
render(<AlertQueue />)
|
|
46
|
+
expect(screen.getByRole('button', { name: /reset/i })).toBeInTheDocument()
|
|
47
|
+
})
|
|
48
|
+
})
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import React, { useState } from 'react';
|
|
2
|
+
import { useNavigate } from 'react-router-dom';
|
|
3
|
+
import { useTranslation } from 'react-i18next';
|
|
4
|
+
import { ShieldAlert } from 'lucide-react';
|
|
5
|
+
import { AlertCard } from '../components/alerts/AlertCard';
|
|
6
|
+
import { AlertFilters } from '../components/alerts/AlertFilters';
|
|
7
|
+
import { Button } from '../components/ui/Button';
|
|
8
|
+
import { Badge } from '../components/ui/Badge';
|
|
9
|
+
import { useAlerts } from '../hooks/useAlerts';
|
|
10
|
+
import { LoadingSpinner } from '../components/ui/LoadingSpinner';
|
|
11
|
+
import { EmptyState } from '../components/ui/EmptyState';
|
|
12
|
+
import type { AlertStatus, AlertPriority } from '../types';
|
|
13
|
+
|
|
14
|
+
export function AlertQueue() {
|
|
15
|
+
const navigate = useNavigate();
|
|
16
|
+
const { t } = useTranslation('alerts');
|
|
17
|
+
const { alerts, loading, error } = useAlerts();
|
|
18
|
+
const [selectedStatus, setSelectedStatus] = useState<AlertStatus[]>([]);
|
|
19
|
+
const [selectedPriority, setSelectedPriority] = useState<AlertPriority[]>([]);
|
|
20
|
+
|
|
21
|
+
const filtered = alerts.filter((a) => {
|
|
22
|
+
if (selectedStatus.length && !selectedStatus.includes(a.status)) return false;
|
|
23
|
+
if (selectedPriority.length && !selectedPriority.includes(a.priority)) return false;
|
|
24
|
+
return true;
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
if (loading) {
|
|
28
|
+
return <div className="flex items-center justify-center h-96"><LoadingSpinner /></div>;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
return (
|
|
32
|
+
<div className="grid grid-cols-1 md:grid-cols-4 gap-lg">
|
|
33
|
+
<div className="md:col-span-1 glass-panel rounded-apple-lg p-lg md:sticky md:top-24 md:self-start">
|
|
34
|
+
<AlertFilters
|
|
35
|
+
selectedStatus={selectedStatus} selectedPriority={selectedPriority}
|
|
36
|
+
onStatusChange={setSelectedStatus} onPriorityChange={setSelectedPriority}
|
|
37
|
+
onReset={() => { setSelectedStatus([]); setSelectedPriority([]); }}
|
|
38
|
+
/>
|
|
39
|
+
</div>
|
|
40
|
+
<div className="md:col-span-3">
|
|
41
|
+
<div className="flex items-center gap-md mb-xxl">
|
|
42
|
+
<h1 className="sf-title gradient-text">{t('queue.title')}</h1>
|
|
43
|
+
<Badge color="red" size="sm">{filtered.length}</Badge>
|
|
44
|
+
</div>
|
|
45
|
+
{error && <p role="alert" className="text-apple-red mb-md">{error.message}</p>}
|
|
46
|
+
{filtered.length === 0 ? (
|
|
47
|
+
<EmptyState
|
|
48
|
+
title={t('queue.no_alerts')}
|
|
49
|
+
description={t('queue.all_clear')}
|
|
50
|
+
icon={<ShieldAlert className="w-16 h-16 mx-auto text-apple-green/40" />}
|
|
51
|
+
action={<Button onClick={() => navigate('/')}>Dashboard</Button>}
|
|
52
|
+
/>
|
|
53
|
+
) : (
|
|
54
|
+
<div className="space-y-md">
|
|
55
|
+
{filtered.map((alert) => (
|
|
56
|
+
<AlertCard key={alert.id} alert={alert} onClick={() => navigate(`/alerts/${alert.id}`)} />
|
|
57
|
+
))}
|
|
58
|
+
</div>
|
|
59
|
+
)}
|
|
60
|
+
</div>
|
|
61
|
+
</div>
|
|
62
|
+
);
|
|
63
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { useTranslation } from 'react-i18next';
|
|
3
|
+
import { PageHeader } from '../components/layout/PageHeader';
|
|
4
|
+
import { AreaChartComponent } from '../components/charts/AreaChart';
|
|
5
|
+
import { DonutChart } from '../components/charts/DonutChart';
|
|
6
|
+
import { BarChartComponent } from '../components/charts/BarChart';
|
|
7
|
+
import { useAnalytics } from '../hooks/useAnalytics';
|
|
8
|
+
import { LoadingSpinner } from '../components/ui/LoadingSpinner';
|
|
9
|
+
|
|
10
|
+
export function Analytics() {
|
|
11
|
+
const { t } = useTranslation('analytics');
|
|
12
|
+
const { analytics, loading, error } = useAnalytics();
|
|
13
|
+
|
|
14
|
+
if (loading) {
|
|
15
|
+
return <div className="flex items-center justify-center h-96"><LoadingSpinner /></div>;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
if (error) {
|
|
19
|
+
return <p className="text-apple-red sf-caption" role="alert">{error.message}</p>;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
if (!analytics) {
|
|
23
|
+
return (
|
|
24
|
+
<div>
|
|
25
|
+
<PageHeader title={t('title')} description={t('description')} />
|
|
26
|
+
<div className="glass-panel rounded-apple-lg p-xxl text-center">
|
|
27
|
+
<p className="sf-body text-apple-label-secondary mb-sm">No screening data yet</p>
|
|
28
|
+
<p className="sf-caption text-apple-label-tertiary">Run your first screening to see analytics here.</p>
|
|
29
|
+
</div>
|
|
30
|
+
</div>
|
|
31
|
+
);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
return (
|
|
35
|
+
<div className="space-y-lg">
|
|
36
|
+
<PageHeader title={t('title')} description={t('description')} />
|
|
37
|
+
<div className="grid grid-cols-1 lg:grid-cols-2 gap-lg">
|
|
38
|
+
<div className="glass-panel rounded-apple-lg p-md glow-blue">
|
|
39
|
+
<AreaChartComponent title={t('charts.screening_volume')} data={analytics.screeningVolume} />
|
|
40
|
+
</div>
|
|
41
|
+
<div className="glass-panel rounded-apple-lg p-md glow-green">
|
|
42
|
+
<DonutChart title={t('charts.alert_disposition')} data={analytics.dispositionBreakdown} />
|
|
43
|
+
</div>
|
|
44
|
+
</div>
|
|
45
|
+
<div className="glass-panel rounded-apple-lg p-md glow-orange">
|
|
46
|
+
<BarChartComponent title={t('charts.risk_distribution')} data={analytics.riskDistribution} />
|
|
47
|
+
</div>
|
|
48
|
+
</div>
|
|
49
|
+
);
|
|
50
|
+
}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { useTranslation } from 'react-i18next';
|
|
3
|
+
import { PageHeader } from '../components/layout/PageHeader';
|
|
4
|
+
import { Card } from '../components/ui/Card';
|
|
5
|
+
import { Badge } from '../components/ui/Badge';
|
|
6
|
+
import { useAudit } from '../hooks/useAudit';
|
|
7
|
+
import { LoadingSpinner } from '../components/ui/LoadingSpinner';
|
|
8
|
+
|
|
9
|
+
type BadgeColor = 'blue' | 'green' | 'red' | 'orange' | 'gray' | 'purple'
|
|
10
|
+
|
|
11
|
+
const actionColors: Record<string, BadgeColor> = {
|
|
12
|
+
screen_initiated: 'blue',
|
|
13
|
+
alert_created: 'orange',
|
|
14
|
+
alert_resolved: 'green',
|
|
15
|
+
config_updated: 'purple',
|
|
16
|
+
list_imported: 'blue',
|
|
17
|
+
export_generated: 'green',
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
export function AuditTrail() {
|
|
21
|
+
const { t } = useTranslation('audit');
|
|
22
|
+
const { entries, loading, error } = useAudit();
|
|
23
|
+
|
|
24
|
+
if (loading) {
|
|
25
|
+
return (
|
|
26
|
+
<div className="flex items-center justify-center h-96">
|
|
27
|
+
<LoadingSpinner />
|
|
28
|
+
</div>
|
|
29
|
+
);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
return (
|
|
33
|
+
<div>
|
|
34
|
+
<PageHeader title={t('title')} description={t('description')} />
|
|
35
|
+
{error && <p className="text-apple-red sf-caption mb-md" role="alert">{error.message}</p>}
|
|
36
|
+
<Card>
|
|
37
|
+
{entries.length === 0 && (
|
|
38
|
+
<div className="text-center py-xl">
|
|
39
|
+
<p className="sf-body text-apple-label-secondary mb-sm">No audit entries yet</p>
|
|
40
|
+
<p className="sf-caption text-apple-label-tertiary">Actions will be recorded here as you use the platform.</p>
|
|
41
|
+
</div>
|
|
42
|
+
)}
|
|
43
|
+
<div className="space-y-md">
|
|
44
|
+
{entries.map((entry) => (
|
|
45
|
+
<div key={entry.id} className="flex items-start justify-between p-md bg-apple-bg-tertiary rounded-apple-md">
|
|
46
|
+
<div className="flex-1">
|
|
47
|
+
<div className="flex items-center gap-md mb-xs">
|
|
48
|
+
<Badge color={actionColors[entry.action] ?? 'gray'}>
|
|
49
|
+
{entry.action.replace('_', ' ')}
|
|
50
|
+
</Badge>
|
|
51
|
+
<span className="sf-caption">{entry.actor}</span>
|
|
52
|
+
</div>
|
|
53
|
+
<p className="sf-body">{entry.target}</p>
|
|
54
|
+
<p className="sf-caption mt-xs">
|
|
55
|
+
{new Date(entry.timestamp).toLocaleString()}
|
|
56
|
+
</p>
|
|
57
|
+
</div>
|
|
58
|
+
</div>
|
|
59
|
+
))}
|
|
60
|
+
</div>
|
|
61
|
+
</Card>
|
|
62
|
+
</div>
|
|
63
|
+
);
|
|
64
|
+
}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { useTranslation } from 'react-i18next';
|
|
3
|
+
import { PageHeader } from '../components/layout/PageHeader';
|
|
4
|
+
import { Card } from '../components/ui/Card';
|
|
5
|
+
import { Button } from '../components/ui/Button';
|
|
6
|
+
import { Upload } from 'lucide-react';
|
|
7
|
+
import { useApi } from '../hooks/useApi';
|
|
8
|
+
import { LoadingSpinner } from '../components/ui/LoadingSpinner';
|
|
9
|
+
import { Badge } from '../components/ui/Badge';
|
|
10
|
+
import { api } from '../api/client';
|
|
11
|
+
|
|
12
|
+
interface BatchJob {
|
|
13
|
+
batch_id: string;
|
|
14
|
+
status: string;
|
|
15
|
+
entity_count: number;
|
|
16
|
+
created_at: string;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
type BadgeColor = 'blue' | 'green' | 'red' | 'orange' | 'gray' | 'purple';
|
|
20
|
+
const statusColors: Record<string, BadgeColor> = {
|
|
21
|
+
completed: 'green', running: 'blue',
|
|
22
|
+
pending: 'orange', failed: 'red',
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
export function BatchJobs() {
|
|
26
|
+
const { t } = useTranslation('batch');
|
|
27
|
+
const { data, loading, error } = useApi<{ jobs: BatchJob[] }>(
|
|
28
|
+
() => api.get('/batch'),
|
|
29
|
+
);
|
|
30
|
+
const jobs = data?.jobs ?? [];
|
|
31
|
+
|
|
32
|
+
if (loading) {
|
|
33
|
+
return (
|
|
34
|
+
<div className="flex items-center justify-center h-96">
|
|
35
|
+
<LoadingSpinner />
|
|
36
|
+
</div>
|
|
37
|
+
);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
return (
|
|
41
|
+
<div>
|
|
42
|
+
<PageHeader
|
|
43
|
+
title={t('title')}
|
|
44
|
+
description={t('description')}
|
|
45
|
+
action={
|
|
46
|
+
<Button variant="primary" className="flex items-center gap-sm">
|
|
47
|
+
<Upload className="w-4 h-4" />
|
|
48
|
+
{t('new_job')}
|
|
49
|
+
</Button>
|
|
50
|
+
}
|
|
51
|
+
/>
|
|
52
|
+
{error && <p className="text-apple-red sf-caption mb-md">{error.message}</p>}
|
|
53
|
+
{jobs.length === 0 && !error && (
|
|
54
|
+
<Card>
|
|
55
|
+
<p className="text-center sf-body text-apple-label-secondary py-lg">
|
|
56
|
+
{t('no_jobs', { defaultValue: 'No batch jobs yet. Upload a file to start.' })}
|
|
57
|
+
</p>
|
|
58
|
+
</Card>
|
|
59
|
+
)}
|
|
60
|
+
<div className="space-y-md">
|
|
61
|
+
{jobs.map((job) => (
|
|
62
|
+
<Card key={job.batch_id}>
|
|
63
|
+
<div className="flex items-center justify-between">
|
|
64
|
+
<div>
|
|
65
|
+
<h3 className="sf-headline">{job.batch_id}</h3>
|
|
66
|
+
<p className="sf-caption mt-xs">
|
|
67
|
+
{job.entity_count} entities • {new Date(job.created_at).toLocaleString()}
|
|
68
|
+
</p>
|
|
69
|
+
</div>
|
|
70
|
+
<Badge color={statusColors[job.status] ?? 'orange'}>
|
|
71
|
+
{job.status}
|
|
72
|
+
</Badge>
|
|
73
|
+
</div>
|
|
74
|
+
</Card>
|
|
75
|
+
))}
|
|
76
|
+
</div>
|
|
77
|
+
</div>
|
|
78
|
+
);
|
|
79
|
+
}
|