Commit Graph

4062 Commits

Author SHA1 Message Date
Niels Lange 6ca73386f6 Update folder-structure.md 2022-08-25 14:39:34 +02:00
Albert Juhé Lluveras 2c1dacdd93 Fix z-index issue in Filter by Attribute dropdowns (https://github.com/woocommerce/woocommerce-blocks/pull/6981)
* Fix z-index issue in Filter by Attribute dropdowns

* Remove unnecessary z-index property
2022-08-25 13:55:33 +02:00
Alba Rincón 90562ae3e0 Remove pattern file added by mistake (https://github.com/woocommerce/woocommerce-blocks/pull/6980) 2022-08-25 13:03:10 +02:00
Alba Rincón 2060f11474 `Filter by Attribute` block design updates (https://github.com/woocommerce/woocommerce-blocks/pull/6920)
* Add and style Reset and Apply buttons

* Style the dropdown option

* Fix class and label

* Fix checkbox margin in editor

* Fix alignment

* Fix the reset button

* Disable Apply button when no changes have been made to the filter to improve UX

* Reduce vertical spacing between list items

* Style chips

* Don't reload on reset if filters have not been applied

* Fix heading styles on the front end

* Add chevron down to filter by attribute dropdown ui component

* Force FormTokenField to remount on reset

* Fix dropdown z-index

* Reduce apply button margin

* Fix styles for single token selection

Co-authored-by: tjcafferkey <tjcafferkey@gmail.com>
2022-08-25 12:01:41 +02:00
Lucio Giannotta 95963a7bab Fix Product Query block hijacking all Query blocks queries (https://github.com/woocommerce/woocommerce-blocks/pull/6952)
* Fix Product Query block hijacking all Query blocks queries

The Product Query block was adding a filter to Gutenberg's core
Query Loop block. When this filter was added once, it would from
then on apply to all other Query Loop blocks (or variations thereof)
on a page.

This change makes sure that:

1. No filters are added in the first place if our custom `__woocommerceVariationProps`
are not set.
2. The filter only gets run once.
2022-08-25 02:48:36 +02:00
Seghir Nadir 58e3b33439 support mdlint in husky (https://github.com/woocommerce/woocommerce-blocks/pull/6968) 2022-08-24 14:26:14 +01:00
Tung Du 6327094a49 Style the Filter by Price block based on the wrapper width (https://github.com/woocommerce/woocommerce-blocks/pull/6943) 2022-08-24 16:10:21 +07:00
Tomasz Tunik b295689571 Product search block as core/search variation (https://github.com/woocommerce/woocommerce-blocks/pull/6191)
Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>
Co-authored-by: Tung Du <dinhtungdu@gmail.com>
2022-08-23 23:06:17 +07:00
Alba Rincón aae8c5d357 Update filter button styles (https://github.com/woocommerce/woocommerce-blocks/pull/6958)
* Update filter button styles

* Address feedback: use mixings

* Improve the editor selector for stock apply button

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

* Reduce vertical margin and input width

Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>
2022-08-23 12:38:39 +02:00
Alba Rincón d8a1dfc456 Make the inlineInput default to false to avoid changing existing block behaviour (https://github.com/woocommerce/woocommerce-blocks/pull/6957) 2022-08-23 12:10:46 +02:00
Seghir Nadir d059d98379 document add rest schema (https://github.com/woocommerce/woocommerce-blocks/pull/6960) 2022-08-22 22:24:49 +01:00
Albert Juhé Lluveras a362a89524 When converting the Filter Products by Price widget into the Filter by Price block, don't use inline input (https://github.com/woocommerce/woocommerce-blocks/pull/6953) 2022-08-22 14:29:29 +02:00
Tom Cafferkey a07cc3c978 Update Filter by Stock block (https://github.com/woocommerce/woocommerce-blocks/pull/6883)
* Update Filter by Stock controls and UI to include custom checkbox and settings.

* Include and style Filter by Stock reset button

* Make checkbox accessible via keyboard

* Update snapshot tests for Filter Products by Stock component

* Update E2E tests with new label value

* Update label test for Apply Filters in E2E tests

* Specify checkbox type so styles are not overridden in the editor

* Update E2E test label for filter button

* Update label selector to search for containing text rather than exact match

* Escape quotation marks for label query in E2E shopper tests for Filter by Stock

* Correct typo on Filter by Stock controls

* Replace custom checkbox with CheckboxControl component from the checkout package.

* Remove opacity on product count for checkbox label so its the same color as the label.

* Update snapshot tests with new component usage for filter by stock

* Update block title from Filter Products by Stock to Filter by Stock

* Update reset button behaviour to clear selections immediately regardless of whether the Apply Filters button is active or not.

* Pass option value as ID to satisfy E2E tests

* Update snapshot tests for stock filter

* Reset checked state on reset for when they have filters checked but not applied.
2022-08-19 09:04:04 +01:00
Alba Rincón 8167f0afb4 `Filter by Attribute` block settings design update (https://github.com/woocommerce/woocommerce-blocks/pull/6912)
* Updata block title and description

* Update block settings to match designs

* Update block title in tests

* Update copy in test
2022-08-19 08:55:34 +02:00
Tung Du 0bea874c8d Fix: flaky test related to setMaxPrice (https://github.com/woocommerce/woocommerce-blocks/pull/6917) 2022-08-18 13:28:46 +02:00
Luigi Teschio ffbf5823d3 Product Query Block POC (Phase 1) (https://github.com/woocommerce/woocommerce-blocks/pull/6812)
* Move `EditorBlock` to general `type-defs`

`EditorBlock` was scoped under the `featured-items` directory at the time of its creation. It is, however, a useful type that should be shared repo-wide. For this reason, I am moving it into the `blocks` type-defs and updating all the references.

* Define types for the Product Query block

Also defines a more generic `WooCommerceBlockVariation` type which should be also useful in the future to implement a similar pattern.

* Add Product Query utils

Add two utility functions:

 1. `isWooQueryBlockVariation`: is used to check whether a given block is a variation of the core Query Loop block, and also one of the allowed variations within our repo. See: `QueryVariation` enum type.
2. `setCustomQueryAttribute`: is a shorthand to set an attribute within the variation query attribute.

* Refactor and cleanup the JS demo code

Specifically:

1. Creates a `constant.ts` file to store all shared constants. Currently, the default variation attributes.
2. Move the variations to their own directory. One file per variation.
3. Move the inspector controls into own file and create a conditional logic to allow showing only certain settings.

* Update webpack config

* Add ProductQuery class

* Fix `QueryVariation` enum

We had changed the Products on Sale variation slug to something else,
but we had forgotten to update the proper enum.

* Remove unused params from `update_query`

The filter we added to Gutenberg will pass the block and the page,
as we might need them in the future and we want to minimize the
amount of changes we'll have to do upstream.

However, we currently do not use those, so I removed
them from our own inner function.

Co-authored-by: Lucio Giannotta <lucio.giannotta@a8c.com>
2022-08-18 10:02:21 +02:00
Tarun Vijwani 40ad67d9a1 Update version to 8.4.0-dev 2022-08-17 18:13:00 +05:30
Tarun Vijwani 9af266a3b9 Merge 8.3.1 patch release 2022-08-17 18:10:15 +05:30
github-actions[bot] d827e8176e Release: 8.3.1 (https://github.com/woocommerce/woocommerce-blocks/pull/6910)
* Add global styles to Product Categories List block in WC core (https://github.com/woocommerce/woocommerce-blocks/pull/6906)

* add side effect to package (https://github.com/woocommerce/woocommerce-blocks/pull/6904)

* Add _blank to terms link (https://github.com/woocommerce/woocommerce-blocks/pull/6908)

* Only show items if there are multiple packages in the cart (https://github.com/woocommerce/woocommerce-blocks/pull/6899)

* Price Filter Block Design update (https://github.com/woocommerce/woocommerce-blocks/pull/6877)

* make toggle control full width

* add inlineInput attribute

* add inlineInput sidebar setting

* add inlineInput help text

* style the filter button

* style price input

* wip: reset button

* clicking on reset button will reset the price query

* support inline input fields

* price text styling update

* fix reset button font size

* add loading placeholder to all elements

* fix filter button style

* update range slider thumb and track style

* fix loading placeholder for non empty query

* move reset button into FilterSubmitButton component

* try: render placeholder serverside

* update filter button label

* Revert "try: render placeholder serverside"

This reverts commit 98f08efdb8048b8f78c7476b774d1128c1d31295.

* remove LoadingPlaceholder component

* remove Price: prefix from the current displayed price range

* update labels

* extract reset button as a dedicated component

* update price text section

* update reset button behavior

* avoid breaking filter submit button style for other filter blocks

* rename block to Filter by Price

* fix e2e test

* remove border support

* adjust padding for elments

* rename panel title

* Make the inline option enabled by default and fix frontend rendering

* Make the `Price Range Selector` uppercase

* Show `Reset` button only when a selection has been made

* Revert the `save` change to avoid the 'Block Recovery Prompt'

Co-authored-by: Alba Rincón <alba.rincon@automattic.com>

* Release: 8.3.0 (https://github.com/woocommerce/woocommerce-blocks/pull/6897)

* Empty commit for release pull request

* Bump version numbers and add changelog

* Add testing notes

* Add global styles to Product Categories List block in WC core

* add side effect to package

* Update testing instructions

* Empty commit

* Fix linting

* Update zip file with latest changes

* Fix linting

* Update changelog entries

* Bumping version strings to new version.

Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Tarun Vijwani <tarun.vijwani@automattic.com>
Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>
Co-authored-by: Nadir Seghir <nadir.seghir@gmail.com>
Co-authored-by: Saad Tarhi <saad.trh@gmail.com>

* Update version to 8.4.0-dev

* Empty commit for release pull request

* Add change log

* Add testing instructions

* Fix the version number in testing instructions

* Bumping version strings to new version.

Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>
Co-authored-by: Seghir Nadir <nadir.seghir@gmail.com>
Co-authored-by: Thomas Roberts <5656702+opr@users.noreply.github.com>
Co-authored-by: Tung Du <dinhtungdu@gmail.com>
Co-authored-by: Alba Rincón <alba.rincon@automattic.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Tarun Vijwani <tarun.vijwani@automattic.com>
Co-authored-by: Saad Tarhi <saad.trh@gmail.com>
2022-08-17 17:32:49 +05:30
Tarun Vijwani 9eaa5d9f73 Update version to 8.4.0-dev 2022-08-17 13:19:44 +05:30
github-actions c89bf80181 Empty commit for release pull request 2022-08-17 07:00:39 +00:00
github-actions[bot] 515919617c Release: 8.3.0 (https://github.com/woocommerce/woocommerce-blocks/pull/6897)
* Empty commit for release pull request

* Bump version numbers and add changelog

* Add testing notes

* Add global styles to Product Categories List block in WC core

* add side effect to package

* Update testing instructions

* Empty commit

* Fix linting

* Update zip file with latest changes

* Fix linting

* Update changelog entries

* Bumping version strings to new version.

Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Tarun Vijwani <tarun.vijwani@automattic.com>
Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>
Co-authored-by: Nadir Seghir <nadir.seghir@gmail.com>
Co-authored-by: Saad Tarhi <saad.trh@gmail.com>
2022-08-17 12:30:15 +05:30
Tung Du 401e7b5a70 Price Filter Block Design update (https://github.com/woocommerce/woocommerce-blocks/pull/6877)
* make toggle control full width

* add inlineInput attribute

* add inlineInput sidebar setting

* add inlineInput help text

* style the filter button

* style price input

* wip: reset button

* clicking on reset button will reset the price query

* support inline input fields

* price text styling update

* fix reset button font size

* add loading placeholder to all elements

* fix filter button style

* update range slider thumb and track style

* fix loading placeholder for non empty query

* move reset button into FilterSubmitButton component

* try: render placeholder serverside

* update filter button label

* Revert "try: render placeholder serverside"

This reverts commit 98f08efdb8048b8f78c7476b774d1128c1d31295.

* remove LoadingPlaceholder component

* remove Price: prefix from the current displayed price range

* update labels

* extract reset button as a dedicated component

* update price text section

* update reset button behavior

* avoid breaking filter submit button style for other filter blocks

* rename block to Filter by Price

* fix e2e test

* remove border support

* adjust padding for elments

* rename panel title

* Make the inline option enabled by default and fix frontend rendering

* Make the `Price Range Selector` uppercase

* Show `Reset` button only when a selection has been made

* Revert the `save` change to avoid the 'Block Recovery Prompt'

Co-authored-by: Alba Rincón <alba.rincon@automattic.com>
2022-08-16 19:58:55 +02:00
Thomas Roberts de9b044eba Only show items if there are multiple packages in the cart (https://github.com/woocommerce/woocommerce-blocks/pull/6899) 2022-08-16 17:19:40 +01:00
Tarun Vijwani fcde655ae5 Bumping version strings to new version. 2022-08-16 21:48:54 +05:30
Seghir Nadir c338a799b3 Add _blank to terms link (https://github.com/woocommerce/woocommerce-blocks/pull/6908) 2022-08-16 15:59:21 +01:00
Saad Tarhi 51c4b9e18d Update changelog entries 2022-08-16 15:40:36 +01:00
Tarun Vijwani cb7bc46223 Fix linting 2022-08-16 17:05:23 +05:30
Tarun Vijwani 8c2a277234 Update zip file with latest changes 2022-08-16 16:45:34 +05:30
Tarun Vijwani 0b30f0fcd5 Fix linting 2022-08-16 16:33:24 +05:30
Tarun Vijwani 7042ada23f Empty commit 2022-08-16 16:26:51 +05:30
Tarun Vijwani 7584e43354 Update testing instructions 2022-08-16 16:23:28 +05:30
Nadir Seghir 9e4f093f90 add side effect to package 2022-08-16 16:22:03 +05:30
Seghir Nadir 4bfb255f6b add side effect to package (https://github.com/woocommerce/woocommerce-blocks/pull/6904) 2022-08-16 16:21:26 +05:30
Albert Juhé Lluveras 61e78c6709 Add global styles to Product Categories List block in WC core 2022-08-16 15:08:29 +05:30
Albert Juhé Lluveras 03c5d9ccd1 Add global styles to Product Categories List block in WC core (https://github.com/woocommerce/woocommerce-blocks/pull/6906) 2022-08-16 09:42:38 +02:00
Tarun Vijwani 356cebda63 Add testing notes 2022-08-15 18:56:33 +05:30
Tarun Vijwani 441bc9f508 Merge remote-tracking branch 'origin/release/8.3.0' into release/8.3.0 2022-08-15 13:52:34 +05:30
Tarun Vijwani 74a1ba215f Bump version numbers and add changelog 2022-08-15 13:48:11 +05:30
github-actions 9320e98573 Empty commit for release pull request 2022-08-15 06:45:23 +00:00
Thomas Roberts 2285d1d4e2 Include Cart and Checkout Blocks when included in WC Core (https://github.com/woocommerce/woocommerce-blocks/pull/6805)
* Remove all inbox notifications about cart and checkout blocks

* Remove feature flag check from CreateAccount class

* Remove feature plugin check to register PaymentsApi class

* Comment out is_feature_plugin_build function

We might need this later, so keeping it around seems useful.

* Remove feature plugin check when adding resource hints

* Import registerBlockType and use it over registerFeaturePLuginBlockType

* Ensure Cart and Checkout inner blocks register even if not feature plugin

* Comment out registerFeaturePluginBlockType

* Remove duplicate import

* Revert "Comment out registerFeaturePluginBlockType"

This reverts commit bec6ed899b68e26e836bde1c573d6066fb2bcc47.

* Align PHPDoc correctly

* Update feature flag doc to remove Cart and Checkout blocks + PaymentApi
2022-08-15 11:15:15 +05:30
Wojtek Naruniec eb1c1c5201 Refactor Product Categories block to use block.json (https://github.com/woocommerce/woocommerce-blocks/pull/6875)
I refactor block to use block.json schema. The block schema
internally extends the main block.json schema and it fixes an issue
that occurs on WPCOM.
2022-08-12 17:46:00 +02:00
Thomas Roberts d45ef84219 Add dismissible compatibility notice to sidebar when editing Cart and Checkout (https://github.com/woocommerce/woocommerce-blocks/pull/6869)
* Add default page notice

* show notice all inner blocks

* support flow when page isnt saved

* switch from where we get the current post id

* update lock

* fix types

* Remove old compatibility notices from Cart and Checkout

* Move useCompatibilityNotice to sidebar-compatibility-notice directory

* Remove old CartCheckoutCompatibilityNotice

* Create sidebar compatibility notice hoc

* Add isCartOrCheckoutOrInnerBlock function

* Refactor defaultNotice to use new isCartOrCheckoutOrInnerBlock func

* Remove BlockSettings from checkout edit and export from checkout-shared

* Change so component still renders, it is just hidden with display: none

This is required because when it returns null the component gets skipped from being added to the Slot, then when it does return a component, then it gets rendered at the bottom of the Slot. By ensuring it always renders we can have it at the top all the time.

* Set the priorities of the hoc filters so compat notice renders first

* Make isCartOrCheckoutInnerBlock a hook

* Remove old compatibility notice related tests

* Remove BlockSettings from Cart

* Remove withDefaultNotice hoc

* Include DefaultNotice in compatibility notice

* Remove DefaultNotice from Checkout

* Rename withSidebarCompatibilityNotice to withSidebarNotices

This is because it includes the sidebar compatibility notice and the default notices

* Remove useIsCartOrCheckoutOrInnerBlock hook

* Remove compatibility notice code from tests

* Revert DefaultNotice back to the old one

* Remove unused components

* Remove withBlockSettings HOC and fix TS types

This is an abstraction that is no longer required, we can just include BlockSettings in the Cart and Checkout blocks

* Remove CartCheckoutFeedbackPrompt from BlockSettings

It will be included in sidebar-notices instead

* Fix TS Types in DefaultNotice

* Add BlockSettings to cart and checkout edit

* Editor: Add feedback box to the Cart & Checkout Inner Blocks (https://github.com/woocommerce/woocommerce-blocks/pull/6881)

* Show "Feedback prompt" for all inner blocks

* Fix the "feedback" notice position for these blocks

The "checkout fields", "checkout billing address" and
"checkout shipping address" have the addressFields option which
gets rerendered and placed at the bottom of the inspector controls.

* Tidy up the address-fields hoc

* Use correct block name to check for billing or shipping address

* Revert "Editor: Add feedback box to the Cart & Checkout Inner Blocks (https://github.com/woocommerce/woocommerce-blocks/pull/6881)"

This reverts commit 5f3d6cf15ce08d9c303e62ec3e0d0315ead1281f.

* Add hack to get feedback prompt to render last

* Fix TS errors for context and attributes

* Include CartCheckoutFeedbackPrompt in accountcontrols & addresscontrols

* Do not include feedback prompt if on an address block or contact info

* Remove unused hoc for address fields

Co-authored-by: Nadir Seghir <nadir.seghir@gmail.com>
Co-authored-by: Saad Tarhi <saad.trh@gmail.com>
2022-08-12 15:23:08 +01:00
Wojtek Naruniec 4a377ef729 Fix broken contributing links (https://github.com/woocommerce/woocommerce-blocks/pull/6876)
* Fix contributing docs links as some of them point to incorrect locations

* Fix typo
2022-08-12 06:38:17 -07:00
Alba Rincón 5bcabd0361 Register patterns under `patterns` folder and add filters pattern (https://github.com/woocommerce/woocommerce-blocks/pull/6861)
* POC about registering patterns

* POC load patterns from `/patterns` folder

* Change class name and remove unnecessary comment

* Add all four blocks to the filters pattern

* Add all 4 blocks to the block type to allow for transformations

* Add internal

* Improve filters name

* Extract regex to constants

* Add class description

* Rename and move class

* Fix wrong imports

* Address feedback

* Early return from condition

* Fix wrong block type
2022-08-12 13:09:37 +02:00
Raluca Stan f1846025db Add a new structure and clearer steps for the WC Core PR section of the release steps (https://github.com/woocommerce/woocommerce-blocks/pull/6878)
* Add a new structure and clearer steps for the WC Core PR release steps

* Apply suggestions from code review

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

* Update .github/patch-initial-checklist.md

Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>
2022-08-11 13:25:49 +02:00
Daniel W. Robert 5c40b83480 Add Style Attributes Hooks to blocks/hooks Directory. (https://github.com/woocommerce/woocommerce-blocks/pull/6870)
* Copy style-attributes file to desired directory.

Add a copy of the style-attributes file in blocks/hooks to the desired
base/hooks directory with the other hooks.

* Remove relative imports in favor of global aliases

Utilizes the custom global project aliases in place of using relative
imports.

Note: seeing some linting issues with the aliases. This seems to be the
case elsewhere so it is likely not a blocker for this effort, however,
it may be worth looking into as a follow-up.

* Adjust all imports to use @woocommerce/base-hooks.

Replace all instances of relative file paths to hooks/style-attributes
to use the custom global alias.

* Remove the hooks dir in `assets/js/blocks/`.

Now that everything is using the `@woocommerce/base-hooks` custom global
alias and we have the `style-attributes` hooks file in the base/hooks
directory, we no longer need the `style-attributes` hooks file in the
aforementioned `assets/js/blocks` directory.

* Split style-attributes.ts out into separate files.

Moved the four hooks in style-attributes.ts out into their own, separate
hook file to be consistent with the rest of our custom hooks.

Additionally, moved the helper function (parseStyle) out into a separate
export in base/utils.
2022-08-10 20:04:12 -04:00
Tarun Vijwani d258a0696c Update billing address when shipping address gets change in Cart block (https://github.com/woocommerce/woocommerce-blocks/pull/6823) 2022-08-10 17:03:28 +05:30
Tung Du 9253ba0eec Fix: Override the description to prevent infinite loop (https://github.com/woocommerce/woocommerce-blocks/pull/6849) 2022-08-09 16:28:35 +07:00
Tung Du dc66942cbb Fix: Attribute filter flaky test (https://github.com/woocommerce/woocommerce-blocks/pull/6862) 2022-08-09 08:30:11 +07:00