apps icon indicating copy to clipboard operation
apps copied to clipboard

Content Production Dashboard: Adding metrics section [MAPS-123]

Open FBanfi opened this issue 3 weeks ago • 0 comments

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:

https://github.com/user-attachments/assets/61e6fdb3-d6d3-4198-a06e-3637052897aa

Breaking Changes

N/A

Dependencies and/or References

Link to MAPS-123

Deployment

N/A

FBanfi avatar Dec 18 '25 14:12 FBanfi