Commit Graph

42 Commits

Author SHA1 Message Date
Peter Fabian a8bedc5998 Accept before and after parameters as DateTime or string. 2019-02-10 17:18:05 +01:00
Peter Fabian d71225d7d1 Use default after and before parameter values if no values are provided by the user. 2019-02-10 17:16:43 +01:00
Peter Fabian 68c65cfde6 Corrected output of GMT time. 2019-02-08 18:12:20 +01:00
Peter Fabian 5fbf5b62d7 Normalize datetimes before doing any further processing with the input from the user.
Also, passing DateTime objects around instead of string so that timezone info can be easily attached to it.
2019-02-08 18:11:04 +01:00
Joshua T Flowers b7379def1b Format todo comments to match WC Core format (https://github.com/woocommerce/woocommerce-admin/pull/1474)
* Format todo comments to match WC Core format

* Remove variations todo comment
2019-02-06 14:41:53 +08:00
Justin Shreve 949afce248 Add Product Detail Report & Finish Comparison Chart Mode Functionality (https://github.com/woocommerce/woocommerce-admin/pull/1391)
Product detail report and comparison

Code cleanup

Fix 404 on product variations endpoint after rebase

Fix up tests

Fix loading indicators and add some checks around malformed variation response

Add date filtering SQL bits to the variations query

Handle PR feedback: Fix viewport, fix duplicate product issue, fix legend display reset, fix bargraph overflow, fix some coding standards/whitespace, add extra variation santiziation.

Fix scroll on wide charts, and fix undefined prop getting passed into report chart render
2019-02-05 13:12:58 -05:00
Peter Fabian b69d2aa2ab Merge branch 'master' into fix/1012-2
# Conflicts:
#	tests/reports/class-wc-tests-reports-orders-stats.php
2019-02-05 18:34:15 +01:00
Joshua T Flowers 3aaf318779 Exclude trashed orders from reports (https://github.com/woocommerce/woocommerce-admin/pull/1464) 2019-02-05 10:57:38 +08:00
Peter Fabian 32f851be5b Merge pull request woocommerce/woocommerce-admin#1286 from woocommerce/fix/1035
Added segmenting support to REST API
2019-02-01 20:50:38 +01:00
Peter Fabian c2bcad2e50 Merge branch 'master' into fix/1012-2 2019-02-01 13:32:35 +01:00
Joshua T Flowers 49e78b90cf Add settings page with excluded order statuses (https://github.com/woocommerce/woocommerce-admin/pull/1364)
* Add settings page routes

* Add control options for excluded statuses

* Add control options for excluded statuses

* Add excluded order statuses to rest api

* Add wc settings to wc-api

* Add wc settings to wc-api

* Split and validate multiselect values in settings controller

* Add wcAdminSettings to wcSettings global

* Set initial excluded statuses from serverside wcSettings data

* Add extensible filter for wcSettings global

* Split arrays into comma separated strings in wc-api

* Extract setting as separate component

* Extra settings to config file

* Add checkboxGroup option as input type

* Separate status types into default and custom groups

* Add setting option styling

* Add responsive styling for settings

* Fix wpClosedMenu and wpOpenMenu for settings page

* Add support for resetting to default values

* Only show checkbox group if options are available

* Add proptypes to Setting component

* Add extensible filter to analytics settings

* Add readme for settings config and extensibility

* Hook up excluded status settings to reports

* Pass object to settings API instead of comma delimited string

* Fix inpuType -> inputType typo

* Remove hasError from constructor

* Bump settings API to v4

* Use interpolateComponents instead of dangerously setting html

* Use empty array in initial excldued statuses setting value if none is retrieved

* Remove double check for refunded status in default order statuses

* Update settings wc-api to use namespace

* Add aria=labelledby to checkbox group
2019-01-31 09:04:11 +08:00
Peter Fabian e56009cfdc Updated todo format to be in line with the rest of WooCommerce. 2019-01-29 13:29:50 +01:00
Peter Fabian e4e09b4c39 Merge branch 'master' into fix/1035 2019-01-29 10:01:41 +01:00
Peter Fabian 64f1418f22 Merge branch 'master' into fix/1012-2 2019-01-23 21:40:09 +01:00
Peter Fabian 33f1240987 Fix to remove extra intervals correctly. 2019-01-23 17:18:39 +01:00
Peter Fabian eff341d832 Made the interval sorting stable (second level sort by time_interval).
This is required so that intervals are sorted in the same way each time when going through pages of results.
2019-01-23 16:58:03 +01:00
Peter Fabian 012e14c589 Corrected time-calculation of last interval. 2019-01-22 19:50:35 +01:00
Peter Fabian 05c7670090 Merge branch 'master' into fix/1035
# Conflicts:
#	includes/class-wc-admin-reports-interval.php
#	includes/data-stores/class-wc-admin-reports-data-store.php
#	includes/data-stores/class-wc-admin-reports-products-data-store.php
2019-01-16 12:51:23 +01:00
Joshua T Flowers 33a7cfa1b0 Store all order statuses (https://github.com/woocommerce/woocommerce-admin/pull/1285)
* Store all orders regardless of status in wc_order_stats

* Only query select statuses if status_is or status_is_not is not set

* Fix order stats example query

* Filter category store by default order statuses

* Add table_name to interval functions to avoid ambiguity

* Filter coupon store by default order statuses

* Fix interval stats by adding table_name to interval function

* Filter products store by default order statuses

* Remove unused order_status in coupons data store

* Store products with any order status

* Fix ambiguous order by call in products data store

* Apply status filter after other filters to avoid logical OR matching

* Store all coupon data regardless of order status

* Filter taxes by default order statuses

* Filter customer stats by default order status

* Filter default order statuses in variations data store

* Use excluded statuses to filter reports by default

* DRY up default excluded statuses query

* Fix up new orders data store after rebase
2019-01-16 10:23:00 +08:00
Peter Fabian b593163dff Added more general function for sorting array of arrays based on subarray's key. 2019-01-15 11:08:23 +01:00
Peter Fabian 250c0910a1 Merge branch 'master' into fix/1035 2019-01-11 11:16:01 +01:00
Joshua T Flowers f3346e9298 Add the order status column to lookup table (https://github.com/woocommerce/woocommerce-admin/pull/1211)
* Add the order status column to lookup table

* Fix order status filter for order stats

* Fix normalize order status and make static function
2019-01-08 09:16:10 +08:00
Justin Shreve e3e9ccb6a4 Add `reports/downloads/stats` REST API Endpoint (https://github.com/woocommerce/woocommerce-admin/pull/1142)
* First pass at downloads REST API

* Add reports/downloads/stats endpoint.

* Add tests

* Update cache key
2019-01-03 13:00:48 -05:00
Peter Fabian 1e39bc0756 Merge branch 'master' into fix/1035
# Conflicts:
#	includes/wc-admin-order-functions.php
2019-01-02 14:08:23 +01:00
Peter Fabian 1931f3bf48 Added table name to time limit clauses. 2019-01-02 11:31:48 +01:00
Justin Shreve 49a0f0f6d2 Add `reports/downloads` REST API endpoint. (https://github.com/woocommerce/woocommerce-admin/pull/1122)
* First pass at downloads REST API

* Handle PR feedback
2018-12-21 14:57:46 -08:00
Peter Fabian a346f13beb Added extended info. 2018-12-18 12:01:38 +08:00
Peter Fabian 1c8459244a Merge branch 'master' into fix/749
# Conflicts:
#	includes/data-stores/class-wc-admin-reports-products-data-store.php
2018-12-04 12:07:43 +01:00
Peter Fabian e297e5ba7f Fixed TABLE_NAME references.
To be compatible with PHP 5.2.
2018-12-03 18:01:50 +01:00
Peter Fabian b8dff97e00 Fixed PHP 5.2 compatibility. 2018-12-03 14:44:43 +01:00
Peter Fabian 216b7c94ca Updated structure for includes/excludes coupons and products subqueries.
As there can be multiple coupons and products assigned to one order, it needs to ba handled differently when constructing SQL query.
2018-11-27 16:26:50 +01:00
Peter Fabian 7dd611f4d4 Added table name to time period sql params.
Without this, the subquery could not be used in some contexts, as the column name was ambiguous.
2018-11-27 16:23:40 +01:00
Peter Fabian c1cf221773 Fixed typos. 2018-11-16 18:02:19 +01:00
Peter Fabian 26debd77c3 WIP on advanced filters.
Plus fixing bugs:
- fixed tests
- fixed schema definition to reflect response data
- split WHERE SQL clause into time constraints and rest
2018-11-16 17:51:33 +01:00
Peter Fabian 7c6d0dc314 Handled case where match parameter is missing. 2018-11-16 12:32:13 +01:00
Peter Fabian ba09fea35d Updated filters subqueries to correctly handle no filter case. 2018-11-16 12:12:47 +01:00
Peter Fabian d009deb3e1 Added initial implementation of advanced filters. 2018-11-15 15:27:19 +01:00
Kelly Dwan f62537fc17 Try: Add Lerna to split out utility packages (https://github.com/woocommerce/woocommerce-admin/pull/678)
* Add lerna & GB package-building script

* Move currency library to lerna module

* Update lerna config

* Add publish commands

* Add currency as an faux-external module

* Add separate command to build just core files

* Update dependency path

* Update build script to build all packages into `dist`

* Add packages to the jest test setup

* Move date library to packages

* Update imports to use @woocommerce/date

* Output wcSettings definition before any scripts are output

Fixes issues where wc-dates lib relies on settings object

* Add the build step into travis

* Update jest config to dynamically get package paths

* Update package postcss config to match wc-admin’s main config

* Add combined watch scripts for package+app, add a `clean` command to clean up old build files

* Ignore PHPCS error (leave todo message to fix)

* Concat files with a space, fix issue where all files join in one continuous string and fail the check
2018-10-30 14:57:48 -04:00
Peter Fabian 3d71ec9208 Simplified compound expression to fix code for older PHP versions. 2018-10-26 14:02:53 +02:00
Jonathan Belcher 46c369afb1 Fixes lints in class-wc-admin-reports-data-store (https://github.com/woocommerce/woocommerce-admin/pull/643)
* Fixes lints in class-wc-admin-reports-data-store

* Fix documentation
2018-10-23 13:55:03 -04:00
Jonathan Belcher ecb3013fd3 Uses PHPBCF to autofix warnings and errors (https://github.com/woocommerce/woocommerce-admin/pull/611) 2018-10-22 12:20:14 -04:00
Peter Fabian d2ac6cdbe1 Added reporting REST API extensions to wc-admin. 2018-09-17 16:32:03 +02:00