Commit Graph

4 Commits

Author SHA1 Message Date
Darren Ethier dcdc5c48ce Improve behaviour of draft order cleanup to account for clobbered custom shop order status. (https://github.com/woocommerce/woocommerce-blocks/pull/2912)
* improve behaviour of draft order cleanup with tests

* hide error logging output from tests

* fix doc

* fix status check and test setup/teardown
2020-08-07 15:36:55 -04:00
Darren Ethier 60b1422cf6 Move Draft order logic behind feature flag. (https://github.com/woocommerce/woocommerce-blocks/pull/2874)
* refactor all draft order functionality to be in it’s own class and feature gate it.

* move and fix tests for draft order deletes

* add test to ensure only draft orders are deleted

* implement review feedback and assert valid results before deleting

* update tests

* doh method can’t be protected

* fix conditional for removing scheduled action

* switch to use Woo Core function for catching the exception

* add tests for error handling.

* use `$wpdb->prepare` and remove temp group on test
2020-07-16 12:19:31 -04:00
Mike Jolley 2f91921214 Fix package init for WooCommerce 3.9 (https://github.com/woocommerce/woocommerce-blocks/pull/1335)
* Update Domain/Package so plugin file is not required, only a path.

* remove WC_BLOCKS_PLUGIN_FILE constant and add more inline docs

* Update tests

* Remove WC_BLOCKS_PLUGIN_FILE constant
2019-12-09 16:44:28 +00:00
Darren Ethier 57fdb8fe9c Implement PHP DI container and refactor. Also implements new Asset data interface for extendable settings passed to js. (https://github.com/woocommerce/woocommerce-blocks/pull/956)
* Add dependency injection container for blocks

* Add new Pacakge and Bootstrap classes.

- Bootstrap for bootstrapping the plugin.
- Package will replace `src/Package` and added as a dependency for any classes needing package info.

* Introduce AssetsDataRegistry for managing asset data

* refactor existing classes to use new DIC and Asset Data Registry

- this is the bare minimum needed to make this pull viable.
- further refactors will be done in more atomic smaller pulls for easier review.

* add new settings handling and export `@woocommerce/settings` as an alias to wc.wcSettings

- the export is exposed php side on the `wc-settings` handle.

* Remove unnecessary concatenation

* Fix typos and improve doc blocks

* fix php linting issue

* Use better escaping function.

* improve jsdoc spacing

* improve test assertion

* use fully qualified class names in bootstrap

* improve comment block to account for dynamic version string replace on build

* handle exceptions a bit differently

* correct dependency reference in webpack config

* remove blank lines

* fix doc block comment alignment

* Various doc/grammar/spacing fixes from code review.

Co-Authored-By: Albert Juhé Lluveras <contact@albertjuhe.com>

* improve naming, documentation and logic of filter callbacks

While this is intended for sanitization/validation, the callback ultimately provides flexibility for filtering the value before returning or setting in state so `filter` is a better name for this.
2019-09-23 14:07:13 -04:00