feat(admin): implement analytics and monitoring center

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

- Business Dashboard: revenue/orders/customers/AOV/top products/low stock/recent activity/warnings/completion% (Overview tab)
- Marketplace Health: real completion checks (images, SEO, categories, reviews, orders, translations, homepage, backend, performance) with clickable recommendations
- Product Analytics: top selling/most reviewed/worst rated/hidden/archived counts; top-viewed honestly marked Unknown (no view tracking exists)
- Customer Analytics: new/returning customers, average spend, retention - derived from real order data
- Search & Traffic tabs: honest 'Unknown - available after backend integration' placeholders, no fabricated numbers
- Recommendations engine: actionable cards (missing images/SEO/category, empty categories, incomplete homepage, unpublished static pages) linking to the relevant admin page
- System Monitoring: added real draft/publish/sync/backend-connectivity state from AdminDashboardFacade
- CSV export extended to top products and health checks; added print action
- New adminAnalytics.* and adminMarketplaceHealth.* i18n namespaces (en/ru/hy), no raw i18n keys
- Reused existing shared UI (app-table/app-badge/app-skeleton/app-empty-state) and content-health-widget completion-meter pattern - no new backend APIs, no storage changes
This commit is contained in:
sdarbinyan
2026-07-18 22:33:36 +04:00
parent 3c9b425203
commit 6af746c561
10 changed files with 1009 additions and 75 deletions

View File

@@ -1594,10 +1594,100 @@ export const en: Translations = {
adminMonitoring: {
eventsEmptyTitle: 'No events found',
eventsEmptyDescription: 'Try a different category filter or search term.',
systemState: 'System state',
backendConnectivity: 'Backend',
connected: 'Connected',
loading: 'Loading',
draftState: 'Draft',
unsavedChanges: 'Unsaved changes',
noDraft: 'No draft',
lastSaved: 'Last saved',
lastPublished: 'Last published',
syncStatus: 'Sync',
},
adminAnalytics: {
topProductsEmptyTitle: 'No product sales in this period',
topProductsEmptyDescription: 'Try a wider date range.',
print: 'Print',
tabsLabel: 'Analytics sections',
tab: {
overview: 'Overview',
health: 'Health',
products: 'Products',
customers: 'Customers',
search: 'Search',
traffic: 'Traffic',
recommendations: 'Recommendations',
},
revenue: 'Revenue',
orders: 'Orders',
customers: 'Customers',
avgOrderValue: 'Avg. Order Value',
conversion: 'Conversion',
completionPercent: 'Completion',
unknown: 'Unknown',
salesChart: 'Sales',
quantitySold: 'Qty sold',
lowStock: 'Low stock',
lowStockEmptyTitle: 'No low-stock products',
quantity: 'Quantity',
status: 'Status',
recentActivity: 'Recent activity',
recentActivityEmptyTitle: 'No recent activity',
activityDraftSaved: 'Draft saved',
activityPublished: 'Published',
warnings: 'Warnings',
topViewed: 'Top viewed',
hiddenProducts: 'Hidden products',
archivedProducts: 'Archived products',
mostReviewed: 'Most reviewed',
worstRated: 'Worst rated',
noReviewedProducts: 'No reviewed products yet',
reviewCount: 'Reviews',
avgRating: 'Avg. rating',
newCustomers: 'New customers',
returningCustomers: 'Returning customers',
averageSpend: 'Average spend',
retention: 'Retention',
searchAnalytics: 'Search analytics',
trafficAnalytics: 'Traffic',
availableAfterBackend: 'Available after backend integration.',
pendingBackend: 'Pending backend',
pendingBackendHint: 'No search-query tracking exists yet.',
funnelsHeatmaps: 'Funnels & heatmaps',
visitors: 'Visitors',
products: 'Products',
categories: 'Categories',
},
adminMarketplaceHealth: {
title: 'Marketplace health',
complete: 'complete',
recommendationsTitle: 'Recommendations',
recommendNone: 'Everything looks good.',
checkImages: 'Products have images',
checkSeo: 'Products have SEO metadata',
checkCategories: 'Categories have products',
checkReviews: 'Reviews are moderated',
checkOrders: 'Orders are processed',
checkTranslations: 'Translations are complete',
checkHomepage: 'Homepage is configured',
checkBackend: 'Backend connectivity',
checkPerformance: 'Performance',
recommendImages: 'Add images to products missing them',
recommendImagesCount: 'Products without images hurt conversion.',
recommendSeo: 'Add SEO metadata to products missing it',
recommendSeoCount: 'Missing SEO titles/descriptions hurt search visibility.',
recommendCategory: 'Assign a category to uncategorized products',
recommendCategoryCount: 'Products without a category are harder to discover.',
recommendEmptyCategories: 'Categories without products',
recommendEmptyCategoriesCount: 'Consider merging or removing empty categories.',
recommendHomepage: 'Homepage is incomplete',
recommendStaticPages: 'Static pages are unpublished',
severity: {
info: 'Info',
warning: 'Warning',
critical: 'Critical',
},
},
adminShell: {
skipToContent: 'Skip to content',