* Wait until networkidle before running tests
* Copy logic to select first attribute from PHP classic template tests
* Create util function to insertProductByAttributeBlockWithFirstAttribute
* Set up Playwright
* Use caching in GitHub Actions
* Update tests/e2e-pw/README.md
Co-authored-by: Thomas Roberts <5656702+opr@users.noreply.github.com>
* Rename “{blockName}” to “{blockName} block”
* Disable “no-console” for setup and teardown files
* Remove obsolete log and adjusted disabled ESLint definition
* Remove conditional logic from actions/upload-artifact
---------
Co-authored-by: Thomas Roberts <5656702+opr@users.noreply.github.com>
* Enable the attribute lookup direct updates settings
We are importing products using the batch api and we need the lookup tables
to be updated immediately for our tests to work. Enabling this setting will
do that, instead of doing it asynchronously.
* Fix customer account test classes
* Increase timeout limit for failing tests
---------
Co-authored-by: roykho <roykho77@gmail.com>
* Introduce the new get_attribute_and_meta_counts method.
* Ensure that if no term_slug or term_id is found for counting, the default list with all terms (with count equal zero) is returned instead.
* update conditional for the slug, the empty state for requests without filter attributes and the condition query for 'and'
* Introduce the get_terms_list method.
* Remove the legacy get_attribute_counts method and update its calls to rely on the new get_attribute_and_meta_counts method instead.
* Update the query to ensure that if a parent product has multiple identical attributes, they are counted once.
* Update to start relying on the get_product_by_metas method for counting product metas
* Add a new where_clause to only include product metas and attributes in the macro query if they are not empty.
* Add wpdb->prepare to the macro query and the get_terms_list method.
* Replace the raw atomic query for fetching the filtered terms with the new get_product_by_filtered_terms method.
* Update the request params for the get_attribute_and_meta_counts method.
* Update the request params for the product metas (min and max price).
* Update the query and returned value on get_terms_list.
* Update the validation for returning the default counts when no values are filtered.
* Update the query on get_terms_list to use ->prefix
* Update the variable for the query to rely on the filtered one. Update the min_price and max_price format on get_product_by_metas.
* Ensure the get_product_by_filtered_terms method is triggered for each one of the filtered terms and update the macro query to include those term ids on the WHERE clause.
* Make adjustments for the 'and' condition to work as expected.
* Ensure the queryState.attributes is properly added as a param to the API request to correctly fetch the attribute count data.
* Ensure the get_product_by_metas method is only triggered when at least one of the metas in the request is not empty.
* Join type update: for the 'and' (all) filter condition, items with the count zero are not displayed.
* wpdb prepare the where clauses
* Update the get_product_by_filtered_terms query wpdb prepare params
* update the get_product_by_metas method's where clause preparation.
* Update the where clause preparation for get_attribute_and_meta_counts so we don't rely on interpolated variables anymore.
* Adjust the get_attribute_and_meta_counts method for usage alongside the rating filter.
* Adjust the query for fetching the attribute counts for filtered ratings.
* Add support for the filter by stock.
* Ensure the product attribute counts are correct if the parent product receives a rating.
* Ensure product_or_parent_id is used only when the filter by rating is used, not affecting price or stock filters.
* Add the missing else condition.
* Enable caching.
* Address CR
* Update query for average rating.
* remove file accidentally commited.
* When multiple ratings are selected, make sure the where clause is updated accordingly for each one of them.
* Start updating the stock_status logic to account for when multiple options are selected by the user.
* Ensure the counts are properly updated when more than one stock status is selected.
* Ditch the is_array condition for the average_rating counts as is always an array.
* Deprecate the second param attributes for the get_attribute_counts method.
* Add the filtered_attribute to the transient_key
* Bypass cache if WP_DEBUG is enabled.
* Update formatting for macro query.
* Fix mixed tabs spaces on query
* Fix PHP unit tests for the new attribute counts.
* Update spacing/formatting for SQL queries.
* Minor: update indentation for the main SQL query
---------
Co-authored-by: roykho <roykho77@gmail.com>
* Allow countries not covered by postcode-validator to pass validaiton
* Add "skipPushCheck" option when filling billing and shipping details
* Allow albania as a shipping/selling country
* Add test to ensure adding a postcode for a country without rules works
* Remove skipPushCheck option
no longer needed
* Add default align attribute value for Cart block
* Add default align attribute value for Checkout block
* Update cart tests
* Check for not disabled insert button
* Update @wordpress/e2e-test-utils
* Remove WP 6.1 specific code
* Don't call switchBlockInspectorTab in blocks that don't have inspector tabs
* Typos and code styling fixes
* Make .toRenderBlock() more resilient
* Make sure we only open the Settings tab when the block has been selected
* Fix goToSiteEditor in WP 6.2
* Create insertAllProductsBlock util
* Create openSettingsSidebar util as an alternative to openDocumentSettingsSidebar so it works in WP 6.2
* Update WOOCOMMERCE_PARSED_ID
* Create enableApplyFiltersButton() util
* Add filter to change allowed blocks in Cart and Checkout blocks
* Add documentation for allowedBlockTypes
* Add test to check the filters work for the Checkout block
* Rename filter to additionalCartCheckoutInnerBlockTypes
* Update docs to reflect new name
* Add tests for additionalCartCheckoutInnerBlockTypes in Cart block
* Update Checkout test to reflect new filter name
* Update docs TOC to add example link
* Remove Single Product Block
* remove more files that belong the Single Product block
* fix php linter error
* remove Product Tag List and Product Category List blocks
* Hide shipping address from local pickup order confirmation page
* Add pickup details to confirmations
* Error handling
* Update test because columns may be hidden
* use address selector
* Custom selector for local pickup
* try forcing flat rate during test
* Fix local pick-up e2e tests
- Change location_country select input to location_country_state select input in e2e tests.
- Remove location_state select input in e2e tests.
* Fix country/state value
- Change country/state value from 'US' to 'United States (US) — California'
* Add inline comment about same field for Country and State fields
- We merged the Country and State fields into the same field in the local pickup modal. Add inline comment in e2e test to avoid confusion.
* Add CartCheckoutUtils class
This class will store reusable methods relating to Cart/Checkout Blocks, i.e. whether they are used on the Cart/Checkout page.
* Update ShippingController to use the new CartCheckoutUtils function
This will reduce code duplication when checking if the Cart/Checkout blocks are in use on the Cart/Checkout page.
* Add filter to remove shipping settings when Cart/Checkout are default
* Ensure setting displays correctly if cart is default but not checkout
* Add tests to ensure core shipping settings update correctly
* Add setCartCheckoutPages function to update set the cart/checkout page
* Force shipping to be enabled if the Checkout block is in use.
* Add filter to override cost requires address option
* Add shippingCostRequiresAddress option
* Check if the address is required before showing rates
* Show shipping rates in editor
* Add shippingCostRequiresAddress attribute to shipping methods block
* Update frontend type to show shippingCostRequiresAddress is a prop
* Add control to toggle shippingCostRequiresAddress option
* Show address notice in the correct scenario
* Send shippingCostRequiresAddress to Block in front end context
* Add e2e test for editor control
* Add e2e tests for shipping options on the front end
* Add updateAttributeInSiblingBlock function
* Add shippingCostRequiresAddress to shipping method block
* Ensure attribute is updated in both blocks when editing
* In Shipping Methods Block, show correct component based on block setting
* Show correct block in editor
* Remove broken test from PR
* Clean up updateAttributeInSiblingBlock
* Add setCartCheckoutPages function to update set the cart/checkout page
* Add tests to ensure core shipping settings update correctly
* Add isAddressComplete function
Borrowed from woocommerce/woocommerce-blocks#8141
* Check if the address is required before showing rates
* Show shipping rates in editor
* Show address notice in the correct scenario
* Add e2e tests for shipping options on the front end
* Ensure errorId is passed to StateInput
* Add fullShippingAddressPushed action to wc/store/cart
* Add fullShippingAddressPushed case to reducer
* Ensure fullShippingAddressPushed is set when initialising cart store
* Add fullShippingAddressPushed selector and default state entry
* Add shippingAddressHasValidationErrors util function
* Do not overwrite addresses when selecting a rate
* Set whether full address has been pushed when saving address changes
* In Shipping Methods Block, show correct component based on block setting
* Don't show from price if rates should be hidden until address entered
* Check city validation errors to assert if shipping address is valid
* Rename merchant.js to merchant.ts
* Move local pickup functions to common merchant util
* Update local pickup tests to use common merchant utils
* Add test to ensure setting toggles in both blocks
* Add navigating to settings and saving in merchant util
* Create addPickupLocation merchant util
* Add test for local pickup and require full address
* Make sure correct conditions are met to show shipping options
* Ensure checkbox is checked during local pickup tests
* Unset the checkbox when tests are finished running
* Update checkout block fixture
* Prevent error in unit tests
* Import validation store key from constants
Required because importing from the index causes the validation data store to register twice
* Update checkout terms test to wait for button not to be disabled
* Revert "Add isAddressComplete function"
This reverts commit 9967dc0d4f10cf638859ae085e6f4cc2901dd299.
* Add third party local pickup method to woo-test-helper plugin
* Add test to check for checkout with local pickup
* Ensure local pickup is disabled when done with tests
* Add a more reliable selector for the "use same address for billing" box
* Prevent local pickup rates showing if local pickup is not enabled
* Check billing details after placing local pickup order
* Change local pickup unit test so rates dont show if localPickup disabled
* Use existing const instead of getSetting
* Update tests to mock constant from @woocommerce/block-settings
---------
Co-authored-by: Niels Lange <info@nielslange.de>
* Add tests for pushChanges and dirty props
* Update assets/js/data/cart/test/push-changes.ts
Co-authored-by: Mike Jolley <mike.jolley@me.com>
---------
Co-authored-by: Mike Jolley <mike.jolley@me.com>
* Merge tax_query of attributes and visibility taxonomies when building Products query
* Add tests confirming the tax_query is merged correctly
* Improve syntax after code review
* Add minimum structure for Single Product Details block
* Add Product Image Gallery woocommerce/woocommerce-blocks#8233
Add Product Image Gallery
* Add tests for Single Product Details block
* Add the initial basis for the Add to Cart button
* Trigger the single product add to cart action for each product type.
* wip: create block structure and add initial styles
* Add block details to the SingleProductDetails.php file
* Rename the block from add-to-cart-button to add-to-cart-form
* Update to use the cart icon.
* Implement the skeleton for the editor preview.
* Render tabs title with empty content
* Use woocommerce_output_product_data_tabs function to retrieve tabs data
* Update styles and add Notice for the display in the Editor.
* Update CSS.
* Add base tests for the new Add to Cart Form component.
* Add Product Image Gallery block
* remove support global styles
* remove support global styles
* Update the button CSS.
* Remove customizations for the Single Product Details block
* Update styles for the cart form.
* update td style.
* Update divs and CSS.
* Use conventional input instead of the experimental InputControl
* address CSS feedback
* add support for the custom classname
* remove save function
* Remove unnecessary console.log from the Edit.tsx file
* Remove block classname from block wrapper
* Remove unnecessary WooCommerce tabs filter from the BlockTemplatesController
* Remove attributes property from the block registration
* Remove isExperimental flag for the Single Product Details block
* Remove get_classes_and_styles_by_attributes method from SingleProductDetails block
* Prevent Single Product Details block from apppearing in Pages or Posts
* add second parameter to the subscribe function
* Implement the new design and copy provided for the editor.
* Make the notice compatible with dark themes.
* Some additional CSS tweaks
* adjust the padding for the input
* wrap the Single Product Template in a div with the product class
* Fix PHP Coding Standards warnings
* improve logic and increase coverage of unit test
* improve logic and increase coverage of unit test
* fix test
* format HTML
* fix edge case
* update @types/wordpress__data package
* update placeholder, icon and description
* update tsconfig
* update block name
* fix SCSS linter error
* address feedback
* create SingleProductTemplateCompatibility class
* Add Hooks compatibility
* remove not used file
* remove not used files
* Add compatibility layer for the Single Product template
* fix check
* address feedback
* remove unused import
* double empty line
* remove logic in the constructor
* remove hook
* generate the docs
* add missing hooks
* fix docs
* address feedback
* fix linter
* fix import
* Disable compatibility layer when the WooCommerce Product Grid Block block and WooCommerce Single Product Block are used (https://github.com/woocommerce/woocommerce-blocks/pull/8538)
* disable compatibility layer via hook
* update docs
* generate the docs
* fix version
* fix import
* fix code after merge
---------
Co-authored-by: Alexandre Lara <allexandrelara@gmail.com>
Co-authored-by: Patricia Hillebrandt <patriciahillebrandt@gmail.com>
* Wait for push changes before clicking place order
* Blur last field and wait for network requests when entering addresses
* Use correct quote style
* Add address_2 to fake test address
* Use correct property names when filling test address
* Use correct comment style
* Update address values to reflect what is in the config file
* Remove unnecessary waits
* Improve batch request checking when filling shipping and billing address
* Wait for network idle before selecting shipping address
* Add checkCustomerPushCompleted function
* Override checkout data with test email
* Fill in the checkout data when testing for terms and conditions text
* Improve comments
---------
Co-authored-by: Nadir Seghir <nadir.seghir@gmail.com>
* Fix e2e tests which use the insertBlock function
* Move more instances of insertBlock to insertWCBlock
* Ensure block inserter is open before searching for a block
* Get rid of openWidgetsEditorBlockInserter
* Rename insertWCBlocks to insertBlockDontWaitForInsertClose
* Fix e2e tests of the Product Details block
* Migrate to insertBlockDontWaitForInsertClose instead of insertBlock
* Go to single product template
* Fix Product Details classname and slug in tests
* Replace usage of 'foo' variable name
* Fix typo in 'can not be inserted in a post' test
* Fix e2e tests which use the insertBlock function
* Move more instances of insertBlock to insertWCBlock
* Ensure block inserter is open before searching for a block
* Get rid of openWidgetsEditorBlockInserter
* Rename insertWCBlocks to insertBlockDontWaitForInsertClose
* Add the initial basis for the Add to Cart button
* Trigger the single product add to cart action for each product type.
* Rename the block from add-to-cart-button to add-to-cart-form
* Update to use the cart icon.
* Implement the skeleton for the editor preview.
* Update styles and add Notice for the display in the Editor.
* Update CSS.
* Add base tests for the new Add to Cart Form component.
* Update the button CSS.
* Update styles for the cart form.
* update td style.
* Update divs and CSS.
* Use conventional input instead of the experimental InputControl
* Implement the new design and copy provided for the editor.
* Make the notice compatible with dark themes.
* Some additional CSS tweaks
* adjust the padding for the input
* Update the icon for the block to match the core icon button
* Add minimum structure for Single Product Details block
* Add tests for Single Product Details block
* wip: create block structure and add initial styles
* Add block details to the SingleProductDetails.php file
* Render tabs title with empty content
* Use woocommerce_output_product_data_tabs function to retrieve tabs data
* Remove customizations for the Single Product Details block
* Remove unnecessary console.log from the Edit.tsx file
* Remove block classname from block wrapper
* Remove unnecessary WooCommerce tabs filter from the BlockTemplatesController
* Remove attributes property from the block registration
* Remove isExperimental flag for the Single Product Details block
* Remove get_classes_and_styles_by_attributes method from SingleProductDetails block
* Prevent Single Product Details block from apppearing in Pages or Posts
* Fix PHP Coding Standards warnings
* update block name
* fix SCSS linter error
* move blocks into product-elements folder and rename to product-details
* avoid 404 error
* disable js asset enqueue
---------
Co-authored-by: Luigi Teschio <gigitux@gmail.com>
* wrap the Single Product Template in a div with the product class
* improve logic and increase coverage of unit test
* improve logic and increase coverage of unit test
* fix test
* format HTML
* fix edge case
* address feedback
* fix name block and fix check
* wrap single product template only on the frontend
* Set inherit default to true when products is inserted on archive products templates
* Create new query attributes object
Co-authored-by: kmanijak <karol.manijak@automattic.com>
* Extract the products registration to a separate function
* Bring back variation name
* Move variation name
* Unregister the block before registering it again
* Use subscribe only on the site editor
* Undo change
* Try fixing tests
* Fix test
* Revert test only
---------
Co-authored-by: kmanijak <karol.manijak@automattic.com>
* Prevent coupon error disappearing on blur if value unchanged
* Check for inline selector on coupon error
* Prevent coupon error disappearing on blur if value unchanged
* Check for inline selector on coupon error
* Update selector for coupon E2E test
- Revert the label change to "Add a coupon" so that it will be merged to WC Core and translation for the new string will be available.
Co-authored-by: Saad Tarhi <saad.trh@gmail.com>
* Initial structure for the breadcrumbs block
* ditch inline comment
* Fine-tune the store breadcrumbs
* Disable the breadcrumbs block for regular posts & pages
* Update the breadcrumbs block details.
* Add tests
* rely on sprintf to render the breadcrumb
* Ditch usesContext.
* Add a link to the breadcrumb editor preview
* Disable all pointer-events for the breadcrumb link in the editor preview
* Add the align attribute
* Use the Disabled component to prevent interactions and update the copy for the block description.
* Fixes a bug where cart response only reflects variation data submitted and not full variation data with default values.
* Sort variation data by attribute alphabetically
* PHP unit test for checking variation data.
The "Coupon code" text was changed to "Add a coupon" and it resulted in the failing of an e2e test as it couldn't find the translated text for "Coupon code". The translation for "Add a coupon" is not available so changing the text to "Apply a coupon code" until the next WC Core release since the translation for the text "Apply a coupon code" is already available.
* Block scaffolding
* Rename to store notices
* Register only in the site editor
* Update description
* Add woocommerce class
* Add tests
* Delete old test file
* Update notices message in the editor
* Remove customization
* Disable the block server side
* Fix TS error
* Add custom classes
* Reprashed test description
* Escape notices
* Remove unnecessary disabled component
* Only allow to insert the block once
* Improve class name
* Merge edit and block files
* Fix copy
* Simplify test case
* Remove align support
* Remove attributes
* Change editor markup
* Use the Notice component to display the notice placeholder on the editor
* Use sprintf to improve readability
* Inline component
* Remove styles and unregister scripts
* Use ordered placeholders
Co-authored-by: Tung Du <dinhtungdu@gmail.com>
* Use info as the notices status
Co-authored-by: Tung Du <dinhtungdu@gmail.com>
* Fix php lint error
Co-authored-by: Tung Du <dinhtungdu@gmail.com>
* WIP
* Render in editor and add styles
* Simplify select
* Undo change
* Update titles and description
* Wrapped text for translation
* Remove from products inner blocks
* Allow the block in the inserter
* Rename test file and add new tests for catalog-sorting block
* Register on the site editor only
* Fix tests
* Disable block server side
* Override the `enqueue_assets`
Co-authored-by: Tung Du <dinhtungdu@gmail.com>
* Fix TS error
* Simplify edit
Co-authored-by: Tung Du <dinhtungdu@gmail.com>
* Disable background color
* Add custom classes
* Remove alignment
* Inherit color and font properties
* Merge edit and block files
* Use sprintf to improve code readability
* Make fontsize small by default
* Add order placeholders and woocommerce class
Co-authored-by: Tung Du <dinhtungdu@gmail.com>
* Fix floating issue
Co-authored-by: Tung Du <dinhtungdu@gmail.com>
* Add woocommerce class
Co-authored-by: Tung Du <dinhtungdu@gmail.com>
Co-authored-by: Tung Du <dinhtungdu@gmail.com>
* Init setup to add a new block Results Count
* Render template part as a content of ResultsCount block
* Switch to template part rendering
* Rename the block to ProductResultsCount
* Fix typo in BlockTypesController
* Change the ProductResultsCount class name
* Remove Product Results Count block from Product Query template
* Improve the way Product Results Count is rendered in the editor
* Add prefix to places that missed renaming from ResultsCount to ProductResultsCount
* Remove unnecessary frontend.tsx file for ProductResultsCount
* Make sure global styles are applied and respected by Product Results Count block
* Make sure the Product Results Count is available inly in Product Catalog template
* Add basic tests to Product Results Count
* Remove empty line in style file
* Fix TS issue in Product Results Count
* Fix typo
* Override the enqueue_assets method to prevent unnecessary enqueue and 404 error on the frontend
* Add necessary property to block's metadata
* Address code review feedback
* Update description
Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>
* Remove disabled component
* Improve test description
* Merge edit and block files
* Remove align support
* Remove background support
* Simplify edit component
* Improve readability with sprintf and add custom class
* Simplify test case
* Add styles and order placeholders
Co-authored-by: Tung Du <dinhtungdu@gmail.com>
* Fix markup to match with the frontend
Co-authored-by: Tung Du <dinhtungdu@gmail.com>
Co-authored-by: Alba Rincón <albarin@users.noreply.github.com>
Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>
Co-authored-by: Alba Rincón <alba.rincon@automattic.com>
Co-authored-by: Tung Du <dinhtungdu@gmail.com>
* Add coupon link instead of dropdown in Cart and Checkout blocks
* Fix state names used for displaying the link and coupon form
* Fix storybook for coupon block
* Fix unit test for coupon block
* Fix css and accessibility
* Fix coupon block position on Checkout
* Update e2e test cases for coupon block (https://github.com/woocommerce/woocommerce-blocks/pull/8022)
* Update e2e test cases for coupon block
* Fix perfomance test for coupon block
* Fix double await typo
* Fix perfomance test for coupon block
* Remove CSS
* Use classnames to add and remove classes
Improved the code to use classnames to add and remove classes. Also, moved the logic to handle click and submit to separate functions.
* Custom validation strings using a new function named getValidityMessageForInput
* getValidityMessageForInput tests
* Added integration test for error message
* Clear value
* update test strings
* Move payment methods
* Setup entrypoints
* Sortable implementation
* Sortable
* Basic UI in place for settings
* Hydrate real settings
* Form updates values
* Styling and save button placement
* useSettings hook
* Prepare for save
* delete
* Add location button
* Remove className
* Conditional display of taxes
* Save via API
* Update general settings to designs
* Modal styles
* Style table
* Border colors and radius
* Added e2e tests
* use node 16
* Enqueue states in admin
* Use render from wordpress/element
* Missing handle style
* Enable translations
* Remove curried function
* Todo for inline settings
Co-authored-by: Nadir Seghir <nadir.seghir@gmail.com>