Commit Graph

49753 Commits

Author SHA1 Message Date
Fernando Marichal 98162b9d42
Images Product management MVP 1.0 (#34769)
* Add image section

# Conflicts:
#	plugins/woocommerce-admin/client/products/add-product-page.tsx

* Add `keepSpaceWhenDragging` to sortable

# Conflicts:
#	packages/js/components/src/sortable/sortable-item.tsx
#	packages/js/components/src/sortable/sortable.tsx

# Conflicts:
#	packages/js/components/src/sortable/sortable.tsx

* Export ImageGalleryItem

* Add props to `image-gallery`

# Conflicts:
#	packages/js/components/src/image-gallery/image-gallery-item.tsx
#	packages/js/components/src/image-gallery/image-gallery.tsx

* Changed `media-uploader` label

* Add changelogs

* Fix image-gallery and sortable components

# Conflicts:
#	packages/js/components/src/sortable/sortable-item.tsx
#	packages/js/components/src/sortable/sortable.tsx

# Conflicts:
#	packages/js/components/src/image-gallery/image-gallery.tsx
#	packages/js/components/src/sortable/sortable.tsx

* Set gallery min-height

* Add onOrderChange

* Show images section edit-product

# Conflicts:
#	plugins/woocommerce-admin/client/products/edit-product-page.tsx

# Conflicts:
#	plugins/woocommerce-admin/client/products/edit-product-page.tsx

# Conflicts:
#	plugins/woocommerce-admin/client/products/edit-product-page.tsx

* Fix styles

* Fix styles

* Fix image alt

* Fix TS any

* Add prop `onDragOver`

# Conflicts:
#	packages/js/components/src/image-gallery/image-gallery.tsx

* Fix styles

* Fix padding

* Fix image area min-height

* Fix subtitle copy

* Fix image margin

* Change `draggedImageId`

* Fix `setDraggedImageId` reset

* Rename `isRemoveZoneVisible`

* Add `CardBody` and remove redundant `setValue`

* Fix card styles

* Remove `getUniqueImages`

* Use url as a key when there is no image id

* Fix `orderedImages`

* Add hover to gallery images

* Fix gallery arrows and set cover problems

* Altering blur handler to prevent toolbar closure on media modal

* Fix toolbar drag and drop

* Add replace fn

* Restoring modal class for blur function

* Fix storybook

* Ensuring onBlur doesn't happen while dragging, resolving issue in Firefox

* Adding expected event object to drag callbacks

* Fix image size

* Fix lint

* Another fix lint

* Update plugins/woocommerce-admin/client/products/sections/images-section.tsx

Co-authored-by: Joshua T Flowers <joshuatf@gmail.com>

* Fix `draggedImageId` default value

* Fix toolbar icon style

* Rename consts

* Update pnpm-lock.yaml

Co-authored-by: Fernando Marichal <contacto@fernandomarichal.com>
Co-authored-by: Joel <dygerati@gmail.com>
Co-authored-by: Joshua T Flowers <joshuatf@gmail.com>
2022-10-12 15:16:22 -03:00
Barry Hughes 1d187b70ca
[HPOS/COT] Ensure date_creation_gmt is correctly populated with a GMT datetime (#34875)
* (HPOS/COT) Ensure date_creation_gmt is correctly populated with a datetime in GMT timezone.

* Update the way we test the value of the persisted order creation date.
2022-10-12 20:10:28 +02:00
Néstor Soriano edc1c6c98a
Add handling for plugin-feature incompatibilities (#34879)
* Extend FeaturesController to handle WooCommerce-aware plugins

The methods that return compatibility info now have an extra
'uncertain' part with information regarding plugins that are
WooCommerce-aware but haven't declared compatibility.

* Add a warning about incompatible plugins in the features page.

Includes a link to the list of incompatible plugins.

* Add handling of incompatible plugins in the plugins page.

Plugins that are incompatible with at least one enabled feature
will show a warning in the WooCommerce plugins page, and will
have their "Activate" link disabled.

* - Hook on 'views_plugins' to display two views in plugins page,
  "All" and "Incompatible with feature X"

- Exclude the legacy Analytics features from the feature and plugins
  activation restrictions

- Allow disabling a feature from the settings pages if it's enabled
  and is incompatible with at least one plugin (it won't be possible
  to re-enable it once the settings page reloads)

* Fix FeaturesController::declare_compatibility not working in Windows
(which uses \ instead of / as directory separator)

* - Add two methods to bypass the feature/plugin activation protection.

- Fix: the incompatible plugins count in the feature settings page
  now only counts active plugins.

* Add changelog file

* Fix unit tests

* - Rename "custom orders table" feature to "high performance order tables"

- Add an extra parameter to FeaturesController::get_compatible_plugins_for_feature
  to retrieve all matching plugins or only active plugins.

* Minor wording fixes

* Address PR feedback.

* Allow enabling plugins when WP_DEBUG is true.

* Return if plugin_status is not set.

* Dont change the Activate button.

Co-authored-by: Vedanshu Jain <vedanshu.jain.2012@gmail.com>
2022-10-12 11:08:46 -03:00
Oleksandr Aratovskyi a9dbb6d64e
Change copy of the payments welcome modal (#35031)
* Change copy in Payments Welcome modal

* Change copy in Payments Welcome modal
2022-10-12 16:18:13 +03:00
Sam Seay 55b49cb50a
Fix and consolidate linting across the monorepo (#35012) 2022-10-12 15:05:01 +13:00
peterbialkowski 7aca607899
Update New Zealand subdivisions in states.php (#35011)
Update states.php (New Zealand/CLDR R41)

* Add changelog

Co-authored-by: barryhughes <3594411+barryhughes@users.noreply.github.com>
2022-10-11 15:33:28 -07:00
Matt Sherman 2605d14b9d
Make DateTimePickerControl debounce handling more robust (#34963) 2022-10-11 17:22:52 -04:00
Igor Dimitrijević a6c1421832
Fix typos in the changelog file (#34932)
Fix typos
2022-10-11 13:54:26 -07:00
Roy Ho eef006dad1
Remove PHP 7.2 and set 7.4 as default (#35021) 2022-10-11 12:55:36 -07:00
Matt Sherman 0b70974d43
Fix DateTimePickerControl initial setting of input field (#34980)
* Fix expect checks to actually do something
* Fix default 24 hour format
* Add test for when currentDate is changed
* Fix up tests that were broken (and masked by no assertions)
* Fix initial setting of input
* Export default 12 hour and 24 hour formats
2022-10-11 14:55:08 -04:00
Vedanshu Jain 75721ed9de
Support fetching order types in bulk. (#34976)
Support fetching order types in bulk.

* Add changelog.

* PHPCS and unit test fixups.

* Add return type and param checking for has_callable.
2022-10-11 11:44:50 -07:00
Roy Ho 1ca5388eed
Prep trunk post 7.0 release (#35038) 2022-10-11 11:38:53 -07:00
Maikel David Pérez Gómez e95bb3768e
Add new shipping class modal to a shipping class section in product page (#34937)
Add new shippping class modal to a shipping class section in product page
2022-10-11 12:00:35 -03:00
Vedanshu Jain 1d4888768f
Serialize value before sending to meta display form. (#34952) 2022-10-11 16:06:30 +02:00
nigeljamesstevenson 13c34ad295
api-core-tests product properties tests (#34998)
* api-core-tests product properties tests

* api-core-tests products tests

* api-core-tests products tests
2022-10-11 07:54:48 -06:00
github-actions[bot] 1af32829e8
Delete changelog files based on PR 35025 (#35028)
Delete changelog files for 35025

Co-authored-by: WooCommerce Bot <no-reply@woocommerce.com>
2022-10-10 12:23:20 -07:00
Wojciech Zięba 322f7e8fc7
[7.0] Only show mobile messaging on Merchant New Order emails (#35025)
Adds a check to the mobile messaging callback to ensure it only gets inserted into the email footer for the New Order notification for merchants, and not for emails sent to customers.

Fixes #35016
2022-10-10 12:09:50 -07:00
Roy Ho 84a74b5edb
Remove unneeded files from distribution package (#35000) 2022-10-10 07:36:20 -07:00
Jorge A. Torres c9c2bfbf92
[COT] `query()` method: add support for field queries (#34533)
* Bring Yoda back.

* Add method to OrdersTableQuery to obtain table info for a given order field

* First pass at field_query

* Add tests

* Add changelog

* Use backticks for table names and aliases

* Improve validation in field_query

* Add some more tests
2022-10-10 13:31:00 +05:30
Sam Seay f9bea12589
Disable lint in CI for now since its broken (#35010) 2022-10-10 17:06:37 +13:00
Sam Seay aec442139f
Update pnpm once again to fix issues with auto-install-peers (#35007) 2022-10-10 16:59:51 +13:00
Sam Seay eb6fa6367f
Label community contributed PRs (#34971) 2022-10-10 11:34:52 +13:00
Jamel Noel Reid 91e1347aab
Fix order email receiving test (#34972)
* Added JS data file

* Moved onboarding logic into utils folder

* Used new onboarding methods and data file

* Added changelog

* Moved utils directory

* Added api utils

* Added customer details data

* Used new api utils and data

* Updated path

* Added comment and removed log

* Removed log

* Added changelog
2022-10-07 13:11:49 -07:00
Jonathan Lane aa438e5741
Fix/update playwright and test fixes (#34790)
* Update Playwright 1.22.1 -> 1.26.0

* Update page title locator

* Wait for View cart link after adding to cart

* Add a wait when applying second coupon

* Fix flakey coupon test

* Ensure Store is in US

* Add changelog

* Revert lock file commit

This reverts commit b75192f53c.

* Updated lock file

* Added command for Playwright test execution

* Resolve merge conflict

* Resolve merge conflict

* Fixed pnpm-lock.json

* Update PW Selectors (#34959)

* Updated PW selectors

* Updated selector

* Removed extra command

* Ensure Billing country is set

* Fix failing payment setup test

* Old test is still running in actions

* Adds colour output for Playwright in GH Actions

* Fix payment test

* Lock file update

* Skipping a test for now

Co-authored-by: Jon Lane <jon.lane@automattic.com>
Co-authored-by: jamelreid <jnoelreid@gmail.com>
Co-authored-by: Jamel Noel Reid <MrJnrman@users.noreply.github.com>
2022-10-07 12:39:39 -06:00
Roy Ho c32eb268cf
Dev/beta tester (#34993)
* Add documentation as to where to find the settings/features

* Fix version picker not working

* Bump versions and normalize changelog section

* Remove old changelog files

* Ensure WR can bump the version

* Add minified version of version-picker

Co-authored-by: Jonathan Sadowski <sadowski@automattic.com>
2022-10-07 10:29:02 -07:00
Tam Mullen 7cb84e5b2d
k6: add additional merchant and API order tests (#34707)
* Expanded k6 merchant order tests

* Adding additional k6 merchant and api order requests

* Added changelog

* Added Changelog

* Update k6 search filter test to use customer ID

* Update k6 README for update to config

* Removed Order Filters from k6 daily external tests until the workflow can be updated

* Updated k6 requests for HPOS

* Add k6 completed orders merchant request
2022-10-07 09:47:40 -07:00
Matt Sherman 739ce306e1
Update pnpm-lock.yaml lockfile (#34995) 2022-10-07 11:58:22 -04:00
Vedanshu Jain 0b5d7ab9ad
Revert "[COT] Add the orders cache" (#34992)
Revert "[COT] Add the orders cache (#34396)"

This reverts commit 3f155c9a63.
2022-10-07 20:09:09 +05:30
nigeljamesstevenson 1eb02b4742
api-core-tests order notes tests (#34979)
* api-core-tests order notes tests

* changelog file
2022-10-07 08:25:02 -06:00
Néstor Soriano 3f155c9a63
[COT] Add the orders cache (#34396)
* Reverse the order of "$id" and "$object" in ObjectCache::set

* Add the ObjectCache::update_if_cached method

* Modify ObjectCache:set to validate object before invoking get_id

* Add a temporary TransientsEngine class.

This is temporary! Must be removed before merging to trunk.

* Add the OrderCache class.

This class uses a TransientsEngine instance as the caching engine.
This is temporary and must be undone (get_cache_engine_instance method
must be removed) before merging to trunk!

* Use the new OrdersCache class

- When an order is retrieved, cache it
- When an order is saved, update it if it was cached already
- When an order is trashed or deleted, remove it from cache
- When the authoritative table for orders changes, flush the cache

* Remove the hardcoded usage of TransientEngine in OrderCache

It will make things easier later before merging. The transients engine
can still be used via the wc_object_cache_get_engine hook.

* Add changelog file

* Fix failing unit test

The test was failing because the order is cached by reference when
being saved in the test, and then when being deleted by the REST API
code it gets its id set to 0.

* Add a setting to enable/disable the orders cache

Also added a mechanism to temporarily disable the orders cache while
syncrhonization is in progress.

* Adjustments in the mechanism to temporarily disable the orders cache usage

* OrderCacheController: backup enable option is now stored in memory.

* Convert conditions to Yoda :-(

* Add missing $

* Use the new features engine to declare the cache as an experimental feature

Also decouple the orders cache mechanism from the COT feature,
it can be now used indepently of the COT feature and independently
of whether the new orders table is in use or not.

* Removed unused import and transient class.

Co-authored-by: Vedanshu Jain <vedanshu.jain.2012@gmail.com>
2022-10-07 12:46:24 +05:30
RJ c67a0fbe27
Add Tiktok to OBW grow list (#34953) 2022-10-07 13:50:35 +08:00
Paul Sealock c87f5ce79b
Storybook: Add react and react-dom dependencies (#34950)
add react and react-dom
2022-10-07 15:18:10 +13:00
Jamel Noel Reid 7d710dfe7a
Move onboarding test steps into utils folder (#34970)
* Added JS data file

* Moved onboarding logic into utils folder

* Used new onboarding methods and data file

* Added changelog

* Moved utils directory

* Fixed import
2022-10-06 11:43:45 -07:00
louwie17 f28a467919
Add/34000 attribute select control (#34744)
* Replace preloaded attribute and term dropdowns with async typeahead dropdowns

* Revert accidenatal change.

* Add condition to show the old dropdown in certain situations

* Add changelog

* Use ternary condition

* Move mininumInputLength down to follow the same format as the other filters

* Fix the minimum input length

* Update the select all to work with the async terms field

* Make sure empty attributes are shown and suppress query filter

* Fix code sniff error
2022-10-06 14:27:48 -03:00
louwie17 d756494bcc
Update/experimental select control (#34620)
* Combine last 23 commits into one.

Update css, so dropdown shows correctly

Add extra callbacks and expose some downshift combobox functions

Add changelog

Update stories to reflect new props

Update stories label

Removed `clearOnSelect` prop and reverted some other changes

Fix missed props during rebase

Remove old storybook story and slight fix from rebase

Remove unneeded code

Update default get filtered functionality and add regex escaping

Some updates by testing a new onStateChange callback

Expose the onStateChange callback for more fine control ove the useSelect

Some minor adjustments

Expose stateReducer and minor adjustments from PR review

Simplify logic around isOpen handling with outside component

Remove unused import

Remove onStateChange prop

Address PR feedback

Some minor adjustments to the input handling

Update the way the stateReducer is called

Remove some of the unneeded logic

Remove onStateChange and replace it with onSelectedItemChange and onInputValueChange for simplicity

Fix lint error

* Remove duplicate and unused import

* Fix call to ControlledPropUpdatedSelectedItem in story
2022-10-06 11:40:41 -03:00
github-actions[bot] 5bad53d854
Delete changelog files based on PR 34966 (#34969)
Delete changelog files for 34966

Co-authored-by: WooCommerce Bot <no-reply@woocommerce.com>
2022-10-06 06:19:45 -07:00
Roy Ho 3c8ca2887e
Remove CLI cherry pick tool in favor of CI workflow (#34954) 2022-10-05 20:20:04 -07:00
Corey McKrill 9f8ae8b46f
REST API: Ensure meta_data prop contains an array (#34966)
REST API: Ensure meta_data prop contains an array

When filtering the meta_data array of a response with include_meta or
exclude_meta, the array indexes were getting preserved so that it was
possible for the array to not contain a 0 index, but still have some
subsequent numbers. When such an array was converted to JSON, it was
interpreted as an object rather than an array.

This ensures the meta_data array indexes are reset after filtering, and
adds unit tests to check that meta_data always contains an array, and
not an object.
2022-10-05 14:39:33 -07:00
Joshua T Flowers 048e04d192
Allow external tags in SelectControl component (#34823)
* Allow external tags in SelectControl component

* Add changelog entry

* Fix up changes after rebase

* Fix up custom item type example
2022-10-05 13:29:30 -07:00
nigeljamesstevenson 32e21bbb1f
Add/a2 p create tax rates crud api core tests (#34960)
* Add Tax api-core-tests

* api-core-tests tax tests

* api-core-tests taxes

* api-core-tests taxes
2022-10-05 13:59:35 -06:00
Joshua T Flowers e4f9ccf184
Update text input placement in SelectControl (#34788)
* Move input next to selected items

* Keep input focused on clicking inside combobox

* Add changelog entry

* Handle PR feedback

* Vertically center search icon
2022-10-05 12:08:10 -07:00
Joel Thiessen 77700eb3cc
Adding toolbar to the Image Gallery component (#34871) 2022-10-05 12:07:03 -07:00
nigeljamesstevenson a0233d2d62
Add/a2p create customers crud api core tests (#34945)
* add customer crud api-core-tests

* add changelog file

* Update plugins/woocommerce/tests/api-core-tests/tests/customers/customers-crud.test.js

Co-authored-by: Greg <71906536+zhongruige@users.noreply.github.com>

* Update plugins/woocommerce/tests/api-core-tests/tests/customers/customers-crud.test.js

Co-authored-by: Greg <71906536+zhongruige@users.noreply.github.com>

* Update plugins/woocommerce/tests/api-core-tests/tests/customers/customers-crud.test.js

Co-authored-by: Greg <71906536+zhongruige@users.noreply.github.com>

* PR review updates

* Update plugins/woocommerce/tests/api-core-tests/tests/customers/customers-crud.test.js

Co-authored-by: Greg <71906536+zhongruige@users.noreply.github.com>

Co-authored-by: Greg <71906536+zhongruige@users.noreply.github.com>
2022-10-05 12:45:26 -06:00
rodelgc f8ea46b086
Implement `maxFailures` and warning messages (#33977)
* Add `maxFailures`

* Intentionally fail a test for testing the failure limit

* Add changelog

* Add step to get total number of E2E tests

* Increase max failures

* Add warnings to the test summary.
Also moved some stuff around.

* Update changelog

* Use env var to set `maxFailures` value instead of hard-coding it

* Make sure env var is converted to a number

* Allow maxFailures even if not on CI

* Show incomplete e2e run warning only when E2E_MAX_FAILURES is set

* Safely escape new lines in comment body

* Fix returned stringified summary

* Remove unnecessary newline escaping

* Fix incorrect reference to E2E_MAX_FAILURES

* Minor formatting change

* Shorten warning messages

* Minor change in warning message

* Intentionally fail only 1 test

* Remove intentional failures

* Removed duplicate env declaration

* Correct pnpm command and playwright config file location

* Simplify reference to CI variable

* Remove unnecessary if condition

* Remove references to the old E2E_PLAYWRIGHT flag

* Remove references to the old E2E_PPTR_SUMMARY_PATH variable

* Test for 2 warnings

* Revert to correct locator

* Test for only 1 warning

* Pass all tests
2022-10-05 10:44:20 -07:00
louwie17 6af1695f34
Add/34333 attribute list (#34841)
* Add initial attribute list with dragging and removing functionality

* Fix sortable styling and remove the default selected logic

* Fix css formatting

* Add changelogs

* Add missing question mark

* Add tests

* Some minor CSS updates and move some logic to a util function

* Fix lint issues and add extra test
2022-10-05 13:04:20 -03:00
github-actions[bot] 1d56b84d17
Delete changelog files based on PR 34936 (#34958)
Delete changelog files for 34936

Co-authored-by: WooCommerce Bot <no-reply@woocommerce.com>
2022-10-05 07:23:17 -07:00
Barry Hughes bb898595b8
Correct the textarea name in the Product Short Description template. (#34936) 2022-10-05 16:05:32 +02:00
Joshua T Flowers 4ca95b4fd1
Fix initially selected items in SelectControl component (#34794)
* Allow initial selection of items in SelectControl

* Update stories to include initially selected items

* Add changelog entry

* Update combobox single selected item name
2022-10-04 17:03:37 -07:00
Vedanshu Jain 82153ea567
Support `wc_customer_bought_product` for hpos. (#34931)
* Support `wc_customer_bought_product` for hpos.

* Apply code standards.
2022-10-04 15:52:02 -03:00
Roy Ho 17c8a7fb0a
Remove failing jobs (#34902)
Remove failing jobs"
2022-10-04 05:36:58 -07:00