* 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
* 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
* 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>
* 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>
* 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>
* 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>
* 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>
* 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
* 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>
* 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>
* WIP: Make place order editable
* Remove obsolete undefined
* Wrap <ReturnToCartButton> within <Noninteractive>
* Rename const from submitButtonText to paymentMethodButtonLabel
* Simplify defaultValue logic
* 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
* 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
* 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
* 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
* 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>
* 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
* 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>
* 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.
* 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>
* 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.
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.
* 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>
* 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
* 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>
* 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