Skip to content

Premium Analytics: port the Bookings by device widget#49701

Merged
nerrad merged 3 commits into
trunkfrom
add/wooa7s-1463-port-woo-widget-bookings-by-device
Jun 28, 2026
Merged

Premium Analytics: port the Bookings by device widget#49701
nerrad merged 3 commits into
trunkfrom
add/wooa7s-1463-port-woo-widget-bookings-by-device

Conversation

@nerrad

@nerrad nerrad commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

Fixes: WOOA7S-1463

Proposed changes

  • Ports the Bookings by device widget into the Premium Analytics customizable dashboard.
  • Registers the jpa/bookings-by-device widget and renders the shared bookings-by-device widget inside WidgetRoot using dashboard-level report params.
  • Ensures booking product filters are forwarded through useReportOrderAttribution() so the widget uses the product-filtered order-attribution endpoint.
  • Adds regression coverage for the hook-level product filter forwarding and product-filtered order-attribution query path.
  • Adds Storybook mock coverage for booking-filtered order-attribution-by-product device data.
  • Adds standalone Default and WithComparison stories plus a real-dashboard WidgetDashboardWithWidget story for the widget.

Storybook screenshot

Captured from the local Storybook widget dashboard story.

Bookings by device Storybook screenshot

Related product discussion/links

Does this pull request change what data or activity we track or use?

No.

Testing instructions

  • git diff --check origin/trunk...HEAD
  • CI=true /Users/dethier/Library/pnpm/pnpm --filter @automattic/jetpack-premium-analytics test -- use-report-order-attribution
  • CI=true /Users/dethier/Library/pnpm/pnpm --filter @automattic/jetpack-premium-analytics typecheck
  • CI=true /Users/dethier/Library/pnpm/pnpm --filter @automattic/jetpack-premium-analytics build
  • CI=true /Users/dethier/Library/pnpm/pnpm --filter @automattic/jetpack-storybook storybook:build
  • Verified the built Storybook iframe packages-premium-analytics-widgets-bookingsbydevice--widget-dashboard-with-widget in the browser: title rendered, Desktop/Mobile/Tablet labels rendered, chart elements rendered, and no visible Storybook render error appeared.

@github-actions

github-actions Bot commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

Thank you for your PR!

When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:

  • ✅ Include a description of your PR changes.
  • ✅ Add a "[Status]" label (In Progress, Needs Review, ...).
  • ✅ Add testing instructions.
  • ✅ Specify whether this PR includes any changes to data or privacy.
  • ✅ Add changelog entries to affected projects

This comment will be updated as you work on your PR and make changes. If you think that some of those checks are not needed for your PR, please explain why you think so. Thanks for cooperation 🤖


Follow this PR Review Process:

  1. Ensure all required checks appearing at the bottom of this PR are passing.
  2. Make sure to test your changes on all platforms that it applies to. You're responsible for the quality of the code you ship.
  3. You can use GitHub's Reviewers functionality to request a review.
  4. When it's reviewed and merged, you will be pinged in Slack to deploy the changes to WordPress.com simple once the build is done.

If you have questions about anything, reach out in #jetpack-developers for guidance!

@jp-launch-control

jp-launch-control Bot commented Jun 17, 2026

Copy link
Copy Markdown

Code Coverage Summary

This PR did not change code coverage!

That could be good or bad, depending on the situation. Everything covered before, and still is? Great! Nothing was covered before? Not so great. 🤷

Full summary · PHP report

@louwie17 louwie17 force-pushed the update/pa-introduce-customize-dashboard branch from 7ff7f71 to 22e10a7 Compare June 19, 2026 12:21
@nerrad nerrad force-pushed the add/wooa7s-1463-port-woo-widget-bookings-by-device branch from c69a0ab to e8683f8 Compare June 23, 2026 12:52
@nerrad nerrad changed the base branch from update/pa-introduce-customize-dashboard to trunk June 23, 2026 12:52
@nerrad nerrad marked this pull request as ready for review June 23, 2026 13:00
@nerrad nerrad requested review from a team as code owners June 23, 2026 13:00
@nerrad nerrad closed this Jun 23, 2026
@nerrad nerrad reopened this Jun 23, 2026
@github-actions github-actions Bot added [Status] Needs Author Reply We need more details from you. This label will be auto-added until the PR meets all requirements. and removed [Status] In Progress labels Jun 23, 2026
@nerrad nerrad added [Status] Needs Review This PR is ready for review. and removed [Status] Needs Author Reply We need more details from you. This label will be auto-added until the PR meets all requirements. labels Jun 23, 2026

@chihsuan chihsuan left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Solid port, verified the story renders the device breakdown end-to-end! 👍

Left a few inline notes worth a look before merge.

Comment thread projects/packages/premium-analytics/widgets/bookings-by-device/package.json Outdated
@nerrad nerrad force-pushed the add/wooa7s-1463-port-woo-widget-bookings-by-device branch 3 times, most recently from d8965ee to 2444965 Compare June 26, 2026 19:55
@nerrad nerrad force-pushed the add/wooa7s-1463-port-woo-widget-bookings-by-device branch from 2444965 to f516859 Compare June 28, 2026 11:37
@nerrad

nerrad commented Jun 28, 2026

Copy link
Copy Markdown
Contributor Author

Opened draft follow-up PR #50031 as an example path for making jpa/bookings-by-device conditionally available only when WooCommerce Bookings is installed and active: #50031

@nerrad nerrad merged commit 1f0ce85 into trunk Jun 28, 2026
91 of 92 checks passed
@nerrad nerrad deleted the add/wooa7s-1463-port-woo-widget-bookings-by-device branch June 28, 2026 15:58
@github-actions github-actions Bot added [Status] UI Changes Add this to PRs that change the UI so documentation can be updated. and removed [Status] Needs Review This PR is ready for review. labels Jun 28, 2026
adamwoodnz pushed a commit that referenced this pull request Jun 29, 2026
* Premium Analytics: Port bookings by device widget

* Premium Analytics: forward bookings device widget errors

* Premium Analytics: localize bookings by device widget
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants