Commit Graph

1019 Commits

Author SHA1 Message Date
Paulo Arromba 86c6e975eb Context for aria-label on cart quantity controls (https://github.com/woocommerce/woocommerce-blocks/pull/8099)
* Aria label context for "Remove item" action on cart

* Aria label context for quantity controls on cart
2023-01-06 15:21:56 +00:00
Thomas Roberts 2575fd10bd Ensure checkout order summary and totals block cannot be removed (https://github.com/woocommerce/woocommerce-blocks/pull/7873) 2023-01-06 07:05:01 -08:00
Thomas Roberts 5d439855e2 Ensure Slot/Fills render in editor (https://github.com/woocommerce/woocommerce-blocks/pull/8111)
* Wrap Checkout Edit in SlotFillProvider

Required to render Slot/Fills in the editor

* Remove editor check when rendering ExperimentalOrderShippingPackages

We want to render it in the editor and on the front end, so checking is no longer necessary

* Wrap Cart in SlotFillProvider when in editor

This is so Slot/Fills can be rendered in the preview
2023-01-06 06:53:53 -08:00
Daniel Dudzic 9214c99724 Attribute, Rating and Stock filters: Fix the dropdown indicator icon display (https://github.com/woocommerce/woocommerce-blocks/pull/8080)
* Filter blocks: Fix the dropdown indicator icon display for 'single option' mode. Closes woocommerce/woocommerce-blocks#8075

* Filter blocks: Fix the dropdown indicator for multiple items option. Closes woocommerce/woocommerce-blocks#7889
2023-01-04 18:37:08 +01:00
Tung Du 2b20e2d3f3 Refactor Filter Wrapper to remove usage of useInnerBlocksProps (https://github.com/woocommerce/woocommerce-blocks/pull/8095) 2023-01-04 17:31:17 +07:00
Lucio Giannotta c708ff2f56 Hide `core/no-results` as default in Product Query if WP <= 5.9 (https://github.com/woocommerce/woocommerce-blocks/pull/8082)
`core/no-results` was not available until WP 6.0.
2023-01-03 19:14:33 +01:00
Patricia Hillebrandt 0959bb1122 Ensure filter blocks are not reloaded every time they are selected in the editor (https://github.com/woocommerce/woocommerce-blocks/pull/8002)
* Filter Rating Block > Prevent reload on select.

* Filter by Stock Block > Prevent reload on select.

* Disable debounce for the editor.

* Filter by Price Block > Prevent reload on select.

* Filter by Attribute Block > Prevent reload on select.

* Make the isEditor and isSelected params optional.

* Make isSelected optional.

* Address CR

* update to use isObject
2023-01-02 00:22:08 +01:00
Lucio Giannotta b81b8a9220 Product Query: Remove the “Products on Sale” Product Query variation (https://github.com/woocommerce/woocommerce-blocks/pull/7926) 2022-12-30 17:02:01 +01:00
Lucio Giannotta cfe4725bc7 Product Query: create variation of `core/post-template` as a Product Query inner block (https://github.com/woocommerce/woocommerce-blocks/pull/7838) 2022-12-30 16:51:27 +01:00
kmanijak 95d5b51949 Include the types of Jest customer matchers for unit tests 2022-12-30 16:36:37 +01:00
Saad Tarhi 230606c7f7 Highlight incompatible payment gateways (https://github.com/woocommerce/woocommerce-blocks/pull/7412)
* Set up incompatiblePaymentMethods in data store

* Save incompatible payment methods in data store

* Create the IncompatibilityPaymentGatewaysNotice

* Fix hidden notice bug

* Rename "paymentAdminLink" to GlobalPaymentMethod and move to types dir

* Add all registered methods to incompatiblePaymentMethods state

* Rename selector to getIncompatiblePaymentMethods

* Remove incompatible methods when adding available ones

* Remove unused reducer cases

* Stop adding incompatible methods now that we add them in default state

* Display incompatible methods in the notice from the data store

* Refactor incompatible payment gateways notice

* Update the incompatible extensions notice's design

* Hide Make as default notice

We hide this notice while the notification for incompatible payment
gateways is visible

* Hide the sidebar compatibility notice

Hide this notice while  the notification for incompatible payment
gateways is visible. And show it otherwise.

* Capitalize the label for the button on the page settings notice

* Fix missing 'globalPaymentMethods' bug on frontend

* Highlight incompatible payments in sidebar

Highlight incompatible payment gateways within the Payment Options Block

* Rename the incompatible gateways notice's component

* Support plural and singular forms for the notice

* Update incompatible extensions notice's design

* Use the simplified types import

Co-authored-by: Niels Lange <info@nielslange.de>

* Add translation support to notice message

* Fix failing unit tests

Co-authored-by: Thomas Roberts <thomas.roberts@automattic.com>
Co-authored-by: Niels Lange <info@nielslange.de>
2022-12-28 17:30:46 +01:00
kmanijak 32119dc8f9 Move annotation from incorrect place to the function it describes (https://github.com/woocommerce/woocommerce-blocks/pull/8023)
* Move annotation from incorrect place to the function it described
2022-12-28 16:17:04 +01:00
Niels Lange 6bfd2b9c8f Convert product-elements/button to TypeScript (https://github.com/woocommerce/woocommerce-blocks/pull/8003)
* Convert product-elements/button to TypeScript

* Fix TS errors

* Fix TS errors

* Update assets/js/atomic/blocks/product-elements/button/attributes.ts

Co-authored-by: Alex Florisca <alex.florisca@automattic.com>

* Import BlockAttributes from @wordpress/blocks as type

* Solve TS error

* Move BlockAttributes interface to increase readability

* Fix TS error

* Simplify TS declaration

Co-authored-by: Alex Florisca <alex.florisca@automattic.com>
2022-12-23 23:01:16 +07:00
Niels Lange aae39f5266 Simplify @woocommerce/types imports (https://github.com/woocommerce/woocommerce-blocks/pull/8019)
* Simplify @woocommerce/types imports

* Fix TS errors
2022-12-23 18:59:02 +07:00
Alba Rincón f9dd42a36a Add `Customer account` to patterns (https://github.com/woocommerce/woocommerce-blocks/pull/7944)
* Render the block in the frontend

* Add icon style selector to Display settings

This adds an icon style selector in which users can choose the customer account link icon.

* Display on the frontend depending on the icon style

* Rename attributes

* Refactor block rendering

* Improve styling

* Add link to account settings

* Split css file

* Switch to SSR

* Add customer account block to header patterns

* Add customer account block to footer patterns

* Adapt minimal header to designs

* Adapt large header to designs

* Adapt header patterns to new designs and format code

* Adapt footer patterns to the designs

* Change display style for the essential header

* Increase alt icon size

* Make the icon resize with the label

* Adjust icon size on headers

* Add padding and move second row to the right

* Remove unused enum

Co-authored-by: Alexandre Lara <allexandrelara@gmail.com>
2022-12-23 10:08:44 +01:00
Alba Rincón a223af0ad5 Add 'Customer Account' block (https://github.com/woocommerce/woocommerce-blocks/pull/7876)
* Add empty 'Customer Account' block

* Add edit to render the block on the editor

* Add Customer Account icon to @woocommerce/icons library

This icon is used in the Customer Account block.

* Use customerAccount icon in the Customer Account block

* Add Block Settings to Customer Account block

Add Typography and Color settings to the Customer Account block that can be used during Edit mode.

* Add Customer Account style icons

This adds the customer account style icons to be used by the customer account block.

* Render the block in the frontend

* Add Display setting to the Customer Account block

This setting allow users to choose if they want to include an icon with the customer account link.

* Add icon style selector to Display settings

This adds an icon style selector in which users can choose the customer account link icon.

* Display on the frontend depending on the icon style

* Rename attributes

* Refactor block rendering

* Improve styling

* Make the account link dynamic

* Add alignment menu

* Get dashboardUrl with getSettings and add fallback

* Add link to account settings

* Add tests

* Fix test

* Change display title

* Split css file

* Switch to SSR

* Add styles to the front end

* Address latest feedback

* Remove experimental flag

Co-authored-by: Alexandre Lara <allexandrelara@gmail.com>
2022-12-22 16:01:01 +01:00
Luigi Teschio d6b3b26c01 Mini Cart block - added notice support (https://github.com/woocommerce/woocommerce-blocks/pull/7234)
* Mini Cart block - added notice support woocommerce/woocommerce-blocks#6941

Mini Cart block - added notice support

* set isDismissible to true

* address feedback

* improve layout

* fix style and update close button label

* fix UI when the admin bar is visible

* Split out dismissible notices

* fix css

Co-authored-by: Mike Jolley <mike.jolley@me.com>
2022-12-22 15:48:24 +01:00
Mike Jolley 637f47cac7 Refactor View Switcher to use Block Attributes (https://github.com/woocommerce/woocommerce-blocks/pull/8006)
* Add cart view switcher

* Attribute based switched POC

* Tidy up view handling

* Mini cart

* Not sure who clint is. Typo - rename to clientId

* Avoid string casting in TS

* Add margin to title

* Set custom source to prevent currentView saving to post content.

Note this also removes `save` which does not exist in Gutenberg.

* Remove higher order component from withViewSwitcher

* Import view switcher in main file

* Add to side effects

* Move view switcher import

Co-authored-by: Thomas Roberts <thomas.roberts@automattic.com>
2022-12-22 14:35:24 +00:00
Niels Lange ec334678d0 Convert product-elements/rating to TypeScript (https://github.com/woocommerce/woocommerce-blocks/pull/7540)
* Convert product-elements/rating to TypeScript

* bot: update checkstyle.xml

* Import decleration type only

* Rebase against trunk

* Interim TS fixes

* bot: update checkstyle.xml

* Solve TS errors

* bot: update checkstyle.xml

* Solve TS errors

* bot: update checkstyle.xml

* Solve TS errors

* bot: update checkstyle.xml

* Fix TS error

* Fix TS error

* Fix TS errors

* Use BlockAttributes from @wordpress/blocks

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2022-12-22 14:23:11 +07:00
Tarun Vijwani 7a4fa29f0c Convert Reviews component to TypeScript (https://github.com/woocommerce/woocommerce-blocks/pull/7936)
* Convert review-sort-select to TS.

* Convert review-list and review-list-item to TS.

* Fix reviewer_avatar_urls type

* Fix TypeScript errors

* Fix TypeScript errors in frontend-block.js

* Update assets/js/base/components/reviews/review-sort-select/index.tsx

Co-authored-by: Luigi Teschio <gigitux@gmail.com>

* Update assets/js/base/components/reviews/types.ts

Co-authored-by: Luigi Teschio <gigitux@gmail.com>

* fix Review type and remove index file details

* fix ReviewSortSelect component 'value' prop type

* fix typo

Co-authored-by: Luigi Teschio <gigitux@gmail.com>
2022-12-21 17:09:48 +04:00
Albert Juhé Lluveras 101034c4f0 Remove feature flag from Products block (https://github.com/woocommerce/woocommerce-blocks/pull/8001)
* Remove feature flag from Products block

* Remove Products block from feature flags documentation
2022-12-21 12:16:48 +01:00
Albert Juhé Lluveras 77b08b6ed3 Remove opinionated styles from Button component on TT3 and Zaino themes (https://github.com/woocommerce/woocommerce-blocks/pull/7992)
* Add Mini Cart button styles to Button component

* Add wp-element-button class to Button component

* Don't load opinionated button styles in TT3 and Zaino

* Remove bold styles from Mini Cart buttons
2022-12-20 16:02:12 +01:00
Mike Jolley 9e00b015fc New contexts for `StoreNoticesContainer` and notice grouping (https://github.com/woocommerce/woocommerce-blocks/pull/7711)
* Refactor Store Notices

Move snackbar hiding filter before notice creation

Implements showApplyCouponNotice

Refactor context providers

Use STORE_NOTICE_CONTEXTS

use refs to track notice containers

Refactor ref usage

Use existing noticeContexts

* Move new notice code to checkout package

* Combine store and snackbars

* Update noticeContexts imports

* Remove context provider

* Update data store

* Fix 502

* Add new error contexts

* Force types

* Unnecessary reorder of imports

* Fix global handling

* Document forceType

* Optional props are undefined

* Remove function name

* Missing condition

* Remove context prop

* Define ACTION_TYPES

* Remove controls

* Update assets/js/base/context/event-emit/utils.ts

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

* CONTACT_INFORMATION

* Remove ref from registerContainer

* Abstract container locating methods

* pass context correctly when displaying notices

* Remove debugging buttons

* Update filter usage - remove useMemo so filter can work inline

* Refactor existing error notices from the API (https://github.com/woocommerce/woocommerce-blocks/pull/7728)

* Update API type defs

* Move create notice utils

* Replace useCheckoutNotices with new contexts

* processCheckoutResponseHeaders should check headers are defined

* Scroll to error notices only if we're not editing a field

* Error handling utils

* processErrorResponse when pushing changes

* processErrorResponse when processing checkout

* remove formatStoreApiErrorMessage

* Add todo for cart errors

* Remove unused deps

* unused imports

* Fix linting warnings

* Unused dep

* Update assets/js/types/type-defs/api-response.ts

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

* Add todo

* Use generic

* remove const

* Update array types

* Phone should be in address blocks

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

* Update store name to wc/store/store-notices

* Fix assertResponseIsValid

* Funnel woocommerce_rest_invalid_email_address to the correct place

* woocommerce_rest_missing_email_address

* Move comments around

* Move data back into const

* Spacing

* Remove spacing

* Remove forced snack bar and styling

* Move notices within wrapper

* Remove type

* hasStoreNoticesContainer rename

* Group by status/context

* Remove global context

* Remove white space

* remove changes to simplify diff

* white space

* Move comment to typescript

* List style

* showApplyCouponNotice docs

* See if scrollIntoView exists

* fix notice tests

Co-authored-by: Thomas Roberts <5656702+opr@users.noreply.github.com>
2022-12-19 15:30:13 +00:00
Niels Lange 7dfced254a Respect core settings for showing the Checkout block (https://github.com/woocommerce/woocommerce-blocks/pull/7883)
* Respect core settings for showing the Checkout block

* Add account creation option from core to checkout context provider

* Fix TS errors

* Adjust display logic of <LoginPrompt />

* Update assets/js/blocks/checkout/block.tsx

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

* Rename <LoginPrompt> to <MustLoginPrompt>

* Show space between login text and login link

* Fix TS error

Co-authored-by: Mike Jolley <mike.jolley@me.com>
2022-12-19 21:19:52 +07:00
Seghir Nadir b58c5beb3e Handle multiple packages coming from slots (https://github.com/woocommerce/woocommerce-blocks/pull/7829)
* Handle multiple packages coming from slots

* fix missing prop

* fix typo

* remove collapse param

* rename trinary to ternary
2022-12-15 15:17:22 +01:00
Niels Lange 0cd069e9ee Remove account creation setting from Checkout block (https://github.com/woocommerce/woocommerce-blocks/pull/7941)
* Remove account creation setting from Checkout block

* Add CartCheckoutFeedbackPrompt

* Adjust e2e test
2022-12-15 18:13:28 +07:00
Niels Lange 36b37458e8 Make place order button editable (https://github.com/woocommerce/woocommerce-blocks/pull/7843)
* WIP: Make place order editable

* Remove obsolete undefined

* Wrap <ReturnToCartButton> within <Noninteractive>

* Rename const from submitButtonText to paymentMethodButtonLabel

* Simplify defaultValue logic
2022-12-15 17:28:23 +07:00
Thomas Roberts fbe6b6127b Refactor `useForcedLayout` to subscribe to store changes and to batch block insertions (https://github.com/woocommerce/woocommerce-blocks/pull/7879)
* Add type for lock attribute in isBlockLocked

* Add getMissingBlocks function

* Add findBlockPosition function

* Refactor useForcedLayout to use registry batch & insert multiple blocks

* Improve comment on getMissingBlocks function
2022-12-14 07:54:59 -08:00
Tung Du 7a8cd47e65 Product Query: Add `Sorted by title` preset. (https://github.com/woocommerce/woocommerce-blocks/pull/7949)
* Add `Sort by title` preset.

* sorted, thanks @nerrad
2022-12-14 13:50:09 +01:00
kmanijak 05b1b0f32f Fix the incorrect layout of Rating and Price in Classic Template and Products block (https://github.com/woocommerce/woocommerce-blocks/pull/7932)
* Fix the incorrect layout of Rating and Price in Classic Template

There were styles required in Rating Filter that were added globally and influenced the layout of Rating in Products block as well as Classic template. The styles were moved to the Rating Filter block
2022-12-14 08:17:19 +01:00
kmanijak 6aa8a72f8e Add dropdown version of Filter by Stock Status (https://github.com/woocommerce/woocommerce-blocks/pull/7831)
* Extend Filter by Stock Editor options with dropdown and single/multiple choice

* Add dropdown implementation for Filter by Stock Status

* Adjust font-sizes to the rest of the filters

* Add tests to Filter by Stock: dropdown and list variants

* Change test file extension from .js to .tsx, so it handles types as well

* Add E2E test to Filter by Stock checking if display style can be toggled

* When typing in Filter by Stock dropdown, handle the space so it highlights the suggestions

* Change the name of the filter blocks in the test files

* Remove unnecessary waiting step in E2E test for Filter by Stock

toMatchElement waits for an element for 30s by itself, hence waitForSelector usage was removed

* Improve the STOCK_STATUS_OPTIONS type handling

* Extract onDropdownChange function instead of inline arrow function

* Fix overlaping dropdown content with the wrapper when Filter by Stock was set to single
2022-12-14 08:16:37 +01:00
Niels Lange 6c40524dfe Make mini cart buttons editable (https://github.com/woocommerce/woocommerce-blocks/pull/7817)
* Make Cart and Checkout buttons editable

* Make shopping button editable

* Remove obsolete dot from the “Empty Mini Cart view” title

* Ensure to keep the existing styles

* Improve name of start shopping button label

* Prevent potential TS error
2022-12-14 13:51:16 +07:00
Alex Florisca 3954e48a75 Edit Proceed to Checkout button (https://github.com/woocommerce/woocommerce-blocks/pull/7733)
* Edit Proceed to Checkout button

* Don't allow empty button and remove console log

* extract default button label into a variable

* Feedback from Nadir & Niels

Co-authored-by: Niels Lange <info@nielslange.de>
2022-12-13 14:54:27 +00:00
Daniel Dudzic 179287f0be Product Query: Add patterns (https://github.com/woocommerce/woocommerce-blocks/pull/7857)
* Product Query: First attempt at adding patterns

* Product Query: Update patterns and the default block template

* Product Query: And new and update existing patterns

* Product Query: Adjust layout of the Minimal Product Row pattern

* Product Query: Update pattern names

* Product Query: Polish spaces between blocks inside the patterns

* Product Query patterns: Link product titles and improve spacing between product elements

* Product Query patterns: Button font-size update

* Product Query patterns: Center the pagination

* Product Query patterns: Center the pagination for the default pattern

* Product Query patterns: Remove an empty column

* Product Query patterns: Remove an empty column from the product list with 1:1 images pattern
2022-12-13 14:53:26 +01:00
kmanijak 6d2ea8ef3a Add dropdown version of Filter by Rating (https://github.com/woocommerce/woocommerce-blocks/pull/7771)
* Rename the setting section to match Filter by Attribute

* Add Display Style toggle to the block settings

* Set list as a default value of displayStyle for Filter by Rating

* Add dropdown variant of Filter by Rating

* Extend the Editor settings with selectType: single or multiple

* Adjust the styles of a FormTokenField to other dropdown

* Align Editor settings order and wording between Filter by Attribute and Rating

* Fix the issue with cut off corners of dropdown borders

* Provide translated screen reader messages and placeholder

* Revert the label property, which is necessary to display checkbox list

* Make classname for Rating component optional and remove styling in Filter by Rating

* Cover the case when filter with zero products needs string methods for comparison

* Handle Typescript errors and add ts-ignore annotations when necessary

* Remove explicit key prop assignment in Rating component

* Remove leftover property in type definition

* Refactor JSX element extension with custom properties to more robust way with object copy

* Filter by rating tests (https://github.com/woocommerce/woocommerce-blocks/pull/7845)

* Filter by Rating tests:
  - List single
  - List multiple
  - Dropdown single
  - Dropdown multiple

* Adjust the font-size of Filter by Rating dropdown to the rest of the filters

* Fix E2E tests after the Editor settings label has been changed

* Improve sorting in Filter by Rating dropdown

With this change the order of options is always descending: in the chips, suggestions, active filters and URL

* Change the name of the filter blocks in the test files

* Prevent single dropdown input to overflow the wrapper

The issue is fixed in three filters, hence a new shared styles file is created at the path assets/js/blocks/shared/styles/style.css

* Remove the unused styles of active options in Filter by Rating

Chosen options in Filter by Rating list have been bolded. That was the only filter that was doing it. Class was removed, but not the styles themselves which became obsolete. Removing the leftover styles then

* Change the approach of shared styles to fix the dropdown issue in filters

Instead of using direct classes, rewrite it to mixin and include in the filters

* Fix the Filter by Rating with Products block

The problem was with the Products block, that there was incorrect initial value of product ratings query

* Align the logic of getting the filters from URL for Filter by Rating with Filter by Stock

Co-authored-by: Luigi Teschio <gigitux@gmail.com>
2022-12-13 09:12:03 +01:00
Patricia Hillebrandt dbae55536e Filter by Rating Block > Display a notice in the editor if the store has no products with ratings (https://github.com/woocommerce/woocommerce-blocks/pull/7763)
* A notice is now displayed in the editor whenever the Filter by Rating block is used in a store that has no products with ratings. Additionally, users can now preview/update the content, settings, and color for the filter even when the store doesn't have any ratings yet.
2022-12-12 22:52:58 +01:00
Luigi Teschio 306ce007d0 Product Query - Enable "Inherit Query from template" option (https://github.com/woocommerce/woocommerce-blocks/pull/7641)
* Add Inherit Query from template option

* Update label
2022-12-12 16:06:25 +01:00
Tung Du e306334911 Fix: encode and decode term slug to support non-ASCII terms (https://github.com/woocommerce/woocommerce-blocks/pull/7906) 2022-12-12 17:46:20 +07:00
Tarun Vijwani 47aa2ae27b Fix payment store performance by getting a focused selector (https://github.com/woocommerce/woocommerce-blocks/pull/7811)
* Fix payment store performance by getting a focused selector

* Replace getState selector with focused selectors in saved payment methods options
2022-12-07 13:12:55 +04:00
Mike Jolley 7758ee05fe Improve inline validation to avoid invalid server pushes (https://github.com/woocommerce/woocommerce-blocks/pull/7755)
* Allows custom validation rules to be applied to fields - in this case, email address

* Add local state to only push valid changes

* Do not need required

* unused isString

* Move to push level

* Update packages/checkout/components/text-input/validated-text-input.tsx

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

* Update packages/checkout/components/text-input/validated-text-input.tsx

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

* Update packages/checkout/components/text-input/validated-text-input.tsx

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

* Update packages/checkout/components/text-input/validated-text-input.tsx

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

* Validate when the data store changes

Co-authored-by: Niels Lange <info@nielslange.de>
Co-authored-by: Thomas Roberts <5656702+opr@users.noreply.github.com>
2022-12-06 13:13:21 +00:00
Luigi Teschio e58e468685 Fix Query Loop crash when an icon of a variation is registered with src attribute (https://github.com/woocommerce/woocommerce-blocks/pull/7852)
* Fix Query Loop crash when an icon of a variation is registered with src attribute

* change scope variation
2022-12-06 12:13:04 +01:00
Lucio Giannotta dc63c2dc46 Product Query: create variation of `core/post-excerpt` as a Product Query inner block (https://github.com/woocommerce/woocommerce-blocks/pull/7837)
* Creates a new block variation based on the core “Post Excerpt” called “Product Summary”.
* Brands it as our old “Product Summary” atomic element.
* Creates a utility function to allow easy creation of such variations.
2022-12-05 17:25:13 +01:00
Lucio Giannotta 7dc5643dff Product Query: create variation of `core/post-title` as a Product Query inner block (https://github.com/woocommerce/woocommerce-blocks/pull/7836)
As much as we can, we should use core blocks when the functionality is mostly overlapping. In the case of the Post Title block, we don't need to add and maintain our own block most likely, so we should just brand the Post Title block instead.

This PR does the following:

* Creates a new block variation based on the core “Post Title” called “Product Title”.
* Brands it as our old “Product Title” atomic element.
* Use this variation as the default within the Product Query template.
* Also removes some old code used for variations before the namespace attribute was available on the core Query Loop and repurposes it to create this variation.
2022-12-05 16:56:53 +01:00
Lucio Giannotta 99ba060720 Product Query: Polishing touches for the feature plugin debut (https://github.com/woocommerce/woocommerce-blocks/pull/7815)
* Product Query: add Feedback Prompt in inspector

The prompt doesn't appear at the very bottom as there isn't
currently any straightforward way to do this in the block variation.

More investigation is required.

* Product Query: Change icon, description and name

* Product Query: switch to Feature plugin flag

* Add all currently available atomic blocks to the default Product Query template

* Update feature flags doc

* Change SKU and Stock Indicator feature flags

* Change feature flags docs

* Add title prop to the `FeedbackPrompt` and add a title to the Product Query one

* Hacky solution to display the feedback block at the bottom

The order of the inspector controls is set in Gutenberg.
We can hack our way down by hooking to the “color” group and
display our feedback there.

Other panels would be displayed below that if added, such as borders
and margin.

* Reduce Product Query default template

* Fix e2e tests after Product Query block name change (https://github.com/woocommerce/woocommerce-blocks/pull/7840)

* Product Query: Add a better default pattern (https://github.com/woocommerce/woocommerce-blocks/pull/7833)

* Product Query: Add a better default pattern

* Product Price: Add bottom margin

Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>
Co-authored-by: Daniel Dudzic <daniel.dudzic@automattic.com>
2022-12-05 13:46:50 +01:00
Tarun Vijwani 24468ba212 Hide the shipping address form from Checkout Block in Editor and rename the Billing Address label when "Force shipping to the customer billing address" is enabled. (https://github.com/woocommerce/woocommerce-blocks/pull/7800)
* Rename billing address labels and hide shipping address from the editor when Force shipping to the customer billing address is enabled
2022-12-02 15:34:27 +04:00
kmanijak 796e952b92 Align text sizing in filter blocks: chips, checkboxes, buttons, dropdown (https://github.com/woocommerce/woocommerce-blocks/pull/7707)
* Align the font-size of checkbox-control component to the price slider amount

* Align the font-size of Price Slider Button to the price slider amount

* Align the font-size of Filter Reset Button to the price slider amount

* Align the font-size of Clear All Button to the price slider amount

* Align the font-size of Apply button in Editor to the price slider amount

* Align the font-size of Apply button in Frontend to the price slider amount

* Align the font-size of Price Slider Amount to the standard size

* Align the font-size of Active Filter chips to the price slider amount

* Align the font-size of Filter by Price (text) to the price slider amount

* Align the font-size of Filter by Attribute (dropdown) to the price slider amount

* Align the font-size of placeholder of Filter by Attribute (dropdown) to the price slider amount

* Change font-size for text in filters from font-size(smaller) to font-size(smaller)

As a result of discussion in PR it was agreed to check the styles with bigger font size hence the change

* Align the font-size of input text of Filter by Attribute (dropdown) to the price slider amount

* Change margin-right of checkbox-control to relative value so it better adapts to the fonts
2022-11-29 16:42:24 +01:00
Lucio Giannotta 181838bfdf Product Query: Add support for filtering by attributes within the block (https://github.com/woocommerce/woocommerce-blocks/pull/7743) 2022-11-29 14:44:52 +01:00
Luigi Teschio 58423a2025 Product Query - add support for the global query (https://github.com/woocommerce/woocommerce-blocks/pull/7382)
* Product Query: Fix pagination issue

* Product Query - Add support for the Filter By Price Block woocommerce/woocommerce-blocks#6790

Product Query - Add support for the Filter By Price Block

* fix query relation

* fix on sale query

* Product Query - Add support for the Filter By Attributes block woocommerce/woocommerce-blocks#6790

Product Query - Add support for the Filter By Attributes block

* fix bugged pagination and on-sale filter after refactor

* address feedback

* Product Query - Add support for the Filter By Stock Block woocommerce/woocommerce-blocks#6790

Product Query - Add support for the Filter By Stock Block

* Fix filter blocks: the data (e.g: max price or stock-status) match the variation woocommerce/woocommerce-blocks#7245

fix filter blocks: the data (e.g: max price or stock-status) match the variation

* rename allowControls to allowedControls

* add support to the global query

* fix eslint error

* bot: update checkstyle.xml

* Update src/BlockTypes/ProductQuery.php

Co-authored-by: Tung Du <dinhtungdu@gmail.com>

* fix global query generation

* bot: update checkstyle.xml

* try: refactor merge_queries

* remove debug code

* fix: unpack assoc array php 7.4

* try: refactor merge_queries to take any form of input without unpacking
and preparing the input arrays

* add missing query vars

* add feature flag

* updates comment

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Tung Du <dinhtungdu@gmail.com>
2022-11-28 15:31:31 +01:00
Albert Juhé Lluveras 91ff195c07 Rename Active Product Filters block to Active Filters (https://github.com/woocommerce/woocommerce-blocks/pull/7753)
* Rename Active Product Filters block to Active Filters

* Rename wc-block-active-product-filters__placeholder to wc-block-active-filters__placeholder

* Rename active filters fixture
2022-11-25 17:17:45 +01:00
Alex Florisca ff414acd63 Add checkout selectors (https://github.com/woocommerce/woocommerce-blocks/pull/7713)
* Add checkout selectors

* bot: update checkstyle.xml

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2022-11-24 14:19:59 +00:00