adserver-dashboard 1.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/.ci/staging.yml +191 -0
- package/.dockerignore +117 -0
- package/.env +40 -0
- package/.env.staging +38 -0
- package/.gitlab-ci.yml +16 -0
- package/DEMO_STATUS.md +579 -0
- package/Dockerfile +61 -0
- package/Influence-MW-AdServer-12-02-2026/client/index.html +17 -0
- package/Influence-MW-AdServer-12-02-2026/client/public/favicon.png +0 -0
- package/Influence-MW-AdServer-12-02-2026/client/src/App.tsx +91 -0
- package/Influence-MW-AdServer-12-02-2026/client/src/components/advanced-map-drawer.tsx +1131 -0
- package/Influence-MW-AdServer-12-02-2026/client/src/components/ai-recommendation-panel.tsx +379 -0
- package/Influence-MW-AdServer-12-02-2026/client/src/components/app-sidebar.tsx +183 -0
- package/Influence-MW-AdServer-12-02-2026/client/src/components/auto-optimize-button.tsx +184 -0
- package/Influence-MW-AdServer-12-02-2026/client/src/components/availability-drawer.tsx +385 -0
- package/Influence-MW-AdServer-12-02-2026/client/src/components/brand-insights-panel.tsx +87 -0
- package/Influence-MW-AdServer-12-02-2026/client/src/components/create-agency-drawer.tsx +198 -0
- package/Influence-MW-AdServer-12-02-2026/client/src/components/create-brand-drawer.tsx +275 -0
- package/Influence-MW-AdServer-12-02-2026/client/src/components/creative-assignment.tsx +526 -0
- package/Influence-MW-AdServer-12-02-2026/client/src/components/data-table-toolbar.tsx +148 -0
- package/Influence-MW-AdServer-12-02-2026/client/src/components/data-table.tsx +158 -0
- package/Influence-MW-AdServer-12-02-2026/client/src/components/filter-drawer.tsx +356 -0
- package/Influence-MW-AdServer-12-02-2026/client/src/components/form-insights-panel.tsx +82 -0
- package/Influence-MW-AdServer-12-02-2026/client/src/components/geography-selector.tsx +699 -0
- package/Influence-MW-AdServer-12-02-2026/client/src/components/header-user-menu.tsx +178 -0
- package/Influence-MW-AdServer-12-02-2026/client/src/components/history-drawer.tsx +313 -0
- package/Influence-MW-AdServer-12-02-2026/client/src/components/inventory-availability-section.tsx +176 -0
- package/Influence-MW-AdServer-12-02-2026/client/src/components/inventory-format-drawer.tsx +173 -0
- package/Influence-MW-AdServer-12-02-2026/client/src/components/inventory-selector.tsx +401 -0
- package/Influence-MW-AdServer-12-02-2026/client/src/components/manual-inventory-drawer.tsx +368 -0
- package/Influence-MW-AdServer-12-02-2026/client/src/components/mapbox-map.tsx +368 -0
- package/Influence-MW-AdServer-12-02-2026/client/src/components/market-insights-panel.tsx +202 -0
- package/Influence-MW-AdServer-12-02-2026/client/src/components/media-owner-drawer.tsx +217 -0
- package/Influence-MW-AdServer-12-02-2026/client/src/components/metric-card.tsx +58 -0
- package/Influence-MW-AdServer-12-02-2026/client/src/components/page-header.tsx +27 -0
- package/Influence-MW-AdServer-12-02-2026/client/src/components/player-status-indicator.tsx +137 -0
- package/Influence-MW-AdServer-12-02-2026/client/src/components/poi-targeting-drawer.tsx +298 -0
- package/Influence-MW-AdServer-12-02-2026/client/src/components/recommendation-score-badge.tsx +102 -0
- package/Influence-MW-AdServer-12-02-2026/client/src/components/recommended-inventories-panel.tsx +248 -0
- package/Influence-MW-AdServer-12-02-2026/client/src/components/searchable-combobox.tsx +134 -0
- package/Influence-MW-AdServer-12-02-2026/client/src/components/signal-visualizations.tsx +407 -0
- package/Influence-MW-AdServer-12-02-2026/client/src/components/status-badge.tsx +35 -0
- package/Influence-MW-AdServer-12-02-2026/client/src/components/theme-provider.tsx +73 -0
- package/Influence-MW-AdServer-12-02-2026/client/src/components/theme-toggle.tsx +37 -0
- package/Influence-MW-AdServer-12-02-2026/client/src/components/traffic-slider.tsx +75 -0
- package/Influence-MW-AdServer-12-02-2026/client/src/components/ui/accordion.tsx +56 -0
- package/Influence-MW-AdServer-12-02-2026/client/src/components/ui/alert-dialog.tsx +139 -0
- package/Influence-MW-AdServer-12-02-2026/client/src/components/ui/alert.tsx +59 -0
- package/Influence-MW-AdServer-12-02-2026/client/src/components/ui/aspect-ratio.tsx +5 -0
- package/Influence-MW-AdServer-12-02-2026/client/src/components/ui/avatar.tsx +51 -0
- package/Influence-MW-AdServer-12-02-2026/client/src/components/ui/badge.tsx +38 -0
- package/Influence-MW-AdServer-12-02-2026/client/src/components/ui/breadcrumb.tsx +115 -0
- package/Influence-MW-AdServer-12-02-2026/client/src/components/ui/button.tsx +62 -0
- package/Influence-MW-AdServer-12-02-2026/client/src/components/ui/calendar.tsx +68 -0
- package/Influence-MW-AdServer-12-02-2026/client/src/components/ui/card.tsx +85 -0
- package/Influence-MW-AdServer-12-02-2026/client/src/components/ui/carousel.tsx +260 -0
- package/Influence-MW-AdServer-12-02-2026/client/src/components/ui/chart.tsx +365 -0
- package/Influence-MW-AdServer-12-02-2026/client/src/components/ui/checkbox.tsx +28 -0
- package/Influence-MW-AdServer-12-02-2026/client/src/components/ui/collapsible.tsx +11 -0
- package/Influence-MW-AdServer-12-02-2026/client/src/components/ui/command.tsx +151 -0
- package/Influence-MW-AdServer-12-02-2026/client/src/components/ui/context-menu.tsx +198 -0
- package/Influence-MW-AdServer-12-02-2026/client/src/components/ui/dialog.tsx +122 -0
- package/Influence-MW-AdServer-12-02-2026/client/src/components/ui/drawer.tsx +118 -0
- package/Influence-MW-AdServer-12-02-2026/client/src/components/ui/dropdown-menu.tsx +198 -0
- package/Influence-MW-AdServer-12-02-2026/client/src/components/ui/form.tsx +178 -0
- package/Influence-MW-AdServer-12-02-2026/client/src/components/ui/hover-card.tsx +29 -0
- package/Influence-MW-AdServer-12-02-2026/client/src/components/ui/input-otp.tsx +69 -0
- package/Influence-MW-AdServer-12-02-2026/client/src/components/ui/input.tsx +23 -0
- package/Influence-MW-AdServer-12-02-2026/client/src/components/ui/label.tsx +24 -0
- package/Influence-MW-AdServer-12-02-2026/client/src/components/ui/menubar.tsx +256 -0
- package/Influence-MW-AdServer-12-02-2026/client/src/components/ui/navigation-menu.tsx +128 -0
- package/Influence-MW-AdServer-12-02-2026/client/src/components/ui/pagination.tsx +117 -0
- package/Influence-MW-AdServer-12-02-2026/client/src/components/ui/popover.tsx +29 -0
- package/Influence-MW-AdServer-12-02-2026/client/src/components/ui/progress.tsx +28 -0
- package/Influence-MW-AdServer-12-02-2026/client/src/components/ui/radio-group.tsx +42 -0
- package/Influence-MW-AdServer-12-02-2026/client/src/components/ui/resizable.tsx +45 -0
- package/Influence-MW-AdServer-12-02-2026/client/src/components/ui/scroll-area.tsx +46 -0
- package/Influence-MW-AdServer-12-02-2026/client/src/components/ui/select.tsx +160 -0
- package/Influence-MW-AdServer-12-02-2026/client/src/components/ui/separator.tsx +29 -0
- package/Influence-MW-AdServer-12-02-2026/client/src/components/ui/sheet.tsx +140 -0
- package/Influence-MW-AdServer-12-02-2026/client/src/components/ui/sidebar.tsx +727 -0
- package/Influence-MW-AdServer-12-02-2026/client/src/components/ui/skeleton.tsx +15 -0
- package/Influence-MW-AdServer-12-02-2026/client/src/components/ui/slider.tsx +26 -0
- package/Influence-MW-AdServer-12-02-2026/client/src/components/ui/switch.tsx +27 -0
- package/Influence-MW-AdServer-12-02-2026/client/src/components/ui/table.tsx +117 -0
- package/Influence-MW-AdServer-12-02-2026/client/src/components/ui/tabs.tsx +53 -0
- package/Influence-MW-AdServer-12-02-2026/client/src/components/ui/textarea.tsx +22 -0
- package/Influence-MW-AdServer-12-02-2026/client/src/components/ui/toast.tsx +127 -0
- package/Influence-MW-AdServer-12-02-2026/client/src/components/ui/toaster.tsx +33 -0
- package/Influence-MW-AdServer-12-02-2026/client/src/components/ui/toggle-group.tsx +61 -0
- package/Influence-MW-AdServer-12-02-2026/client/src/components/ui/toggle.tsx +43 -0
- package/Influence-MW-AdServer-12-02-2026/client/src/components/ui/tooltip.tsx +30 -0
- package/Influence-MW-AdServer-12-02-2026/client/src/components/vendor-stores-modal.tsx +336 -0
- package/Influence-MW-AdServer-12-02-2026/client/src/components/venue-type-drawer.tsx +359 -0
- package/Influence-MW-AdServer-12-02-2026/client/src/components/venue-type-selector.tsx +436 -0
- package/Influence-MW-AdServer-12-02-2026/client/src/hooks/use-mobile.tsx +19 -0
- package/Influence-MW-AdServer-12-02-2026/client/src/hooks/use-toast.ts +191 -0
- package/Influence-MW-AdServer-12-02-2026/client/src/index.css +244 -0
- package/Influence-MW-AdServer-12-02-2026/client/src/lib/queryClient.ts +57 -0
- package/Influence-MW-AdServer-12-02-2026/client/src/lib/utils.ts +39 -0
- package/Influence-MW-AdServer-12-02-2026/client/src/lib/venue-taxonomy.ts +532 -0
- package/Influence-MW-AdServer-12-02-2026/client/src/main.tsx +5 -0
- package/Influence-MW-AdServer-12-02-2026/client/src/pages/assign-creative.tsx +781 -0
- package/Influence-MW-AdServer-12-02-2026/client/src/pages/content-hub.tsx +995 -0
- package/Influence-MW-AdServer-12-02-2026/client/src/pages/custom-pois.tsx +431 -0
- package/Influence-MW-AdServer-12-02-2026/client/src/pages/dashboard.tsx +620 -0
- package/Influence-MW-AdServer-12-02-2026/client/src/pages/deal-detail.tsx +1062 -0
- package/Influence-MW-AdServer-12-02-2026/client/src/pages/deal-form.tsx +1570 -0
- package/Influence-MW-AdServer-12-02-2026/client/src/pages/deals.tsx +716 -0
- package/Influence-MW-AdServer-12-02-2026/client/src/pages/edit-creative-assignment.tsx +1051 -0
- package/Influence-MW-AdServer-12-02-2026/client/src/pages/geotargeting.tsx +675 -0
- package/Influence-MW-AdServer-12-02-2026/client/src/pages/integrations.tsx +425 -0
- package/Influence-MW-AdServer-12-02-2026/client/src/pages/line-item-creatives.tsx +622 -0
- package/Influence-MW-AdServer-12-02-2026/client/src/pages/line-item-form.tsx +3132 -0
- package/Influence-MW-AdServer-12-02-2026/client/src/pages/line-items.tsx +530 -0
- package/Influence-MW-AdServer-12-02-2026/client/src/pages/not-found.tsx +21 -0
- package/Influence-MW-AdServer-12-02-2026/client/src/pages/proof-of-play-upload.tsx +479 -0
- package/Influence-MW-AdServer-12-02-2026/client/src/pages/proof-of-play.tsx +880 -0
- package/Influence-MW-AdServer-12-02-2026/client/src/pages/reports.tsx +235 -0
- package/Influence-MW-AdServer-12-02-2026/client/src/pages/settings.tsx +652 -0
- package/Influence-MW-AdServer-12-02-2026/client/src/pages/signal-form.tsx +1117 -0
- package/Influence-MW-AdServer-12-02-2026/client/src/pages/signals.tsx +366 -0
- package/Influence-MW-AdServer-12-02-2026/client/src/pages/tags.tsx +332 -0
- package/Influence-MW-AdServer-12-02-2026/client/src/pages/venues.tsx +381 -0
- package/Influence-MW-AdServer-12-02-2026/client/src/types/mapbox-gl-draw.d.ts +37 -0
- package/Influence-MW-AdServer-12-02-2026/client/src/types/react-simple-maps.d.ts +57 -0
- package/Influence-MW-AdServer-12-02-2026/components.json +20 -0
- package/Influence-MW-AdServer-12-02-2026/docs/PRD.md +3373 -0
- package/Influence-MW-AdServer-12-02-2026/docs/influence-feature-mapping.csv +498 -0
- package/Influence-MW-AdServer-12-02-2026/drizzle.config.ts +14 -0
- package/Influence-MW-AdServer-12-02-2026/package-lock.json +9672 -0
- package/Influence-MW-AdServer-12-02-2026/package.json +118 -0
- package/Influence-MW-AdServer-12-02-2026/postcss.config.js +6 -0
- package/Influence-MW-AdServer-12-02-2026/replit.md +91 -0
- package/Influence-MW-AdServer-12-02-2026/script/build.ts +67 -0
- package/Influence-MW-AdServer-12-02-2026/scripts/create-miro-diagrams.cjs +318 -0
- package/Influence-MW-AdServer-12-02-2026/scripts/create-remaining-diagrams.cjs +270 -0
- package/Influence-MW-AdServer-12-02-2026/server/index.ts +103 -0
- package/Influence-MW-AdServer-12-02-2026/server/recommendation-service.ts +319 -0
- package/Influence-MW-AdServer-12-02-2026/server/routes.ts +1890 -0
- package/Influence-MW-AdServer-12-02-2026/server/static.ts +19 -0
- package/Influence-MW-AdServer-12-02-2026/server/storage.ts +2058 -0
- package/Influence-MW-AdServer-12-02-2026/server/vite.ts +58 -0
- package/Influence-MW-AdServer-12-02-2026/shared/schema.ts +1595 -0
- package/Influence-MW-AdServer-12-02-2026/tailwind.config.ts +107 -0
- package/Influence-MW-AdServer-12-02-2026/tsconfig.json +23 -0
- package/Influence-MW-AdServer-12-02-2026/vite.config.ts +40 -0
- package/LINE_ITEM_BUDGET_FIELD_MAPPING.md +178 -0
- package/PCM/.env.example +92 -0
- package/PCM/README.md +558 -0
- package/PCM/docs/TEST_CASES.md +422 -0
- package/PCM/index.js +106 -0
- package/PCM/package-lock.json +3282 -0
- package/PCM/package.json +32 -0
- package/PCM/replit.md +64 -0
- package/PCM/schema.sql +495 -0
- package/PCM/scripts/export-schema.js +183 -0
- package/PCM/scripts/seed-comprehensive.js +631 -0
- package/PCM/scripts/seed-production.js +477 -0
- package/PCM/src/config/db.js +56 -0
- package/PCM/src/config/swagger.js +5975 -0
- package/PCM/src/dto/EmailRequestDTO.js +166 -0
- package/PCM/src/middleware/errorHandler.js +52 -0
- package/PCM/src/middleware/logger.js +26 -0
- package/PCM/src/migrations/001_add_campaign_mode_fields.sql +36 -0
- package/PCM/src/migrations/002_create_deal_id_counters.sql +22 -0
- package/PCM/src/migrations/003_update_publishers_column.sql +15 -0
- package/PCM/src/migrations/004_add_direct_dealtype_and_advertiser.sql +5 -0
- package/PCM/src/migrations/005_add_programmatic_fields_and_update_enums.sql +31 -0
- package/PCM/src/migrations/006_add_line_item_programmatic_fields.sql +12 -0
- package/PCM/src/migrations/007_add_line_item_direct_fields.sql +15 -0
- package/PCM/src/migrations/008_add_inventory_fields.sql +45 -0
- package/PCM/src/migrations/009_move_inventory_fields_to_metadata.sql +32 -0
- package/PCM/src/migrations/010_add_draft_status_and_line_items_count.sql +23 -0
- package/PCM/src/migrations/011_add_planning_field.sql +21 -0
- package/PCM/src/migrations/012_fix_inventory_composite_pk.sql +17 -0
- package/PCM/src/migrations/013_make_external_id_optional.sql +3 -0
- package/PCM/src/migrations/014_create_change_history.sql +38 -0
- package/PCM/src/migrations/016_create_publisher_insertion_orders.sql +33 -0
- package/PCM/src/migrations/017_fix_line_item_id_fk_reference.sql +86 -0
- package/PCM/src/migrations/018_create_approval_tables.sql +44 -0
- package/PCM/src/migrations/019_add_encrypted_token_column.sql +2 -0
- package/PCM/src/migrations/020_add_rejection_reason_to_deals.sql +10 -0
- package/PCM/src/migrations/021_add_publisher_external_id_to_inventories.sql +12 -0
- package/PCM/src/migrations/022_add_line_item_extended_fields.sql +24 -0
- package/PCM/src/migrations/023_add_base_price_fields.sql +8 -0
- package/PCM/src/migrations/run-migrations.js +46 -0
- package/PCM/src/models/ApprovalOTP.js +51 -0
- package/PCM/src/models/ApprovalToken.js +79 -0
- package/PCM/src/models/ChangeHistory.js +107 -0
- package/PCM/src/models/Deal.js +186 -0
- package/PCM/src/models/DealIdCounter.js +28 -0
- package/PCM/src/models/LineItem.js +227 -0
- package/PCM/src/models/LineItemCreative.js +89 -0
- package/PCM/src/models/LineItemInventory.js +115 -0
- package/PCM/src/models/PublisherInsertionOrder.js +93 -0
- package/PCM/src/models/TransactionHistory.js +34 -0
- package/PCM/src/models/associations.js +81 -0
- package/PCM/src/routes/approval.js +321 -0
- package/PCM/src/routes/creatives.js +437 -0
- package/PCM/src/routes/deals.js +1638 -0
- package/PCM/src/routes/digitalSignage.js +242 -0
- package/PCM/src/routes/insertionOrders.js +380 -0
- package/PCM/src/routes/lineItems.js +926 -0
- package/PCM/src/routes/system.js +384 -0
- package/PCM/src/services/ApprovalService.js +885 -0
- package/PCM/src/services/CampaignImportConverter.js +631 -0
- package/PCM/src/services/CampaignModeService.js +273 -0
- package/PCM/src/services/CampaignStatusService.js +395 -0
- package/PCM/src/services/ChangeHistoryService.js +316 -0
- package/PCM/src/services/DealIdService.js +94 -0
- package/PCM/src/services/DealResponseFormatter.js +90 -0
- package/PCM/src/services/EmailNotificationService.js +315 -0
- package/PCM/src/services/LineItemResponseFormatter.js +122 -0
- package/PCM/src/services/LineItemStatusService.js +380 -0
- package/PCM/src/tests/comprehensiveTestRunner.js +360 -0
- package/PCM/src/tests/comprehensiveTests.js +1277 -0
- package/PCM/src/tests/dealTypeUnitTests.js +1058 -0
- package/PCM/src/tests/testRunner.js +248 -0
- package/PCM/src/utils/caseConverter.js +92 -0
- package/PCM/src/utils/dealCalculations.js +206 -0
- package/PCM/src/utils/lineItemPayloadNormalizer.js +41 -0
- package/PCM/src/utils/payloadNormalizer.js +34 -0
- package/PCM/src/utils/sourceNormalizer.js +56 -0
- package/PCM/src/validators/creativeValidator.js +27 -0
- package/PCM/src/validators/dealValidator.js +203 -0
- package/PCM/src/validators/lineItemValidator.js +489 -0
- package/PCM/tests/approval-flows.test.js +238 -0
- package/PCM/tests/approval-workflow.test.js +291 -0
- package/PCM/tests/campaign-import-converter.test.js +543 -0
- package/PCM/tests/campaign-import-e2e.test.js +520 -0
- package/PCM/tests/campaign-status.test.js +539 -0
- package/PCM/tests/direct-publisher-split-reimport.test.js +460 -0
- package/PCM/tests/e2e/digital-signage.test.js +145 -0
- package/PCM/tests/e2e/search-filter-pagination.test.js +399 -0
- package/PCM/tests/e2e-comprehensive.test.js +3446 -0
- package/PCM/tests/edge-cases.test.js +340 -0
- package/PCM/tests/line-item-status.test.js +340 -0
- package/PCM/tests/seller-account-external-ids.test.js +877 -0
- package/PCM/tests/source-validation.test.js +324 -0
- package/PRD.md +3373 -0
- package/README.md +186 -0
- package/client/index.html +35 -0
- package/client/public/DEMO_STATUS.md +579 -0
- package/client/public/img/MW-logo-trans_1754045676555.png +0 -0
- package/client/public/locales/ar/approval.json +144 -0
- package/client/public/locales/ar/buyer.json +61 -0
- package/client/public/locales/ar/campaigns.json +1 -0
- package/client/public/locales/ar/common.json +218 -0
- package/client/public/locales/ar/contentHub.json +266 -0
- package/client/public/locales/ar/creatives.json +79 -0
- package/client/public/locales/ar/dashboard.json +57 -0
- package/client/public/locales/ar/deals.json +886 -0
- package/client/public/locales/ar/dsp.json +131 -0
- package/client/public/locales/ar/inventory.json +201 -0
- package/client/public/locales/ar/lineItems.json +553 -0
- package/client/public/locales/ar/navigation.json +48 -0
- package/client/public/locales/ar/wizard.json +1 -0
- package/client/public/locales/en/approval.json +144 -0
- package/client/public/locales/en/buyer.json +65 -0
- package/client/public/locales/en/campaigns.json +1 -0
- package/client/public/locales/en/common.json +218 -0
- package/client/public/locales/en/contentHub.json +266 -0
- package/client/public/locales/en/creatives.json +79 -0
- package/client/public/locales/en/dashboard.json +57 -0
- package/client/public/locales/en/deals.json +886 -0
- package/client/public/locales/en/dsp.json +131 -0
- package/client/public/locales/en/inventory.json +201 -0
- package/client/public/locales/en/lineItems.json +659 -0
- package/client/public/locales/en/navigation.json +48 -0
- package/client/public/locales/en/wizard.json +1 -0
- package/client/public/locales/ja/approval.json +144 -0
- package/client/public/locales/ja/buyer.json +61 -0
- package/client/public/locales/ja/campaigns.json +1 -0
- package/client/public/locales/ja/common.json +218 -0
- package/client/public/locales/ja/contentHub.json +266 -0
- package/client/public/locales/ja/creatives.json +79 -0
- package/client/public/locales/ja/dashboard.json +57 -0
- package/client/public/locales/ja/deals.json +886 -0
- package/client/public/locales/ja/dsp.json +131 -0
- package/client/public/locales/ja/inventory.json +201 -0
- package/client/public/locales/ja/lineItems.json +553 -0
- package/client/public/locales/ja/navigation.json +48 -0
- package/client/public/locales/ja/wizard.json +1 -0
- package/client/public/locales/zh/approval.json +144 -0
- package/client/public/locales/zh/buyer.json +61 -0
- package/client/public/locales/zh/campaigns.json +1 -0
- package/client/public/locales/zh/common.json +218 -0
- package/client/public/locales/zh/contentHub.json +266 -0
- package/client/public/locales/zh/creatives.json +79 -0
- package/client/public/locales/zh/dashboard.json +57 -0
- package/client/public/locales/zh/deals.json +886 -0
- package/client/public/locales/zh/dsp.json +131 -0
- package/client/public/locales/zh/inventory.json +201 -0
- package/client/public/locales/zh/lineItems.json +553 -0
- package/client/public/locales/zh/navigation.json +48 -0
- package/client/public/locales/zh/wizard.json +1 -0
- package/client/public/manifest.json +36 -0
- package/client/src/App.tsx +464 -0
- package/client/src/components/app-sidebar.tsx +312 -0
- package/client/src/components/approval/approval-decision-form.test.tsx +294 -0
- package/client/src/components/approval/approval-decision-form.tsx +326 -0
- package/client/src/components/approval/approval-sheet.tsx +631 -0
- package/client/src/components/approval/line-item-details-sheet.tsx +371 -0
- package/client/src/components/approval/otp-verification.test.tsx +337 -0
- package/client/src/components/approval/otp-verification.tsx +180 -0
- package/client/src/components/content-hub/bulk-transcode-dialog.tsx +379 -0
- package/client/src/components/content-hub/content-hub-manager-v2.tsx +574 -0
- package/client/src/components/content-hub/content-hub-manager.tsx +330 -0
- package/client/src/components/content-hub/creative-card.tsx +456 -0
- package/client/src/components/content-hub/creative-detail-sheet.tsx +685 -0
- package/client/src/components/content-hub/creative-filters.tsx +457 -0
- package/client/src/components/content-hub/creative-grid.tsx +329 -0
- package/client/src/components/content-hub/creative-selector.tsx +415 -0
- package/client/src/components/content-hub/creative-upload.tsx +547 -0
- package/client/src/components/content-hub/folder-dialogs.tsx +445 -0
- package/client/src/components/content-hub/folder-list.tsx +280 -0
- package/client/src/components/content-hub/review-dialogs.tsx +268 -0
- package/client/src/components/content-hub/transcode-dialog.tsx +226 -0
- package/client/src/components/creative-library/creative-details-view.tsx +446 -0
- package/client/src/components/creative-library/creative-filters-panel.tsx +203 -0
- package/client/src/components/creative-library/creative-list.tsx +360 -0
- package/client/src/components/creative-library/creative-status-badge.tsx +71 -0
- package/client/src/components/creative-library/folder-card.tsx +78 -0
- package/client/src/components/creative-library/index.ts +27 -0
- package/client/src/components/creative-library/new-creative-card.tsx +211 -0
- package/client/src/components/creative-library/upload-creative-dialog.tsx +261 -0
- package/client/src/components/dashboard-overview.tsx +109 -0
- package/client/src/components/deals/approval-history-panel.test.tsx +240 -0
- package/client/src/components/deals/approval-history-panel.tsx +156 -0
- package/client/src/components/deals/deal-status-badge.tsx +92 -0
- package/client/src/components/deals/import-from-planner-dialog.tsx +399 -0
- package/client/src/components/deals/market-insights-panel.tsx +237 -0
- package/client/src/components/deals/reopen-deal-sheet.tsx +191 -0
- package/client/src/components/deals/request-approval-sheet.test.tsx +323 -0
- package/client/src/components/deals/request-approval-sheet.tsx +136 -0
- package/client/src/components/deals/resend-approval-sheet.tsx +201 -0
- package/client/src/components/direct-campaigns/campaign-card.tsx +283 -0
- package/client/src/components/direct-campaigns/deal-filter-panel.tsx +325 -0
- package/client/src/components/inventory/advanced-filters-panel.tsx +273 -0
- package/client/src/components/inventory/csv-upload-modal.tsx +639 -0
- package/client/src/components/inventory/inventory-availability-view.tsx +486 -0
- package/client/src/components/inventory/inventory-details-sheet.tsx +376 -0
- package/client/src/components/inventory/inventory-map-view.tsx +596 -0
- package/client/src/components/inventory/inventory-settings-menu.tsx +52 -0
- package/client/src/components/language-switcher.tsx +53 -0
- package/client/src/components/line-items/campaign-forecast-panel.tsx +138 -0
- package/client/src/components/line-items/form-insights.tsx +89 -0
- package/client/src/components/line-items/geofencing/LocationCsvUploadDrawer.tsx +100 -0
- package/client/src/components/line-items/geofencing/POIDropdown.tsx +379 -0
- package/client/src/components/line-items/geofencing/SelectedLocationsSidebar.tsx +436 -0
- package/client/src/components/line-items/geofencing/ViewFileLocationDrawer.tsx +199 -0
- package/client/src/components/line-items/geofencing/components/ExistingFilesTab.tsx +268 -0
- package/client/src/components/line-items/geofencing/components/TemplateDownloadSection.tsx +59 -0
- package/client/src/components/line-items/geofencing/components/UploadTab.tsx +215 -0
- package/client/src/components/line-items/geofencing-map.tsx +1270 -0
- package/client/src/components/line-items/inventory-availability-section.tsx +178 -0
- package/client/src/components/line-items/line-item-schedule-manager.tsx +313 -0
- package/client/src/components/line-items/manual-inventory-drawer.tsx +346 -0
- package/client/src/components/line-items/planner-inventory-card.tsx +495 -0
- package/client/src/components/line-items/planner-schedule-grid.tsx +495 -0
- package/client/src/components/line-items/schedule-rule-editor.tsx +649 -0
- package/client/src/components/line-items/schedule-rule-types.ts +122 -0
- package/client/src/components/line-items/steps/creatives-step.tsx +681 -0
- package/client/src/components/line-items/steps/inventory-schedule-step.tsx +1596 -0
- package/client/src/components/line-items/steps/inventory-step.tsx +1533 -0
- package/client/src/components/line-items/steps/line-item-details-step.tsx +916 -0
- package/client/src/components/line-items/steps/schedule-step.tsx +273 -0
- package/client/src/components/line-items/steps/summary-step.tsx +680 -0
- package/client/src/components/line-items/steps/targeting-step.tsx +1708 -0
- package/client/src/components/product-switcher.tsx +105 -0
- package/client/src/components/protected-route.tsx +49 -0
- package/client/src/components/skip-link.tsx +22 -0
- package/client/src/components/stat-card.tsx +53 -0
- package/client/src/components/status-badge.tsx +96 -0
- package/client/src/components/ui/hierarchical-venue-selector.tsx +389 -0
- package/client/src/components/ui/toaster.tsx +111 -0
- package/client/src/contexts/auth-context.tsx +181 -0
- package/client/src/contexts/sidebar-state.tsx +50 -0
- package/client/src/contexts/theme-context.tsx +66 -0
- package/client/src/data/campaign-data.json +107 -0
- package/client/src/data/countries.json +22 -0
- package/client/src/hooks/use-approval.ts +366 -0
- package/client/src/hooks/use-keyboard-shortcuts.ts +74 -0
- package/client/src/hooks/use-media-query.ts +46 -0
- package/client/src/hooks/use-mobile.tsx +19 -0
- package/client/src/hooks/use-page-title.ts +21 -0
- package/client/src/hooks/use-toast.ts +195 -0
- package/client/src/index.css +694 -0
- package/client/src/lib/__tests__/accessibility.test.ts +104 -0
- package/client/src/lib/__tests__/date-utils.test.ts +199 -0
- package/client/src/lib/__tests__/dsp-buyer-api.test.ts +127 -0
- package/client/src/lib/__tests__/dsp-buyer-integration.test.ts +247 -0
- package/client/src/lib/__tests__/storage-utils.test.ts +167 -0
- package/client/src/lib/__tests__/utils.test.ts +57 -0
- package/client/src/lib/accessibility.ts +141 -0
- package/client/src/lib/api-config.ts +9 -0
- package/client/src/lib/auth-service.ts +209 -0
- package/client/src/lib/campaign-creative-api.ts +82 -0
- package/client/src/lib/company-api.ts +61 -0
- package/client/src/lib/content-hub-api.ts +407 -0
- package/client/src/lib/creative-mapper.ts +61 -0
- package/client/src/lib/date-utils.ts +119 -0
- package/client/src/lib/deal-helpers.ts +220 -0
- package/client/src/lib/dsp-buyer-api.ts +196 -0
- package/client/src/lib/geo-import-api.ts +151 -0
- package/client/src/lib/google-poi-api.ts +305 -0
- package/client/src/lib/i18n/__tests__/formatting.test.ts +202 -0
- package/client/src/lib/i18n/formatting.ts +130 -0
- package/client/src/lib/i18n/index.ts +8 -0
- package/client/src/lib/i18n-compat.ts +76 -0
- package/client/src/lib/influence-deals-api.ts +896 -0
- package/client/src/lib/inventory-api.ts +399 -0
- package/client/src/lib/oauth-service.ts +678 -0
- package/client/src/lib/poi-types.ts +75 -0
- package/client/src/lib/queryClient.ts +144 -0
- package/client/src/lib/recommendation-api.ts +380 -0
- package/client/src/lib/storage-utils.ts +104 -0
- package/client/src/lib/tolgee.ts +85 -0
- package/client/src/lib/utils.ts +0 -0
- package/client/src/main.tsx +67 -0
- package/client/src/mapbox-draw-modes.d.ts +32 -0
- package/client/src/pages/all-folders.tsx +203 -0
- package/client/src/pages/auth-callback.tsx +115 -0
- package/client/src/pages/buyer-form.tsx +339 -0
- package/client/src/pages/buyer-list.tsx +622 -0
- package/client/src/pages/content-hub.tsx +1358 -0
- package/client/src/pages/create-deal.tsx +2093 -0
- package/client/src/pages/creative-assignment-page.tsx +548 -0
- package/client/src/pages/creatives.tsx +5 -0
- package/client/src/pages/custom-pois.tsx +425 -0
- package/client/src/pages/dashboard.tsx +615 -0
- package/client/src/pages/deal-history.tsx +434 -0
- package/client/src/pages/deal-line-items.tsx +1703 -0
- package/client/src/pages/demo-status.tsx +113 -0
- package/client/src/pages/direct-campaign-details.tsx +361 -0
- package/client/src/pages/direct-campaigns-new.tsx +824 -0
- package/client/src/pages/dsp-form.tsx +803 -0
- package/client/src/pages/dsp-list.tsx +239 -0
- package/client/src/pages/folder-content.tsx +336 -0
- package/client/src/pages/integrations.tsx +429 -0
- package/client/src/pages/line-item-creatives.tsx +789 -0
- package/client/src/pages/line-item-detail-page.tsx +684 -0
- package/client/src/pages/line-item-form-page.tsx +3261 -0
- package/client/src/pages/line-item-wizard.tsx +1207 -0
- package/client/src/pages/login.tsx +154 -0
- package/client/src/pages/not-found.tsx +23 -0
- package/client/src/pages/proof-of-play.tsx +397 -0
- package/client/src/pages/public-approval.tsx +551 -0
- package/client/src/pages/reports.tsx +231 -0
- package/client/src/pages/settings.tsx +760 -0
- package/client/src/pages/signals.tsx +389 -0
- package/client/src/pages/tags.tsx +318 -0
- package/client/src/pages/test-results.tsx +328 -0
- package/client/src/store/hooks.ts +5 -0
- package/client/src/store/index.ts +15 -0
- package/client/src/store/mapMarkerLocationsSlice.ts +241 -0
- package/client/src/styles/design-tokens.css +324 -0
- package/client/src/test/setup.ts +261 -0
- package/client/src/test/test-utils.tsx +40 -0
- package/client/src/types/approval.ts +221 -0
- package/client/src/types/content-hub.ts +209 -0
- package/client/src/types/geofencing.ts +67 -0
- package/client/src/types/transcoding.ts +140 -0
- package/client/src/vite-env.d.ts +18 -0
- package/components.json +20 -0
- package/creative-api.json +1 -0
- package/docs/AI_REFERENCE.md +459 -0
- package/docs/MWDesign-Prompt.md +132 -0
- package/docs/MWDesign-System.md +344 -0
- package/docs/test-plan.md +277 -0
- package/e2e/AUTONOMOUS-TESTING.md +406 -0
- package/e2e/README.md +219 -0
- package/e2e/autonomous-flow.spec.ts +308 -0
- package/e2e/debug-sso.spec.ts +163 -0
- package/e2e/direct-campaigns.spec.ts +219 -0
- package/e2e/explore-sso.spec.ts +149 -0
- package/e2e/fixtures/auth.ts +26 -0
- package/e2e/fixtures/enhanced-test.ts +331 -0
- package/e2e/pagination.spec.ts +280 -0
- package/e2e/view-toggle.spec.ts +312 -0
- package/generated-icon.png +0 -0
- package/i18next-scanner.config.cjs +46 -0
- package/package.json +141 -0
- package/playwright.config.ts +93 -0
- package/postcss.config.js +6 -0
- package/replit.md +196 -0
- package/screenshot-after-login.png +0 -0
- package/screenshot-contenthub-grid.png +0 -0
- package/screenshot-contenthub-list-fixed.png +0 -0
- package/screenshot-contenthub-list.png +0 -0
- package/screenshot-create-deal.png +0 -0
- package/screenshot-dashboard.png +0 -0
- package/screenshot-deals.png +0 -0
- package/screenshot-login-filled.png +0 -0
- package/screenshot-login.png +0 -0
- package/screenshot.mjs +24 -0
- package/scripts/deploy-stg.sh +185 -0
- package/shared/direct-io-schema.ts +383 -0
- package/shared/schema.ts +439 -0
- package/shared/screen-types.ts +149 -0
- package/springdocDefault.json +1 -0
- package/swagger-ui-bundle.js +2 -0
- package/swagger-ui-init.js +10316 -0
- package/tailwind.config.ts +282 -0
- package/terraform/README.md +306 -0
- package/terraform/cloudfront.tf +289 -0
- package/terraform/ecs.tf +727 -0
- package/terraform/environments/dev.tfvars +59 -0
- package/terraform/environments/production.tfvars +60 -0
- package/terraform/main.tf +47 -0
- package/terraform/outputs.tf +145 -0
- package/terraform/s3.tf +192 -0
- package/terraform/variables.tf +226 -0
- package/terraform/waf.tf +165 -0
- package/terraform-frontend/.terraform.lock.hcl +25 -0
- package/terraform-frontend/README.md +85 -0
- package/terraform-frontend/cloudfront.tf +125 -0
- package/terraform-frontend/main.tf +31 -0
- package/terraform-frontend/outputs.tf +24 -0
- package/terraform-frontend/terraform.tfvars +12 -0
- package/terraform-frontend/variables.tf +53 -0
- package/tsconfig.json +23 -0
- package/vite.config.ts +226 -0
- package/vitest.config.ts +56 -0
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
import { useState } from 'react';
|
|
2
|
+
import { SlidersHorizontal } from 'lucide-react';
|
|
3
|
+
import { Button } from "@moving-walls/design-system";
|
|
4
|
+
import { Sheet, SheetContent, SheetHeader, SheetTitle, SheetTrigger } from "@moving-walls/design-system";
|
|
5
|
+
import { Slider } from "@moving-walls/design-system";
|
|
6
|
+
import { SelectRoot } from "@moving-walls/design-system";
|
|
7
|
+
import { Badge } from "@moving-walls/design-system";
|
|
8
|
+
|
|
9
|
+
export interface CreativeFilters {
|
|
10
|
+
duration?: [number, number];
|
|
11
|
+
resolution?: string[];
|
|
12
|
+
uploadedBy?: string[];
|
|
13
|
+
status?: string[];
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export interface CreativeFiltersPanelProps {
|
|
17
|
+
filters: CreativeFilters;
|
|
18
|
+
onFiltersChange: (filters: CreativeFilters) => void;
|
|
19
|
+
onClear: () => void;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
const resolutionOptions = [
|
|
23
|
+
{ value: '1920x1080', label: '1920x1080 (Full HD)' },
|
|
24
|
+
{ value: '1280x720', label: '1280x720 (HD)' },
|
|
25
|
+
{ value: '3840x2160', label: '3840x2160 (4K)' },
|
|
26
|
+
{ value: 'multiple', label: 'Multiple' }
|
|
27
|
+
];
|
|
28
|
+
|
|
29
|
+
const statusOptions = [
|
|
30
|
+
{ value: 'accepted', label: 'Accepted' },
|
|
31
|
+
{ value: 'processing', label: 'Processing' },
|
|
32
|
+
{ value: 'inadequate', label: 'Inadequate' }
|
|
33
|
+
];
|
|
34
|
+
|
|
35
|
+
export function CreativeFiltersPanel({
|
|
36
|
+
filters,
|
|
37
|
+
onFiltersChange,
|
|
38
|
+
onClear
|
|
39
|
+
}: CreativeFiltersPanelProps) {
|
|
40
|
+
const [open, setOpen] = useState(false);
|
|
41
|
+
const [localFilters, setLocalFilters] = useState<CreativeFilters>(filters);
|
|
42
|
+
|
|
43
|
+
const activeFilterCount = Object.values(filters).filter(
|
|
44
|
+
v => v !== undefined && (Array.isArray(v) ? v.length > 0 : true)
|
|
45
|
+
).length;
|
|
46
|
+
|
|
47
|
+
const handleApply = () => {
|
|
48
|
+
onFiltersChange(localFilters);
|
|
49
|
+
setOpen(false);
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
const handleCancel = () => {
|
|
53
|
+
setLocalFilters(filters);
|
|
54
|
+
setOpen(false);
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
const handleClear = () => {
|
|
58
|
+
setLocalFilters({});
|
|
59
|
+
onClear();
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
return (
|
|
63
|
+
<Sheet open={open} onOpenChange={setOpen}>
|
|
64
|
+
<SheetTrigger asChild>
|
|
65
|
+
<Button variant="outline" size="sm" className="relative">
|
|
66
|
+
<SlidersHorizontal className="w-4 h-4 mr-2" />
|
|
67
|
+
Filter
|
|
68
|
+
{activeFilterCount > 0 && (
|
|
69
|
+
<Badge
|
|
70
|
+
className="ml-2"
|
|
71
|
+
>
|
|
72
|
+
{activeFilterCount}
|
|
73
|
+
</Badge>
|
|
74
|
+
)}
|
|
75
|
+
</Button>
|
|
76
|
+
</SheetTrigger>
|
|
77
|
+
|
|
78
|
+
<SheetContent side="right" className="w-[400px] flex flex-col">
|
|
79
|
+
<SheetHeader className="pb-4 border-b">
|
|
80
|
+
<SheetTitle>Filters</SheetTitle>
|
|
81
|
+
</SheetHeader>
|
|
82
|
+
|
|
83
|
+
<div className="p-6 space-y-6 flex-1 overflow-y-auto">
|
|
84
|
+
{/* Duration Slider */}
|
|
85
|
+
<div className="space-y-3">
|
|
86
|
+
<div className="flex items-center justify-between">
|
|
87
|
+
<label className="text-sm font-medium">
|
|
88
|
+
Duration
|
|
89
|
+
</label>
|
|
90
|
+
<Button
|
|
91
|
+
variant="ghost"
|
|
92
|
+
size="sm"
|
|
93
|
+
className="text-xs text-blue-600 dark:text-blue-400 h-auto p-0"
|
|
94
|
+
onClick={() => setLocalFilters({ ...localFilters, duration: undefined })}
|
|
95
|
+
>
|
|
96
|
+
Clear
|
|
97
|
+
</Button>
|
|
98
|
+
</div>
|
|
99
|
+
<div className="px-2">
|
|
100
|
+
<Slider
|
|
101
|
+
min={0}
|
|
102
|
+
max={80}
|
|
103
|
+
step={8}
|
|
104
|
+
value={localFilters.duration || [0, 80]}
|
|
105
|
+
onValueChange={(value) =>
|
|
106
|
+
setLocalFilters({ ...localFilters, duration: value as [number, number] })
|
|
107
|
+
}
|
|
108
|
+
/>
|
|
109
|
+
<div className="flex justify-between text-xs text-muted-foreground mt-2">
|
|
110
|
+
<span>0</span>
|
|
111
|
+
<span>40</span>
|
|
112
|
+
<span>80</span>
|
|
113
|
+
</div>
|
|
114
|
+
</div>
|
|
115
|
+
</div>
|
|
116
|
+
|
|
117
|
+
{/* Resolution Select */}
|
|
118
|
+
<div className="space-y-3">
|
|
119
|
+
<div className="flex items-center justify-between">
|
|
120
|
+
<label className="text-sm font-medium">
|
|
121
|
+
Resolution
|
|
122
|
+
</label>
|
|
123
|
+
<Button
|
|
124
|
+
variant="ghost"
|
|
125
|
+
size="sm"
|
|
126
|
+
className="text-xs text-blue-600 dark:text-blue-400 h-auto p-0"
|
|
127
|
+
onClick={() => setLocalFilters({ ...localFilters, resolution: undefined })}
|
|
128
|
+
>
|
|
129
|
+
Clear
|
|
130
|
+
</Button>
|
|
131
|
+
</div>
|
|
132
|
+
<SelectRoot
|
|
133
|
+
value={localFilters.resolution?.[0] || ''}
|
|
134
|
+
onValueChange={(value) =>
|
|
135
|
+
setLocalFilters({
|
|
136
|
+
...localFilters,
|
|
137
|
+
resolution: value ? [value] : undefined
|
|
138
|
+
})
|
|
139
|
+
}
|
|
140
|
+
>
|
|
141
|
+
<option value="">Select Options</option>
|
|
142
|
+
{resolutionOptions.map(option => (
|
|
143
|
+
<option key={option.value} value={option.value}>
|
|
144
|
+
{option.label}
|
|
145
|
+
</option>
|
|
146
|
+
))}
|
|
147
|
+
</SelectRoot>
|
|
148
|
+
</div>
|
|
149
|
+
|
|
150
|
+
{/* Status Select */}
|
|
151
|
+
<div className="space-y-3">
|
|
152
|
+
<div className="flex items-center justify-between">
|
|
153
|
+
<label className="text-sm font-medium">
|
|
154
|
+
Status
|
|
155
|
+
</label>
|
|
156
|
+
<Button
|
|
157
|
+
variant="ghost"
|
|
158
|
+
size="sm"
|
|
159
|
+
className="text-xs text-blue-600 dark:text-blue-400 h-auto p-0"
|
|
160
|
+
onClick={() => setLocalFilters({ ...localFilters, status: undefined })}
|
|
161
|
+
>
|
|
162
|
+
Clear
|
|
163
|
+
</Button>
|
|
164
|
+
</div>
|
|
165
|
+
<SelectRoot
|
|
166
|
+
value={localFilters.status?.[0] || ''}
|
|
167
|
+
onValueChange={(value) =>
|
|
168
|
+
setLocalFilters({
|
|
169
|
+
...localFilters,
|
|
170
|
+
status: value ? [value] : undefined
|
|
171
|
+
})
|
|
172
|
+
}
|
|
173
|
+
>
|
|
174
|
+
<option value="">Select Status</option>
|
|
175
|
+
{statusOptions.map(option => (
|
|
176
|
+
<option key={option.value} value={option.value}>
|
|
177
|
+
{option.label}
|
|
178
|
+
</option>
|
|
179
|
+
))}
|
|
180
|
+
</SelectRoot>
|
|
181
|
+
</div>
|
|
182
|
+
</div>
|
|
183
|
+
|
|
184
|
+
{/* Actions */}
|
|
185
|
+
<div className="p-6 border-t bg-background flex gap-3 mt-auto">
|
|
186
|
+
<Button
|
|
187
|
+
variant="outline"
|
|
188
|
+
className="flex-1"
|
|
189
|
+
onClick={handleCancel}
|
|
190
|
+
>
|
|
191
|
+
Cancel
|
|
192
|
+
</Button>
|
|
193
|
+
<Button
|
|
194
|
+
className="flex-1"
|
|
195
|
+
onClick={handleApply}
|
|
196
|
+
>
|
|
197
|
+
Apply Filters
|
|
198
|
+
</Button>
|
|
199
|
+
</div>
|
|
200
|
+
</SheetContent>
|
|
201
|
+
</Sheet>
|
|
202
|
+
);
|
|
203
|
+
}
|
|
@@ -0,0 +1,360 @@
|
|
|
1
|
+
import { useState, useMemo } from 'react';
|
|
2
|
+
import { Download, Eye, FolderInput, Trash2, Settings2, MoreHorizontal } from 'lucide-react';
|
|
3
|
+
import { Button } from "@moving-walls/design-system";
|
|
4
|
+
import {
|
|
5
|
+
Dialog,
|
|
6
|
+
DialogContent,
|
|
7
|
+
DialogHeader,
|
|
8
|
+
DialogTitle,
|
|
9
|
+
DialogFooter,
|
|
10
|
+
} from "@moving-walls/design-system";
|
|
11
|
+
import {
|
|
12
|
+
DropdownMenu,
|
|
13
|
+
DropdownMenuContent,
|
|
14
|
+
DropdownMenuItem,
|
|
15
|
+
DropdownMenuTrigger,
|
|
16
|
+
} from "@moving-walls/design-system";
|
|
17
|
+
import { Switch } from "@moving-walls/design-system";
|
|
18
|
+
import { CreativeStatusBadge, type CreativeStatusType } from './creative-status-badge';
|
|
19
|
+
import { AgGridTable } from '@moving-walls/design-system';
|
|
20
|
+
import type { ColDef } from '@moving-walls/design-system';
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
export interface CreativeListItem {
|
|
24
|
+
id: string;
|
|
25
|
+
filename: string;
|
|
26
|
+
type: 'image' | 'video' | 'document';
|
|
27
|
+
format: string;
|
|
28
|
+
size: string;
|
|
29
|
+
status: CreativeStatusType;
|
|
30
|
+
uploadedBy: string;
|
|
31
|
+
resolution?: string;
|
|
32
|
+
duration?: string;
|
|
33
|
+
tags?: string[];
|
|
34
|
+
thumbnail?: string;
|
|
35
|
+
onPreview?: () => void;
|
|
36
|
+
onDownload?: () => void;
|
|
37
|
+
onDelete?: () => void;
|
|
38
|
+
onMove?: () => void;
|
|
39
|
+
onTranscode?: () => void;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
interface ColumnConfig {
|
|
43
|
+
id: string;
|
|
44
|
+
label: string;
|
|
45
|
+
enabled: boolean;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
const defaultColumns: ColumnConfig[] = [
|
|
49
|
+
{ id: 'sno', label: 'S.No', enabled: true },
|
|
50
|
+
{ id: 'name', label: 'Creative name', enabled: true },
|
|
51
|
+
{ id: 'type', label: 'Creative Type', enabled: true },
|
|
52
|
+
{ id: 'resolution', label: 'Resolution', enabled: true },
|
|
53
|
+
{ id: 'size', label: 'Size', enabled: true },
|
|
54
|
+
{ id: 'tags', label: 'Tags', enabled: true },
|
|
55
|
+
{ id: 'uploadedBy', label: 'Uploaded By', enabled: true },
|
|
56
|
+
{ id: 'status', label: 'Status', enabled: true },
|
|
57
|
+
];
|
|
58
|
+
|
|
59
|
+
function getTypeIcon(type: string): string {
|
|
60
|
+
switch (type) {
|
|
61
|
+
case 'image': return '🖼️';
|
|
62
|
+
case 'video': return '🎬';
|
|
63
|
+
case 'document': return '📄';
|
|
64
|
+
default: return '📁';
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
function getFormatLabel(type: string, format: string): string {
|
|
69
|
+
return `${type.charAt(0).toUpperCase() + type.slice(1)}/${format.toLowerCase()}`;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
type CreativeListRow = CreativeListItem & { index: number };
|
|
73
|
+
|
|
74
|
+
interface CreativeListProps {
|
|
75
|
+
items: CreativeListItem[];
|
|
76
|
+
currentPage?: number;
|
|
77
|
+
pageSize?: number;
|
|
78
|
+
totalItems?: number;
|
|
79
|
+
onPageChange?: (page: number) => void;
|
|
80
|
+
onPageSizeChange?: (size: number) => void;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
export function CreativeList({
|
|
84
|
+
items,
|
|
85
|
+
currentPage = 1,
|
|
86
|
+
pageSize = 10,
|
|
87
|
+
totalItems,
|
|
88
|
+
onPageChange,
|
|
89
|
+
onPageSizeChange
|
|
90
|
+
}: CreativeListProps) {
|
|
91
|
+
const [columns, setColumns] = useState<ColumnConfig[]>(defaultColumns);
|
|
92
|
+
const [tempColumns, setTempColumns] = useState<ColumnConfig[]>(defaultColumns);
|
|
93
|
+
const [customizeOpen, setCustomizeOpen] = useState(false);
|
|
94
|
+
|
|
95
|
+
const handleOpenCustomize = () => {
|
|
96
|
+
setTempColumns([...columns]);
|
|
97
|
+
setCustomizeOpen(true);
|
|
98
|
+
};
|
|
99
|
+
|
|
100
|
+
const handleToggleColumn = (id: string) => {
|
|
101
|
+
setTempColumns(prev => prev.map(col =>
|
|
102
|
+
col.id === id ? { ...col, enabled: !col.enabled } : col
|
|
103
|
+
));
|
|
104
|
+
};
|
|
105
|
+
|
|
106
|
+
const handleToggleAll = () => {
|
|
107
|
+
const allEnabled = tempColumns.every(col => col.enabled);
|
|
108
|
+
setTempColumns(prev => prev.map(col => ({ ...col, enabled: !allEnabled })));
|
|
109
|
+
};
|
|
110
|
+
|
|
111
|
+
const handleApplyChanges = () => {
|
|
112
|
+
setColumns(tempColumns);
|
|
113
|
+
setCustomizeOpen(false);
|
|
114
|
+
};
|
|
115
|
+
|
|
116
|
+
const handleCancelChanges = () => {
|
|
117
|
+
setTempColumns(columns);
|
|
118
|
+
setCustomizeOpen(false);
|
|
119
|
+
};
|
|
120
|
+
|
|
121
|
+
const allEnabled = tempColumns.every(col => col.enabled);
|
|
122
|
+
|
|
123
|
+
const hiddenColumns = useMemo(() => {
|
|
124
|
+
return columns.filter(c => !c.enabled).map(c => c.id);
|
|
125
|
+
}, [columns]);
|
|
126
|
+
|
|
127
|
+
const columnDefs = useMemo((): ColDef<CreativeListRow>[] => {
|
|
128
|
+
return [
|
|
129
|
+
{
|
|
130
|
+
colId: 'sno',
|
|
131
|
+
headerName: 'S.No',
|
|
132
|
+
width: 60,
|
|
133
|
+
sortable: false,
|
|
134
|
+
cellRenderer: (params: { data: CreativeListRow }) => (
|
|
135
|
+
<span className="text-[var(--color-mw-neutral-500)]">
|
|
136
|
+
{String(params.data.index).padStart(2, '0')}
|
|
137
|
+
</span>
|
|
138
|
+
),
|
|
139
|
+
},
|
|
140
|
+
{
|
|
141
|
+
colId: 'name',
|
|
142
|
+
headerName: 'Creative Name',
|
|
143
|
+
field: 'filename',
|
|
144
|
+
sortable: true,
|
|
145
|
+
headerComponent: () => (
|
|
146
|
+
<div className="flex items-center gap-1">
|
|
147
|
+
Creative Name
|
|
148
|
+
<Button variant="ghost" size="sm" isIconOnly onClick={handleOpenCustomize} className="ml-auto">
|
|
149
|
+
<Settings2 className="w-4 h-4 text-[var(--color-mw-neutral-400)]" />
|
|
150
|
+
</Button>
|
|
151
|
+
</div>
|
|
152
|
+
),
|
|
153
|
+
cellRenderer: (params: { value: string; data: CreativeListRow }) => (
|
|
154
|
+
<div className="flex items-center gap-3">
|
|
155
|
+
{params.data.thumbnail ? (
|
|
156
|
+
<img
|
|
157
|
+
src={params.data.thumbnail}
|
|
158
|
+
alt={params.data.filename}
|
|
159
|
+
className="w-8 h-8 rounded object-cover bg-[var(--color-mw-neutral-100)]"
|
|
160
|
+
/>
|
|
161
|
+
) : (
|
|
162
|
+
<div className="w-8 h-8 rounded bg-[var(--color-mw-neutral-100)] flex items-center justify-center text-sm">
|
|
163
|
+
{getTypeIcon(params.data.type)}
|
|
164
|
+
</div>
|
|
165
|
+
)}
|
|
166
|
+
<span className="font-medium truncate max-w-[200px]">{params.value}</span>
|
|
167
|
+
</div>
|
|
168
|
+
),
|
|
169
|
+
},
|
|
170
|
+
{
|
|
171
|
+
colId: 'type',
|
|
172
|
+
headerName: 'Creative Type',
|
|
173
|
+
sortable: true,
|
|
174
|
+
valueGetter: (params: { data: CreativeListRow | undefined }) => params.data ? getFormatLabel(params.data.type, params.data.format) : '',
|
|
175
|
+
cellRenderer: (params: { value: string }) => (
|
|
176
|
+
<span className="text-[var(--color-mw-neutral-600)]">{params.value}</span>
|
|
177
|
+
),
|
|
178
|
+
},
|
|
179
|
+
{
|
|
180
|
+
colId: 'resolution',
|
|
181
|
+
headerName: 'Resolution',
|
|
182
|
+
field: 'resolution',
|
|
183
|
+
sortable: true,
|
|
184
|
+
cellRenderer: (params: { value: string | undefined }) => (
|
|
185
|
+
<span className="text-[var(--color-mw-neutral-600)]">{params.value || '--'}</span>
|
|
186
|
+
),
|
|
187
|
+
},
|
|
188
|
+
{
|
|
189
|
+
colId: 'size',
|
|
190
|
+
headerName: 'Size',
|
|
191
|
+
field: 'size',
|
|
192
|
+
sortable: true,
|
|
193
|
+
cellRenderer: (params: { value: string }) => (
|
|
194
|
+
<span className="text-[var(--color-mw-neutral-600)]">{params.value}</span>
|
|
195
|
+
),
|
|
196
|
+
},
|
|
197
|
+
{
|
|
198
|
+
colId: 'tags',
|
|
199
|
+
headerName: 'Tags',
|
|
200
|
+
field: 'tags',
|
|
201
|
+
sortable: true,
|
|
202
|
+
cellRenderer: (params: { value: string[] | undefined }) => {
|
|
203
|
+
const value = params.value;
|
|
204
|
+
if (!value || value.length === 0) {
|
|
205
|
+
return <span className="text-[var(--color-mw-neutral-400)]">--</span>;
|
|
206
|
+
}
|
|
207
|
+
return (
|
|
208
|
+
<div className="flex items-center gap-1">
|
|
209
|
+
{value.slice(0, 2).map((tag, i) => (
|
|
210
|
+
<span
|
|
211
|
+
key={i}
|
|
212
|
+
className="px-2 py-0.5 text-xs bg-[var(--color-mw-neutral-100)] rounded text-[var(--color-mw-neutral-600)]"
|
|
213
|
+
>
|
|
214
|
+
{tag}
|
|
215
|
+
</span>
|
|
216
|
+
))}
|
|
217
|
+
{value.length > 2 && (
|
|
218
|
+
<span className="text-xs text-[var(--color-mw-neutral-500)]">+{value.length - 2}</span>
|
|
219
|
+
)}
|
|
220
|
+
</div>
|
|
221
|
+
);
|
|
222
|
+
},
|
|
223
|
+
},
|
|
224
|
+
{
|
|
225
|
+
colId: 'uploadedBy',
|
|
226
|
+
headerName: 'Uploaded By',
|
|
227
|
+
field: 'uploadedBy',
|
|
228
|
+
sortable: false,
|
|
229
|
+
cellRenderer: (params: { value: string }) => (
|
|
230
|
+
<span className="text-[var(--color-mw-neutral-600)]">{params.value}</span>
|
|
231
|
+
),
|
|
232
|
+
},
|
|
233
|
+
{
|
|
234
|
+
colId: 'status',
|
|
235
|
+
headerName: 'Status',
|
|
236
|
+
field: 'status',
|
|
237
|
+
sortable: true,
|
|
238
|
+
cellRenderer: (params: { value: CreativeStatusType }) => <CreativeStatusBadge status={params.value} />,
|
|
239
|
+
},
|
|
240
|
+
{
|
|
241
|
+
colId: 'actions',
|
|
242
|
+
headerName: '',
|
|
243
|
+
width: 60,
|
|
244
|
+
sortable: false,
|
|
245
|
+
resizable: false,
|
|
246
|
+
cellRenderer: (params: { data: CreativeListRow }) => {
|
|
247
|
+
const row = params.data;
|
|
248
|
+
const actions = [
|
|
249
|
+
{ label: 'View', icon: <Eye className="w-4 h-4" />, onClick: () => row.onPreview?.(), hidden: !row.onPreview },
|
|
250
|
+
{ label: 'Download', icon: <Download className="w-4 h-4" />, onClick: () => row.onDownload?.(), hidden: !row.onDownload },
|
|
251
|
+
{
|
|
252
|
+
label: 'Transcode',
|
|
253
|
+
icon: (
|
|
254
|
+
<svg className="w-4 h-4" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2">
|
|
255
|
+
<path d="M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7" />
|
|
256
|
+
<path d="M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z" />
|
|
257
|
+
</svg>
|
|
258
|
+
),
|
|
259
|
+
onClick: () => row.onTranscode?.(),
|
|
260
|
+
hidden: !row.onTranscode,
|
|
261
|
+
},
|
|
262
|
+
{ label: 'Move File', icon: <FolderInput className="w-4 h-4" />, onClick: () => row.onMove?.(), hidden: !row.onMove },
|
|
263
|
+
{ label: 'Remove', icon: <Trash2 className="w-4 h-4" />, onClick: () => row.onDelete?.(), hidden: !row.onDelete, destructive: true },
|
|
264
|
+
].filter(a => !a.hidden);
|
|
265
|
+
|
|
266
|
+
if (actions.length === 0) return null;
|
|
267
|
+
|
|
268
|
+
return (
|
|
269
|
+
<DropdownMenu>
|
|
270
|
+
<DropdownMenuTrigger asChild>
|
|
271
|
+
<Button variant="ghost" size="sm" className="h-8 w-8 p-0">
|
|
272
|
+
<MoreHorizontal className="h-4 w-4" />
|
|
273
|
+
</Button>
|
|
274
|
+
</DropdownMenuTrigger>
|
|
275
|
+
<DropdownMenuContent align="end">
|
|
276
|
+
{actions.map((action) => (
|
|
277
|
+
<DropdownMenuItem
|
|
278
|
+
key={action.label}
|
|
279
|
+
onClick={action.onClick}
|
|
280
|
+
className={action.destructive ? 'text-destructive' : ''}
|
|
281
|
+
>
|
|
282
|
+
{action.icon}
|
|
283
|
+
<span className="ml-2">{action.label}</span>
|
|
284
|
+
</DropdownMenuItem>
|
|
285
|
+
))}
|
|
286
|
+
</DropdownMenuContent>
|
|
287
|
+
</DropdownMenu>
|
|
288
|
+
);
|
|
289
|
+
},
|
|
290
|
+
},
|
|
291
|
+
];
|
|
292
|
+
}, []);
|
|
293
|
+
|
|
294
|
+
const dataWithIndex = items.map((item, idx) => ({
|
|
295
|
+
...item,
|
|
296
|
+
index: (currentPage - 1) * pageSize + idx + 1,
|
|
297
|
+
}));
|
|
298
|
+
|
|
299
|
+
const total = totalItems ?? items.length;
|
|
300
|
+
|
|
301
|
+
const hasPagination = !!(onPageChange && onPageSizeChange);
|
|
302
|
+
|
|
303
|
+
return (
|
|
304
|
+
<>
|
|
305
|
+
<div style={{ height: '500px' }}>
|
|
306
|
+
<AgGridTable
|
|
307
|
+
rowData={dataWithIndex}
|
|
308
|
+
columnDefs={columnDefs}
|
|
309
|
+
getRowId={(row) => row.id}
|
|
310
|
+
hiddenColumns={hiddenColumns}
|
|
311
|
+
emptyMessage="No creatives found"
|
|
312
|
+
pagination={hasPagination}
|
|
313
|
+
serverSidePagination={hasPagination}
|
|
314
|
+
serverSideConfig={hasPagination ? {
|
|
315
|
+
totalCount: total,
|
|
316
|
+
currentPage,
|
|
317
|
+
pageSize,
|
|
318
|
+
onPageChange: (page) => onPageChange!(page),
|
|
319
|
+
onPageSizeChange: (size) => onPageSizeChange!(size),
|
|
320
|
+
pageSizeSelector: [10, 25, 50, 100],
|
|
321
|
+
} : undefined}
|
|
322
|
+
/>
|
|
323
|
+
</div>
|
|
324
|
+
|
|
325
|
+
<Dialog open={customizeOpen} onOpenChange={setCustomizeOpen}>
|
|
326
|
+
<DialogContent className="max-w-md">
|
|
327
|
+
<DialogHeader>
|
|
328
|
+
<DialogTitle>Customise Table Elements</DialogTitle>
|
|
329
|
+
</DialogHeader>
|
|
330
|
+
<div className="py-4 space-y-4">
|
|
331
|
+
<div className="flex items-center justify-between py-2 border-b border-[var(--color-mw-neutral-200)]">
|
|
332
|
+
<span className="font-medium">Enable all fields</span>
|
|
333
|
+
<Switch
|
|
334
|
+
checked={allEnabled}
|
|
335
|
+
onChange={handleToggleAll}
|
|
336
|
+
/>
|
|
337
|
+
</div>
|
|
338
|
+
{tempColumns.map((col) => (
|
|
339
|
+
<div key={col.id} className="flex items-center justify-between py-2">
|
|
340
|
+
<span className="text-[var(--color-mw-neutral-700)]">{col.label}</span>
|
|
341
|
+
<Switch
|
|
342
|
+
checked={col.enabled}
|
|
343
|
+
onChange={() => handleToggleColumn(col.id)}
|
|
344
|
+
/>
|
|
345
|
+
</div>
|
|
346
|
+
))}
|
|
347
|
+
</div>
|
|
348
|
+
<DialogFooter>
|
|
349
|
+
<Button variant="outline" onClick={handleCancelChanges}>
|
|
350
|
+
Cancel Changes
|
|
351
|
+
</Button>
|
|
352
|
+
<Button variant="primary" onClick={handleApplyChanges}>
|
|
353
|
+
Apply Changes
|
|
354
|
+
</Button>
|
|
355
|
+
</DialogFooter>
|
|
356
|
+
</DialogContent>
|
|
357
|
+
</Dialog>
|
|
358
|
+
</>
|
|
359
|
+
);
|
|
360
|
+
}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { Badge } from "@moving-walls/design-system";
|
|
2
|
+
import { Check, X, Clock, HelpCircle } from 'lucide-react';
|
|
3
|
+
|
|
4
|
+
export type CreativeStatusType = 'approved' | 'processing' | 'inadequate' | 'accepted' | 'draft' | 'rejected' | 'pending' | string;
|
|
5
|
+
|
|
6
|
+
export interface CreativeStatusBadgeProps {
|
|
7
|
+
status: CreativeStatusType;
|
|
8
|
+
size?: 'sm' | 'md' | 'lg';
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export function CreativeStatusBadge({ status, size = 'sm' }: CreativeStatusBadgeProps) {
|
|
12
|
+
const statusConfig: Record<string, { variant: 'default' | 'error' | 'secondary'; className: string; icon: React.ReactNode; label: string }> = {
|
|
13
|
+
approved: {
|
|
14
|
+
variant: 'default',
|
|
15
|
+
className: 'bg-green-100 text-green-800 dark:bg-green-900/20 dark:text-green-300',
|
|
16
|
+
icon: <Check className="w-3 h-3" />,
|
|
17
|
+
label: 'Approved'
|
|
18
|
+
},
|
|
19
|
+
accepted: {
|
|
20
|
+
variant: 'default',
|
|
21
|
+
className: 'bg-green-100 text-green-800 dark:bg-green-900/20 dark:text-green-300',
|
|
22
|
+
icon: <Check className="w-3 h-3" />,
|
|
23
|
+
label: 'Accepted'
|
|
24
|
+
},
|
|
25
|
+
processing: {
|
|
26
|
+
variant: 'default',
|
|
27
|
+
className: 'bg-yellow-100 text-yellow-800 dark:bg-yellow-900/20 dark:text-yellow-300',
|
|
28
|
+
icon: <Clock className="w-3 h-3" />,
|
|
29
|
+
label: 'Processing'
|
|
30
|
+
},
|
|
31
|
+
pending: {
|
|
32
|
+
variant: 'default',
|
|
33
|
+
className: 'bg-yellow-100 text-yellow-800 dark:bg-yellow-900/20 dark:text-yellow-300',
|
|
34
|
+
icon: <Clock className="w-3 h-3" />,
|
|
35
|
+
label: 'Pending'
|
|
36
|
+
},
|
|
37
|
+
inadequate: {
|
|
38
|
+
variant: 'error',
|
|
39
|
+
className: '',
|
|
40
|
+
icon: <X className="w-3 h-3" />,
|
|
41
|
+
label: 'Inadequate'
|
|
42
|
+
},
|
|
43
|
+
rejected: {
|
|
44
|
+
variant: 'error',
|
|
45
|
+
className: '',
|
|
46
|
+
icon: <X className="w-3 h-3" />,
|
|
47
|
+
label: 'Rejected'
|
|
48
|
+
},
|
|
49
|
+
draft: {
|
|
50
|
+
variant: 'secondary',
|
|
51
|
+
className: 'bg-gray-100 text-gray-800 dark:bg-gray-900/20 dark:text-gray-300',
|
|
52
|
+
icon: <HelpCircle className="w-3 h-3" />,
|
|
53
|
+
label: 'Draft'
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
const normalizedStatus = status?.toLowerCase() || 'draft';
|
|
58
|
+
const config = statusConfig[normalizedStatus] || {
|
|
59
|
+
variant: 'secondary' as const,
|
|
60
|
+
className: 'bg-gray-100 text-gray-800 dark:bg-gray-900/20 dark:text-gray-300',
|
|
61
|
+
icon: <HelpCircle className="w-3 h-3" />,
|
|
62
|
+
label: status || 'Unknown'
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
return (
|
|
66
|
+
<Badge variant={config.variant} className={`flex items-center gap-1 ${config.className}`}>
|
|
67
|
+
{config.icon}
|
|
68
|
+
{config.label}
|
|
69
|
+
</Badge>
|
|
70
|
+
);
|
|
71
|
+
}
|