Commit Graph

49476 Commits

Author SHA1 Message Date
Chi-Hsuan Huang 26a3d0d3c1
Update inbox notes to display localized strings when locale changed (#34038)
* Add a filter woocommerce_get_note to modify note before it is returned

* Make ChoosingTheme.get_note public so we can call it outside

* Implement the get_note filter to return localized strings

* Create get_actions method to reuse it in RemoteInboxNotificationsEngine

* Implement get_note filter in RemoteInboxNotificationsEngine to return localized note

* Add changelog

* Make GivingFeedbackNotes.get_note public so we can call it outside

* Check if note class has NOTE_NAME constant

* Update WooSubscriptionsNotes to show localized content

* Rename filter hook name

* Remove todo to pass php lint

* Update filter description

* Move locale check into individual filter functions

* Fix get_note_from_db logic

* Fix php lint errors

* Update the filter doc

* Add test for spec-runner.php

* Add tests for RemoteInboxNotificationsEngine

* Remove unneeded check

* Check if $note_from_class is instance of Note class

* Fix unit test
2022-08-18 09:53:40 +08:00
Paul Sealock 71f722942d
6.8 changelog: Copy from release branch into trunk (#34365)
update trunk with 6.8 changelog
2022-08-18 10:56:26 +12:00
nigeljamesstevenson 301c02a757
add tests for shipping zone regions (#34339)
* add tests for shipping zone regions

* add changelog file

* add changelog file

* update files to disable use of linting rules via .elintrc.js rather than .eslintrc

Co-authored-by: Greg <zhongruige@gmail.com>
2022-08-17 14:50:31 -06:00
Jamel Noel Reid b85819f2a9
Fix broken API tests (#34345)
* Bumped jest to v27

* Used jest in packaged node_modules

* Jest bump

* Removed puppeteer related code

* Updated CHANGELOG

* Added changelog
2022-08-17 11:04:41 -07:00
Néstor Soriano 5f257ed7d0
Fix inconsistent order total on checkout vs manual order page (#33812)
* fix: tax calculation and coupon sequence

* add phpunit skeleton

* Refactor calc_line_taxes and add_coupon_discount

The methods are moved to separate classes in src/Internal,
and two new "core" methods that exclude HTTP processing are added.

* The test partially passes now

* Final fix to unit tests, and fix remaining formatting issues

* Add changelog file

* Fix path to html-order-items.php

Co-authored-by: Siddharth Thevaril <siddharth.thevaril@gmail.com>
2022-08-17 14:56:28 +05:30
Ismael Martín Alabarce 115cac05de
Add WC Payments welcome page experiment (#34251)
* Show WCPay welcome page to all eligible merchants.

Remove the experiment and also check for marketplace suggestions.

* Update banner design and copy

Replace background `wcpay-banner.png` with `wcpay-offer.svg`, `flag.j` svg component with `gift.js`. Adjust styles and ensure it's responsive.

* Add more requirements.

Don't register it when there is an existing WCPay account or the site is on a WPCOM starter plan.

* Update promotion and FAQ copy

* Add the new experiment.

And remove the supported country check to use Explat instead.

* Add changelog entry

* Remove WPCOM starter plan check

* Remove Yoda comparisons

* Update `wcpay_exit_survey` event.

Record it also when the user chooses `Just remove` and use snake_case to avoid Track errors.

* Country and time conditions.

Only for US based businesses with a live store of at least 90 days.

* Update design and copy to match new requirements

* Update promo ID

* Fix country condition

* Load SVG as image instead of background

To prevent wrong asset generation due to Webpack configuration

* Fix WCPay installed condition

* Update promo ID

* Update promo ID in allowed notes

* Update FAQ copy

* Add `apply_filters` docblock

* Add missing `@since` to docblock comment
2022-08-17 17:11:51 +08:00
Rommel Castro 796c52018f
Add `wc com connect` command (#34073) 2022-08-17 10:21:16 +02:00
Paul Sealock 7a1048340e
Delete changelog files based on PR 34354 (#34355)
Delete changelog files for 34351
2022-08-17 18:33:04 +12:00
Chi-Hsuan Huang 02b47a67db
Migrate @woocommerce/data navigation store to TS (#34239)
* Migrate woo data navigation store to TS

* Add changelog

* Fix action type

* Update packages/js/data/src/navigation/reducer.ts

Co-authored-by: Ilyas Foo <foo.ilyas@gmail.com>

* Add a doc comment to MenuItem type

Co-authored-by: Ilyas Foo <foo.ilyas@gmail.com>
2022-08-17 14:32:38 +08:00
RJ a6d656f363
fix: pinned wp/element to 4.8.0 until we sort out esm dependencies (#34349) 2022-08-17 12:09:00 +08:00
Chi-Hsuan Huang 64e14ebe7d
Enhance/34244 update data source poller for i18n (#34247)
* Update data source poller for i18n

* Update unit test

* Remove unnecessary change_locale hook

* Fix payment-gateway-suggestions unit test
2022-08-17 12:06:46 +08:00
Ilyas Foo cd5ffed61b
Deploy payments banner in settings page (#34326)
* Deploy payments banner in settings page, updated tests

* Add track on banner CTA click

* Add test for track

* Changelog

* Fix unit tests
2022-08-17 11:33:24 +08:00
Moon 68985e3222
Fix: Smart shipping defaults bug (#34351)
* Do not create default shipping zones when a shipping zone already exists

* Add changelog

* Use woocommerce_admin_skipped_creating_default_shipping_zones to avoid triggering spotlight tour

* Set woocommerce_admin_reviewed_default_shipping_zones to yes to prevent spotlight tour for the existing shipping zones
2022-08-16 20:18:52 -07:00
Eric Jinks 3739c425ac
Remove WCPay Subscriptions offer page experiment code (#34317)
* Remove WCPay Subscriptions offer page experiment

This removes all code added in PR#32957 as experiment has ended.

(WooCommerce > Subscriptions admin menu item and empty state offer screen)

* Add changelog entry
2022-08-17 15:07:39 +12:00
Peter Fabian 82b95fb474
Remove PHP 8.1 warnings and errors (#34336)
* Make the php file valid

* Remove code that's no longer in PHP.

mysql_* functions were removed in PHP 7.0

* Remove deprecated setting.

This only helps detecting \r as end of line and that should only be used in old MacOS 9 which is 20 years old by now.

* Changelog

* Added compulsory file comment.

* Removed forgotten phpcs flag

* ...and more cleanup.
2022-08-16 10:22:53 -07:00
Jorge A. Torres ecec9eaa76
[COT] Respect status flags `show_in_admin_(all|status)_list` in orders list table (#34290)
* Implement filtering by status in list table

* Respect ‘show_in_admin_status_list’ in list table

* Display correct status name for ‘draft’ and ‘trash’ post statuses
2022-08-16 12:37:46 +02:00
Sam Seay f4595c6ed4
Fix a bug crashing wp-env 5.1.0 in CI (#34274)
* remove `core: null` from wpenv json config
* peg wp-env to 5.1.0
2022-08-16 13:21:52 +12:00
Chi-Hsuan Huang ed9cd231d2
Add unit tests for orders milestone note (#34295)
* Refactor OrderMilestones.php

* Add unit tests for Orders Milestones note

* Add changelog

* Update OrderMilestones.php

* Fix OrderMilestones.php
2022-08-16 08:42:11 +08:00
Chi-Hsuan Huang 71ffd2c548
Update "context" prop of task list click/view event (#34297)
* Update Update context prop of wcadmin_tasklist_/view event

* Add changelog
2022-08-16 08:41:59 +08:00
jonathansadowski d5538505dd
Update the cherry-pick workflow to not run for non-existent branches (#34325) 2022-08-15 16:00:14 -05:00
Jamel Noel Reid 40dbc1f924
Update CI to use wp-env for api, e2e and performance tests (#34311)
* Renamed e2e to e2e-legacy

* Moved e2e folder to tests/e2e

* Updated gitignore

* Updted init script to work with wp-env

* Updated readme

* Updated commands to match new test structure

* Updated workflow to work with new test structure

* Added changelog

* turned off alternate wp cron in test

* Fixed path to playwright config

* Renamed e2e to e2e-pw

* Renamed e2e-legacy to e2e

* Updated e2e-pw path

* Fixed workflow

* Fixed csv test

* Updated .gitignore

* Removed puppeteer specific step
2022-08-15 11:47:53 -07:00
Barry Hughes 7021d442bd
Clear post cache after updating menu order for products. (#34195) 2022-08-15 07:28:14 -07:00
Rommel Castro 2ab9398167
Add `wc com disconnect` command (#33999)
* extract `disconnect` function

* extract `is_site_connected` function

* add `wc com disconnect` command

* add changelog

* fix phpcs errors
2022-08-15 09:54:55 -03:00
Chi-Hsuan Huang de46baf8fc
Fix review shipping option task title (#34294)
* Fix Review Shipping Options Task title

* Add changelog

* Reformat by phpcbf
2022-08-15 17:41:12 +08:00
Adrian Duffell d6224d8a0c
Add Facebook Extension to Onboarding (#34303)
* Add facebook logo

* Add facebook to OBW

* Add pinterest to OBW

* Add changelog

* Revert "Add pinterest to OBW"

This reverts commit cd99fb296c.

* Update changelog

* Update facebook URL

* Switch the “alt” data

* Update manage url
2022-08-12 14:54:53 -07:00
Joshua T Flowers a98f0fef52
Add Media Uploader component (#34181)
* Add media uploader component

* Expand on mocked examples in storybook

* Add styling

* Move MediaUploder out of index

* Add changelog entry

* Handle PR feedback

* Add readme

* Fix missing media utils types

* Rebase and use variant instead of isSecondary for Button

* Fix up lock file

* Fix up lint errors
2022-08-12 12:58:25 -07:00
Joshua T Flowers 19853e1577
Add SortableList component (#34237)
* Add initial draggable list component

* Add changelog entry

* Add drag and drop index

* Add util for checking target drop index

* Add handle component

* Rename component to SortableList

* Use dragged list item for placeholder height

* Add onOrderChange prop to subscribde to updates

* Throttle the drag over event

* Add base styles

* Add utils tests

* Add component tests

* Export component

* Update changelog entry

* Add readme

* Escape pipe in readme
2022-08-12 11:45:26 -07:00
Roy Ho f171913c93
Change to use fetch depth 0 (#34288) 2022-08-12 13:42:08 -05:00
Jacob Sewell 46762dab29
Add SplitDropdown component (#34180)
* Early draft of SplitButton component.

* Changelog for SplitButton component.

* Rename SplitButton to SplitButtonDropdown, apply styles to address toggle button location/size, take primary button from children.

* Address button variant styles

* Rename 'Default' SplitButtonDropdown story to 'Secondary' for clarity.

* Add a SplitButtonDropdown story where the component is disabled.

* README for SplitButtonDropdown component.

* Add disabled prop to SplitButtonDropdown README.

* Add a SplitButtonDropdown story where some but not all actions are disabled.

* Restore PrimaryDisabled story for SplitButtonDropdown.

* Reorganize SplitButtonDropdown properties inheritance to allow both disabled and variant to apply to both the main and toggle buttons.

* Rename SplitButtonDropdown to SplitDropdown.

* Hardcode menuIcon and menuIconExpanded in SplitDropdown.

* Fix outdated stylesheet import for SplitDropdown.

* Update SplitDropdown changelog to new component name.

* Update variable names that reference Actions to Items.

* Hardcode expanded/collapsed toggle button icons without extraneous const declarations.

* Use classNames() helper fn for className concatenation.

* Increase width of SplitDropdown toggle button.

* Add a specific className to the root ButtonGroup element of SplitDropdown.

* Simple rendering test for SplitDropdown.

* For consistency, move Button text out of props in SplitDropdown README and story.

* SplitDropdown does not render a toggle button if there is nothing to put in the menu.

* Fix variant prop type declaration in SplitDropdown.

* Improve SplitDropdown test: remove snapshot, add toggle click.

Co-authored-by: Joshua Flowers <joshuatf@gmail.com>
2022-08-12 12:47:39 -05:00
Peter Fabian 0f99bd4e8d
Fix/forgotten template version (#34308)
Corrected the template version.
2022-08-12 08:23:34 -07:00
Barry Hughes 1a4060d689
Fix/34271 unlimited results (#34289)
Support for unlimited ('-1') results in COT queries.
2022-08-12 08:22:32 -07:00
Fernando 4693e251f7
Add product name and checkboxes for Product details (#34214)
* Add product details

# Conflicts:
#	plugins/woocommerce-admin/client/products/sections/product-details-section.tsx

# Conflicts:
#	plugins/woocommerce-admin/client/products/sections/product-details-section.tsx

* Rename folder

* Fix help icon

* Fix form

* Removed useless `useState`

* Add `getCheckboxProps`

* Add params to getCheckboxProps

* Add recordEvent

* Rename event

* Add changelog

* Fix texts

* Remove Fragment

* Fix useState initial state

* Convert EnrichedLabel to TS

* Fix unknown value prop

* Rename event

* Move EnrichedLabel

* Fix js warning

* Add storybook

* Add readme

* Add components changelog

Co-authored-by: Fernando Marichal <contacto@fernandomarichal.com>
2022-08-12 10:47:54 -03:00
github-actions[bot] 3e7c2e52cd
Prepare Packages for Release (#34299)
Automated change: Prep @woocommerce/components for release.

Co-authored-by: ilyasfoo <ilyasfoo@users.noreply.github.com>
2022-08-12 16:05:13 +08:00
RJ 6a95d3ee93
dev: move guided tours into consolidated folder (#34279)
* dev: moved shipping tour into guided tours folder

* dev: moved store address tour to guided-tour folder

* dev: updated imports for store address tour code move

* dev: move add-product-tour to guided-tours

* dev: update imports for add-product-tour code move
2022-08-12 09:49:18 +08:00
Roy Ho fc06be8296
Add flag to state it is in dev mode so tools are installed like phpun… (#34258)
Add flag to state it is in dev mode so tools are installed like phpunit closes #34158
2022-08-11 12:58:36 -07:00
Roy Ho aee35e368b
Remove concurrency check (#34286)
* Remove cancel concurrency

* Add unique number to group

* Remove concurrency check
2022-08-11 12:29:25 -07:00
Barry Hughes bc31065b8e
Filtering for the COT admin list table. (#33789)
* Column sorting for the COT admin list table.

* Add filter for easier extensibility.

* Implement date based filtering within the admin order list table.

* Implement customer-based filtering within admin order list table.

* Allow filtering down to no results, better management of http_referer state.

* Changelog.

* Bring up-to-date, fix some conflict resolution mis-steps.

* Address coding standards.

* Remove unused import.
2022-08-11 13:00:47 -03:00
louwie17 a498cc8280
Add product form buttons and specific product edit page (#34211)
* Add initial product form action buttons to form

* Add new edit page and allow for updating and creating products

* Move crud functions to helper hook to keep things seperated better

* Add changelog

* ADd package changelogs

* Add isPending selector to products store

* Fix trash screen showing up when deleting product and add loading indicators

* Add extra types to Product type

* Update track names and add product data to tracks

* Update track logic when product is published

* Remove the Image section for now, to prevent confusion as it is not ready yet

* Add tests for the product form actions

* Update copy for publish & duplicate

* Remove unused code

* Set window.location correctly with href

* Reset changes in pnpm lock

* Moved pending action variables to product helper and updated buttons to reflect new suggestions

* Fix backwards compabitibility issue with Form changes

* Add switch to draft button
2022-08-11 11:04:14 -03:00
RJ 046fb2100e
Dev: remove vscode typescript build task (#34278)
* dev: remove vscode tsc build task

* dev: remove .gitignore entry for vscode build task
2022-08-11 17:08:44 +08:00
Jorge A. Torres 055ed34c0d
[COT] Add support for /v3/orders (#34178)
* Use WC_Order_Query for REST API v3 requests when COT is enabled

* Remove pre-COT internal meta keys from metadata in REST order responses

* Add changelog

* Add unit tests

* Fix test in `ProductAttributesLookup\FiltererTest`

Some tests in this class relied on a particular ordering of an array of IDs returned by a query with an `ORDER BY` that doesn’t really disambiguate sorting (all rows have the same values for the fields). As such, `assertEquals()` can’t be used to make sure arrays had the same values.

* Use `get_internal_meta_keys()` from a CPT instance to hide certain meta on COT REST response

* Move COT REST test outside of the COT datastore tests

* Fix typo

* Remove unnecessary imports
2022-08-11 13:11:18 +05:30
RJ 8af95fb700
fix: removed Step 1 of 1 for 1 step tours (#34249) 2022-08-11 11:42:07 +08:00
Chi-Hsuan Huang 831c9fcab3
Keep the user in the marketing task after installing an extension (#34241)
* Keep the user in the marketing task after installing an extension

* Add changelog
2022-08-11 08:56:58 +08:00
Roy Ho 42deef4a52
Add cherry pick tool workflow (#34160)
* Add cherry pick tool workflow

* Update cherry pick workflow

* Add Slack ping overrides

* Update .github/workflows/cherry-pick.yml

Co-authored-by: jonathansadowski <jonathansadowski@users.noreply.github.com>

* Update logic to be more clear

Co-authored-by: jonathansadowski <jonathansadowski@users.noreply.github.com>
2022-08-10 16:36:59 -07:00
Sam Seay ed912cb984
Fix wp-env to 5.0.0 until we can fix issues causing it to crash in CI (#34267) 2022-08-11 11:07:09 +12:00
Sam Seay c10d34742b
Ensure that schema and DB changes are reported to the changes JSON file, fix reporting bugs(#34238) 2022-08-11 10:49:20 +12:00
Seghir Nadir 0a9c0049b3
support single_select_page_with_search in WC REST API (#34234)
Support single_select_page_with_search in WC REST API
2022-08-10 14:37:53 -07:00
Chi-Hsuan Huang 58ff656764
Remove @wordpress/eslint-plugin from woo admin package.json (#34240)
* Remove @wordpress/eslint-plugin from woo admin package.json

* Add changelog

* Update pnpm-lock.yaml
2022-08-10 14:45:40 +08:00
Moon dd794e8e26
Update/34063 store location skip btn (#34176)
* Make ProfileItems properties optional

* Remove skip button codes and replace them with SkipButton component

* Add SkipButton component

* Add changelog

* Add back continue button callback

* Apply popover styles globally

* Add skip button on the industry step

* Add skip button on the product types step

* Add skip button on the Business Details step

* Support onSkipped callback

* Record skip event

* Add skip event track for industry, product types, and business details

* Add SkipButton to the theme step

* Update snapshot

* Change track name to separate business details and free features

* Add changelog

* Remove unused code

* Update product types test snapshot

* Add back UsageModal on Continue click

* Update e2e tests to use Skip

* Use button selector for skip btn

* Fix duplicate event dispatch

* Do not call onClose and onContinue during the rendering -- it causes cannot update a component while rendering a different warning. Instead, call them when the button is clicked

* Skip the profiler without rendering usage modal when woocommerce_allow_tracking is set

* Skip the profiler without rendering usage modal when woocommerce_allow_tracking is set

* Go to the next step when allowTracking is yes
2022-08-08 21:08:03 -07:00
Paul Sealock 2fe344e2af
Remove cherry-picked 34209 changelogs (#34216)
remove wc-admin changelogs
2022-08-09 11:15:52 +12:00
Néstor Soriano cc779db83c
Add the woocommerce_cart_session_initialize-hook (#34156)
* Add the woocommerce_cart_session_initialize-hook

* Add changelog file
2022-08-08 16:54:44 -03:00