Skip to content

Conversation

@rachelmcr
Copy link
Contributor

@rachelmcr rachelmcr commented Nov 22, 2022

Part of: #8149
⚠️ Depends on #8175 ⚠️

Description

This PR adds a set of helpers for generate the delta percentage text (e.g. +36% or -16%) for Analytics Hub cards.

Changes

  • Adds general helpers and unit tests for creating the delta percentage text from two values (Decimal or Double types).
  • Adds specific helpers and unit tests for creating the delta percentage text for specific stats used in Analytics Hub, e.g. Total Orders, Average Order Value.

Testing

These helpers aren't yet used in the app; confirm the new unit tests are checking the correct values and tests pass.

Submitter Checklist

Update release notes:

  • I have considered if this change warrants user-facing release notes and have added them to RELEASE-NOTES.txt if necessary.

@rachelmcr rachelmcr added the feature: stats Related to stats, including Top Performers. label Nov 22, 2022
@rachelmcr rachelmcr added this to the 11.4 milestone Nov 22, 2022
@rachelmcr rachelmcr force-pushed the issue/8149-delta-percentage-helper branch from 77da0db to 52fca2a Compare November 22, 2022 12:47
@rachelmcr rachelmcr marked this pull request as ready for review November 22, 2022 12:54
Copy link
Contributor

@ealeksandrov ealeksandrov left a comment

Choose a reason for hiding this comment

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

LGTM :shipit:
Great example of using Apple APIs for i18n!

@wpmobilebot
Copy link
Collaborator

wpmobilebot commented Nov 23, 2022

You can test the changes from this Pull Request by:
  • Clicking here or scanning the QR code below to access App Center
  • Then installing the build number pr8181-09bf974 on your iPhone

If you need access to App Center, please ask a maintainer to add you.

Base automatically changed from issue/8149-shared-stats-helpers to trunk November 23, 2022 11:52
@peril-woocommerce
Copy link

Warnings
⚠️ This PR is assigned to a milestone which is closing in less than 2 days Please, make sure to get it merged by then or assign it to a later expiring milestone

Generated by 🚫 dangerJS

@rachelmcr rachelmcr enabled auto-merge November 23, 2022 12:02
@rachelmcr rachelmcr merged commit db394a5 into trunk Nov 24, 2022
@rachelmcr rachelmcr deleted the issue/8149-delta-percentage-helper branch November 24, 2022 00:12
@rachelmcr rachelmcr linked an issue Dec 5, 2022 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature: stats Related to stats, including Top Performers.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Analytics Hub] Configure Orders Analytics card

4 participants