Commit Graph

309 Commits

Author SHA1 Message Date
RJ ec29880e3e
fix: added pre-API call permissions check on APIs being called on non-admin accessible screens (#51406)
fix: no permissions api errors
2024-09-18 12:53:52 +08:00
Tomek Wytrębowicz a89bd1a485
Use page query param consistently as string for ReportsTable (#51396) 2024-09-16 15:57:58 +02:00
RJ 109744db33
fix: remove help panel user meta (#51249) 2024-09-13 05:46:27 +08:00
Vlad Olaru b40c4a95e5
Attach WooPayments incentive ID to wcadmin_tasklist_click Tracks event props (#51105)
* Add WooPayments incentive ID to task additional data

* Attach WooPayments incentive ID to wcadmin_tasklist_click Tracks event

* Add changelog

* Add changelog

* Replace short array syntax

* docs: Update docs
2024-09-09 18:06:43 +03:00
louwie17 0e8d19d43b
Upgrade storybook to version 7 and add pages workflow for GH publishing (#51168)
* Updated storybook and renamed stories to use the *.story.js/tsx format

* Renamed stories within product editor and wc admin package

* Include *story files in product editor package

* Add storybook pages workflow

* Remove the 'on' param in storybook-pages

* Add changelogs

* Fix failing tests

* Add dirname for any other webpack configs that rely on the woocommerce-admin one

* Fix React 18 warnings

* Remove unneeded storybook packages from components package

* Remove storybook workflow, to be added as a follow up instead

* Revert @storybook/react back to fix unit tests
2024-09-09 12:06:01 -03:00
RJ 88806aae87
add: stripe tax to onboarding tax task (#50989) 2024-08-29 19:48:51 +08:00
Chi-Hsuan Huang c63bb88e0e
Add react-powered main payments settings screen (#50825)
* Fix payment store selector type

* Add changelog

* Add react-powered payment settings main screen

* Add changelog

* Update style

* Revert changes

* Fix enable payment gateway error

* Fix wcpay install busy state

* Check if Nonce exist or not

* Fix extra payment methods

* Fix untranslated texts

* Fix lint
2024-08-27 14:30:01 +08:00
Sam Seay 35cdc6dc20
Use syncpack to lock pnpm version till we can fix issues (#50828) 2024-08-22 12:34:42 +12:00
Chi-Hsuan Huang deaca578cc
Migrate LYS user meta (#50664)
* Migrate lys meta

* Update lys meta logic

* Update user preferences types and logic

* Add changelog

* Revert changes

* Fix types

* Fix logic

* Fix lint
2024-08-20 13:06:57 +08:00
Gabriel Manussakis c7003646ce
[Accessibility] Fix typos in packages/js/ resolvers error messages (#48646)
* Fix "retriving" typo

* Add changelog file
2024-07-29 11:05:55 +08:00
Miguel Pérez Pellicer dd8f9686fb
Rename Google Listings and Ads with Google for WooCommerce (#47614)
* Rename Google Listings and Ads with Google for WooCommerce

* Revert change regarding changelog

* Add changelogs

* Add changefile(s) from automation for the following project(s): @woocommerce/data, packages/php/remote-specs-validation, woocommerce

* Lint

* Lint

* Lint

* Rename Google Listings and Ads with Google for WooCommerce

* Lint

* Lint

* Tweak updated tests

* Add changefile(s) from automation for the following project(s): @woocommerce/data, packages/php/remote-specs-validation, woocommerce

* Lint

* Fix flaky tests

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-07-22 18:59:43 +04:00
Vladimir Reznichenko 68532ce433
CI: update linting jobs to skip build step (#49193)
In this PR, we introduce changes to linting and PHPUnit jobs in order to speed them up: skip or minimize the build step.
2024-07-08 08:39:39 +02:00
Wacław Jacek 00f7420f81
Don't recommend WCS&T in tax task if WCShip or WCTax is active (#48699) 2024-06-25 14:23:07 +02:00
Gabriel Manussakis 525cd4f946
[Accessibility] Fix typo in upateItemErrorRequestId function name (#48702)
* Fix typo in upateItemErrorRequestId function name

* Add changelog file
2024-06-25 16:54:46 +08:00
Gabriel Manussakis 532f1beb02
[Accessibility] Fix misspelling in inline documentation in packages/js/* (#48640)
* Fix "colleciton" typo

* Fix "fomatting" typo

* Fix "elments" typo

* Fix "actuall" typo

* Fix "witth" typo

* Fix "varation" typo

* Fix "procesing" typo

* Fix "neigbouring" typo

* Fix "staticly" typo

* Fix "Curreny" typo

* Fix "addd" typo

* Fix "accessibile" typo

* Fix "avaiable" typo

* Fix "Resurce" typo

* Fix "curent" typo

* Fix "flakyness" typo

* Fix "flakyness" typo

* Fix "Shiping" typo

* Fix "specfically" and "Shiping" typos

* Fix "flakyness" typo

* Fix "avaliable" typo

* Fix "availble" typo

* Fix "oject" typo

* Fix "explict" typo

* Fix "sumary" typo

* Fix "whn" typo

* Fix "normaly" typo

* Add changelog files
2024-06-21 10:28:54 -07:00
Chi-Hsuan Huang 76171ea32f
Use `hasConnectedOwner` value instead to check if Jetpack is connected (#48609)
Use hasConnectedOwner value instead to check if Jetpack is connected
2024-06-19 13:04:50 -07:00
Moon f95d8b240b
Detect cache when launching store (#48586)
* Remove duplicate

* Add is-coming-soon-page endpoint

* Render invalid cache warning

* Use meta tag instead

* Add url for debug purpose

* Use a different copy for the congrats page when the cache is still shown

* Clean up unused codes

* Guard the api with permission

* Add changefile(s) from automation for the following project(s): woocommerce

* Reuse $is_fse_theme

* Lint fixes

* Update 48586-update-48516-detect-cache-when-launching-store

* Add changefile(s) from automation for the following project(s): woocommerce

* Add changefile(s) from automation for the following project(s): woocommerce

* Update plugins/woocommerce/changelog/48586-update-48516-detect-cache-when-launching-store

Co-authored-by: Chi-Hsuan Huang <chihsuan.tw@gmail.com>

* Add changefile(s) from automation for the following project(s): woocommerce

* changed to js method

* Add changefile(s) from automation for the following project(s): @woocommerce/data, woocommerce

* empty commit to trigger CI

* Add changefile(s) from automation for the following project(s): @woocommerce/data, woocommerce

* empty commit to trigger CI

---------

Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Chi-Hsuan Huang <chihsuan.tw@gmail.com>
Co-authored-by: rjchow <me@rjchow.com>
2024-06-19 18:23:29 +08:00
Chi-Hsuan Huang 4162a6ef89
Wrap activity panels in error boundary (#48415)
* Fix review error type

* Add changelog

* Rename global error-boundary class to avoid conflict

* Rename global error-boundary class to avoid conflict

* Wrap panels in error boundary

* Remove console

* Reformat

* Fix test

* Fix test

* Add changelog
2024-06-17 13:05:11 +08:00
github-actions[bot] d2ea42a658
Prepare Packages for Release (#48407)
Automated change: Prep @woocommerce/data for release.

Co-authored-by: lanej0 <lanej0@users.noreply.github.com>
2024-06-11 15:37:33 -07:00
Chi-Hsuan Huang 50d6d0a9c5
Fix getOption() not catch error properly (#48246)
* Improve batch fetching of options error handling and code

* Add changelog

* Catch promise error

* Catch options fetch error

* Fix lint

* Use debounce fetch

* Change debounce wait time to 100ms

* Fix debounce
2024-06-11 13:44:51 +08:00
Nathan Silveira 442adcc395
Determine _product_template_id from WP filter (#47762)
* Remove template matching from front-end

* Create 'woocommerce_rest_get_product' filter to allow extensions to change the product when it's fetched through the REST API

* Stop defaulting to 'standard-product-template' product template and handle defaults only in getLayoutTemplateId function

* Use created hook to determine and persist the product template ID when it's not defined.

Also introduce 'match_fn' in ProductTemplate to allow extensions to provide robust ways of matching the template

* Add changelog

* Fix tests

* Remove outdated tests

* Fix issue in filter because $product can be false and move API change to v3

* Add comments to continue statements

* Small refactor

* Only send layout template id to useLayoutTemplate after product is loaded

* Revert front-end changes

* Remove match_fn and create filter to allow extensions to determine the product template id

* Avoid loading layout template before product is loaded

* Create woocommerce_product_editor_determine_product_template filter and use it

* Update changelogs and remove unused code

* Remove _product_template_id for products that were created with the new product editor.

* Use only id to find productTemplate

* Turn hook into experimental

* Remove deprecated tests

* Rename filter

* Add more typings to useEntityRecord

* Use hasResolved boolean to check whether product has been resolved

* Add changelog

* Add 'variation' to ProductType

* Don't default to the standard-product-template for variations

* Update changelog

* Accept null in getLayoutTemplateId

* Fix edit variable product test

* Rename hook

* Revert changed logic to avoid regressions

* Increment useProductTemplate logic

* Default to standard-product-template instead of undefined when no matches

* Re-import Features class

---------

Co-authored-by: Jon Lane <jon.lane@automattic.com>
2024-06-07 19:48:20 +00:00
Damián Suárez f51b93359f
CRUD: populates `items` and `itemsCount` when a new item is created (#47632)
* minor change in reducer

* use organizeItemsById to compute new items

* add reducer test with pick optimisticUrlParameters

* rename constant name

* add optimisticUrlParameters to CRUD actions types

* use organizeItemsById to generate store IDs

* add more reducer tests

* compute nextItemsData based on ids

* tessstssssss

* add a order_by: name test

* fix sorting data when url parameters

* add tests

* introduce filterDataByKeys helper fn

* fix process to sort items optimistically

* rollback wrong change in actions

* changelog

* set action `options` as optional

* set default value for options
2024-05-27 16:34:12 +01:00
Adrian Moldovan 13ab9007f6
[testing workflows] Add workflow_call trigger in CI workflow - support daily and other types of runs (#47612)
* Add workflow_call event

* Add tests-daily-run.yml

* Remove workflow version

* Update input value

* Remove secrets from caller workflow

* Rename job

* Check context

* Check context

* Check workflow_call inputs

* Override github.event_name with inputs.trigger

* Fix input name

* Add config for daily e2e tests with Gutenberg

* Update env commands for Gutenberg run

* Add disableHpos env variable in ci-utils

* Revert the trigger to push

* Revert the env variable setting in ci-jobs

* Revert the env variable setting in ci-jobs

* Rebuild utils

* Update test env start command

* Define the Gutenberg Playwright project

* Use path relative to workspace root

* Update events for test projects

* Update events for test projects

* Add changelogs

* Remove the e2e tests with Gutenberg tests from daily runs

* Set the schedule and workflow_dispatch triggers

* Add --project default flag to only run the default tests in CI

* Renamed snapshots to match the new Playwright project name
2024-05-22 11:04:44 -07:00
Damián Suárez f5713b3f94
CRUD: introduce organizeItemsById helper function (#47624)
* introduce processItems() util function

* add processItems fn tests

* use processItems in the reducer process

* udpate GET_ITEMS reducer test

* minor CREATE_ITEM_SUCCESS test update

* changelog
2024-05-21 10:15:22 +01:00
Damián Suárez 1f20bc5af1
Data: update getKey helper function (#47548)
* build key conidering all url params

* add getKet test with multiple parents

* changelog
2024-05-16 07:06:41 -07:00
Sam Seay 3ef7a01840
Update blocks JS tests to React 18 (#47383) 2024-05-15 21:33:36 +12:00
Damián Suárez 6ce65cadf7
Data: improve reducer with optimisticQueryUpdate test (#47428)
* update when creating new Item

* improve optimisticQueryUpdate reducer test

* changelog

* minor
2024-05-14 15:03:10 +01:00
Sam Seay 2db29164f9
Update to pnpm 9.1 (#47385)
* Update to pnpm 9.1 and fix a mini css bug

* Add changefile(s) from automation for the following project(s): @woocommerce/tracks, @woocommerce/product-editor, @woocommerce/onboarding, @woocommerce/number, @woocommerce/notices, @woocommerce/navigation, @woocommerce/internal-js-tests, @woocommerce/extend-cart-checkout-block, @woocommerce/expression-evaluation, @woocommerce/explat, @woocommerce/experimental, @woocommerce/eslint-plugin, @woocommerce/dependency-extraction-webpack-plugin, @woocommerce/date, @woocommerce/data, @woocommerce/customer-effort-score, @woocommerce/currency, @woocommerce/csv-export, @woocommerce/create-woo-extension, @woocommerce/create-product-editor-block, @woocommerce/components, @woocommerce/api, @woocommerce/ai, @woocommerce/admin-e2e-tests, woocommerce-blocks, woocommerce-beta-tester, woocommerce, woo-ai

* temporarily disable swallowing build output to diagnose issue with perf workflow

* Ignore some type issues that commonly resurface when deps slightly change

* Fix persistent type issues that have recurred many times

* Add more ignores

* Fix lint issue

* Revert change to swallow build error

* Improve access of the config that needs updated build dir.

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-05-13 10:57:39 -03:00
Nathan Silveira 5fbd502a17
Enable inline actions in the variations table for images (#47065)
* Increment ProductVariationImage type

* Allow adding images to variations from the main product screen through a button

* Add changelog

* Add changelog

* Change showSuccess parameter to optional
2024-05-03 15:26:22 -03:00
Damián Suárez 8d2f88da71
[Product Block Editor]: update the attributes list optimistically when a new attribute is created (#46717)
* tweak optimisticQueryUpdate type

* sort items optimistically

* update attributes list optimistically

* do not invalidate when creating a new attribute

* changelog

* changelog

* update tests

* update options param in test

* wait for the promise when creating new attribute

* fix the rest of tests
2024-04-26 07:53:13 -04:00
Damián Suárez a0aa4724df
Tidy and update product attribute TypeScript types (#46907)
* rename ProductAttribute with ProductProductAttribute

* introduce ProductAttribute to define actions

* update importing attribute types

* fix select item type

* export ProductAttribute TS type

* update attribute-input-field component

* changelog

* update jsdoc block

* update test
2024-04-25 07:30:02 -04:00
RJ fd52f18f6b
Move LYS coming soon initialization to core profiler flow (#46708)
Co-authored-by: Ilyas Foo <foo.ilyas@gmail.com>
2024-04-22 14:49:59 +08:00
Damián Suárez b0e3e31cbe
Data: introduce optimisticQueryUpdate item option (#46343)
* add a CustomActionDispatchers for createProductAttribute action

* add optional options to createItem() fn

* update items object when optimisticQueryUpdate is defined

* reduce itemsCount when creating a new item

* polish TS types

* update reducer tests

* clean unused type

* clean dirty code

* add optimisticQueryUpdate test

* changelog

* minor improvement

* options could be undefined

* compute items and itemsCount based on data

* fix TS error

* changelog
2024-04-18 01:27:40 -04:00
Ron Rennick 4fa2e3822c
Update the monorepo to node v20 (#45148)
* test bumping node to v18

* remove community contributor condition from review assignment

* Add changefile(s) from automation for the following project(s): @woocommerce/tracks, @woocommerce/onboarding, @woocommerce/number, @woocommerce/notices, @woocommerce/navigation, @woocommerce/internal-js-tests, @woocommerce/extend-cart-checkout-block, @woocommerce/expression-evaluation, @woocommerce/explat, @woocommerce/experimental, @woocommerce/eslint-plugin, @woocommerce/dependency-extraction-webpack-plugin, @woocommerce/date, @woocommerce/data, @woocommerce/customer-effort-score, @woocommerce/currency, @woocommerce/csv-export, @woocommerce/create-woo-extension, @woocommerce/create-product-editor-block, @woocommerce/components, @woocommerce/api, @woocommerce/admin-e2e-tests, woocommerce-blocks, woocommerce-beta-tester, woocommerce, woo-ai

* bump node to v20

* Add changefile(s) from automation for the following project(s): @woocommerce/tracks, @woocommerce/onboarding, @woocommerce/number, @woocommerce/notices, @woocommerce/navigation, @woocommerce/internal-js-tests, @woocommerce/extend-cart-checkout-block, @woocommerce/expression-evaluation, @woocommerce/explat, @woocommerce/experimental, @woocommerce/eslint-plugin, @woocommerce/dependency-extraction-webpack-plugin, @woocommerce/date, @woocommerce/data, @woocommerce/customer-effort-score, @woocommerce/currency, @woocommerce/csv-export, @woocommerce/create-woo-extension, @woocommerce/create-product-editor-block, @woocommerce/components, @woocommerce/api, @woocommerce/admin-e2e-tests, packages/php/remote-specs-validation, woocommerce-blocks, woocommerce-beta-tester, woocommerce, woo-ai

* Add changefile(s) from automation for the following project(s): @woocommerce/tracks, @woocommerce/onboarding, @woocommerce/number, @woocommerce/notices, @woocommerce/navigation, @woocommerce/internal-js-tests, @woocommerce/extend-cart-checkout-block, @woocommerce/expression-evaluation, @woocommerce/explat, @woocommerce/experimental, @woocommerce/eslint-plugin, @woocommerce/dependency-extraction-webpack-plugin, @woocommerce/date, @woocommerce/data, @woocommerce/customer-effort-score, @woocommerce/currency, @woocommerce/csv-export, @woocommerce/create-woo-extension, @woocommerce/create-product-editor-block, @woocommerce/components, @woocommerce/api, @woocommerce/admin-e2e-tests, woocommerce-blocks, woocommerce-beta-tester, woocommerce, woo-ai

* add blocks eslint-plugin-woocommerce to project workspace

* add e2e-environment as a peer to e2e-utils

* restore version on @woocommerce/api

* update lock file

* move e2e-environment to devDependencies

* add undefined location check to admin js test

---------

Co-authored-by: Ron Rennick <ronald.rennick@automattic.com>
Co-authored-by: github-actions <github-actions@github.com>
2024-04-12 13:49:55 -03:00
Fernando Marichal d8037dd154
Add menu item to Publish button with copy to draft (#46294)
* Add duplicate product store

* Add copyToDraft method

* Add copy to draft button

* Modify success notice

* Add changelogs

* Update name before saving product

* Add comment to code
2024-04-12 10:19:12 -03:00
Ron Rennick c6048b5c49
Add glob, rimraf, and uuid to Syncpack (#46278)
* add uuid to syncpack

* add rimraf to syncpack

* add glob to syncpack

* Add changefile(s) from automation for the following project(s): @woocommerce/tracks, @woocommerce/product-editor, @woocommerce/onboarding, @woocommerce/number, @woocommerce/notices, @woocommerce/navigation, @woocommerce/internal-js-tests, @woocommerce/integrate-plugin, @woocommerce/expression-evaluation, @woocommerce/explat, @woocommerce/experimental, @woocommerce/eslint-plugin, @woocommerce/dependency-extraction-webpack-plugin, @woocommerce/date, @woocommerce/data, @woocommerce/customer-effort-score, @woocommerce/currency, @woocommerce/csv-export, @woocommerce/components, @woocommerce/block-templates, @woocommerce/ai, @woocommerce/admin-layout, @woocommerce/admin-e2e-tests, woocommerce

---------

Co-authored-by: Ron Rennick <ronald.rennick@automattic.com>
Co-authored-by: github-actions <github-actions@github.com>
2024-04-11 12:52:49 -03:00
Nathan Silveira e2eaa55b7d
Apply filter to add metadata for generated variations (#45953)
* Add meta_data parameter in generateProductVariations

* Apply filter to get meta_data to generate variations

* Add meta_data parameter in generate variations endpoint

* Update name and add documentation

* Fix useEntityRecord in blockEditor
2024-04-02 05:25:01 -03:00
Damián Suárez 65d71fa1e2
Data: reduxify suggested products (#44043)
* use Thunks in wc/admin/products store

* first implementation

* changelog

* fixing tests

* remove unused __meta prop

* update constant name

* fix eslint issue
2024-01-24 16:56:41 -04:00
Matt Sherman 1ea439fb61
[Product Editor] Variation quick actions succeed when sku is inherited from parent (#44017) 2024-01-24 09:50:00 -05:00
Christopher Allford 95bc1189e5
Update `wireit` & Optimize Builds (#43595)
This bumps the version to 0.14.3 so that we can take advantage of some
upstream improvements. It also makes some changes to the way our
builds and watches work to minimize the number of unnecessary
Node processes involved in the execution.
2024-01-15 14:06:55 -08:00
Christopher Allford 758df4854d
Use `ci-jobs` Utility For `ci.yml` Matrix (#43532)
This adds support for using the `pnpm utils ci-jobs` command in our `ci.yml` file. One of the bigger benefits to this change too is that we're now distributing a bundled version of the utils tool. This lets us run it without actually having to install the repo and will let us speed up any workflows that currently do.
2024-01-12 20:32:14 -08:00
Damián Suárez d0d056c60e
Data: add selector to get related products (#43489)
* add getRelatedProducts to get related products

* changelog

* add a resolver to pull the related products

* minor jsdoc enhancement

* query Product params should be optional

* fix ES issue

* minor TS enhancement

* use createSelector() helper
2024-01-11 12:56:59 -03:00
Damián Suárez 17c8354ad9
[Product Block Editor]: Be able to dismiss AdviceCard instances (#43124)
* introduce packages/js/data/src/user/types.ts pref

* be able to dismiss the Upsells advice

* rename user pref key

* typify product_advice_card_dismissed prop

* store is dismissed state in the user pref

* delegate the dismiss state to the component

* changelog

* remove console.log :'(

* fix TS issue

* fix TS issue

* changelog
2024-01-04 12:17:03 -03:00
Ron Rennick 8550da9959
bump php version in packages/js/*/composer.json (#42020)
* bump php version in packages/js/*/composer.json

* add package changelogs

---------

Co-authored-by: Ron Rennick <ronald.rennick@automattic.com>
2024-01-04 10:18:34 -04:00
Damián Suárez b6f8ab94f5
[Woo beta tester]: add User Preference panel (#43125)
* introduce UserPreference panel

* render user preference panel

* expose UserPreferences type

* introduce force mode to update user pref

* rename global object with `__wcbt`

* changelog

* changelog
2024-01-03 17:42:18 -03:00
Christopher Allford bf29119032
Updated PNPM to ^8.12.1 (#42860) 2023-12-18 20:31:49 +13:00
Christopher Allford e46d6bd207
Fixed `watch:build` Race Conditions (#42802)
There's currently a bug with `wireit` that makes the watch crash.
Swiching over to `nodemon` until that is resolved will
keep that from happening.
2023-12-13 18:25:16 -08:00
Christopher Allford 4c4e89bc98
Enhance Build Watching (#42712)
Similarly to `build:project`, a new `watch:build:project`
script will watch individual projects for changes. The
`watch:build` script has been updated so that it does
a deep watch in the same vein as `build`. We have also
hooked up tool-level watching for faster performance.
2023-12-12 12:43:48 -08:00
Christopher Allford 4e89debd0c
Fix Jest Preset (#42707)
When using a preset we need to keep in mind that the transformation
paths are relative to the preset, not the consuming package. We get
around this by using `<rootDir>` in the transform paths. However,
doing this means fixing the root directory for all of the jest tests.
This keeps the tests working in the same way but lets us fix the
preset too.
2023-12-12 09:58:13 -08:00
Christopher Allford 1c635cda6f
Optimized `wireit` Fingerprinting File Inputs (#42684)
Having an explicit `"files"` definition will allow us to fingerprint
dependencies in `wireit` more granularly. This avoids problems
that can be caused by different source files and directories that
trigger a rebuild in a dependee before a dependent finishes.
2023-12-11 16:21:35 -08:00