* Convert block templates tests to parametized tests
* Use frontendUtils.addToCart() when possible
* Add changefile(s) from automation for the following project(s): woocommerce-blocks
---------
Co-authored-by: github-actions <github-actions@github.com>
* Update commands to run e2e tests
* Capitalize Product Catalog template name
* Create tests with block theme with templates
* Create Block Theme with Templates test environment
* Update classic theme commands
* Code cleanup
* Add changefile(s) from automation for the following project(s): woocommerce-blocks
* Code cleanup (II)
* Add config to blocks-playwright.yml and remove unnecesssary .github/workflows/playwright.yml file
* Remove unnecessary imports from product-catalog-template.block_theme_with_templates.spec.ts
* Update blocks e2e commands to pnpm
* Replace hardcoded strings with a variable
* Unify all 'block theme with templates' tests in a parameterized test
* Create a testData object for the Mini-Cart template part test
* Fix some code styling issues
* Create a testData object for the Mini-Cart template part test (II)
* Remove duplicate userText variable
---------
Co-authored-by: github-actions <github-actions@github.com>
* Add unique ID attribute to Product Collection block
In this update, we introduced a unique identifier for each instance of the Product Collection block. This change involves several key modifications:
1. **Block JSON Update**: Added a new `id` attribute in `block.json` to store the unique identifier for each block instance.
2. **Product Collection Content Update**: In `product-collection-content.tsx`, we utilized the `uuid` library to generate a unique ID. This is done in a `useEffect` hook, ensuring that each block instance receives a distinct ID upon initialization.
3. **Type Definitions**: The `ProductCollectionAttributes` interface in `types.ts` was updated to include the new `id` attribute, aligning with our enhanced data structure.
4. **Package Dependencies**: To support this feature, `@types/uuid` and `uuid` were added to `package.json`, ensuring we have the necessary tools for ID generation.
This enhancement is pivotal for uniquely identifying each Product Collection block, paving the way for more robust and individualized block handling in the future.
* Rename uniqueId to id
* Add lock file
* Add 'id' context to product collection and template
* Add changefile(s) from automation for the following project(s): woocommerce-blocks
* Merge trunk with 42861-introduce-a-unique-identifier-for-each-product-collection-block
* Regenerate the lockfile
* Remove autogenerated change in plugins/woocommerce/package.json
* Regenerate lock file
* Rerun CI actions
* Delete pnpm-lock.yaml file & regenerate it using pnpm install command
---------
Co-authored-by: github-actions <github-actions@github.com>
* CYS - Core: add unit test
* Add changefile(s) from automation for the following project(s): woocommerce
* fix description
* Enable TT4 when the customize your store process starts
* Add changefile(s) from automation for the following project(s): woocommerce
---------
Co-authored-by: github-actions <github-actions@github.com>
* Add refund order to unit test.
* Remove buggy defensive check since existance of order is already verified.
* Changelog.
* PHPCS fixes.
* Added more assertions after cleanup to verify cleanup worked.
* Remove the experimental flag from the Product Gallery block
* Add changefile(s) from automation for the following project(s): woocommerce-blocks, woocommerce
---------
Co-authored-by: github-actions <github-actions@github.com>
* Add test to Product Collection - featured products filters
* Open Featured option before trying to set it up
* Add test for Created filter
* Add missing awaits
* Add tests for a price range filter
* Add explanation to test step
* Update the conditions for created filter
* Add changelog
* Change leftover values
* Empty commit - trigger CI
* Add the UX element dropdown for search box.
* Add unit test for search_filter param.
* Add support for search filter in search query for better performance.
* Link search_filter dropdown with query param.
* Fix conflicts.
* Reformat to allow adding more filters in future.
* Fixing margin in the search filter box.
* Fix merge conflict.
* Apply linting.
* Add changelog.
* Apply PR suggestions.
* Grammer fixes.
* Get default attributes on front end
* Remove console log
* Show notice about 0 registered fields in editor
* Do not show block in editor if no fields are registered
* Wrapper block
* Styling/spacing
* Update webpack config
* Register heading pattern
* Wrapper block type definition
* get_fields_for_location return fields in array format
* Use wrapper in default content
* Separate fields from the hook block
* Hide when no custom fields exist
* Address and contact fields
* Shared form fields in settings
* remove info block from wrapper
* Revert render_content to original
* rename block
* Add changefile(s) from automation for the following project(s): woocommerce-blocks, woocommerce
* Update styling
* Create shared get_order_additional_fields_with_values to format values
* Update block names and descriptions
* Show address placeholders
* Add changefile(s) from automation for the following project(s): woocommerce-blocks, woocommerce
* Unused import
---------
Co-authored-by: Thomas Roberts <thomas.roberts@automattic.com>
Co-authored-by: github-actions <github-actions@github.com>
* CYS - Core: add unit test
* Add changefile(s) from automation for the following project(s): woocommerce
* fix description
---------
Co-authored-by: github-actions <github-actions@github.com>
* Update copy for CYS intro screen sidebar
* Add changefile(s) from automation for the following project(s): woocommerce
* Avoid using variables in __()
* Add missing period
Co-authored-by: Patricia Hillebrandt <patriciahillebrandt@gmail.com>
---------
Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Patricia Hillebrandt <patriciahillebrandt@gmail.com>
* Migrate mini cart tests
* Add changefile(s) from automation for the following project(s): woocommerce-blocks
* Adjust broken e2e test
---------
Co-authored-by: github-actions <github-actions@github.com>
* Add new spec for checking comments on a post
* Add changelog
* Update locators to use geBy methods
* Update locators to use geBy methods
* Fixed strict mode violation
* Change HPOS and non HPOS e2e tests to use 5 shards each
* Add changelog
* Update numbering
---------
Co-authored-by: Jon Lane <jon.lane@automattic.com>
This bumps the version to 0.14.3 so that we can take advantage of some
upstream improvements. It also makes some changes to the way our
builds and watches work to minimize the number of unnecessary
Node processes involved in the execution.
* Product Gallery: Update div elements to ul and li for better accessibility
* Product Gallery: Add changelog files
---------
Co-authored-by: roykho <roykho77@gmail.com>
Unfortunately, it looks like we need to build in order
to be able to lint. This makes sense since some
projects will lint imports from others that haven't
been built yet.
* Add "No AI" banner image and center banner content
* Add changefile(s) from automation for the following project(s): woocommerce
---------
Co-authored-by: github-actions <github-actions@github.com>
* Add test to check Product Collection filtering by tags
* Set single product out of stock and unskip the test for stock status
* Add changelog
* Use more specific selector
* Update variables holding products in products.sh to keep the same convention
* clarify comment in maybe_sync_order
* Add changefile(s) from automation for the following project(s): woocommerce
* appease the linter
---------
Co-authored-by: github-actions <github-actions@github.com>
This adds support for using the `pnpm utils ci-jobs` command in our `ci.yml` file. One of the bigger benefits to this change too is that we're now distributing a bundled version of the utils tool. This lets us run it without actually having to install the repo and will let us speed up any workflows that currently do.
* Remove variable-product-template from the product template list
* Add changelog files
* Redirect the variable product to the new experience now that is does not have a product template anymore
* Fix php linter error
* Prevent body from scrolling when pop-up is open
* Add changefile(s) from automation for the following project(s): woocommerce-blocks
* Add namespace to the modal-open css class
* Fix class name for the Product Gallery block
---------
Co-authored-by: github-actions <github-actions@github.com>
* Do not sanitize WooCommerce Subscriptiion column HTML in Settings > Payments methods table
* Add features supports entry to pseudo-gateway WCPay Promotion
* Add changelog
* Add changelog entry for woocommerce-admin
* Lint fixes
* Move ProductTemplate type
* useProductTemplate
* Use useProductTemplate
* Use useLayoutTemplate
* Handle if window.productBlockEditorSettings doesn't exist
* Unit tests for useProductTemplate
* Fix fallback in useProductTemplate
* Remove layoutTemplates from ProductEditorSettings on client
* Fallback to simple-product layout template
* Unit test to verify the standard product template is used if product type is variable
* Use standard product template if product type is variable
* Unit test to verify product type is used to match if product template id matches a template with a different product type
* Make sure product type matches on product template, unless variable, in which case we match simple
* Remove layoutTemplates and layoutTemplateEvents from global
* Changelog
* Changelog
* Import types only
* Call the `/wc/private/ai/patterns` to remove the `patterns_ai_data` post from the db
* Add changefile(s) from automation for the following project(s): woocommerce-beta-tester
---------
Co-authored-by: github-actions <github-actions@github.com>
* CYS: fix php warning raise by the Product Collection block
* fix typo
* Add changefile(s) from automation for the following project(s): woocommerce
---------
Co-authored-by: github-actions <github-actions@github.com>
* Fix Mini-Cart price disappearing on hover
* Add changefile(s) from automation for the following project(s): woocommerce-blocks
---------
Co-authored-by: github-actions <github-actions@github.com>
* Fix notice template overwrites
* Add changefile(s) from automation for the following project(s): woocommerce
* Bump template versions
* Changing template version numbers to 8.5.0 as they haven’t been touched
---------
Co-authored-by: github-actions <github-actions@github.com>
* Add `wp wc hpos status` command
* Add helper method to build order from different datastores
* Add helper method `get_diff_for_order()` to compare orders between datastores
* Add CLI tool `wp wc hpos diff` to compare an order between datastores
* Add changelog
* PHPCS fixes
* Better format for dates
* Add test for scheduled date start
* Add more test around product sales.
* Simplify sales check + also check product sale price is changed.
* Apply conding standards.
* Add changelog.
* Revert changes added in 39948 with explanation.
* Revert changes added in 39948 with explanation.
* CYS - Core: Setup the site with a default homepage when the assembler is loaded
* CYS - Core: Implement route guards
* Add changefile(s) from automation for the following project(s): woocommerce
---------
Co-authored-by: github-actions <github-actions@github.com>
* Playwright migrated test file bootstrap and first test for local pickup
* Added page reload to force a new render
* Updated test description
* WIP: figuring out the fake input checkbox
* WIP: figuring out flaky state of local pickup enabled
* Fix flakey enable/disable local pickup
* Migrated remaining local pickup tests to Playwright
* Removed deprecated E2E
* Added changelog
* Corrected linting errors
* Fixed playwright/no-element-handle lint error
* Replace CSS IDs and classes with recommended built in locators
* Remove obsolete function calls
---------
Co-authored-by: Niels Lange <info@nielslange.de>
* Add e2e tests to verify Products by Category/Tag/Attribute templates default to Product Catalog template
* Add changefile(s) from automation for the following project(s): woocommerce-blocks
---------
Co-authored-by: github-actions <github-actions@github.com>
* Add few E2E tests to cover half of the milestone
* Improve welcome modal closing
* Add new test scenarios
* Add more tests to cover creating account and shipping
* Update shipping zone labels to fulfil latest design changes
* Add tests for checkout block coupons and cart block coupons
* Remove only flag leftover
* Add checkout block tax tests and merge with cart test
* Update selectors to match checkout page
* Update checkout block test and comment scenario until issue resolved
* Remove only leftover
* Update checkout block test
* Improve filling shipping and billing checkout
* Create order via API with coupon
* Include checkout filling util helper
* Update test to use get by role for alerts
* Remove only leftover
* Adjust scenario for placing an order as a customer
* Improve existing customer placing order scenario
* Add util helper for adding products to cart
* Remove leftover from testing
---------
Co-authored-by: Jon Lane <jon.lane@automattic.com>
* Try sharding e2e tests
* Update reporter for merge
* Add changelog
* Change to trigger CI
* Update job name to match existing run
* Install with dependencies
* Set working directory
* Only run 2 workers at a time on CI
* Try single run, but 6 shards
* Simplify welcome modal closing util helper
* Switch to more simpler way of closing welcome modal
* Fix flakiness in create shipping zone test
* Try 10 shards
* Drop CI retries to 2 from 4
* Update path to reports
* Fix syntax error in GH file
* Remove working directory
* Update directories
* Path again
* Use Allure dir
* Fix merge step
* Install dependencies
* Setup repo in report merge
* Commands to merge reports
* Set working directory
* Update actions
* Name upload artifacts
* Just numbers for shards
* Update matrix
* Need to redeclare env variables
* Update file paths for merge step
* Remove working directory for merge step
* Try absolute paths
* Missed a path
* Put all artifacts in single download folder
* Tweak download action
* Might not have to merge reports
* Fix typo
* Update path for summary report
* Update results paths
* Tweak condition
* Add step to check success of matrix run
* Remove ternary per feedback
---------
Co-authored-by: Jon Lane <jon.lane@automattic.com>
Co-authored-by: Veljko <veljano@yahoo.com>
* Add e2e tests for user customization of block templates
* Update instructions to run Playwright e2e tests
* Code cleanup
* Add changefile(s) from automation for the following project(s): woocommerce-blocks
* Create revertTemplateCustomizations util
---------
Co-authored-by: github-actions <github-actions@github.com>
* Fix PHP warning related to logging default severity threshold
* Add changefile(s) from automation for the following project(s): woocommerce
---------
Co-authored-by: github-actions <github-actions@github.com>
* Force marketing menu items order.
* Add changelog.
* Make sure that Overwiev is present.
* Coupons should be always second.
* Update plugins/woocommerce/src/Internal/Admin/Marketing.php
Co-authored-by: Gan Eng Chin <ecgan@users.noreply.github.com>
* Update plugins/woocommerce/src/Internal/Admin/Marketing.php
Co-authored-by: Gan Eng Chin <ecgan@users.noreply.github.com>
* Use fallback for different languages.
* Use location as a fallback for names.
* Fix linting.
* Refactor.
* Remove unneded new line.
* Remove duplicated code.
---------
Co-authored-by: Gan Eng Chin <ecgan@users.noreply.github.com>
* Add MarketingRecommendations feature.
The code here is based on other feature with default fallbacks and with data source poller, e.g. see payment gateway suggestions.
* Use MarketingRecommendations feature in API.
* Add spec_key for MarketingRecommendationsDataSourcePoller.
If we don't specify it, the default is `id`, which is not used in our recommendation data, and this will cause things not to work as expected.
* Recursively convert object to array.
This is because all the subsequent functions work with arrays, not objects.
* Make recommended marketing tools and coupons use MarketingRecommendationsInit.
This is so that recommended channels, tools, and coupons make use of the same transient data with data source poller.
* Add changelog.
* Fix PHP lint issues.
* Add doc comment to fix lint error.
* Fix tests in MarketingRecommendationsTest.
* Replace recommendations.json file with generated data in DefaultMarketingRecommendations.
This is to have i18n support.
* Add icons for fallback marketing recommendations.
* Fix PHP linting issue.
* Fix linting issue.
* Fix failing tests with PHP 8.0.
* Remove unused replaced code in MarketingSpecs.
* Delete old marketing recommendations transient upon update to WC 8.6.0.
* Add changelog.
* Introduce the minimal block style for productDetails block
* Change the default style in the template
* Change the default template when using the transform-to-blocks button
* Cleanup
* Organize CSS selectors
* Add opacity on hover
* Fix specificity and add explanation
* Cleanup
* Changelog
* Add MarketingRecommendations feature.
The code here is based on other feature with default fallbacks and with data source poller, e.g. see payment gateway suggestions.
* Use MarketingRecommendations feature in API.
* Add spec_key for MarketingRecommendationsDataSourcePoller.
If we don't specify it, the default is `id`, which is not used in our recommendation data, and this will cause things not to work as expected.
* Recursively convert object to array.
This is because all the subsequent functions work with arrays, not objects.
* Make recommended marketing tools and coupons use MarketingRecommendationsInit.
This is so that recommended channels, tools, and coupons make use of the same transient data with data source poller.
* Add changelog.
* Fix PHP lint issues.
* Add doc comment to fix lint error.
* Fix tests in MarketingRecommendationsTest.
* Replace recommendations.json file with generated data in DefaultMarketingRecommendations.
This is to have i18n support.
* Add icons for fallback marketing recommendations.
* Fix PHP linting issue.
* Fix linting issue.
* Fix failing tests with PHP 8.0.
* Remove unused replaced code in MarketingSpecs.
* Remove unneeded false check.
This is because `is_array` would return `false` when `false` is being passed as the argument.
Co-authored-by: Bartosz Budzanowski <bartosz.budzanowski@automattic.com>
---------
Co-authored-by: Bartosz Budzanowski <bartosz.budzanowski@automattic.com>
* Do not access change_feature_enable() statically. Closes#43175. Copy of @helgatheviking's cd71d08577.
* Add changefile(s) from automation for the following project(s): woocommerce
---------
Co-authored-by: github-actions <github-actions@github.com>
* Centralize log level labels
* Fire an action specific to loading the Logs tab
* Functional settings screen (no way to navigate to it yet)
* Deprecate wc_register_default_log_handler
* Hook up the settings
* Add section nav
* Add an action hook to the settings form
* Rename render_page method to render_form
* Scaffold the unit tests
* Remove logging enabled check from WC_Logger construct
Caching the enabled setting value turns out to not be a great idea,
it breaks some tests, and could cause issues if the setting value
changes, and then a logging event happens later in the same request.
WP has its own caching layer for options anyway, but one that will
update if the value of the option changes. So this just makes the
enabled check directly from the should_handle method.
* Add most unit tests. Still needs a couple more
* Add remaining unit tests
* Update since values on new hooks to 8.6.0
* phpcs cleanup
* Change deprecated tag from 8.5.0 to 8.6.0
* Add missing return types to unit tests
* Add changelog file
* Add missing clear method to new log file handler
* Change level_threshold default value to 'none'
* Ensure logger has a valid level threshold set, regardless of level given
* Update legacy unit test
* Ensure settings only saved on settings view
* Add settings sections for filesystem and database
Also add a filesystem setting for collapsing log entry lines.
* Add public LoggingUtil class for external usage, and use in WC_Logger
* Remove unused import
* Deprecate wc_get_log_file_path and wc_get_log_file_name
* Preserve white space in log file lines
It turns out that several extensions add log entries that are just
a print_r of an array. Preserving the white space is important for
making this data legible (ideally they'd switch to adding this data
within the context parameter)
* More legacy unit test fixes
* Remove entry collapse option and functionality
It's unclear right now that entry collapsing provides much real
benefit, while it clearly does have some potential drawbacks if
extensions are in use that add print_r output to the log files.
* phpcs cleanup
* Yet more unit test tweaks
* Remove unused code
* Don't wrap extra handler options in <code>, it gets excaped
* Attempt fix for WC_Tests_Logger::test_clear
This is only failing on GH CI, not when running locally. Maybe
ensuring all the created log files are deleted will help.
* Improve logging of fatal errors
This improves the formatting of error messages caught and logged
during shutdown to be more legible and to take advantage of the
logging method's context parameter. With this change, the log entry
will be a simple message on one line, and any stack trace will be
available but hidden in an "Additional context" details element.
* Tweaks to some settings' wording
* Update webooks link to logs, undeprecate
* Remove `realpath` usage since it deos not work if log directory does not already exists.
---------
Co-authored-by: Vedanshu Jain <vedanshu.jain.2012@gmail.com>
* Remove custom styles from button
* Avoid php warning about images and slug not defined
* Add changefile(s) from automation for the following project(s): woocommerce
* Add changefile(s) from automation for the following project(s): woocommerce
* Fix linting errors
---------
Co-authored-by: github-actions <github-actions@github.com>
* Redirect supported product types to the new experience based on the product template associated to it
* Add changelog file
* Fix linter error
* Redirect using the product type first and then the associated product template
* Set the product template id also for unsupported product templates
* Add changelog file
* Remove supported_product_types from the RedirectionController since the product_templates is used instead
* Fix php linter error
* Remove v1 of plugin installer.
* Rename WC_REST_WCCOM_Site_Installer_Controller_V2 into WC_REST_WCCOM_Site_Installer_Controller.
* - Create base controller for WCCOM Site requests, extended by Installer and SSR controllers.
- Switch get SSR endpoint to v2 namespace.
* Remove namespace property from Installer controller.
* Linting.
* Add changefile(s) from automation for the following project(s): woocommerce
* Switch request method of reset install endpoint to POST (#43150)
- Switch reset installation state request to POST.
- Change wccom-site API namespace to v3.
* Exclude deleted files from linter check (#43355)
Exclude deleted files from linter check.
---------
Co-authored-by: github-actions <github-actions@github.com>
* Rename media setting to "Open pop-up when clicked"
* Add changefile(s) from automation for the following project(s): woocommerce-blocks
---------
Co-authored-by: github-actions <github-actions@github.com>
* Fix "rm: .git/hooks: No such file or directory" error in `pnpm install`.
* Add changelog.
* Use "rm -rf" instead of "test" command on .git/hooks directory.
We use the "-f" flag so that it does not throw error when the directory does not exist.
* Try reducing blocks build size
* Add changefile(s) from automation for the following project(s): woocommerce
* Only set NODE_ENV if its not already defined
---------
Co-authored-by: github-actions <github-actions@github.com>
- Use `referrer` & `source_type` field names consistently
Remove the need to translate it back and forth.
- Make fields actually extendable using `wc_order_attribution_tracking_fields`.
Propagate the field configuration to the client side as well.
Disambiguate fields in variables and functions.
Co-authored-by: Justin Palmer <228780+layoutd@users.noreply.github.com>
* Add product search field to the linked product list block
* Add empty state to the linked product list block
* Fix AdviceCard styles
* Create skeleton for the linked product list block
* Fix linter errors
* Move the product list skeleton to the product list component folder
* Revert AdviceCard changes
* Remove upsells and cross-sells block to use linked-product-list block instead
* Add changelog files
* Hide sale badge if product image is disabled
* Fix css target to cover all product grid
* Add changefile(s) from automation for the following project(s): woocommerce-blocks
* Hide on sale badge via PHP side
* Remove css changes
---------
Co-authored-by: github-actions <github-actions@github.com>