Commit Graph

35738 Commits

Author SHA1 Message Date
Nestor Soriano a33bcaf532 Remove unnecessary phpcs disabler in quick-edit.js 2020-07-14 11:42:22 +02:00
Nestor Soriano a39e15f92b Small adjustments in WC_Admin_Post_Types
- Remove no longer needed phpcs disablers.
- Rename method.
- Remove no longer needed logic.
- Simplify some logic.
2020-07-14 11:42:21 +02:00
Nestor Soriano fc0be07e0f Add unit test for WC_Admin_Post_Types::bulk_and_quick_edit_save_post.
The test added checks that the new regular or sale price is
appropriately set when bulk saving.
2020-07-14 11:42:21 +02:00
Nestor Soriano 320fa38c51 Improve WC_Helper_Product::create_simple_product.
Add a new optional $props parameter containing the properties
to be set in the newly created product.
2020-07-14 11:42:21 +02:00
Nestor Soriano 4531af3382 Small fix in WC_Tests_Admin_Post_Types::bulk_and_quick_edit_stock_status_for_variable_product.
At some point the 'change_stock' key is assumed to be present
in the request data, but it might not. Fixed to test for existence
before using the value.
2020-07-14 11:42:21 +02:00
Nestor Soriano e05aa8a03a Add unit test for WC_Admin_Post_Types::bulk_and_quick_edit_save_post.
The test added checks that stock status of variations when saving
a variable product is changed or not appropriately depending on
the request data supplied.
2020-07-14 11:42:21 +02:00
Nestor Soriano a3ee904081 Add login_as_role and login_as_administrator to WC_Unit_Test_Case.
Those methods are a convenient replacement for
"this->factory->user->create". Tests that were using that to
simulate user login have been modified to use the new methods.
2020-07-14 11:42:21 +02:00
Nestor Soriano 9c2a43bfd5 Fix code sniffer errors in a few unit test files. 2020-07-14 11:42:21 +02:00
Nestor Soriano b71a9c33b6 Extract $_REQUEST to a method in WC_Admin_Post_Types.
Create a new `request_data` method in WC_Admin_Post_Types that
just returns $_REQUEST. This is intended to ease unit testing,
as this method can be easily mocked to return test data.
2020-07-14 11:42:21 +02:00
Nestor Soriano fd34cf76b2 Fix stock status setting for variable products on bulk & quick edits.
For bulk edit: even if stock status was left as "No change", the
status of all variations was being changed to whatever the status
of the product was before it was converted to variable. Now
no change is performed when "No change" is selected, and all
variations change to whatever is selected otherwise.

For quick edit: a new "No change" option is added that will be
preselected when the product is variable. Previously, whatever
status the product had before being converted to variable was being
shown, and that's the status that would be set when saving.
Also, a "This will change the stock status of all variations"
message is displayed before the selector.
2020-07-14 11:42:21 +02:00
Nestor Soriano 39e5a1bfb1 Fix code sniffer errors on quick-edit.js 2020-07-14 11:42:21 +02:00
Nestor Soriano ae0d269128 Refactor duplicate code & add rounding to price calculations in WC_Admin_Post_Types.
Two methods have been created:

- update_stock_status, replaces code that was duplicated in the
  quick_edit_save and bulk_edit_save methods.

- set_new_price, replaces code that was duplicated-ish in the
  bulk_edit_save for setting the new regular and sales prices
  (code was not identical but very similar).

