Premium Analytics: port the Average order value widget#49578
Draft
nerrad wants to merge 1 commit into
Draft
Conversation
Port the Average order value widget from next-woocommerce-analytics (woocommerce/woocommerce-analytics@develop) into the Premium Analytics customizable dashboard (WOOA7S-1461). Same composition shape as the average-items-per-order port: report data via @jetpack-premium-analytics/data (useReportOrders), rendering via the widgets-toolkit (WidgetRoot + OrderMetricWidget, average_order_value metric), Range editor via the fields package's ReportParamsField (externalized script module), inline WidgetErrorNotice for the host contract's missing setError channel. Adds the icons and widgets-toolkit link: entries and the widgets/** lint relaxations this widget needs (also added independently by the average-items-per-order PR; identical lines, trivial merge).
Contributor
|
Are you an Automattician? Please test your changes on all WordPress.com environments to help mitigate accidental explosions.
Interested in more tips and information?
|
Contributor
|
Thank you for your PR! When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:
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:
If you have questions about anything, reach out in #jetpack-developers for guidance! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #
Proposed changes
Ports the Average order value widget from
next-woocommerce-analytics(woocommerce/woocommerce-analytics@develop) into the Premium Analytics customizable dashboard — the second data-driven widget, same composition shape as the average-items-per-order port (#49505):useReportOrdersfrom@jetpack-premium-analytics/dataagainst/wc/v3/woocommerce-analytics/proxy/reports/orders, with comparison range. Since data is an externalized script module (Premium Analytics: build the internal ui and data packages as script modules #49574), this widget shares the page-wide QueryClient — with both order-metric widgets on the same range, one pair of report requests serves both types.WidgetRoot+OrderMetricWidget(metricaverage_order_value) from the widgets-toolkit.ReportParamsFieldfrom the fields package (Premium Analytics: add the fields package for widget DataForm controls #49575), externalized as a script-module dependency.icons/widgets-toolkitlink:entries and thewidgets/**lint relaxations this widget's bundles need — also added independently by Premium Analytics: port the Average items per order widget #49505 (identical lines; whichever lands second merges trivially).Deviations from upstream mirror #49505: inline
WidgetErrorNotice(host contract has nosetErrorchannel) and thejpa/namespace.Related product discussion/links
Does this pull request change what data or activity we track or use?
No.
Testing instructions
Requires pnpm ^11.5 and Node ^24.15.
pnpm --filter @automattic/jetpack-premium-analytics build— theaverage-order-valuewidget builds andbuild/widgets.phpregisters it.woocommerce-analyticsplugin active and synced):proxy/reports/ordersrequests serving both widgets (shared QueryClient via Premium Analytics: build the internal ui and data packages as script modules #49574).