Skip to content

Conversation

@rachelmcr
Copy link
Contributor

@rachelmcr rachelmcr commented Dec 6, 2022

Closes: #8243
⚠️ Depends on #8317 ⚠️

Description

This extracts DeltaPercentage from the StatsDataTextFormatter, for use as a separate entity.

The original idea behind DeltaPercentage was to just be a representation of the formatted string/direction in StatsDataTextFormatter. Given that so many report card values depend on the DeltaPercentage, it seems relevant as a separate entity. This will help simplify the view model setup for each analytics card in the Analytics Hub.

Changes

  • Extracts DeltaPercentage from the StatsDataTextFormatter. For the sake of formatting the delta percentage string, we still use StatsDataTextFormatter to generate the delta from the order stats data.
  • Updates the analytics card view models to accept a DeltaPercentage. The convenience inits for each analytics card now maps the delta in the view model to the respective properties on the card.

Testing

There should be no change in behavior:

  1. Launch the app.
  2. Tap "See more" on the My Store dashboard.
  3. Confirm the Analytics Hub loads with the expected delta strings, colors, and charts.

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 category: tracks Related to analytics, including Tracks Events. label Dec 6, 2022
@rachelmcr rachelmcr added this to the 11.6 milestone Dec 6, 2022
@rachelmcr rachelmcr marked this pull request as ready for review December 6, 2022 11:38
@rachelmcr rachelmcr linked an issue Dec 6, 2022 that may be closed by this pull request
@wpmobilebot
Copy link
Collaborator

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 pr8320-9e8f0ad on your iPhone

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

@ealeksandrov ealeksandrov self-assigned this Dec 6, 2022
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.

Great work, viewmodels seem much more readable now!

@ealeksandrov ealeksandrov removed their assignment Dec 6, 2022
Base automatically changed from issue/8243-zero-delta-color to trunk December 6, 2022 14:01
@rachelmcr rachelmcr merged commit f629e6c into trunk Dec 6, 2022
@rachelmcr rachelmcr deleted the issue/8243-delta-percentage branch December 6, 2022 14:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

category: tracks Related to analytics, including Tracks Events.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Analytics Hub] Update colors to match designs for 0% change

4 participants