feat(dashboards): add website visits and email CTR cards#347
feat(dashboards): add website visits and email CTR cards#347mrautela365 wants to merge 12 commits intofeat/LFXV2-1220-pr2-backend-apisfrom
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
📝 Coding Plan
Comment |
There was a problem hiding this comment.
Pull request overview
This PR upgrades the Executive Director “Marketing Overview” dashboard by wiring the Website Visits and Email CTR cards to live analytics endpoints and adding drill-down drawers for deeper exploration of each metric.
Changes:
- Add two new AnalyticsService methods to fetch Website Visits and Email CTR marketing data from
/api/analytics/*endpoints. - Replace the Marketing Overview’s static card rendering with signal-driven transforms that populate Website Visits + Email CTR cards from API responses (and add a key-insights carousel card).
- Introduce two new drawer components (Website Visits, Email CTR) with charts and breakdown views.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| apps/lfx-one/src/app/shared/services/analytics.service.ts | Adds getWebActivitiesSummary() and getEmailCtr() client methods with fallback defaults. |
| apps/lfx-one/src/app/modules/dashboards/executive-director/components/marketing-overview/marketing-overview.component.ts | Fetches marketing data based on selected foundation, computes populated metric cards, and manages drawer state. |
| apps/lfx-one/src/app/modules/dashboards/executive-director/components/marketing-overview/marketing-overview.component.html | Adds a key-insights carousel card, wires metric-card click handling, and mounts the new drawers. |
| apps/lfx-one/src/app/modules/dashboards/executive-director/components/website-visits-drawer/website-visits-drawer.component.ts | New Website Visits drawer logic (signals + chart data/options). |
| apps/lfx-one/src/app/modules/dashboards/executive-director/components/website-visits-drawer/website-visits-drawer.component.html | New Website Visits drawer UI (summary, insights, charts). |
| apps/lfx-one/src/app/modules/dashboards/executive-director/components/email-ctr-drawer/email-ctr-drawer.component.ts | New Email CTR drawer logic (signals + chart data/options). |
| apps/lfx-one/src/app/modules/dashboards/executive-director/components/email-ctr-drawer/email-ctr-drawer.component.html | New Email CTR drawer UI (summary, insights, charts). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
.../dashboards/executive-director/components/marketing-overview/marketing-overview.component.ts
Show resolved
Hide resolved
17af13d to
0e73461
Compare
2741709 to
53e42d0
Compare
0e73461 to
b8463ce
Compare
53e42d0 to
5ab0f74
Compare
6813d48 to
9694f90
Compare
9694f90 to
7510270
Compare
b8463ce to
6b696da
Compare
d755a1a to
6368c99
Compare
6b696da to
88f019b
Compare
4fbcd7f to
ccec7d7
Compare
ccec7d7 to
08b1014
Compare
Add marketing carousel with live Snowflake data for website visits and email CTR metrics. Includes drill-down drawers with charts, domain breakdowns, and monthly trend data. LFXV2-1220 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Misha Rautela <mrautela@linuxfoundation.org>
Mark marketing insights as sample data with amber badge and add TODO comment for replacing dummy data with AI-generated insights. LFXV2-1220 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Misha Rautela <mrautela@linuxfoundation.org>
- Replace nested ternaries with @if/@else blocks for priority badges - Add Sample badges to Recommended Actions and Key Insights - Add standard empty states for chart sections - Add TODO comment on dummy data LFXV2-1220 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Misha Rautela <mrautela@linuxfoundation.org>
Replace nested ternaries with @if/@else if/@else blocks, add Sample badges to dummy data sections, add empty states for chart sections, and add TODO comment for AI automation. LFXV2-1220 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Misha Rautela <mrautela@linuxfoundation.org>
Switch email CTR endpoint from foundationName/PROJECT_NAME to foundationSlug/PROJECT_SLUG, matching the web activities pattern that already works correctly with Snowflake Platinum tables. LFXV2-1220 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Misha Rautela <mrautela@linuxfoundation.org>
The subquery approach (slug→name via WEB_ACTIVITIES_SUMMARY) worked locally but failed silently in deploy preview. Use foundationName directly since EMAIL_CTR tables have PROJECT_NAME column. LFXV2-1220 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Misha Rautela <mrautela@linuxfoundation.org>
Use INNER JOIN with WEB_ACTIVITIES_SUMMARY instead of subquery or direct foundationName for email CTR queries. WEB_ACTIVITIES_SUMMARY has both PROJECT_SLUG and PROJECT_NAME, and Website Visits already uses it successfully with PROJECT_SLUG. This avoids name mismatch between project service and Snowflake. Added debug logging. LFXV2-1220 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Misha Rautela <mrautela@linuxfoundation.org>
Replace hardcoded dummy "Sample" data in marketing drawers with computed signals that analyze actual Snowflake metrics. Email CTR drawer now shows data-driven recommended actions (CTR trends, open rates, campaign comparisons) and key insights. Website visits drawer derives insights from session trends, domain concentration, and pages-per-session. Marketing overview card generates summary insights from loaded data instead of static text. LFXV2-1220 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Misha Rautela <mrautela@linuxfoundation.org>
Use MAX instead of SUM for PLATFORMS_ACTIVE in social media overview to avoid double-counting across sub-project rows. Also query SPEND, REVENUE, and ROAS per channel in paid social reach and compute totalSpend/totalRevenue from channel data instead of hardcoding 0. LFXV2-1220 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Misha Rautela <mrautela@linuxfoundation.org>
Add missing component stylesheet with hide-scrollbar class to prevent visible scrollbar on marketing overview carousel, matching the existing foundation-health and organization-involvement patterns. LFXV2-1220 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Misha Rautela <mrautela@linuxfoundation.org>
Email CTR Snowflake tables (EMAIL_CTR_SUMMARY, EMAIL_CTR_BY_MONTH)
filter by PROJECT_NAME, not PROJECT_SLUG. The frontend was passing
foundation.slug ('tlf') but the SQL queries need foundation.name
('The Linux Foundation'). This caused zero rows returned for all
foundations.
LFXV2-1220
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Misha Rautela <mrautela@linuxfoundation.org>
BY_PROJECT_CHANNEL_MONTH table only has IMPRESSIONS column — remove references to non-existent SPEND, REVENUE, ROAS columns. These values are already aggregated from BY_PROJECT_MONTH in Block 1. LFXV2-1220 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Misha Rautela <mrautela@linuxfoundation.org>
08b1014 to
f8678d6
Compare
Summary
marketing-overviewfrom static mock cards to live Snowflake data with carousel + key insights cardWebsiteVisitsDrawerComponent— daily session chart, domain group breakdown table, page view totalsEmailCtrDrawerComponent— monthly CTR trend chart, campaign group table, sends/opens bar chartgetWebActivitiesSummary()andgetEmailCtr()toAnalyticsServiceContext
PR 3a of 5 — first half of marketing cards (website visits + email CTR). The remaining 2 cards (paid social + social media) come in PR 3b.
Depends on: #346 (backend APIs)
PR sequence: #345 → #346 → PR 3a (this) → PR 3b → PR 4 → PR 5
Build safety
Test plan
yarn buildpassesyarn lintpassesLFXV2-1220
🤖 Generated with Claude Code