Also, `round` is now used on sale price calculations that involve
multiplying by a percent, the same was as it was done already
to calculate the regular price.
2020-07-14 11:42:21 +02:00
Nestor Soriano 7d5b59953c Fix code sniffer errors in WC_Admin_Post_Types. 2020-07-14 11:42:21 +02:00
Christopher Allford 6cd4079c8a Added a test to verify the rating ordering for products 2020-07-13 13:35:00 -07:00
Peter Fabian 22d3c91182
Merge pull request #26993 from woocommerce/dev/update-versions-after-4.3-release
Update versions and changelog from latest releases.
2020-07-13 21:05:37 +02:00
Christopher Allford 16c5ac401a Adjusted the publish configuration to respect the @woocommerce scope 2020-07-13 10:05:17 -07:00
Christopher Allford 2ef15f02e3 Renamed `WC_Cart::is_tax_displayed()` to `WC_Cart::get_tax_price_display_mode()` to clarify intent 2020-07-13 07:21:19 -07:00
Peter Fabian 23028a90a1 Schema has not been updated, so revert. 2020-07-13 15:34:54 +02:00
Peter Fabian e111b57a86 Removed wildcards from branch name match.
Otherwise branches like 'fix/update-master-branch' will be protected as well.
2020-07-13 15:04:45 +02:00
Christopher Allford 933cdd7a7b Removed the default `id` field added to all CLI commands
Some of our endpoints don't have an "<id>" parameter but we're expecting one in the CLI. Since the `id` is already part of the supported IDs we don't actually need this since it will pull it from the route.
2020-07-10 14:16:30 -07:00
Christopher Allford c3618cad47 Added the `instance_id` parameter to the CLI runner
This is used for shipping zone methods and so we need to be able to parse it too!
2020-07-10 07:21:05 -07:00
Christopher Allford c2bf58a739 Fixed the accessibility of WC_Cart::is_tax_displayed()
Since we're calling the function from the base class we need it to be protected or this throws a fatal exception.
2020-07-09 13:39:16 -07:00
Peter Fabian 6bc0ca724f Update versions and changelog from latest releases. 2020-07-09 13:18:51 +02:00
Adam Radocz 558a052983
Remove leftover note. 2020-07-09 09:44:13 +02:00
Peter Fabian 730df27bc6
Merge pull request #26980 from woocommerce/update/woocommerce-admin-1.3.0
Update WooCommerce Admin to 1.3.0
2020-07-08 18:58:00 +02:00
Timmy Crawford 1fb700486b Update WooCommerce Admin to 1.3.0 2020-07-08 09:51:54 -07:00
Claudio Sanches 864f451775
Merge pull request #26338 from woocommerce/fix/25561
Fixed user cap required to view the order count indicator
2020-07-08 12:09:28 -03:00
Claudio Sanches eeb08467af
Merge pull request #26877 from woocommerce/fix/26547
Fixed WooCommerce menu for users that can only manage orders on WooCommerce
2020-07-08 12:08:29 -03:00
Peter Fabian 7830e90550
Merge pull request #26966 from woocommerce/update/woocommerce-admin/1.3.0-rc.3
Update woocommerce-admin to 1.3.0-rc.3
2020-07-07 11:39:32 +02:00
Timmy Crawford bb32e4a557 Update woocommerce-admin to 1.3.0-rc.3 2020-07-06 15:15:15 -07:00
Peter Fabian db7ca984a5
Merge pull request #26955 from woocommerce/fix/bump-template-versions-4.3
Update template versions for 4.3.
2020-07-06 22:10:19 +02:00
Peter Fabian 0b3900b84a
Merge pull request #26963 from woocommerce/arch/remove-type-hints-from-src
Removed type hints from src folder.
2020-07-06 18:54:25 +02:00
Ron Rennick 625857e9e1 add rating count to order by rating clause 2020-07-06 11:19:17 -03:00
Peter Fabian d54a2c3b2f Removed type hints.
Based on the design committee, we've decided not to use 'old' classes from the includes folder in new code in the 'src' directory. Thus removing those type hints, but leaving them in the docblock to not lose the information.
2020-07-06 15:36:33 +02:00
Szabolcs Légrádi 5174baca35
Extend BACS accounts filter with order ID 2020-07-06 13:36:24 +02:00
Peter Fabian e20568be7d Update template versions for 4.3. 2020-07-04 21:57:39 +02:00
Christopher Allford e4d90f10c3 Corrected the tabs in the README.me 2020-07-02 15:28:19 -07:00
Christopher Allford 3e1d07dd97 Updated the package-lock.json after fixing merge conflicts 2020-07-02 14:44:36 -07:00
Christopher Allford 51467f4683 Added a registry for adapters and factories to be held in globally 2020-07-02 14:43:14 -07:00
Christopher Allford b5e1e1cc8a Added a readme documenting the usage of the model factory package 2020-07-02 14:39:18 -07:00
Christopher Allford 822179e4ac Renamed the e2e-factories package to better reflect its usage-agnostic design 2020-07-02 14:16:01 -07:00
Christopher Allford 5652025d28 Removed unused adapter types 2020-07-02 13:56:48 -07:00
Christopher Allford d8beef56b5 Added support for faker to populate models with dummy data 2020-07-02 13:33:30 -07:00
Christopher Allford 4373c7be1b Moved the factory package init into a common utility 2020-07-02 13:13:23 -07:00
Claudio Sanches 85580cfb4f
Merge pull request #26935 from woocommerce/fix/26822
[Tracker] Added order_total to orders_edit_status_change
2020-07-02 16:29:13 -03:00
Christopher Allford 9b18a95f93 Adjusted the build:packages command to allow each package to build itself 2020-07-02 11:59:41 -07:00
Jonathan Sadowski 3b9ac931b6 Include alt in the items passed to initialize photoswipe 2020-07-02 13:17:34 -05:00
Jonathan Sadowski c0fe1e25de Update jquery zoom to grab alt from source image 2020-07-02 13:17:34 -05:00
Jonathan Sadowski c9e327809a Update photoswipe to display alt attribute on preload 2020-07-02 13:17:34 -05:00
Christopher Allford f1a616e026 Made the model properties compliant with code style 2020-07-02 10:56:21 -07:00