* Reverse ordter of filter item name and close btn.
* Update layout & typography styles for block items
* Update chip ui view styles.
Additionally, add editor styles to have the editor match the rendered
frontend.
* Update additional remove button styles.
- Add hover state to remove button on chip layout.
- Update disabled styles to remove button in both layouts (mainly relevant
to the editor view).
* Adjust remove button colors.
Set hover states to shades of grey. Also set chip color and text to
match selected text color of the block.
* Update e2e test to account for new element order.
Since we're moving the remove button in the list view from the last
child node to the first child node, we need to adjust the expected order
of the active filter item text.
* Design and copy updates on the block settings
Co-authored-by: Alba Rincón <albarin@users.noreply.github.com>
Co-authored-by: Alba Rincón <alba.rincon@automattic.com>
* 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.
* 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>
* 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>
* Added Cross-sells object and schema for the API Cart response.
* Cross-sells are now WC_Product objects that pass through the visibility filter.
* Removed redundant check.
* Updated function doc comment.
* Cleaned up imports.
* Cross-sells item schema (extension of ProductSchema) was removed, and replaced by ProductSchema itself. Cross-sells are direct product representation, and extending this goes out of scope for the task at hand.
* Unit testing for cart response containing cross-sell products.
* Increase `schema_version` to add the new `wc_blocks_use_blockified_templates` flag
If the schema version stored on the db is <= 260 means the plugin is being updated
to the new version and we should keep using the old templates, not the blockified ones.
* After the theme is switched we check if we need to update the flag to
start loading the blockified templates or not.
* Get the templates from the blockified folder if the flag is set to true on the db
* Add temporary blockified template for testing purposes
* Inline variable
* Improve comment
* Use blockified templates on new installs with block themes only
* Don't use blockified templates when switching to a non FSE theme
* Fix condition
* Add tests for the option value
* Move the check to use blockified templates
* WIP
* WIP
* Add migration strategy
* Move the blockified templates to the templates folder and filter them depending on the option
* Fix tests and start using the Options constants
* Fix migration, the `should_use_blockified_product_grid_templates` and tests
* Rename tests and move to Utils folder
* add Migration class test
* try
* remove PHP
* add composer
* Replace the blockified templates with a temporary version
* Fix tests
* add comment
* Add feature gating for experimental builds
* Inject the package to the controller
* test
* Change blocks.ini
* debug
* Remove debug info
* fix test
* fix tests
* try now
* using composer cache
* install deps
* test
* Remove unnecessary extra key
* Add cache actions
* Undo tests change
* Fix readme format
Co-authored-by: Luigi <gigitux@gmail.com>
* wip
* set editor using env var instead
* fix attribute missing issue when watching the test
* wip php templates test
* Add E2E tests for the Filter Products By Price Block woocommerce/woocommerce-blocks#6363
add E2E tests for the Filter Products By Price Block
* Add E2E tests for the Filter Products By Price Block woocommerce/woocommerce-blocks#6363
add E2E tests for the Filter Products By Price Block
* create clickLink util
* Add E2E tests for the Active Filters Block woocommerce/woocommerce-blocks#6377
add E2E tests for the Active Filters Block
* Add E2E tests for the Filter Products By Attribute Block woocommerce/woocommerce-blocks#6322
add E2E tests for the Filter Products By Attribute Block
* Add E2E tests for the Filter Products By Stock Block woocommerce/woocommerce-blocks#6323
add E2E tests for the Filter Products By Stock Block
* improve checks
* improve checks
* improve checks
* remove globals.d.ts file
* replace waitForTimeout
* create clickLint utils
Co-authored-by: Tung Du <dinhtungdu@gmail.com>
* Add E2E tests for the Filter Products By Price Block woocommerce/woocommerce-blocks#6363
add E2E tests for the Filter Products By Price Block
* Add E2E tests for the Filter Products By Attribute Block woocommerce/woocommerce-blocks#6322
add E2E tests for the Filter Products By Attribute Block
* Add E2E tests for the Filter Products By Stock Block woocommerce/woocommerce-blocks#6323
add E2E tests for the Filter Products By Stock Block
* improve checks
* improve checks
* remove globals.d.ts file
* replace waitForTimeout
* Add E2E tests for the Filter Products By Attribute Block woocommerce/woocommerce-blocks#6322
add E2E tests for the Filter Products By Attribute Block
* Add E2E tests for the Filter Products By Stock Block woocommerce/woocommerce-blocks#6323
add E2E tests for the Filter Products By Stock Block
* improve checks
* improve checks
* remove globals.d.ts file
* Add E2E tests for the Filter Products By Attribute Block woocommerce/woocommerce-blocks#6322
add E2E tests for the Filter Products By Attribute Block
* improve checks
* Try to fix account.test.js
* Remove language installations for woo core and wp core and take screenshots
* Upload screenshots to artifacts
* npm install instead of npm ci
* Upload artifacts not matter what
* fsdf
* fsdfsf
* remove screenshoting from account.test.js and only run checkout-terms.test.js
* Print NODE_ENV
* Better handling of overriding wp-env.json
* Run all tests
* Re-enable translations for WP and Woo
* Wait for Cart & Checkout blocks to load before moving on
* Uncomment github actions
* Try to fix shipping test
* fill checkout before placing order, duuuh
* Wait until networkidel0 instead of domcontentloaded for page navigations
* Fix account.test.js
* change visitBlockPage() to use Promise.all()
* Remove screenshot taking
* I think Promise.all() is being funny and not throwing properly, testing
* wait for checkbox to be visible before clicking
* Remove try catch around Promise.all()
* Fix linting issues
* Remove screenshot dir
* Raluca feedback:
* Timeout back to 30000
* Login to merhcant before changing settings
* merchant.logout()
* Transform object for woocommerce_price_filter legacy widget to be replaced with block alternative
* Filter products by price transform
* Price Filter formatting
* Set set_filterable_product_data data on the widgets screen
* Prevent rendering the Price Filter block if there are no products to filter
* Prevent Classic Price Filter Widget from being available as a widget
* Transform layered nav classic widget to attribute filter block
* Allow Filter Products by Stock block to be added as a widget
* Allow Active Filters widget to be transformed to Active Filters block
* Set showFilterButton to true and showInputFields to false in the transform of Price Filter to minic widgets more
* Change displayStyle property to be display_type instead of incorrectly using title
* mock @woocommerce/settings for has_filterable_products setting
* try: add All Products block to render that filter on the front end
* Revert "try: add All Products block to render that filter on the front end"
This reverts commit 5ad09e964b77e5c6499b4134cf58d7a6c226424d.
* try: add all product block to bypass has_filterable_products check
* fix: backend e2e test for attribute filter
Co-authored-by: Tung Du <dinhtungdu@gmail.com>
* Add test to check if T&C and Privacy links are visible
* Fix filling wrong type of form error
With a virtual product we shouldn't need to fill the shipping details
We need to fill the billing instead
* Fix undefined 'termsCheckbox' bug
* Fix terms checkbox name
* Activate test case
* Replace static URL with dynamic one
* Convert external plugin into mock
* Fix JS linting issue
Co-authored-by: Saad Tarhi <saad.trh@gmail.com>
* Enable Attribute Filter block to work with the PHP rendered Classic Template block
* Check for presence of option before rendering it
* improve filter product by attribute
* fix pagination problem
* fix check when two filter block with same attribute are used
* fix filter by stock for PHP templates
* fix naming and comment
* Update filter key in ClassicTemplate
* Update stock filter block for PHP templates when the filter button is enabled
* Remove unused useEffect and fix ESLint error
* Set active stock filter and track using local state
* ESLint fix
* Remove unncessary dependencies from useEffect
Co-authored-by: tjcafferkey <tjcafferkey@gmail.com>
* Cart & Checkout translations test use the already installed language nl_NL
* Extra timeout when checking for shipping and billing addresses
* wait for selector instead of increase timeout
* Change waitForSelector selector:
* Clean up
* Increase idleTime for waitForNetworkRequest
* Fix random timeouts and increase timeout of verifying shipping option
* feedack
* Register missing C & C inner blocks and update fallback template for older C & C versions
This will fix the issues with missing order summary inner blocks: Coupons (both in C & C blocks) and the Cart header. The issue was happening because, for example, for Cart the coupons were registred on the on frontend, but it just wasn't forced in the attributes. Because it also wasn't added to the PHP fallback layout, the render function didn't include it. For the Checkout block the coupons inner block wasn't registered at all.
* Revert changes to Checkout.php, we don't need to test for inner blocks
* Revert "Revert changes to Checkout.php, we don't need to test for inner blocks"
This reverts commit fc39535f8476d02e35353374d9434a8723458cfa.
* Fix the returned template for older Checkout block iterations
* Fix Cart and Checkout templates to accommodate the Summary order inner blocks
* Hide coupon form div from inner blocks if coubons are not enabled
* Fix checkout coupon tests in checkout
They have been written for logged in user
* Fix Order Summary Heading inner block's default text
* Update comments with better wording
* Revert "Hide coupon form div from inner blocks if coubons are not enabled"
This reverts commit ab09021b923fad4218b3016e47760ad07f6bc960.
* rename some things
* Refactor e2e tests
* remove only from checkout test
* Typo in test
* Add --testPathIgnorePatterns performance back into package.json
* Niels feedback and fix a test
* Update import from utils
* Increase timeout of translations test to 30000
* Wait for network idle in goToCart and goToCheckout
* Increase timeout to 30000
* fix E2E tests
* try fix
* test
* test
* test
* another test
* fix test
* 60s timeout
* test
* Update product constants
* Simplify orderSummary check
* Go back to page.$
Co-authored-by: Luigi <gigitux@gmail.com>
* Check for performance file existence before running
* check reports/performance-report.json file exists on setup
Co-authored-by: Alex Florisca <alex.florisca@automattic.com>
* Add performance script to measure load times of cart and checkout blocks
* Temp commit
* Temp commit
* Temp commit
* Remove specific test from performance e2e command
* Add performance reporter
* Add step to clean performance file before running tests
* Add test report constant & average and logPerformanceResult test utils
* Update uses of product name constant
* Add cart coupon performance test
* Check if report file is empty before parsing
* Limit performance tests to only ones in performance directory
* Round the averages and add a linebreak after each entry in the log
* Fix formatting of report and only output after all tests
* Log each loading metric as an individual data point
* Improve formatting
* Get load times in ms from profiler
* Revert changes to fixtures
* Remove trace.json from git
* Remove checkout test file (tests not implemented)
* Check performance log file exists before truncating it
* Fix checkout coupon test
* Remove console logs
* Revert to use virtual products after rename of constant
* Ignore performance tests when running regular e2e tests
* Feedback changes
* Tidy up
* Fix packag-log.json:
Co-authored-by: Alex Florisca <alex.florisca@automattic.com>
* Add "single-use" coupon to the fixture data
* Create a first draft of the coupon e2e test
* Create single use coupon code constant
* Create "applyCouponFromCheckout" function
* Remove the "single-use" coupon from the fixture data
* Setup coupon creation using Woo's Rest API
* Add single-use coupon E2E test
* Move discount XPath definition to the expressions file
* Clean comments
* Remove unnecessary delay function
* Refactor to a more human friendly check
* Clear the setup in the afterAll branch (delete coupon)
Co-authored-by: Saad Tarhi <saad.tarhi@automattic.com>