Skip to content

Conversation

@rachelmcr
Copy link
Contributor

Closes: #8363, #8366

Description

This PR fetches site summary stats to use in the Sessions card in the Analytics Hub:

  • Defines a period and quantity for the site stats request depending on the AnalyticsHubTimeRangeSelection.SelectionType.
  • Adds a new async method to request the site stats from remote.
  • Sets the sessions card loading state and the error state.
  • Updates the view model binding so the card waits for both requests (the current period order stats and the site stats) before it binds the data.

Note: For now, the Sessions card will show a sync error when custom date ranges are selected. This behavior will be updated in #8367.

Testing instructions

  1. Build and run the app.
  2. Tap "See more" to open the Analytics hub.
  3. Confirm the Sessions card loads with the expected data for the selected date range.
  4. Disable your network connection.
  5. Pull to refresh Analytics and confirm the card displays the expected error.

Screenshots

AnalyticsHub-SessionsCard.mp4

  • 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 Dec 14, 2022
@rachelmcr rachelmcr added this to the 11.7 milestone Dec 14, 2022
@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 linked an issue Dec 14, 2022 that may be closed by this pull request
@wpmobilebot
Copy link
Collaborator

wpmobilebot commented Dec 14, 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 pr8412-b712073 on your iPhone

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

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

All good! :shipit:

@ealeksandrov ealeksandrov removed their assignment Dec 15, 2022
@rachelmcr rachelmcr merged commit e84dcb0 into trunk Dec 15, 2022
@rachelmcr rachelmcr deleted the issue/8353-fetch-summary-stats-ui branch December 15, 2022 12:03
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 Sessions analytics card error state [Analytics Hub] Fetch data for the Sessions analytics card

4 participants