Commit Graph

2428 Commits

Author SHA1 Message Date
Thomas Roberts 38759c4e84 Move `FormattedMonetaryAmount` to the components package (https://github.com/woocommerce/woocommerce-blocks/pull/11230) 2023-10-18 07:43:34 -07:00
Thomas Roberts c9ae690a0b Move `Chip` and `RemovableChip` to components package (https://github.com/woocommerce/woocommerce-blocks/pull/11223) 2023-10-18 05:08:18 -07:00
Karol Manijak d548852380 Simplify Product Collection query attributes by removing attributes which are never used (https://github.com/woocommerce/woocommerce-blocks/pull/11259)
* Simply Product Collection query attribute by removing sticky and parents which are never used

* Remove parents attribute from migration logic
2023-10-18 12:47:55 +02:00
Tung Du a441329dc8 Fix: Mini-Cart block shows wrong total if theres multiple installs on the same domain (https://github.com/woocommerce/woocommerce-blocks/pull/11257) 2023-10-18 07:21:15 +00:00
Thomas Roberts 766fa1311d Move `CheckboxList` and create new `blocksComponents` package (https://github.com/woocommerce/woocommerce-blocks/pull/11214) 2023-10-17 02:47:34 -07:00
Tung Du 9297d5ee9e Add: `menu-order` orderby option for Product Attribute Terms route (https://github.com/woocommerce/woocommerce-blocks/pull/11232)
Co-authored-by: Mike Jolley <mike.jolley@me.com>
2023-10-17 04:54:50 +00:00
Karol Manijak 276556a47c Revert woocommerce/woocommerce-blocks#10032 so All Products renders in the frontend (https://github.com/woocommerce/woocommerce-blocks/pull/11263) 2023-10-16 17:16:07 +02:00
Brian ce6c7e460a LocalPickup: fix learn more documentation link (https://github.com/woocommerce/woocommerce-blocks/pull/11241) 2023-10-16 06:26:23 -07:00
Roy Ho 8bb98fd9d9 product gallery block: add preview (https://github.com/woocommerce/woocommerce-blocks/pull/11247) 2023-10-13 11:19:14 -07:00
Mike Jolley c8b8b7232d Checkout Field Padding and Spacing (https://github.com/woocommerce/woocommerce-blocks/pull/11207)
* Spacing values

* Unused opacity rule
2023-10-13 12:13:50 +01:00
Tung Du cd16c0f401 Price Filter powered by Interactivity API (https://github.com/woocommerce/woocommerce-blocks/pull/10730)
Co-authored-by: David Arenas <david.arenas@automattic.com>
Co-authored-by: Luis Herranz <luisherranz@gmail.com>
2023-10-12 04:30:27 +00:00
Niels Lange 113342fc89 Fix inconsistent border focus styles (https://github.com/woocommerce/woocommerce-blocks/pull/11203) 2023-10-12 09:31:55 +07:00
Mike Jolley 0c2f042886 Add universal border radius for form elements and components (https://github.com/woocommerce/woocommerce-blocks/pull/11193)
* Add universal border radius

* Apply radius to checkbox and dropdown
2023-10-11 17:04:45 +01:00
Mike Jolley 2044798af6 Remove Shipping calculator settings and link to the WooCommerce admin settings (https://github.com/woocommerce/woocommerce-blocks/pull/11184)
* Remove block level options in favour of settings

* Remove calculator toggle test

* Update assets/js/blocks/cart/inner-blocks/cart-order-summary-shipping/block.tsx

Co-authored-by: Thomas Roberts <5656702+opr@users.noreply.github.com>

* Remove unused attributes

---------

Co-authored-by: Thomas Roberts <5656702+opr@users.noreply.github.com>
2023-10-11 15:09:43 +01:00
Manish Menaria e88fa94026 Product Collection - Fix undefined layout attribute issue in migration (https://github.com/woocommerce/woocommerce-blocks/pull/11196)
This commit addresses an issue where layout attributes could become undefined during the block migration process. Alongside this fix, several updates were made to align the migration logic with the new `ProductCollectionDisplayLayout` types:

- Added logic to handle `undefined` layout attributes, defaulting to `DEFAULT_ATTRIBUTES.displayLayout`.
- Removed `ProductGridLayout` and `ProductGridLayoutTypes` from the types file.
- Imported `LayoutOptions` and `ProductCollectionDisplayLayout` from the product-collection module.
- Updated the `mapLayoutType` and `mapLayoutPropertiesFrom...` functions to use the new layout types.
- Updated transformation functions like `transformProductTemplate` and `transformPostSummary` to use the new types.

These changes not only resolve the issue with undefined layout attributes but also align the codebase with the new layout options, enhancing code maintainability.
2023-10-11 11:00:26 +05:30
Mike Jolley 75bac91787 Ensure validation of fields occurs when collapsing fields (https://github.com/woocommerce/woocommerce-blocks/pull/11199)
* Ensure validation of fields occurs when collapsing fields

* update click for edit button

* turn off pointer events when hidden

* Add visibility rule
2023-10-10 22:07:58 +01:00
Alexandre Lara a6ddae9dc3 Product Gallery block: Move inner block settings around to match the order from the design (https://github.com/woocommerce/woocommerce-blocks/pull/11170)
* Rearrange block settings to correct position

* Remove unnecessary comments

* Remove unused imports

* Fix e2e tests
2023-10-10 14:04:54 +02:00
Thomas Roberts 14b5414c36 Update wording on checkout error message to try to prevent retries (https://github.com/woocommerce/woocommerce-blocks/pull/10888) 2023-10-10 01:16:24 -07:00
Niels Lange cd1f199f1b Increase number of visible products when cart is empty (https://github.com/woocommerce/woocommerce-blocks/pull/11182) 2023-10-09 22:04:19 +07:00
Mike Jolley 3857dc6e04 WIP: Condensed Address Form Implementation (https://github.com/woocommerce/woocommerce-blocks/pull/11167)
* Add address card component

* Condensed shipping address

* Billing address

* Animations

* Fix editing state

* Toggle sections open in tests
2023-10-09 12:49:09 +01:00
Luigi Teschio 924ed3f30b Product Gallery: fix CSS leak (https://github.com/woocommerce/woocommerce-blocks/pull/11111)
* fix CSS leak

* fix css

* fix comment
2023-10-09 10:15:54 +00:00
Mike Jolley 2f9181a514 Icon should use current color (https://github.com/woocommerce/woocommerce-blocks/pull/11127) 2023-10-09 10:36:17 +01:00
Tung Du 758fdb3b46 Making filter block contextual on the front end (https://github.com/woocommerce/woocommerce-blocks/pull/10919) 2023-10-09 08:22:17 +00:00
Mike Jolley 4987a921b1 Force 100% width for combobox (https://github.com/woocommerce/woocommerce-blocks/pull/11133) 2023-10-06 11:03:48 +01:00
Alba Rincón 37623be4f2 Remove placeholder and pagination (https://github.com/woocommerce/woocommerce-blocks/pull/11145)
* Add titles to patterns and set the aligment to Wide

* Replace product query patterns with product collection ones

* Remove pagination and no results query from product query patterns

* Add aspect ratio to the product image attributes

* Add portrait aspect ratio to product X column and product gallery patterns
2023-10-06 10:51:35 +02:00
Alexandre Lara b4f07b7c5f Product Gallery > Next/Previous Buttons block: Add support to Interactivity API (https://github.com/woocommerce/woocommerce-blocks/pull/10938)
* Add interactivity API to the Pager block

* Replace Large Image when clicking on page

* Fix php cs errors

* Fix php cs errors

* Fix php cs errors

* fix php cs errors

* Add support to Interactivity API

* Fix phpcs errors

* Fix phpcs errors

* Remove unnecessary code and fix block classes

* Rename interactivity actions

* Remove unnecessary type conversion

* Fix error when clicking on page in Pager block

* Fix php cs errors

* Fix ProductGalleryUtils import

* fix php cs error

* Fix styles for next/previous buttons

* Fix styles for the next/previous buttons

* Fix php cs errors

* Fix next/previous icons when buttons are outside image

* Fix php cs errors

* Fix php cs errors

* Fix buttons not visible in Editor

* Delete src/SpeciticTemplateController.php

Delete unnecessary file that is causing php cs error
2023-10-05 18:55:52 +02:00
Luigi Teschio ad80598ab8 Pattern: fetch product id on the JS side (https://github.com/woocommerce/woocommerce-blocks/pull/11138)
* Pattern: fetch product id on the frontend side

* fix TS type
2023-10-05 07:30:50 +00:00
Alexandre Lara dec4e4fc75 Product Gallery > Pager block: Add E2E tests for the block (https://github.com/woocommerce/woocommerce-blocks/pull/11001)
* Add e2e tests for Pager block

* Fix e2e tests for Product Gallery Pager

* Fix e2e tests
2023-10-04 19:11:34 +02:00
Luigi Teschio 9dd8dd321f Product Button: use setTimeout when requestIdleCallback isn't available (https://github.com/woocommerce/woocommerce-blocks/pull/11125) 2023-10-04 10:58:23 +02:00
Luigi Teschio c47babe628 Product Gallery: fix 'Block woocommerce/product-gallery-large-image is already registered' error (https://github.com/woocommerce/woocommerce-blocks/pull/11124) 2023-10-04 10:57:45 +02:00
Luigi Teschio 29fe7cdce0 Product Gallery: Polish Gallery in full view mode (https://github.com/woocommerce/woocommerce-blocks/pull/10947)
* Product Gallery: add support for On Sale Badge Block

* add align support

* Add E2E tests

* set margin via Block Styles

* disable experimental flag

* add next previous block

* restore support file

* fix TS error

* fix layout

* change product

* change product

* Product Gallert Block: Add zoom on hover

* set to true by default

* remove block is already registered error

* remove unecessary await

* Improve zoom logic

Co-authored-by: Alexandre Lara <allexandrelara@gmail.com>

* Product Gallery Full view mode: Add the logic to render the dedicated template

* use template-part instead template

* add E2E tests

* update selectors

* add feature flag product gallery template part

* fix E2E tests

* remove not necessary file

* polish the dialog

* fix: dialog show always the selected product

* fix: not open the dialog when the user click on icon

* rename handleClick to handleCloseButtonClick

* improve style

* fix overlay css

* fix registration

* improve logic

* improve default template

---------

Co-authored-by: Alexandre Lara <allexandrelara@gmail.com>
2023-10-02 14:36:48 +02:00
Niels Lange 60e5943c53 Update the sidebar notice we show for incompatible extensions (https://github.com/woocommerce/woocommerce-blocks/pull/10877)
* Adkust text of sidebar notice

* Adjust text of sidebar notice

* Rename folder to “incompatible-extension-notice”

* Rename main component and interface

* Rename constants

* Add new files for splitting logic

* WIP: Semi-hardcoded solution

* WIP: Add new data store

* Fetch incompatible extensions dynamically

* Fix broken dismiss notice functionality

* Minor refactor

* Remove data store

* Remove console.log

* Remove obsolete data store fragment

* Update package-lock.json and composer.lock

* Change wording from “might be” to “may be”

* Show single incompatible extension within notice instead of as list

* Fix *.md linting error
2023-09-29 17:39:57 +07:00
Alexandre Lara 218e47f37a Product Gallery > Pager block: Fix classname to adhere to the Coding Guidelines (https://github.com/woocommerce/woocommerce-blocks/pull/11035)
* Improve regex for directive parsing

* Fix classname when page is selected and active

* Remove unnecessary commit
2023-09-29 09:42:05 +02:00
Mike Jolley 241984a265 Fix downloads block visibility (https://github.com/woocommerce/woocommerce-blocks/pull/11056) 2023-09-27 11:56:24 +00:00
Hritik Chaudhary 91c5ff83ca Remove data attributes from being saved in html of All products block (https://github.com/woocommerce/woocommerce-blocks/pull/10032)
* Remove data attributes from being saved in html of All products block

* added old save in deprecated

* Addressed review comments

---------

Co-authored-by: Tung Du <dinhtungdu@gmail.com>
Co-authored-by: Roy Ho <roykho77@gmail.com>
2023-09-25 07:57:59 -07:00
Alexandre Lara f4424f541c Improve regex for directive parsing (https://github.com/woocommerce/woocommerce-blocks/pull/11034) 2023-09-22 18:26:36 -03:00
Saad Tarhi 13024c88e6 Fix crash in WooExpress Cart & Checkout Editor (https://github.com/woocommerce/woocommerce-blocks/pull/11024) 2023-09-22 19:10:50 +01:00
Daniel Dudzic a7b5812703 Product Gallery Large Image: Add wrapper to fix zoom (https://github.com/woocommerce/woocommerce-blocks/pull/11023)
* Product Gallery Large Image: Add wrapper to fix zoom

* Product Gallery: Fix E2E test
2023-09-22 13:48:51 +02:00
Karol Manijak 25bac5f030 Add condition to register blocks and variation in single product temp… (https://github.com/woocommerce/woocommerce-blocks/pull/10978)
* Add condition to register blocks and variation in single product template

* Improve the fix by providing default ancestor value to block registered for single product

* add E2E test

* add insert block

---------

Co-authored-by: Luigi Teschio <gigitux@gmail.com>
2023-09-22 08:27:12 +02:00
Alexandre Lara f8fcc41c5a Product Gallery > Pager block: Add support to interactivity API (https://github.com/woocommerce/woocommerce-blocks/pull/10736)
* Add interactivity API to the Pager block

* Replace Large Image when clicking on page

* Fix php cs errors

* Fix php cs errors

* Fix php cs errors

* fix php cs errors

* Remove unnecessary code and fix block classes

* Fix error when clicking on page in Pager block

* Fix php cs errors

* Fix styles for the block

* Fix styles and php cs errors
2023-09-21 16:35:25 -03:00
Daniel Dudzic 8b470177f4 Product Gallery: CSS styling tightening up (https://github.com/woocommerce/woocommerce-blocks/pull/10867)
* Product Gallery: Fix conflicts between block settings and CSS

* Product Gallery: Final CSS polishes

* Product Gallery: Minor CSS refactor

* Product Gallery: Revert the minor css refactor

* add custom class on the main div

* Product Gallery: Combine inner block styles and optimize them

* Product Gallery Inner Blocks: Remove imports to no longer existing stylesheet files

* Product Gallery: Change all references from wp-block to wc-block

* Product Gallery Inner Blocks: Remove loading of non-existent inner blocks stylesheet files

* Product Gallery: Add additional class to ensure correct width for single product gallery despite of the Next/Previous mode selected

* Product Gallery: Add final polishing

* fix zoom

* Product Gallery Thumbnails: Fix css

* Product Gallery Large Image Next Previous Buttons: Skip failing tests

---------

Co-authored-by: Luigi <gigitux@gmail.com>
2023-09-21 11:31:16 +00:00
Alexandre Lara 3ecd34e01a Upgrade webpack to version 5 (https://github.com/woocommerce/woocommerce-blocks/pull/8013)
* Upgrade terser-webpack-plugin to version 4.2.3

* Upgrade webpack-bundle-analyzer to 4.7.0

* Upgrade to Webpack version 5

* Upgrade @wordpress/dependency-extraction-webpack-plugin to 4.6.0

* Upgrade dependency copy-webpack-plugin to version 11.0.0

* Upgrade dependency terser-webpack-plugin to version 5.3.6

* Replace webpack-rtl-plugin with the new @automattic/webpack-rtl-plugin

* Replace module.issuer with the new ModuleGraph API

There is a warning appearing in the console when running the application. This is due to the fact that the module.issuer has been deprecated on Webpack 5 and replaced with the new ModuleGraph API. This commit replaces the deprecated API with the new one.

* Upgrade babel and babel plugins to latest version

* Replace jsonpFunction with the new uniqueName property

Add a unique name of the webpack build to avoid multiple webpack runtimes to conflict when using globals. It defaults to output.library name or the package name from package.json in the context, if both aren't found, it is set to an ''.

* Replace cacheDirectory inline configuration with options.cacheDirectory

* Upgrade @wordpress/e2e-tests dependency to version 5.6.0

* Remove babel-plugin-transform-react-jsx dependency

Remove babel-plugin-transform-react-jsx dependency because it is already included in @wordpress/babel-preset-default

* Remove unnecessary Babel dependencies

Remove some unnecessary babel dependencies that are already included in the @babel/preset-env package.

* Upgrade puppeteer dependency to version 16.2.0

* Remove caret from package.json dependencies

* Fix Storybook build error

This commit fixes the Storybook build error that was being caused because of Storybook by default uses Webpack 4, but since we are currently upgrading our webpack to version 5, we need to install some required dependencies and also explicitly tell Storybook to use Webpack 5.

* Fix package-lock.json after merging with trunk

* Add own webpack-rtl-plugin implementation to the project

Before upgrading Webpack to version 5, we were using the original `webpack-rtl-plugin` released by Romain Berger; unfortunately, this plugin is not compatible with Webpack 5, so we replaced it with `@automattic/webpack-rtl-plugin`. The problem is that `@automattic/webpack-rtl-plugin` by default generates files with the '.rtl.css' suffix and does not provide a way to change that.

This commit adds our own implementation of the `webpack-rtl-plugin` (adapted from `@automattic/webpack-rtl-plugin`) that is compatible with Webpack 5 and allows us to change the suffix of the generated files to follow the recommended way defined by Wordpress (https://codex.wordpress.org/Right-to-Left_Language_Support)

* Change conditional clause to be multiline

* Fix package-lock.json after merge with trunk

* Fix package-lock.json after merge with trunk

* Rename files to fix ESLint errors

This commit renames files that have the .js extension but contain JSX code. This is causing ESLint to throw errors because by default our Eslint configuration expects only files with the .jsx extension to contain JSX code.

* Fix package-lock.json file

* Add is-plain-obj module to the transformIgnorePatterns of jest config

* Update package-lock.json

* Fix package-lock.json

* Upgrade @wordpress/i18n dependency to version 4.31.0

* Update package-lock.json

* Update composer lock file

* Fix Webpack config for Webpack 5

* Add the package-lock.json

* Remove unsupported config from webpack

* Fix error with Webpack build

* Add wait for network idle to the tests

* Attempt to fix e2e test

* Restore promise.all

* Upgrade puppeteer to v17.1.3

* Upgrade expect-puppeteer

* Update expect-puppeteer

* Downgrade expect-puppeteer

* Revert "Upgrade puppeteer to v17.1.3"

This reverts commit 61ed52a56f131961f3970b6fb22cdd8b540bada3.

* Upgrade Puppeteer to version 17.1.3

* Fix executionContext.frame is not a function error

* Fix e2e tests

* Remove isExperimentalBuild from Product Gallery inner blocks

* Upgrade Webpack and Webpack-cli to latest version

* Upgrade postcss and mini-css plugins

* Fix error with mini-cart block

* Fix styling error with filter blocks

* Fix issue when running unit tests

* Fix storybook script not loading

* Fix a11y issue in Storybook

* Fix error when multiple isExperimentalBuild was being used

* Prevent error when layout is not present in the attributes object

* Update `chunkIds` to `named` in Webpack

* Add cache groups to the Webpack configs
2023-09-20 17:31:52 -03:00
Mike Jolley edf4a95b23 Feature Branch: Blockified Order Confirmation (https://github.com/woocommerce/woocommerce-blocks/pull/10056)
* Main block types for confirmation

* Initial blocks

* Styling and placeholders

* Make blocks experimental

* Update summary icon

* Add name/description for status block and missing text descriptions in the block.

Closes woocommerce/woocommerce-blocks#10057

* Order confirmation: Convert Order Details Templates to Blocks (https://github.com/woocommerce/woocommerce-blocks/pull/10095)

* Move code from templates into the details block

* Details -> Totals

* Downloads block

* Sample content for downloads block

* Add block icon

* Add conversion template (https://github.com/woocommerce/woocommerce-blocks/pull/10077)

* Update inner block name

* Add default title constant

* Revert "Add default title constant"

This reverts commit 1dd3bbfecc1be83c367b1ab064f5032ea58cb678.

* Add global styles for order confirmation status block (https://github.com/woocommerce/woocommerce-blocks/pull/10164)

* Implement style controls

* Prevent link color spilling over onto wrapper

* Add styles and remove class names

* Remove __experimentalWritingMode

* Add global styles for order confirmation summary block (https://github.com/woocommerce/woocommerce-blocks/pull/10179)

* Styles for summary

* Remove __experimentalWritingMode

* Add table styles for order details (https://github.com/woocommerce/woocommerce-blocks/pull/10185)

* Add table styles for order details

* __experimentalFontWeight

* Add link styles

* Handle preview link styles

* Unauthenticated views for Order Confirmation template (https://github.com/woocommerce/woocommerce-blocks/pull/10414)

* Different views by permission

* check user id matches when logged out

* Add order confirmation wrapper block (https://github.com/woocommerce/woocommerce-blocks/pull/10286)

* Add a heading wrapper block

* Register the BillingWrapper Block server side

* Fix exception 'render_content' error

* Add the Billing Wrapper Block to the template

* Fix wrong block name error

* Fix php error

* Conditionally render Billing Address within the Wrapper

* Fix parent rendering

* Clean up code (remove billing address from the template)

* Update titles, descriptions, and icons of the billing Block and inner block

* Fix broken block by removing the "parent" keyword

* Use a user-friendly title and description for the Billing Wrapper

* Update Billing Wrapper Block's title case

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

* Fix PHP failing unit test

---------

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

* Remove "thanks" for authenticated page

* Introduce shipping wrapper based on billing wrapper

Closes woocommerce/woocommerce-blocks#10053

* Order confirmation block: Verify email address for guest customers (https://github.com/woocommerce/woocommerce-blocks/pull/10567)

* Add verify step for guest orders

* Render content to pass through block content

* Revert package changes

* Customer orders cannot use email to verify

* Add style controls for order shipping and billing address blocks (https://github.com/woocommerce/woocommerce-blocks/pull/10633)

* Order confirmation block styling (https://github.com/woocommerce/woocommerce-blocks/pull/10780)

* Add missing heading to order details

* Summary block spacing

* Update css variables

* table styles

* Inherit border styles for cells

* Alignment and address styles

* Add downloads wrapper

* Style controls

* Fix typo

* Update Download Wrapper's Icon

* Fix TS error

* Disable Download Block's server side rendering in the editor

This fixes the loading after each style change from the style controls

* Clean up Downloads render functions

* Fix client side Downloads Block's table border

* Download + Total wrappers and tables styling

* small screen

* Remove server side render for previews

---------

Co-authored-by: Saad Tarhi <saad.trh@gmail.com>

* Shorten template description

* Update test address data

* Avoid leaking order key in permission form

* Remove todo

* Make email form required.

* Remove edit page link

* Remove empty columns from address wrapper

* Remove IIFE

* typo

* Update description to mention billing

* Adjust link scss

* Fix wrapper markup and spacing controls

* Add link preview in editor

* Add initial E2E setup for the Order Confirmation Block (https://github.com/woocommerce/woocommerce-blocks/pull/10840)

* Fix WC_DateTime check

* Move form outside of block markup

* Add additional information block (https://github.com/woocommerce/woocommerce-blocks/pull/10842)

* Add block which contains hooks

* Use skeleton for placeholder instead of illustration

* Remove duplicate methods

* Remove duplicate align tag

* Update meta styles

* Tests for order confirmation conditional blocks (https://github.com/woocommerce/woocommerce-blocks/pull/10972)

* Add tests for conditional blocks

* Move setup into test

* Add E2E to the the Order Confirmation Block (https://github.com/woocommerce/woocommerce-blocks/pull/10863)

* Add editor util functions

* Update editor template E2E test

* Add the "exact" property for consistency

* Skip test

Can't get the element in the page. More investigation needed! Skipping
for now.

* Fix "transformIntoBlocks" logic

* Add tests for logged in user

* Fix "beforeAll" config

* Confirm downloads section is visible when logged in

* Create "verifyOrderConfirmationDetails" util function

* Add logged in test case

* Add Guest user test case

* Fix editor e2e testing

* Apply a proper teardown

* Fix failing tests after logout

* Ensure we are logged in before visiting the editor

* Ensure to have shipping selected

* Wait for changes to be saved on the editor

* Ensure shipping options is selected

* Remove comment

* Ensure we are logged in before going to the admin page

* Mark the Order Confirmation as a side effect test

* OrderConfirmation blocks are not experimental

* resolve merge conflict

* Revert package lock changes

* Fix enqueue_assets

* Fix CSS 404s

* Make template tests more robust

* Fix page URL for default confirmation page

* Try afterEach to log back in

* Skip guest/logout use cases

Login out causes other tests to fail. We will implement these case when
the multiple sign in roles are introduced in the codebase.

* Remove tests requiring login out & add comments

* Remove unused util functions

* Hide confirmation blocks from post editor

---------

Co-authored-by: Saad Tarhi <saad.trh@gmail.com>
Co-authored-by: Paulo Arromba <17236129+wavvves@users.noreply.github.com>
2023-09-20 13:56:00 +01:00
Sam Seay 767a093b6a Refactor frontend, frontend-container-block (of reviews) to TypeScript (https://github.com/woocommerce/woocommerce-blocks/pull/10787)
Co-authored-by: Luigi Teschio <gigitux@gmail.com>
2023-09-20 04:21:26 +00:00
Mike Jolley 68064c115b Refactor Cart and Checkout Page Templates (https://github.com/woocommerce/woocommerce-blocks/pull/10773)
* Rename checkout template slug

* Remove redirect and custom title

* Classic shortcode block for checkout

* Empty title

* WIP placeholder

* Change blockified template

* Prefix cart and checkout templates with "Page: "

* Template migration routine

* Apply same treatment to cart template

* Notices

* Update placeholder text

* Classic shortcodes block

* Page content wrapper for templates

* Update default

* Do not save attributes

* Update templates

* Remove cart classic template

* Reverted endpoints for Cart & Checkout templates. This reverts PR 9406

* Migrate page content wrapper.

* Removed useless method arg. Minor tweaks.

* Skip migration if the theme has a template file for this page.

* Removed impossible condition.

* Migrate page content wrapper.

* Remove TemplateNotice in favour of DefaultNotice

* Documentation links in shortcode placeholder

* Hide cart and checkout page selector when using block themes

* Unused var

* Add tests for template changes

* Revert changes to classic-template

* Allow frontend redirect

* Unused file

* Bump version for updater

* Support x template naming as well as page-x

* Need to add item to cart to test checkout

* Fix header test by fixing utility for adding to cart

* Remove permalink tests

* Click body

* Wait for content to finish loading

* Wait for add to cart response when adding to cart without item name

* Wait for save before visiting frontend

* Set content instead of inserting block

* Perform test in site editor rather than page editor

* Prevent notice to set the default cart/checkout page from showing on the site editor.

---------

Co-authored-by: Paulo Arromba <17236129+wavvves@users.noreply.github.com>
Co-authored-by: Thomas Roberts <thomas.roberts@automattic.com>
2023-09-19 10:58:18 +01:00
Manish Menaria 890c5dbcac Transfer layout options from Toolbar to Inspector controls (https://github.com/woocommerce/woocommerce-blocks/pull/10922)
In this update, the layout options for the Product Collection block are transferred from the Toolbar to the Inspector controls. Below is the breakdown of the changes:

1. **Constants Update**
    - `LayoutOptions` enumeration has been imported into `constants.ts`, facilitating a more structured approach to managing layout types (grid and stack).
    - The default display layout type has been updated from 'flex' to reference `LayoutOptions.GRID`.
    - The `getDefaultQuery` function now uses the `getDefaultValueOfInheritQueryFromTemplate` utility to set the default `inherit` value. (This is mainly done to fix a bug)

2. **Display Layout Control Removal**
    - The `display-layout-control.tsx` file has been removed, discontinuing the previous method of layout management.

3. **New Layout Options Control**
    - A new component `LayoutOptionsControl` has been introduced in the `layout-options-control.tsx` file, utilizing the experimental `ToggleGroupControl` and `ToggleGroupControlOption` components from the WordPress package to provide a more intuitive layout selection experience.
    - The `types.ts` file has been updated to define the `LayoutOptions` enum, effectively mapping 'flex' to 'GRID' and 'list' to 'STACK'.

4. **Inspector Controls Update**
    - In `inspector-controls/index.tsx`, the obsolete `DisplayLayoutControl` has been replaced with the new `LayoutOptionsControl`, integrating it into the `ProductCollectionInspectorControls` component.
    - The `BlockControls` wrapper has been removed, and layout options have been relocated to the Inspector controls, presented as a toggle group within the ToolsPanel.

5. **Inherit Query Control Modification**
    - The `inherit-query-control.tsx` file sees a change in the reset value for the `inherit` query attribute to employ a default value which fix one bug.

These changes aim to streamline the user experience by relocating the layout options from the Toolbar to the Inspector controls, offering a centralized location for block settings. Leveraging an enum for layout options fosters code readability and maintainability.

Do note that the update uses experimental components, hence it would be prudent to keep an eye on potential alterations or deprecations in upcoming WordPress releases.
2023-09-15 15:38:48 +05:30
Luigi Teschio 11062e8600 Product Gallery Block: Add Product Gallery template to allow users to edit full mode view (https://github.com/woocommerce/woocommerce-blocks/pull/10823)
* Product Gallery: add support for On Sale Badge Block

* add align support

* Add E2E tests

* set margin via Block Styles

* disable experimental flag

* add next previous block

* restore support file

* fix TS error

* fix layout

* change product

* change product

* Product Gallert Block: Add zoom on hover

* set to true by default

* remove block is already registered error

* remove unecessary await

* Improve zoom logic

Co-authored-by: Alexandre Lara <allexandrelara@gmail.com>

* Product Gallery Full view mode: Add the logic to render the dedicated template

* use template-part instead template

* add E2E tests

* update selectors

* add feature flag product gallery template part

* fix E2E tests

* remove not necessary file

---------

Co-authored-by: Alexandre Lara <allexandrelara@gmail.com>
2023-09-15 08:54:49 +00:00
Karol Manijak 4418cb7d67 Hide unexpected bullet point in Product Collection on Storefront (https://github.com/woocommerce/woocommerce-blocks/pull/10945) 2023-09-15 08:07:54 +02:00
Karol Manijak 25c0b47721 Add pattern chooser in Product Collection (https://github.com/woocommerce/woocommerce-blocks/pull/10876)
* Enable Product Collection patterns in inserter and kick off the layout control button

* Add Choose Pattern button

* Move Toolbar settings to related directory

* Display Pattern Selection modal with available patterns after clicking the button

* Make Pattern Chooser always visible

Patterns can be changed no matter if the Inherit Query from Template option in enabled or not

* Add pattern replacement mechanism

* Switch from Gutenberg styles to internal ones
2023-09-14 14:19:16 +02:00
Roy Ho 3c0498e891 Add collection filters block (https://github.com/woocommerce/woocommerce-blocks/pull/10726)
Co-authored-by: Tung Du <dinhtungdu@gmail.com>
2023-09-14 11:13:33 +07:00