Commit Graph

49804 Commits

Author SHA1 Message Date
Vedanshu Jain 8848e4aa47
Check before getting order classname to see if it exists. (#35207) 2022-10-20 14:47:58 +05:30
Vedanshu Jain 80cbb9dcdc
Use correct datastore when backfilling orders. (#35176)
* Use correct datastore when backfilling orders.

* Fix some unit tests and simplify calls.
2022-10-20 13:22:22 +05:30
github-actions[bot] 3d78fd24ee
Prepare Packages for Release (#35205)
Automated change: Prep @woocommerce/components for release.

Co-authored-by: chihsuan <chihsuan@users.noreply.github.com>
2022-10-20 13:21:11 +08:00
Sam Seay 4fc33dc3ef
Add back the code reference updates action (#35140)
Add back the code reference updates action.
2022-10-20 13:52:03 +13:00
louwie17 5f2c656e6b
Add/34331 add attributes modal (#34999)
* Add initial add attribute modal

* Add async select control component and add attribute terms

* Make use of AsyncSelectControl for attributes

* Rearranged the add attribute form to make removing easier

* Make sure add button is disabled if fields are empty

* Remove the use of AsyncSelectControl for now

* Add disabled option and fix merge conflict

* Add attribute modal tests

* Remove unused trigger drag

* Add popover slot

* Small update to select control and fix multi selection in term field

* Add tests for attribute and attribute term fields

* Add changelogs

* Small fix after merge conflict

* Fix some styling and issue with select control when clearing item

* Fix lint error

* Fix up some styling issues after rebase

* Fix formatting, some styling issues, and address some PR feedback

* And confirmation dialog for closing the modal.
2022-10-19 16:28:29 -03:00
Vedanshu Jain 5b6ddf0b88
Update biling and shipping address indexes. (#35121)
* Update biling and shipping address indexes.

* Add changelog.

* Code standard fixes.

* Add unit test for search after update.

* PHPCS fixes.
2022-10-19 16:21:42 +05:30
Jonathan Lane a2076f59a5
Update PR template to provide guidance for testing (#34597)
* Update PR template to provide guidance for testing

Co-authored-by: Jon Lane <jon.lane@automattic.com>
2022-10-19 14:00:09 +08:00
Joshua T Flowers c72e00d85c
Add Tooltip component and remove EnrichedLabel (#35024)
* Add experimental tooltip component

* Add tooltip stories

* Update EnrichedLabel component

* Remove EnrichedLabel

* Add changelog entries

* Fix up linting issues

* Handle PR feedback
2022-10-18 16:08:49 -07:00
Roy Ho 53cb2ada67
Revise logic to update changelog.txt entries (#35086)
* Add logic to update the Stable version after a release

* Revise post release automation to only update changelog
2022-10-18 15:44:20 -07:00
nigeljamesstevenson bb42e7892a
api-core-tests add product reviews crud tests (#35163) 2022-10-18 16:33:11 -06:00
louwie17 1f7deb139f
Add popover support to select control dropdown (#34967)
* Add dropdownPlacement option to SelectControl

* Make use of parent element of menu for width

* Add changelog

* Add useEffect for boundingRect so it gets updated accordingly

* Fix styling for popover dropdown

* Move popup markup down to render return

* Move getMenuProps up

* Move getMenuProps down to list again and always render the popover menu

* Add MenuSlot that adds popover slot to mody with aria-live=off so it is skipped by Modal

* Add comment in relation to the eslint-disable comment

* Fix flashing of popover and addressed some minor PR suggestions
2022-10-18 16:55:37 -03:00
Matt Sherman 0769625b72
Add DateTimePickerControl Form stories and tests (#34964)
* Add test for DataTImePickerControl in Form
* Add DateTimePickerControl to Form story
* Export type for InputProps
2022-10-18 15:06:04 -04:00
Maikel David Pérez Gómez c79af1acc5
Replace the trash can icon in the attribute list (#35133) 2022-10-18 16:05:01 -03:00
Maikel David Pérez Gómez a0b27a4966
Select the current new added shipping class (#35123)
* Select the current new added shipping class

* Extracting constants into the right file

* Add unit tests

* Use setValue instead onChange to select the shipping class of the product
2022-10-18 15:40:56 -03:00
Moon 4775defb1f
Update WooCommerce beta tester README (#35090)
* Update readme

* Add changelog

* Add Installation section

* Fix typo

* Update WC Admin Test Helper dev commands

* Move back Development section to README.md
2022-10-18 09:22:51 -07:00
Joshua T Flowers 3c6681054a
Add product management description (#34961)
* Add label prop to rich text editor

* Create feature class and enqueue styles

* Add description editor and parsing

* Fix up incorrect context for product data

* Add styling to rich text editors in product form

* Fix editor initialization on new product

* Add changelog entries

* Use trunk lock file

* Add component changelog entry

* Update lock file

* Register block store provider in tests

* Fix up phpcs errors in product feature file
2022-10-18 08:55:31 -07:00
jonathansadowski d0e277e80b
Add PR_ASSIGN_TOKEN to contributors action (#35137)
Adds PR_ASSIGN_TOKEN with repo permissions to the community contributors actions so that the bot has permission to make team assignments
2022-10-18 09:20:22 -05:00
Paulo Arromba 00368924df
Update WooCommerce Blocks package to 8.7.2 (#35101)
* Update WooCommerce Blocks package to 8.7.2

Co-authored-by: Niels Lange <info@nielslange.de>
2022-10-18 10:36:05 +01:00
Matt Sherman 9fc0935e98
Remove non-gmt scheduled sale properties from Product type (#35096) 2022-10-17 16:50:18 -04:00
jonathansadowski c6eab3b4b2
Fix the match pattern for the version bump tool (#34982)
* Update pattern in version bump tool to use two digits

* Update README for version bump for pnpm7 parameter order
2022-10-17 13:48:56 -05:00
Greg 868f581af8
Prepare api-core-tests for release (#35001) 2022-10-17 12:24:07 -06:00
Moon 13a5ba2f1d
Optimize query usage in the Onboarding tasks (#35065)
* Optimize is_complete() method

* Replaed WC_Product_Query with wp_count_posts, which has more optimized query

* Optimize TaskList::is_complete -- return early when false instead of running through all the tasks

* Cache is_complete() method for the tasks with db query

* Add changelog
2022-10-17 11:23:55 -07:00
Matt Sherman e470c62650
Add date-only mode to DateTimePickerControl (#35066)
* Remove border from top of date picker
* Add isDateOnlyPicker, rename is12HourPicker
* Add tests for isDateOnlyPicker
* Add date only story
2022-10-14 16:48:03 -04:00
jonathansadowski 8747ea2995
Remove latest stable version from README (#35056)
* Remove latest stable version from README

* Add change file
2022-10-14 15:22:27 -05:00
Matt Sherman 0cbc45ba85
Handle ambiguous dates (with no offset) in DateTimePickerControl (#35077)
* Add tests for ambiguous and unambiguous UTC dates

* Assume UTC for ambiguous dates

* Changelog

* Remove console statements
2022-10-14 15:38:18 -04:00
jonathansadowski 1eecefb715
Update version of auto-assign-reviewer (#35104)
* Update version of auto-assign-reviewer

Update version of auto-assign-reviewer action to one that fixes the bug with team reviewers.

* Update community pr assigner config for team syntax

The new version of community pr assigner uses `team: ` prefix to designate teams.
2022-10-14 14:23:39 -05:00
Moon 0f58f2efbd
Fix JS errors when the OBW business step is accessed directly via URL (#35045)
* Set default value for product types

* Add changelog
2022-10-14 11:43:36 -07:00
louwie17 c55c91d7e0
Add category field dropdown field (#34400)
* Add initial category field component with new typeahead

Move search logic to useCategorySearch hook

Add initial add new category logic

Add parent category field to add new category modal

Adding some debug changes

Update category control to make use of internal selectItem function of select control

Add changelogs

Update pagesize back to 100

Add placeholder

Empty placeholder

Fix input and icon sizes

Fix input underline

Add max height and scroll to category dropdown

Add sorting of category items

Auto open parents when traversing up the tree using arrow keys

Add several comments

Add some initial unit tests for the category field component

Add tests for useCategorySearch hook and fixed minor bug

Update styling and autoselect parent if child is selected

Fix styling issues for the select control dropdown inside a modal

Fix issue with creating new category with parent

Add function comment and fixed border styling

Prune out create new category logic

Fix minor css issue with border

Revert some of the select control changes and make use of the custom type

Fix up some styling changes

* Fix type conflict

* Revert change in state reducer

* Add cursor pointer

* Fix styling errors

* Fix broken category tests

* Fix merge conflict
2022-10-14 09:05:39 -03:00
Sam Seay 9b9abd1eae
Replace outdated readme examples of using pnpm (#35064) 2022-10-14 16:14:45 +13:00
jonathansadowski 6b85482f34
PR Review Assigner: Try using `atlas` instead of `woocommerce/atlas` (#35082)
Try using `atlas` instead of `woocommerce/atlas`
2022-10-13 15:20:25 -05:00
jonathansadowski 699e14d4c7
Action: Assign community PRs a reviewer (#35041)
* Community contrib action: Set output with contributor status

* Assign community PRs a reviewer

* Create configuration for community PR labeler
2022-10-13 14:19:36 -05:00
github-actions[bot] 4055797bf0
Release: Remove 7.1 change files (#35080)
Delete changelog files from 7.1 release

Co-authored-by: WooCommerce Bot <no-reply@woocommerce.com>
2022-10-13 13:57:26 -05:00
Roy Ho 8db5b7be8b
Dev/update code freeze workflow (#35078)
* Update changelog command post PNPM update

* Add version bump to trunk for next dev cycle

* Remove reviewer part
2022-10-13 11:23:03 -07:00
Kirtan Gajjar a5814f1bc7
Make qty input box visible when min_qty = max_qty (#34282)
Make the quantity input visible, even if the min and max allowed values are identical.

* Add changelog

* Update plugins/woocommerce/changelog/fix-GH-34280

Co-authored-by: Barry Hughes <3594411+barryhughes@users.noreply.github.com>

* Update plugins/woocommerce/templates/global/quantity-input.php

Co-authored-by: Barry Hughes <3594411+barryhughes@users.noreply.github.com>

* Fix `@since` tag

* Use a single readonly input (when quanity cannot be changed) instead of two inputs (hidden and disabled).

* Introduce consistent formatting when a product is sold individually and when the min/max is identical.

* Update `@version` tags to 7.1.0.

Co-authored-by: Barry Hughes <3594411+barryhughes@users.noreply.github.com>
2022-10-13 09:48:08 -07:00
Bartosz Budzanowski cfe8f76be9
Add order origin tracking. (#35069)
Track order origins ( _created_via )

* Add changelog.

* Fix formatting.

* Use one-liner array.

Co-authored-by: Barry Hughes <3594411+barryhughes@users.noreply.github.com>

* Add missing whitespace.

Co-authored-by: Barry Hughes <3594411+barryhughes@users.noreply.github.com>

* Fix foreach format.

Co-authored-by: Barry Hughes <3594411+barryhughes@users.noreply.github.com>

* No trailing spaces in description.

Co-authored-by: Barry Hughes <3594411+barryhughes@users.noreply.github.com>

* Don't use hardcoded table prefix.

Co-authored-by: Barry Hughes <3594411+barryhughes@users.noreply.github.com>

Co-authored-by: Barry Hughes <3594411+barryhughes@users.noreply.github.com>
2022-10-13 08:59:24 -07:00
Vedanshu Jain 21419e4a2c
Fix missing changelog. (#35072) 2022-10-13 18:39:51 +05:30
Peter Fabian 638af2f04e
[HPOS] Improve plugin matching for compatibility check (#35070) 2022-10-13 14:42:53 +02:00
Fernando Marichal ca4bd882ed
Improve the "Dismiss" button visibility (#35060)
* Improve `Dismiss` button visibility

* Add changelog

Co-authored-by: Fernando Marichal <contacto@fernandomarichal.com>
2022-10-13 09:42:35 -03:00
Vedanshu Jain 4ccbcc1b2e
Set correct timezone when backfilling data. (#35033)
* Set correct timezone when backfilling data.

* Add changelog.

* Apply code standards.

* Address further flakiness and more comprehensive test.

* More fixes for timezone backfil.

* Remove unnecessary comments.

* Revert test change since we are not changing systems timezone.

* Minor alignment fix.

* Minor language fix.

Co-authored-by: Peter Fabian <peter.fabian.github@gmail.com>

Co-authored-by: Peter Fabian <peter.fabian.github@gmail.com>
2022-10-13 17:48:24 +05:30
Vedanshu Jain 0a9434605e
Also read from posts when reading from COT to check for direct write (#34465)
* Add and use ON_DUPLICATE_KEY update function to perform update/insert without additional query.

* Fix typo

* Add more tests for save related functions.

* Update post directly to update correct post_modified value.

If we use wp's update_post function, then it will set the post-modified date to current time(). This is not desirable when backfilling order data where we want post data to be exactly the same as orders.

* Add changelog.

* Add support to sync from posts table when reading order table.

When sync is enabled, we also read from posts table when an order is read from COT. Mismatch in this case implies a direct write and therefore we update the COT record with data from posts. This provides an additional layer of backwards compatibility.

* Add more tests for different tables.

* Modify sync logic to account for metadata that has been changed.

* Fetch post only when data sync is enabled.

* Made test case comparison more strict to prevent flakiness.

* WIP

* WIP

* Added protections and code standard fixes.

* WIP

* Change order data store internal key to props for better representation.

* Add changelog

* Add legacy datastore prop for WC_Data object to support COT.

* Also support passing in `get_stock_reduced` method.

* Add internal meta keys to order table data store.

* Add tests for CPT datastore for orders.

* Change return type to prevent implicit type conversion.

* Use correct conversion.

* Revert "Use correct conversion."

This reverts commit 97ead11f71.

* Add conversions to test as needed.

* Add internal keys for order table data store for consistency.

* Apply code standards.

* Merge conflict fixes.

* Add more tests.

* Add more fixes and unit test for sync logic.

* Remove $save param for consistency with parent class.

Earlier, we added the $save parameter for performance reason, but now that we are storing the props in the WC_Order object, this isn't needed anymore (as the object can hold the updated props).

* Return bool instead of string as described.

* Fix test by transforming bool values before confirming.

* Fix test by not needing to converting to string, since we now bool value.

* Store internal props as bool instead of string.

* Remove unused method.

* Only select props for refunds that are actually needed.

* Store bool as yes/no to maintain compatibility with how were storing prev.

* Fix unit test to extpect yes.

* Add tests and set special metadata migrated from data store correctly.

* Add tests for legacy prop get/set in ordertabledatastore.

* Update email class to use data store method instead of get_meta.

* Update exisiting tests to account for changes in legacy prop setting.

* Read from CPT store directly, and cache the pending value.

* Fixup in unit test.

* Add test for refund creation.

* Add test for refund creation.

* Remove strict WC_Order typecasting.

* Address code standard voilation.

* Call correct parent method for updating meta.

* Use WC_Absract instead of WC_Order to provide more compatibility.

* Record order ids we are syncing for to prevent any infinite loop.

* Add test for fixing infinite loop with read on sync.

* Address PR feedback.

* Fix formatting.

Co-authored-by: Barry Hughes <3594411+barryhughes@users.noreply.github.com>

* Fix formatting.

Co-authored-by: Barry Hughes <3594411+barryhughes@users.noreply.github.com>

* Use correct type hints.

Co-authored-by: Barry Hughes <3594411+barryhughes@users.noreply.github.com>

* Fix formatting.

Co-authored-by: Barry Hughes <3594411+barryhughes@users.noreply.github.com>

* Yoda, use.

Co-authored-by: Barry Hughes <3594411+barryhughes@users.noreply.github.com>

* Remove space between minus and numeral for readability.

* Fix ut, and use assertTrue instead of native for consistency.

* Port a fix for edit date save.

Co-authored-by: Barry Hughes <3594411+barryhughes@users.noreply.github.com>
2022-10-13 17:13:37 +05:30
Joel Thiessen 315e163b29
Only show five inbox messages and add "Show more" button (#35003)
* Basic paging functionality

* Adding changelog

* Inserting placeholder at end of list, working dismissal

* Fixing issues with dismissed notes not updating UI

* Fixing odd display when removing last note

* Renaming page variable

* Adding tracks event

* Addressing issues caused by .map within useSelect, and getting rid of hash

* Fixing nested ternary linting issue

* Removing console logs

* Updating test
2022-10-13 08:36:02 -03:00
Paulo Arromba 1c0925a905
Update WooCommerce Blocks package to 8.7.1 (#35040)
* Update WooCommerce Blocks package to 8.7.0

* Update WooCommerce Blocks package to 8.7.1
2022-10-13 12:21:20 +02:00
Jorge A. Torres 3e3b413d17
Some improvements to plugin feature incompatibility UI (#35063)
Co-authored-by: Nestor Soriano <konamiman@konamiman.com>
2022-10-13 12:06:57 +02:00
Vedanshu Jain b6439c6ed1
Implement missing refund tax methods for HPOS (#34805)
Co-authored-by: Nestor Soriano <konamiman@konamiman.com>
2022-10-13 10:57:22 +02:00
RJ 1991347234
fix: handle error loading and error states for magic link button (#35068) 2022-10-13 16:12:40 +08:00
Jorge A. Torres d2dd772ede
Fix admin settings checkbox disabled (#35067)
* Fix ‘disabled’ state for admin settings

* Add changelog
2022-10-13 11:51:30 +05:30
Ismael Martín Alabarce 3d1f8c36e0
Update WCPay promo requirements and ensure dismiss (#35030)
* Ensure Payments menu is dismissed after choosing no

Now it gets also dismissed on modal close

* Add a new requirement

Check if the store has another payment gateway installed to be eligible for the promotion.

* Add changelog entry

* Fix not using strict comparison for in_array

* Update is_another_payment_gateway_installed

To use a static list instead of PaymentGatewaySuggestions
2022-10-13 08:14:01 +02:00
RJ edbb3ea793
Fix: mismatching jetpack user should not see mobile app task list item (#35052)
* fix: mismatched user shouldn't see task item to get mobile app
2022-10-13 10:27:42 +08:00
Joshua T Flowers 8fbdbaf354
Add product page inventory quantity management (#34984)
* Add manage stock section to product inventory section

* Fix up h4 styles in form sections

* Check if stock management is enabled in store settings

* Fix up more styles in form

* Extract inventory validation and add new validation rules

* Add changelog entry

* Add changelog entry

* Remove sku related validation
2022-10-12 14:30:02 -07:00
Joshua T Flowers 618cc54a3f
Add RichTextEditor component using native block editor toolbar (#34865)
* Add initial rich text editor component

* Use fixed toolbar and add base formatters

* Add link as formatter option

* Fix up references to core/link block

* Add quote transform

* Add changelog entry

* Add text alignment toolbar

* Remove references to checkbox list

* Update toolbar button organization

* Remove unused rtj format types

* Create unique instance for editor writing flow

* Add registry provider for storybook examples

* Update styling for editor

* Rebase and fix lock file

* Add packages and type dependencies

* Move component to experimental

* Fix up formatting

* Update editor to use default GB toolbar

* Prefix names with woocoommerce

* Create block on initialization so toolbar is visible

* Rely on insertBlock to handle selection

* Update text editor to use setting instead of BlockList prop

* Fix up lock file after rebase

* Handle PR feedback

* Move logic for force rerender

* Fix up pnpm lock file

* Use trunk lock file

* Update lock file

* Add missing semicolon

* Use Pauls lock file and package file
2022-10-12 14:15:55 -07:00