Skip to content

feat(dashboards): add website visits and email CTR cards#347

Open
mrautela365 wants to merge 12 commits intofeat/LFXV2-1220-pr2-backend-apisfrom
feat/LFXV2-1220-pr3a-website-email
Open

feat(dashboards): add website visits and email CTR cards#347
mrautela365 wants to merge 12 commits intofeat/LFXV2-1220-pr2-backend-apisfrom
feat/LFXV2-1220-pr3a-website-email

Conversation

@mrautela365
Copy link
Contributor

Summary

  • Upgrade marketing-overview from static mock cards to live Snowflake data with carousel + key insights card
  • Add WebsiteVisitsDrawerComponent — daily session chart, domain group breakdown table, page view totals
  • Add EmailCtrDrawerComponent — monthly CTR trend chart, campaign group table, sends/opens bar chart
  • Add getWebActivitiesSummary() and getEmailCtr() to AnalyticsService

Context

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

  • Marketing overview component renders with all 4 MARKETING_OVERVIEW_METRICS cards, but only website visits and email CTR have live data transforms (other 2 show static defaults)
  • Drawer components are imported but only render when clicked

Test plan

  • yarn build passes
  • yarn lint passes
  • License header check passes
  • Website Visits drawer shows daily chart + domain groups
  • Email CTR drawer shows monthly trend + campaign breakdown

LFXV2-1220

🤖 Generated with Claude Code

@mrautela365 mrautela365 requested a review from a team as a code owner March 19, 2026 23:31
Copilot AI review requested due to automatic review settings March 19, 2026 23:31
@coderabbitai
Copy link

coderabbitai bot commented Mar 19, 2026

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: d530f674-a544-4718-ab12-a7bc78d3e897

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/LFXV2-1220-pr3a-website-email
📝 Coding Plan
  • Generate coding plan for human review comments

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@mrautela365 mrautela365 force-pushed the feat/LFXV2-1220-pr2-backend-apis branch from 17af13d to 0e73461 Compare March 20, 2026 00:00
@mrautela365 mrautela365 force-pushed the feat/LFXV2-1220-pr3a-website-email branch from 2741709 to 53e42d0 Compare March 20, 2026 00:02
@mrautela365 mrautela365 force-pushed the feat/LFXV2-1220-pr2-backend-apis branch from 0e73461 to b8463ce Compare March 20, 2026 00:13
@mrautela365 mrautela365 force-pushed the feat/LFXV2-1220-pr3a-website-email branch from 53e42d0 to 5ab0f74 Compare March 20, 2026 00:13
@mrautela365 mrautela365 force-pushed the feat/LFXV2-1220-pr3a-website-email branch from 6813d48 to 9694f90 Compare March 20, 2026 01:22
@mrautela365 mrautela365 force-pushed the feat/LFXV2-1220-pr3a-website-email branch from 9694f90 to 7510270 Compare March 20, 2026 01:34
@mrautela365 mrautela365 force-pushed the feat/LFXV2-1220-pr2-backend-apis branch from b8463ce to 6b696da Compare March 20, 2026 03:34
@mrautela365 mrautela365 force-pushed the feat/LFXV2-1220-pr3a-website-email branch from d755a1a to 6368c99 Compare March 20, 2026 03:34
@mrautela365 mrautela365 force-pushed the feat/LFXV2-1220-pr2-backend-apis branch from 6b696da to 88f019b Compare March 20, 2026 04:15
@mrautela365 mrautela365 force-pushed the feat/LFXV2-1220-pr3a-website-email branch from 4fbcd7f to ccec7d7 Compare March 20, 2026 04:15
@mrautela365 mrautela365 force-pushed the feat/LFXV2-1220-pr3a-website-email branch from ccec7d7 to 08b1014 Compare March 20, 2026 04:35
mrautela365 and others added 12 commits March 19, 2026 22:38
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants