Commit Graph

2157 Commits

Author SHA1 Message Date
Moon 0468bdbe82
blueprint - add php package and cli commands (#49763)
* Add blueprint package

* Add blueprint to composer

* Register blueprint cli commands

* Add feature flag

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

* Update packages/php/blueprint/src/Exporters/HasAlias.php

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

* Update packages/php/blueprint/src/Exporters/ExportInstallThemeSteps.php

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

* Update packages/php/blueprint/src/UseWPFunctions.php

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

* Set destination correctly

* Make sure the given path is within wp content dir

* Remove debug code

* Fix typo

* Fix typo

* Fix lint errors with README

* Move READMD.md from src to the root directory and add development.md

* Add run-unit-tests.sh

* Setup test env

* Create dirs recursively

* Remove debug code

* Update packages/php/blueprint/src/Util.php

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

* Update packages/php/blueprint/src/ZipExportedSchema.php

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

* Check for steps key

* Use if statement

* Add hook comment for wooblueprint_exporters and wooblueprint_importers

* Fix plugin activation condition

* Check for download_link -- it can be empty

* Check to make sure a file was written

* Plugin must be deactivated before attemping to delete it

* Lint fixes

* Lint fixes

* blueprint - add rest api (#49765)

* Add blueprint rest api endpoint

* Rename process to import

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

* Update plugins/woocommerce/src/Admin/Features/Blueprint/Init.php

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

* Update plugins/woocommerce/src/Admin/Features/Blueprint/RestApi.php

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

* Update plugins/woocommerce/src/Admin/Features/Blueprint/RestApi.php

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

* Update plugins/woocommerce/src/Admin/Features/Blueprint/RestApi.php

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

* Update plugins/woocommerce/src/Admin/Features/Blueprint/RestApi.php

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

* Remove unavailable 2nd argument from get_param -- default values are already set from the rest api def.

* blueprint - add builder page  (#49774)

* Add blueprint builder page

* Change to the correct endpoint

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

* Note that the builder intro page is temporary

* Remove unused code

---------

Co-authored-by: github-actions <github-actions@github.com>

* blueprint - add blueprint settings page (#49775)

* Add blueprint settings page

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

---------

Co-authored-by: github-actions <github-actions@github.com>

* Fix broken test

* Lint fixes

---------

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

* Update unit test env

* Added composer scripts to setup and run tests
* Moved tests to Unit dir to make space for Integration tests later

* WIP Add tests

* Use full if statement

* Use the correct step names

* Use activate_plugin and wp_get_thmes from wp functions trait

* Skip inactive plugins

* Use plural for collections

* Add a comment for StepExporter

* Remove unused construct code

* Correct function return types

* Update packages/php/blueprint/src/Importers/ImportActivateTheme.php

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

* Use full if statement

* Make sure plugin is installed

* Use functions from trait

* Remove unused functions

* Pass $force_convert correctly

* Correctly assign $this->validator

* Fix lint issues

* Rename setOptions to setSiteOptions

* Do not use die() -- throw an exception instead

* Make sure slug is a valid WP plugin slug

* Remove hardcoded string with get_step_name()

* Fix lint issues

* Update json example files

* Removed woo-specific examples -- these should be placed in the core
* Updated the built-in steps to reflect the recent changes

* Update packages/php/blueprint/src/docs/json-examples/deletePlugin.json

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

* Update plugins/woocommerce/src/Admin/Features/Blueprint/RestApi.php

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

* Rename to correct filename

* Set version number

* Use mime_content_type for checking mime type

* Catch all exceptions

* Only allow zip and json

* Remove unused function

* Remove unused functions

* Add PHPCS command and ruleset

* PHP lint fixes

* Update plugins/woocommerce/src/Admin/Features/Blueprint/Init.php

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

* Add back removed functions

* blueprint - Add woo blueprint exporters and importers (#50057)

* Add woo blueprint exporters and importers

* Comment fix

* Update plugins/woocommerce/src/Admin/Features/Blueprint/Exporters/ExportWCSettings.php

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

* Update plugins/woocommerce/src/Admin/Features/Blueprint/Exporters/ExportWCSettings.php

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

* Update plugins/woocommerce/src/Admin/Features/Blueprint/Exporters/ExportWCSettings.php

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

* Update plugins/woocommerce/src/Admin/Features/Blueprint/Exporters/ExportWCSettings.php

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

* Add a test for ImportSetWCTaxRates

* Lint fixes

* Lint fixes

* Fix setWCShipping schema and data format

* Add woocommerce_default_country option

* Lint fixes

* Fix typo -- it should be decode, not encode

* Fix incorrect argument order

* Fix typo

* Export and import shipping method settings

* Lint fixes

* Lint fixes

* Type functions -- base PR has changed

---------

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

* Require admin for import and export

* Use mime type from $_FILES -- mime_content_type can return incorrect mime type depending on the system configuration

* Enable export button when backend errors out

* Enable export button when backend errors out

* Allow WooCommerce export

* Change copy text

* Remove redundant check

* Fix lint issues

* Fix lint issues

---------

Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Ilyas Foo <foo.ilyas@gmail.com>
Co-authored-by: Chi-Hsuan Huang <chihsuan.tw@gmail.com>
2024-08-12 16:33:05 -07:00
Nathan Silveira f7595c6725
Add pattern validation for global_unique_id (#50501)
* Add validation for global_unique_id in classic editor

* Fix an issue with validations in the text block

* Replace everything that is not number or hyphen in the product API

* Add pattern validation in the product and variation templates

* Add changelogs

* Increment regex to also accept empty string

* Fix e2e test

* Update update-stricter-global-unique-id
2024-08-12 08:27:06 -03:00
Paul Sealock 9d12459c44
[Navigation] Prepare to remove feature (#50190) 2024-08-09 14:18:39 +12:00
louwie17 003629efb3
Address some styling conflicts in the description block editor toolbar on small viewports (#50435)
* Some minor CSS changes to address GB styling conflicts

* Add changelog

* Address issue with sidebar not showing up sometimes
2024-08-08 14:41:18 -03:00
Chi-Hsuan Huang 450a4ce3bb
Add remote logging tool to beta tester (#50425)
* Add remote logging beta tester tool

* chore: Update log method return type to Promise<boolean>

* Update pnpm-lock.yaml

* Reformat

* Check window.wcSettings?.isRemoteLoggingEnabled

* Add changelogs

* Fix test

* Update toggle_remote_logging

* Fix toggle_remote_logging

* Improve message

* Fix lint
2024-08-08 11:12:51 +08:00
Matt Sherman fe7fafa729
[e2e] Product Editor: Add SKU, GTIN, shipping, and custom fields to simple product creation test (#50241)
* Refactor to add steps in 'can create a simple product' test

* Remove unnecessary await

* Fill in shipping dimensions

* Add frontend verification step

* Get permalink from editor page

* Verify shipping dimensions

* Verify sku and gtin

* Fix label association for sku field

* Fill in shipping class

* Fill custom field

* Handle SKU auto-update before filling in SKU

* Changelog

* Changelog

* Add more specific locator for attributes "Add new" button

* Update comment for why click() is used instead of check() for toggle

* Fix incorrect selector for attributes "Add new" button

* Remove check for toggle being checked, as it is flaky

* Await isChecked()

* Scroll custom fields toggle into view if needed

* Make custom field toggling more reliable

* Break filling into a separate step

* Break filling and verifying of full description into separate steps

* Verify the description and fix verifying shipping details

* Make showing of description toolbar more reliable

* Suppress errant warning

* Suppress warning for conditional and add comment about why it is okay

* Remove unused const
2024-08-07 04:34:31 -03:00
louwie17 7fd864d234
Fix Gutenberg modal conflict around CSS specificity (#50387)
* Increase specificity for modal frame styling

* Add changelog

* Address other modals within product form
2024-08-07 04:29:36 -03:00
RJ b74bd01ca1
fix: remove defaultProps in prep for react 19 (#50266) 2024-08-06 12:20:45 +00:00
Fernando Marichal c410610c62
Rename and move errorHandler method (#50277)
* Rename and move errorHandler method

* Add changelog
2024-08-06 06:39:35 -03:00
DAnn2012 8f661d071f
Fix typos (shopper.js) (#50337) 2024-08-05 15:13:36 +03:00
Fernando Marichal 54b29ec50e
[E2E tests]: Add product description using the block editor (#50232)
* Add product description

* Add changelog

* Add changelog

* Always use same label for ToolbarItem
2024-08-05 08:43:22 -03:00
Maikel Perez 67ab34aab2
Product image getting removed in the new product editor after replacing cover image (#50181)
* Fix image gallery state conflict with external consumer state

* Fix the image gallery removal conflict now that the image gallery is stateless

* Add changelog files

* Ignore the media if it is replaced by itseft
2024-08-02 09:29:28 -03:00
Fernando Marichal 14751afeac
Use the validatorId to get access to the field instead of the context (#50035)
* Remove context

* Add method to get closest block

* Make methods async

* Add changelog

* Add await to getProductErrorMessageAndProps

* Fix getClientIdByField

* Fix tests

* Undo send id to DateTimePickerControl

* Add check before calling getClientIdByField
2024-08-02 08:31:18 -03:00
louwie17 89e8df826a
Update linked product search to use GB combobox in order to fix timing issue (#50128)
* Make use of GB Combobox for the product select

* Update E2E tests

* Add changelog

* Small CSS changes

* Fix create variable product E2E test

* Add changelogs

* Use our internal wrapper of the combobox

* A couple small fixes

* Fix bug and address feedback

* Address small formatting in comments

* Move search products back to consolidated function
2024-08-02 03:24:14 -03:00
DAnn2012 ef85173041
Fixed typo WooCommmerce (#50247)
* Update README.md.mustache

* Update README.md

* Update page-controller.md

* Update README.md

* Add changefile(s) from automation for the following project(s): @woocommerce/create-woo-extension, woocommerce

---------

Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Chi-Hsuan Huang <chihsuan.tw@gmail.com>
2024-08-02 03:14:15 +00:00
Chi-Hsuan Huang e8dacef7a6
Track frequency of unhandled JS errors with MC Stats (#50155)
* Add bumpStat and fix tests

* Add changelog

* chore: Update dependencies and add @woocommerce/tracks for remote logging

* feat: Track frequency of unhandled JS errors with bumpStat

* chore: Update error boundary to log unhandled JS errors with bumpStat

* Add changelog

* Fix lint

* Check if tracks is enabled before bumping stats

* Fix test

* Fix lint

* chore: Refactor buildQuerystring to buildQueryParams for clarity and consistency

* Add bumpStat to wc tracks mock
2024-08-02 03:04:31 +00:00
Chi-Hsuan Huang ed81aa8201
Integrate JS remote logging package in WooCommerce Admin (#50134)
* Update remote logger to check dev env and whether logging is enabled

* Add changelog

* Integrate JS remote logging package in WooCommerce Admin

* Add changelog

* Update remote logger package

* Update test

* Log error in error boundary

* Update remote logger

* Fix webpack config

* Update log stack format

* Update handleError

* Add init debug
2024-08-02 10:25:39 +08:00
Matt Sherman 606224d0d0
Product Editor: Fix shipping dimensions length field label (#50180)
Correct label of length field
2024-08-01 08:49:07 -04:00
Chi-Hsuan Huang 76e1761cf7
Add JS remote logging package (#49702)
* Add remote logging package

* Update package.json

* Fix wca admin

* Add changefile(s) from automation for the following project(s): @woocommerce/remote-logging, @woocommerce/dependency-extraction-webpack-plugin, woocommerce

* Update .eslintrc.js

* Revert core changes

* Add tracks check and update tests

* Set hard limit to trace

* Fix filename

* Add filters to customise API endpoints

* Update REDAME.md

- Add filters
- Remove installation section

* Update REDAME.md

* Add composer.lock

* Fix filename

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-08-01 12:35:43 +08:00
DAnn2012 e8dfe754dd
Fix typo (README.md) (#50156)
* Update README.md

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

* Update heading to fix lint failure

---------

Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Jonathan Lane <lanej0@users.noreply.github.com>
2024-07-31 11:37:15 -07:00
Nathan Silveira d3bd80fc61
SelectTree: keep the focus on the input while navigating between menu items (#49989)
* Commit at a functional state

* Change role to 'listbox'

* Add --highlighted class rules

* Fix overflow in create category modal

* Add countNumberOfItems
Fix multiple bugs
Refactor
Rename and move use-linked-tree file to linked-tree-utils

* Add comments

* Escape regExp

* Allow to select/remove with the enter key

* Add changelogs

* Fix unit tests

* Fix bug on css selector, since role was changed

* Fix bug in index calculation and handle focus on checkboxes and expander button correctly

* Only add activedescendant when something is highlighted

preventDefault when pressing arrowUp

* Fix bug: items array was being used instead of using linked tree

* Call onSelect when pressing enter

* Add guards to prevent tests breaking

* Add additional tests for SelectTree

* Add comments and rename some functions in linked-tree-utils
2024-07-31 11:30:32 -03:00
Maikel Perez 75d55a4a66
Product Block Editor: clicking outside of the attribute modal triggers an error (#50139)
* Fix clicking outside of the attribute modal triggers an error

* Add changelog file
2024-07-31 09:03:39 -04:00
Fernando Marichal e40d91c279
Always count variations without price (#50129)
* Always count variations without price

* Add changelog
2024-07-30 16:13:48 -03:00
Fernando Marichal e759036dcb
[Enhancement]: Change link label for duplicated SKU (#49729)
* Change link label for sku

* Add changelog

* Add id to product_sku

* Fix focus function

* Get element by id

* Fix tests

* remove hardcoded elements

# Conflicts:
#	packages/js/product-editor/src/hooks/use-error-handler.ts

* Add id to generic text

* Remove comment

* Fix e2e tests

* Add changelog

* Fix js tests

* Show example of empty useValidation

* Rename validator function

* Create method getParentTabIdByBlockName

* Fix errorhandler hook

* Fix tests

* Fix useBlocksHelper tests

* Fix e2e test

* Fix test

* Add tests

* Replace empty string by null

* Add errorContext null check

* Fix errorHandler hook tests

* Fix test description

---------

Co-authored-by: Lourens Schep <lourensschep@gmail.com>
2024-07-30 10:00:17 -03:00
Maikel Perez dc2c2eda8e
[Product Editor] Attribute create term failed request causes unlimited loading state (#50093)
* Fix unhandled promise rejection when creating an attribute term and the create request fails

* Add changelog file

* Fix linter error

* Fix compilation error
2024-07-30 09:59:10 -03:00
Nathan Silveira 71b865fa63
Add abbreviations for fields GTIN, UPC, EAN, or ISBN (#50042)
* Add abbreviations for fields GTIN, UPC, EAN, OR ISBN

* Add translators comments
2024-07-30 09:51:29 -03:00
Vladimir Reznichenko 07a71106dc
Monorepo: actualize loaders paths filtering for better Webpack performance. (#49714) 2024-07-29 15:20:17 +02:00
github-actions[bot] a8b560a03f
Prepare Packages for Release (#50073)
* Automated change: Prep @woocommerce/onboarding for release.

---------

Co-authored-by: mordeth <mordeth@users.noreply.github.com>
Co-authored-by: mordeth <cvetan.cvetanov@automattic.com>
2024-07-29 16:18:37 +03:00
Gabriel Manussakis 928271b427
[Accessibility ]Fix typos in experimental select control test (#48643)
* Fix "begining" and "fullfiled" typos

* Add changelog file
2024-07-29 03:16:01 +00:00
Gabriel Manussakis b2a822d44d
[Accessibility] Fix typo in Find Country Option test (#48648)
* Fix "comparsion" typo

* Add changelog file
2024-07-29 11:06:24 +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
github-actions[bot] fe85d2b1ab
Prepare Packages for Release (#50000)
Automated change: Prep @woocommerce/experimental for release.

Co-authored-by: lanej0 <lanej0@users.noreply.github.com>
2024-07-25 14:54:32 -07:00
Jonathan Lane d6fad9f6d5
Add changelogs to trigger version bumps in packages (#48645)
* Add changelogs to trigger version bumps in packages

* Don’t update already updated packages

* Don’t update other packages

* extend-cart-checkout-block has been released

---------

Co-authored-by: Jon Lane <jon.lane@automattic.com>
2024-07-25 13:57:30 -07:00
Fernando Marichal 4e368a1b67
Add readme for validations (#49723)
* Add readme for validators

* Add changelog

* Add docs manifest

* Fix product-editor.md

* Fix readme
2024-07-24 13:02:02 -03:00
Maikel Perez 4689a09ec3
Create combobox-control (#49691)
* Create combobox-control

* Exporting the combobox control

* Integrate the combobox control into the custom field names component

* Remove some non needed styles

* Add changelog file

* Fix comment text typo

Co-authored-by: louwie17 <lourensschep@gmail.com>

* Fix linter errors

---------

Co-authored-by: louwie17 <lourensschep@gmail.com>
2024-07-24 11:13:24 -04: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 46f952eeb5
Monorepo: enable babel-loader and Jest caching (inc. CI) (#49656)
In this PR, we are consolidating babel-loader caching and adding Jest caching, improving build/testing times locally and in CI. The improvement comes from cache covering transpile steps in the mentioned processes.
2024-07-19 09:40:01 +02:00
Nathan Silveira 98a0e96bc9
Product Editor: Modal block editor (description) small viewport (mobile) support (#49611)
* Add media query rules for mobile and fix rule for .block-editor-list-view-tree

* Add missing translation call

* Add small screen title to show product name on mobile

* Add changelog

* Add media-query for inserter-sidebar

* Close inserter when is mobile viewport
2024-07-17 16:41:26 -03:00
Nathan Silveira f2a4db4280
Fix missing onEscape handle in SelectTree (#49396)
* Fix missing onEscape handle in SelectTree

* Avoid passing onEscape to html element

* Propagate onEscape for recursive Tree
2024-07-17 10:12:13 -03:00
Nathan Silveira 7335645b70
SelectTree: allow navigation between items and input using tab and arrow keys (#49251)
* Hide help text in create-taxonomy-modal

* Expose onKeyDown and onBlur events in SelectedItems

* Increment isEventOutside function to consider remove button tags as well

* Add label to remove all button

* Handle navigation between added items and input using tab and arrow keys

* Add changelogs

* Prevent unwanted scroll

* Revert change in product editor and fix issue in component itself

* Change onKeyDown and onBlur to optional

* Move tags navigation to selectedItems and create lastRemoveButtonRef to avoid long CSS query

* Small refactor

* use useImperativeHandle hook in SelectedItems to abstract focusing on last remove button
2024-07-16 16:26:29 -03:00
Nathan Silveira eb2b3da95b
Adjust spacings for variations table notice (#49561) 2024-07-16 16:02:55 -03:00
Cvetan Cvetanov 54dd7a621a
Add new shared payment methods logos component (#49300)
* Add WooPaymentMethodsLogos component

---------

Co-authored-by: Anurag Bhandari <anurag.bhd@gmail.com>
2024-07-16 17:42:52 +03:00
Nathan Silveira 4dbe1c96e7
Prevent high numbers from breaking currency inputs (#49489) 2024-07-16 10:22:44 -03:00
Nathan Silveira af571585b6
Hide variation related notices when product type is not variable (#49400)
* Hide variation related notices when product type is not variable

* Revert "Hide variation related notices when product type is not variable"

This reverts commit 66a67b6ada.

* Hide variation related notices when product type is not variable
2024-07-15 16:38:14 -03:00
Fernando Marichal 67ecc95633
Add reference to number control (#49357)
* Add ref to NumberControl

* Add identifier

# Conflicts:
#	packages/js/product-editor/src/hooks/use-error-handler.ts

* Remove console.log

* Add changelog

* Stop using setTimeout and use mutation observer to check if the tab is visible before focusing field

* Rename prop

* Refactor number-control functions

* Fix lint

* resetIncrement funciton

---------

Co-authored-by: Nathan Schneider <nsschneider1@gmail.com>
2024-07-15 15:49:19 -03:00
Fernando Marichal 6bc551c71b
Add tests for snackbar error handling hooks (#49498)
* Add tests for use-error-handler

* Add tests for useBlocksHelper

* Add changelog
2024-07-15 15:01:24 -03:00
Fernando Marichal a9de74df6f
Add link into the error snackbar (#49246)
* Add link to snack bar

# Conflicts:
#	packages/js/product-editor/src/hooks/use-product-manager/use-product-manager.ts

# Conflicts:
#	packages/js/product-editor/src/contexts/validation-context/validation-provider.tsx

* Fix variations

* Add useBlocksHelper

* Remove old tests

* Remove timeout

* Fix typo

* Fix errors

* Add changelog
2024-07-15 11:00:40 -03:00
Fernando Marichal 64ce7bd732
Add context to errors (#49242)
* Add context to errors

* Add changelog

* Fix product manager hook

* Add useBlocksHelper

# Conflicts:
#	packages/js/product-editor/src/blocks/product-fields/shipping-dimensions/edit.tsx

* Send clientId as context

* Add validatorId when validating

* Small refactor errorHandler

* Improve method
2024-07-13 10:39:13 -03:00
Vladimir Reznichenko 4311640de2
Monorepo: caching deps per target package in GH actions (#49020)
In this PR, we are implementing per-package build and caching, which optimizes build and fetching cached dependencies times across our workflows.
2024-07-10 14:39:49 +02:00
github-actions[bot] de9664f922
Prepare Packages for Release (#49334)
Co-authored-by: opr <opr@users.noreply.github.com>
2024-07-10 12:34:32 +01:00