Skip to content

Conversation

@FBanfi
Copy link
Collaborator

@FBanfi FBanfi commented Dec 18, 2025

Purpose

This update adds the metrics section as well as the extraction of the main logic, so we can reuse it in both the Home and Page locations.

Approach

IMP: In this PR the refresh button was removed, it does the same as a navigator refresh. In other apps (Homebase) we removed this type of button for that reason, so I follow the same approach here.

Implemented a metrics dashboard that calculates and displays 5 content production metrics from Contentful entries and scheduled actions:

  • Total Published
  • Average Time to Publish
  • Scheduled, Recently Published
  • Needs Update

The metrics use configurable time periods from installation parameters (needsUpdateMonths, recentlyPublishedDays, timeToPublishDays) and are rendered as styled cards.

The MetricsCalculator class performs all calculations in the constructor, and the Dashboard component is reusable across both Page and Home locations.

  • Note: Although this class's behavior is limited to the constructor, it provides encapsulation of the calculation logic, ensures consistent state (same timestamp for all metrics), and offers a user-friendly, immutable interface that simplifies usage and testing.

Testing steps

Automated tests added.

With entries and scheduled actions:

Captura de pantalla 2025-12-18 a la(s) 11 08 00 a  m

Without any entry or scheduled actions:

Captura de pantalla 2025-12-18 a la(s) 11 10 13 a  m

With negative published percentage:

Captura de pantalla 2025-12-18 a la(s) 11 12 37 a  m

How the flow works:

Grabacion.de.pantalla.2025-12-18.a.la.s.4.27.55.p.m.mov

Breaking Changes

N/A

Dependencies and/or References

Link to MAPS-123

Deployment

N/A

@FBanfi FBanfi requested a review from a team as a code owner December 18, 2025 14:17
…ashboard-123

# Conflicts:
#	apps/content-production-dashboard/src/locations/Page.styles.ts
#	apps/content-production-dashboard/src/locations/Page.tsx
#	apps/content-production-dashboard/test/locations/Page.spec.tsx
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