Commit Graph

5736 Commits

Author SHA1 Message Date
Tung Du 1868b62ba0 E2E: Improve the setup script (https://github.com/woocommerce/woocommerce-blocks/pull/10611) 2023-08-22 17:32:05 +07:00
Hritik Chaudhary 4199533688 Fixed newly detected broken links (https://github.com/woocommerce/woocommerce-blocks/pull/10537)
* Update check-doc-links.yml

* Update check-doc-links.yml

* Update check-doc-links.yml

* Update check-doc-links.yml

* POC: Exclude releases folder from MD link check using “ignorePatterns”

* Update check-doc-links.yml to use tcort/markdown-link-check

* Update check-doc-links.yml to use existing config

* reverted check-doc-links-config.json

* fixed broken links

* fixed broken links and generated docs

* updated docs

---------

Co-authored-by: Niels Lange <info@nielslange.de>
2023-08-22 11:51:18 +02:00
Manish Menaria c925c11f25 Update testing notes for 10.9.1 & 10.9.2 2023-08-22 14:34:03 +05:30
Alexandre Lara 2f65c6cdd4 Product Gallery block: Fix 404 errors occurring on frontend (https://github.com/woocommerce/woocommerce-blocks/pull/10555)
* Prevent block from loading frontend scripts

* Fix issue with Product Gallery not being registered on the Editor

* Fix php cs error
2023-08-21 20:20:48 -03:00
Raluca Stan 40a7a755f2 Update README.md 2023-08-21 18:43:19 +02:00
Paulo Arromba efb6136a70 Fix/10530 Inconsistent new install behaviour for templates when using block themes (https://github.com/woocommerce/woocommerce-blocks/pull/10608)
* Skipped requests regarding WP/WC setup, to avoid issues with the pages not existing yet when migrating page content to templates.

* Skipped requests regarding WP-CLI to avoid issues with the pages not existing yet when migrating page content to templates.

* Added check for woocommerce_db_version option

* Add check for occurred migration to skip template injection

* corrected if clause

* Update src/BlockTemplatesController.php

Co-authored-by: Mike Jolley <mike.jolley@me.com>

* Added maintenance mode to migration exception. Added trace value to has_migrated options

* Merge with new migration logic.

* Set correct post terms for wp_template content

* updated comment

---------

Co-authored-by: Mike Jolley <mike.jolley@me.com>
2023-08-21 14:48:51 +01:00
Alba Rincón 85ae77d10d [Store Customization MVP] Create the new patterns dictionary (https://github.com/woocommerce/woocommerce-blocks/pull/10674)
* Create the new patterns dictionary

* Fix prompts and keys
2023-08-21 14:23:11 +02:00
Karol Manijak cdd5c4e68b Make View Cart link displayed below the Add to Cart button (https://github.com/woocommerce/woocommerce-blocks/pull/10675) 2023-08-21 13:52:08 +02:00
Alexandre Lara 94c5dcefce Fix icon color when block is selected in List View (https://github.com/woocommerce/woocommerce-blocks/pull/10652) 2023-08-18 18:03:53 +00:00
Mike Jolley 0054d24f5c Fix: Made migration migrate block templates in the current theme (https://github.com/woocommerce/woocommerce-blocks/pull/10641)
* Fix: Made migration migrate block templates in the current theme

* Update src/BlockTemplatesController.php

Co-authored-by: Paulo Arromba <17236129+wavvves@users.noreply.github.com>

* Move migration and status codes to BlockTemplateMigrationUtils

---------

Co-authored-by: Paulo Arromba <17236129+wavvves@users.noreply.github.com>
2023-08-18 17:45:28 +01:00
Luigi Teschio d1a1b9d5f9 Load Interactivity API in `bootstrap.php` (https://github.com/woocommerce/woocommerce-blocks/pull/10657)
* load Interactivity API in Bootstrap.php file

* fix comment

* update visibility function

* remove blank line

* remove comment

* remove logic to not load Interactivity API
2023-08-18 12:40:35 +00:00
Daniel Dudzic 601adc6e1f Product Gallery Large Image: Add E2E test (https://github.com/woocommerce/woocommerce-blocks/pull/10482) 2023-08-18 14:02:06 +02:00
Karol Manijak 2bd1d31602 Add logic of Upgrade Notice after upgrading Products to Product Collection (https://github.com/woocommerce/woocommerce-blocks/pull/10267)
* WIP of Upgrade Notice state

* Extend the state options with seeing option

* Move the logic to the dedicated folder

* Subscribe only if not reverted

* Refactor the way UpgradeNotice is rendered

* Simplify the logic of keeping the Upgrade Notice state in local storage

* Improve types organisation

* Lift the functions interacting with local storage to the Inspector Controls of Product Colelction

* Simplify logic of showing Upgrade Notice

* Disable auto migration

* Refactoring

* Use useLocalStorageState hook

* Fix incorrect merge

* Final improvements

* Allow to display Upgrade Notice after revert and manual upgrade

* Fix incorrect merge

* Improve the unsubscribe process

* Trigger auto-update from Product Collection only

* Remove weird console.log

* Abstract manual update from Product Query

* Fix the taxQuery migration from Product Collection to Products

* Product Collection - logic to hide upgrade notice (https://github.com/woocommerce/woocommerce-blocks/pull/10494)

* Add timestamp to each upgrade notice status change

* Revert back only Product Collections converted from Products block

* Make the time threshold configurable

* Add logic that hides the Upgrade Notice after some amount of displays

* Fix the taxQuery migration from Product Collection to Products

* Change the way to count Product Collection entries

* Fix the problem of multiple display counter increments with Product Collection

* Update Upgrade Notice visibility conditions

* Add contiions to unmark Product Collection as converted from Products

* Change variable name

* Change variable t to time name for better readibility. Improve types

* Replace useState with useRef

* Remove unecessary props passed to UpgradeNotice
2023-08-18 08:25:15 +02:00
Patricia Hillebrandt f88a7e984d Testimonials Single Pattern > Update the image format and content width (https://github.com/woocommerce/woocommerce-blocks/pull/10600)
* Testimonials Single Pattern: Update the styles for the image and add and alt text.

* Update the layout type of the comlumn iwth the content to constrained and update padding to 32px for the columns wrapper.

* Vertical align image to the center.
2023-08-17 15:28:58 +00:00
Mike Jolley d46e286bf7 Fix: sync_endpoint_with_page should use a matching slug if it exists instead of creating a new page (https://github.com/woocommerce/woocommerce-blocks/pull/10640) 2023-08-17 16:26:49 +01:00
Patricia Hillebrandt 4290a948a6 Ensure the My Account text size matches other texts in the footer. (https://github.com/woocommerce/woocommerce-blocks/pull/10614) 2023-08-17 15:04:56 +00:00
Alba Rincón 748015b675 Fix "On sale" badge class (https://github.com/woocommerce/woocommerce-blocks/pull/10634)
* Fix "On sale" badge class for shop

* Add class to sale badge
2023-08-17 15:46:11 +02:00
Manish Menaria f40131c33e Remove client side navigation from Products beta block (https://github.com/woocommerce/woocommerce-blocks/pull/10636)
* Remove client side navigation from Products beta block

Changes:
- Removed the `add_navigation_id_directive` method and its associated filter. This method previously added a `data-wc-navigation-id` attribute to the query block for client-side navigation, which is no longer required.
- Removed the `add_navigation_link_directives` method and its associated filter. This method previously added interactive directives to pagination links inside the Query Pagination block. This specific functionality has been removed as it is no longer needed.
- Introduced a new method `mark_block_as_interactive`, which is designed to mark the Product Query as an interactive region so that interactive elements can work inside it. This is achieved using the 'data-wc-interactive' attribute.

* add data-wc-interactive to product button block

* Remove unnecessary code

As we have added `data-wc-interactive` on Product button therefore we don't need to add it in Product Query block.

* Boolean attribute doesn't need explicit value equal to true

* Skip failing i18n-related E2E tests

* Skip failing i18n-related E2E test

---------

Co-authored-by: Luigi <gigitux@gmail.com>
Co-authored-by: Niels Lange <info@nielslange.de>
2023-08-17 15:45:59 +02:00
Tom Cafferkey efec0bbd02 Update to PR template (https://github.com/woocommerce/woocommerce-blocks/pull/10549) 2023-08-17 12:16:14 +01:00
Alba Rincón ee9b93a026 Remove `queryId` parameter from patterns (https://github.com/woocommerce/woocommerce-blocks/pull/10616) 2023-08-17 09:06:48 +02:00
Seghir Nadir 98e4259482 fix missing use statment (https://github.com/woocommerce/woocommerce-blocks/pull/10592) 2023-08-16 16:08:59 +01:00
Tom Cafferkey 981ac612f5 Update WooCommerce Blocks brand assets (https://github.com/woocommerce/woocommerce-blocks/pull/10622) 2023-08-16 14:15:20 +01:00
Niels Lange c374b13c2b Update versions to 11.0.0-dev 2023-08-16 15:08:14 +02:00
Niels Lange c957c5e7a8 Release: 10.9.0 2023-08-16 15:05:23 +02:00
Roy Ho c9f32707d0 Product-details: Add margin spacing controls (https://github.com/woocommerce/woocommerce-blocks/pull/10440)
* Product-details: Add margin spacing controls

* Add additional div to allow custom styling
2023-08-16 05:48:18 -07:00
Karol Manijak 1d3cffff42 Add E2E tests for Product Collection with Compatibility Layer (https://github.com/woocommerce/woocommerce-blocks/pull/10540)
* Add E2E tests for Product Collection with Compatibility Layer

* Remove unnecessary changes

* Rename the file so it covers side effects and improve imports

* Rename the file to the correct suffix - side_effects instead of side-effects
2023-08-16 11:54:09 +02:00
Karol Manijak f290966ddf Open links from the Editor in the top frame, not editor iframe (https://github.com/woocommerce/woocommerce-blocks/pull/10515)
* Open links from the Editor in the top frame, not editor iframe

* Remove leftover

* Change the _top to _blank for external links
2023-08-16 11:03:50 +02:00
Tung Du 97b22cc17a Better handling tests with global side effects (https://github.com/woocommerce/woocommerce-blocks/pull/10508) 2023-08-16 12:23:43 +07:00
Mike Jolley 6b083aa641 Convert product tag control to functional component (https://github.com/woocommerce/woocommerce-blocks/pull/10529) 2023-08-15 17:40:05 +01:00
Niels Lange 320286b69e Update release-initial-checklist.md 2023-08-15 18:25:52 +02:00
Niels Lange 8b9a8b3864 Update patch-initial-checklist.md 2023-08-15 18:24:34 +02:00
Thomas Roberts ad9b732629 Convert shipping selection Checkout tests to playwright (https://github.com/woocommerce/woocommerce-blocks/pull/10532)
* Create selectAndVerifyShippingOption method

* Add goToCheckout util

* Add emptyCart util

* Add selectAndVerifyShippingOption to FrontendUtils class

* Add initial checkout shopper test file and a shipping options test

* Remove selectAndVerifyShippingOptions from frontendUtils

* Re-add selectAndVerifyShippingOption to checkout block test

* Move cart and checkout blocks into their own directories

* Create CheckoutPage class to keep utils for checkout

* Use CheckoutPage class in Checkout tests

* Update name of test suite

* Remove nested describe

* Move to correct folder, make selectAndVerifyShippingOption return

* Remove networkidle and goToCheckout from frontendutils

* Add placeOrder util

* Add fillBilingDetails util to checkout page

* Add fillShippingDetails util to checkout page

* Add fillInCheckoutWithTestData util to checkout page

* Add checkCustomerPushCompleted util to checkout page

* Change test to focus on free shipping and flat rate in separate tests

* Instead of waiting for selector, just wait for the shipping name

* Check element visibility instead of count

* Use postcode id rather than autocomplete value

* Don't instantiate FrontendUtils

* Delete tests that have been moved to playwright

* Add test to side effects project because it adds items to cart

* Remove unused method

* Go to cart page before removing items

This is to ensure the cart data store is loaded

* Empty cart before proceeding with tests

* Re-implement goToCheckout to frontendUtils

* Remove check for whether customer data has been pushed

Rely instead on order complete page to check for address details.

* Ensure request to set shipping option is complete

* Get email address from page not billing form (its not there)

* Move testData to class property

* Add verifyAddressDetails util

* Make test check for setting different addresses and shipping in same run

* Remove User can have different shipping and billing addresses from jest

* Pass in playwright's request to the frontend utils file

* Update emptyCart function to use API requests to empty the cart

* Pass request utils to frontendUtils class

* Update frontendUtils to use requestUtils for API requests
2023-08-15 03:42:29 -07:00
Tung Du c66da3b6a7 Fix: warning with default archive templates when queryId is missing (https://github.com/woocommerce/woocommerce-blocks/pull/10596) 2023-08-15 16:28:45 +07:00
Raluca Stan fe8679c135 Fix express button display in the Cart block (https://github.com/woocommerce/woocommerce-blocks/pull/10534)
* Fix express button display in the Cart block

When multiple buttons are displayed they don't appear stacked. This PR fixes a regression;

* Fix editor experience
2023-08-14 14:04:27 +02:00
Patricia Hillebrandt da10fe8a3e Add the wc-blocks-footer-pattern class identifier to all patterns (https://github.com/woocommerce/woocommerce-blocks/pull/10542) 2023-08-14 10:02:27 +00:00
Luigi 11e335d750 Merge branch 'release/10.8.0' of https://github.com/woocommerce/woocommerce-blocks into trunk 2023-08-11 17:09:13 +02:00
github-actions[bot] fa8ef7098e Release: 10.8.3 (https://github.com/woocommerce/woocommerce-blocks/pull/10547)
* Create wc-all-block-styles chunk with all the styles for classic themes (https://github.com/woocommerce/woocommerce-blocks/pull/10543)

* add testing instructions and changelog

* bump version to 10.8.3

* Empty commit for release pull request

* add zip link

* Fix the `on sale` badge for product blocks (https://github.com/woocommerce/woocommerce-blocks/pull/10550)

* Fix the `on sale` badge for product blocks

* Fix in the editor

* Update changelog and testing instructions

* update zip link

* fix testing instructions

---------

Co-authored-by: Luigi Teschio <gigitux@gmail.com>
Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Alba Rincón <albarin@users.noreply.github.com>
2023-08-11 17:08:05 +02:00
Alexandre Lara f9ee3cfd70 Product Gallery block: Fix incorrect icon color when block is selected (https://github.com/woocommerce/woocommerce-blocks/pull/10426)
* Fix incorrect icon color when Product Gallery is selected

* Fix incorrect icon color when block is selected

* Remove unnecessary style

* Fix icon alignment

* Fix alignment for the icon

* Fix icon alignment
2023-08-11 11:59:35 -03:00
Alba Rincón 70c1a70243 Fix the `on sale` badge for product blocks (https://github.com/woocommerce/woocommerce-blocks/pull/10550)
* Fix the `on sale` badge for product blocks

* Fix in the editor
2023-08-11 16:08:26 +02:00
Patricia Hillebrandt 6ca3623f14 Add the wc-blocks-header-pattern class identifier to header patterns. (https://github.com/woocommerce/woocommerce-blocks/pull/10541) 2023-08-11 13:31:49 +00:00
Luigi Teschio 97474e4040 Create wc-all-block-styles chunk with all the styles for classic themes (https://github.com/woocommerce/woocommerce-blocks/pull/10543) 2023-08-11 14:12:34 +02:00
Mike Jolley 566513e3ed Simplify code path and remove todo (https://github.com/woocommerce/woocommerce-blocks/pull/10526) 2023-08-11 10:44:50 +01:00
Patricia Hillebrandt edbfa8d35e Store Customization > Add placeholder images for the Alternating Image and Text pattern (https://github.com/woocommerce/woocommerce-blocks/pull/10479)
* Add placeholder images and update text styles for the Alternating Image and Text pattern.

* Address code review.

* add spacing.

* streamline the styles.
2023-08-11 09:33:54 +02:00
Manish Menaria 56fd1165a6 Product Collection: Use Interactivity API for pagination (https://github.com/woocommerce/woocommerce-blocks/pull/10361)
* Update router to hydrate only interactive regions

* Rename link directive to navigation-link

* Add navigation directives to Query and Pagination blocks

* Enable the Interactivity API by default

* Remove client-side navigation meta tag

* Cache initial regions

* Move data-wc-interactive from query to query-pagination

* Add woo prefix to navigation id

* Add keys and move wc-interactive back to the query block

* Reuse root fragments for each interactive region

* Fix navigation-id retrieval

* Introduce interactivity to Product Collection block and navigation enhancements

This commit brings significant improvements to the ProductCollection block.

1. A new property `parsed_block` is added to the class to hold the block with its attributes before it gets rendered. This allows for more complex manipulations of the block and its attributes.

2. Interactivity has been added to the product collection block. The block is marked as an interactive region so it can be updated during client-side navigation. The `add_navigation_id_directive` method is responsible for adding this functionality. This ensures better UX as users navigate through the products.

3. Navigation links inside the Query Pagination block are also made interactive. The `add_navigation_link_directives` function is responsible for this. All anchor tags in the pagination are given the `data-wc-navigation-link` attribute with relevant navigation payload. This includes prefetching and scroll behavior. The pagination links are given unique keys for 'previous' and 'next' navigation.

4. The `render_block` filter hook has been used to add these functionalities to the product collection and query pagination blocks during render.

* Disable scroll

---------

Co-authored-by: David Arenas <david.arenas@automattic.com>
2023-08-11 11:37:55 +05:30
Tung Du 40d8eb8ac9 Fix: Adjust Playwright E2E tests for WP 6.3 (https://github.com/woocommerce/woocommerce-blocks/pull/10516)
Co-authored-by: Luigi <gigitux@gmail.com>

- Updates the `@wordpress/e2e-test-utils-playwright` package to use the npm release.
- Removes hard-coded WP version in `.wp-env.json` to use the latest Core release.
- Fixes failing Playwright tests when using WP 6.3.
- Pins the core version (6.2.2) for Jest E2E tests so they can keep passing. We decided not to fix those tests because we're moving to Playwright.
2023-08-11 06:28:38 +07:00
Patricia Hillebrandt 75acbba85f Featured Products: Fresh & Tasty pattern > Enhance mobile view and optimize images (https://github.com/woocommerce/woocommerce-blocks/pull/10521)
* Update wrapping on mobile view

* Update styling for images and size.

* remove e2e-pw changes

* Remove font style.

* Remove custom styling from images.
2023-08-10 14:33:31 +00:00
Luigi Teschio b90e0ffdc9 Interactivity API and Product Button (https://github.com/woocommerce/woocommerce-blocks/pull/10006)
* Update Interactivity API JS files

* Disable TS checks in the Interactivity API for now

* Add new SSR files

* Replace wp_ prefixes with wc_ ones

* Replace wp- prefix with wc-

* Replace guternberg_ prefix with woocommerce_

* Remove file comments from Gutenberg

* Rename files with `wp` prefix

* Fix code to load Interactivity API php files

* Remove TODO comments

* Replace @wordpress with @woocommerce

* Update Webpack configuration

* Fix directive prefix

* Remove interactivity folder from tsconfig exclude

* Add client-side navigation meta tag code

* Remove unneeded blocks.php file

* Fix store tag id

* Register Interactivity API runtime script

* Fix Interactivity API runtime registering

* Remove all files related to directive processing in PHP

* Move json_encode to Store's render method

* WIP

* WIP

* WIP

* WIP

* Preserve previous context

* Ignore Minicart block on client-side navigation

* Refresh page on store updatRefresh page on store updatee

* Refactor logic

* Add console error when a path is missing

* fix PHP lint error

* WIP store

* use store approach

* update jest configuration

* restore Mini Cart changes

* move cart store subscription to interactivity package

* move interactivity flag

* format HTML

* move addToCartText to the context

* Load product-query stylesheet when rendering the Products block

* update sideEffects array

* fix catch

* rename moreThanOneItem to isThereMoreThanOneItem

* improve how scripts are enqueued

* update default value for the filter woocommerce_blocks_enable_interactivity_api

* Update assets/js/atomic/blocks/product-elements/button/block.json

Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>

* Update assets/js/interactivity/cart/cart-store.ts

Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>

* fix block.json

* remove updateStore function

* restore interactivity api changes

* import cart store

* show notice when there is an error

* add logic to dequeue script on classic themes and block themes

* imrpove logic about notice

* Interactivity API: add `afterLoad` callbacks to `store()` function (https://github.com/woocommerce/woocommerce-blocks/pull/10338)

* show notice when there is an error

* Add initial implementation for store callbacks

* Run `afterLoad` callbacks after `init`

* Move cart state subscription to Product button

* Remove cart-store from Interactivity API internals

* Change callbacks with options and save only afterLoad callbacks

* ProductButton: Add animation (https://github.com/woocommerce/woocommerce-blocks/pull/10351)

* implement animation

* improve logic

* refactor logic

* refactor code

* address feedback about code style

* add support for woocommerce_add_to_cart_quantity

* Fix animation flickering

* Introduce wp-effect, reduce the amount of numberOfItem variables to 2 and consolidate animation status

* add support for added class

* Remove unnecessary selector

* Don't fetch cart if it was already fetched

* remove added class

---------

Co-authored-by: Luis Herranz <luisherranz@gmail.com>

---------

Co-authored-by: Luigi <gigitux@gmail.com>
Co-authored-by: Luis Herranz <luisherranz@gmail.com>

* update deepsignal

* remove added class

* update deepsignal

* Interactivity API and Product Button: Add E2E tests (https://github.com/woocommerce/woocommerce-blocks/pull/10036)

* Add FrontendUtils class

* fix conflicts

* use locator

* restore click usage

* Product Button: Add E2E test

* fix util

* fix E2E tests

* remove comment

* Add E2E test to ensure that woocommerce_product_add_to_cart_text works

* update sideEffects array

* add zip and unzip as package

* fix wp-env configuration

* fix E2E test

* add report

* try now

* try now

* try now

* fix E2E test

* E2E: Add documentation for testing actions and filters. Fixes woocommerce/woocommerce-blocks#10135 (https://github.com/woocommerce/woocommerce-blocks/pull/10206)

* update description

* fix label

* rename files

* make requestUtils private

* remove page.goto

* use toHaveCount

* use productsToDisplay variable

* fix E2E tests

* rename class utils

---------

Co-authored-by: Daniel Dudzic <daniel.dudzic@automattic.com>

---------

Co-authored-by: David Arenas <david.arenas@automattic.com>
Co-authored-by: Luis Herranz <luisherranz@gmail.com>
Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>
Co-authored-by: Daniel Dudzic <daniel.dudzic@automattic.com>
2023-08-10 14:02:33 +00:00
David Arenas 4771c70fc9 Disable scroll in pagination links (https://github.com/woocommerce/woocommerce-blocks/pull/10522) 2023-08-10 12:06:25 +02:00
Mike Jolley 4fd16267be Refactor Push Changes Readability and Performance (https://github.com/woocommerce/woocommerce-blocks/pull/10315)
* Add local state to address-form

* Update test with valid postcode and required fields

* Push changes refactoring

* Avoid loops due to retrying same data

* Callbacks to prevent rerenders

* Move validation functions

* Filter incoming values to only those included as fields to prevent errors

* Keep track of country changes to prevent excessive updates of addressFormFields.

* Use helpers in test

* Fill company

* Revert local state in address form

* Update address form to remove validation handling for postcode (country clears the field).

* Revert "Update test with valid postcode and required fields"

This reverts commit 718a6006df24f6e957297ad4d1ef9d6f690793bd.

* Clear postcode when country changes if invalid

* Revalidate fields when country changes

* Comment for pick

* Revert unneccessary test change

* Revery moving of functions to reduce diff size

* Increase push timeout in tests

* Revert test changes
2023-08-09 18:24:51 +01:00
Thomas Roberts f3bdfaee98 Update E2E util to allow adding to cart by name from the shop page (https://github.com/woocommerce/woocommerce-blocks/pull/10507)
* Allow adding to cart by name from the shop page

* Remove networkidle
2023-08-09 16:17:05 +02:00