Commit Graph

7938 Commits

Author SHA1 Message Date
Christopher Allford 6d0fc0d6ac
Expand Repository Development Documentation (#33423)
This commit reworks some of the documentation in the monorepo to better represent how to get started and develop projects in it.
2022-06-15 21:55:25 -07:00
AnnaMag 65cd33bee8
Settings: fix Tracks event when enabling/disabling advanced features settings. (#33305)
* Trigger the hook that record the track events
once the option settings are updated:navigation and analytics. Tracks do not include yes/no properties, so we record the latter as _disabled.

* Changelog

* Prevent reloading of page immediately after feature updates

* Remove feature specific code in tracks class

Co-authored-by: Joshua Flowers <joshuatf@gmail.com>
2022-06-15 14:58:49 -05:00
Corey McKrill bccc80366d
Update method for getting Reports API cache version number (#33353)
* Changes the frequency at which the Reports API cache can be invalidated via the cache version number to be at most once every 10 minutes, instead of with every change to the store.
* Changes the TTL of Reports API cache entries so that they expire after an hour instead of after a week.

The goal of these changes is to increase the chance that a request to the Reports API for store stats will result in a cache hit, thus avoiding expensive, slow queries. The reason for lowering the TTL is so that if multiple store changes are made within the new 10-minute frequency window, the cache data will only be stale for up to an hour. With #33325 users will be able to refresh entries in the cache manually if they think something is stale.

Closes #33315
2022-06-15 11:40:05 -07:00
Jorge A. Torres f0b9adc7ae
Make sure payment gateway title is a string before sanitizing (#33434)
Make sure payment gateway title is a string before sanitizing.

* Add changelog
* Drop type-hint in `validate_safe_text_field()`
* Update plugins/woocommerce/includes/abstracts/abstract-wc-settings-api.php

Co-authored-by: Barry Hughes <3594411+barryhughes@users.noreply.github.com>
2022-06-15 10:49:11 -07:00
Joshua T Flowers 35a4d1ca32
Clean up unused remote inbox notifications option (#33373)
* Clean up unused remote inbox notifications option

* Add changelog entry

* Add comments to existing action hooks
2022-06-15 08:03:36 -04:00
Jorge A. Torres 4b63f34841
[COT] Implement metadata CRUD and `update()` method in COT datastore (#33026)
* Add `OrdersTableDataStoreMeta` to handle metadata for orders

* Add `OrdersTableDataStoreHelper` with various helper functions used in the COT datastore

* Pass some helper classes as args to the COT datastore

* Use `OrdersTableDataStoreMeta` for meta in COT datastore

* Minor fixes to columns definition in COT datastore

* First pass at update() in the COT datastore

* PHPCS fixes

* Remove duplicate `read_meta` calls.

* Register `OrdersTableDataStore` earlier to make container happy

* Do not hardcode table metadata in `OrdersTableDataStoreMeta`

* Correctly format decimals for storing in the db

* read() shouldn’t success on non-existing orders

* Rework persisting to db in OrdersTableDataStore

* Correctly handle some props in OrdersTableDataStore

* Add changelog

* Add missing TODOs

* Remove unused variables

* No need to query db before deleting meta in `OrdersTableDataStoreMeta`

* Simplify OrdersTableDataStoreMeta::update_meta()

* Explicitly enumerate columns in OrdersTableDataStoreMeta::get_metadata_by_id()

* Make COT metadata implementation more generic

* Do not use property_exists() to determine existence of meta value

* Move some methods over to DatabaseUtil and get rid of COT datastore helper

* Rename `CustomDataStoreMeta` to `CustomMetaDataStore`

* Make PHPCS happy

* Add unit test.

* Correct arg passed to persist_order_to_db()

* Remove comment

* Split conditional on multiple lines

Co-authored-by: vedanshujain <vedanshu.jain.2012@gmail.com>
2022-06-15 14:09:41 +05:30
Ilyas Foo 090822eabf
Update product task experiment names (#33428)
* Update product task experiment names

* Changelog

* Fix lint
2022-06-15 16:34:24 +08:00
Niels Lange c33d7cc632
Correct CLIRunner translations (#33247)
* Correct CLIRunner translations

* Adjust placeholder formats and translator comments

* Add changelog.

Co-authored-by: vedanshujain <vedanshu.jain.2012@gmail.com>
2022-06-15 12:54:39 +05:30
Chi-Hsuan Huang aac85ac301
Turn on experimental-product-tour feature flag (#33413)
* Turn on experimental-product-tour feature flag

* Add changelog
2022-06-15 09:50:37 +08:00
Corey McKrill 12cbb87e80
Add cache refreshing/debugging mechanisms to Report API endpoints (#33325)
Adds a new collection parameter to all Reports API endpoints that utilize caching, `force_cache_refresh`, which will cause the current request to bypass the cache, re-run the queries for the requested data, and overwrite the previous cache entry with the new results.

Note that this doesn't invalidate the entire cache, only the entry for the particular set of collection parameters and values specified in the request.

This also adds a way to include debugging information related to the cache in the API response. Modeled after the way the Query Monitor plugin adds such information, you can get this by including an `_envelope` parameter in your API request. The debugging info includes whether the cache has been disabled via filter (`should_use_cache`), whether the `force_cache_refresh` parameter was used, whether the returned data was a `cache_hit` or not, and an array of the query parameters that were actually used to create the cache key.

Closes #33221
2022-06-14 14:24:31 -07:00
Paul Sealock dc2977cea3
Merge pull request #33329 from woocommerce/add/admin-tester
Add WooCommerce Admin Test Helper
2022-06-15 07:31:21 +12:00
jonathansadowski 4ec3bef590
Update the changelog.txt and the stable tag in readme.txt for 6.6.0 (#33419) 2022-06-14 14:14:27 -05:00
Joel Thiessen 183ac65c82
Adding context property to tasklist tracks event, introducing LayoutContext (#33287) 2022-06-14 11:31:50 -07:00
Daniel Morell 143d86490d
Generalize photoswipe button event target (#27804)
* Generalize photoswipe button event target

Co-authored-by: Jorge A. Torres <jorge.torres@automattic.com>
2022-06-14 15:05:43 -03:00
jonathansadowski 277fd78bca
Sync payment gateway titles fix (#33418)
* Introduce a 'safe_text' field that allows a reduced subset of HTML tags.

* Escape on input as well as output; generalize sanitization function.

* Set reasonable default rules.

* Guard against invalid callbacks (escaping/sanitizing) functions.

* Update plugins/woocommerce/src/Internal/Utilities/HtmlSanitizer.php

Co-authored-by: Peter Fabian <peter.fabian.github@gmail.com>

* Allow alt (accessibility) for img tags; allow class attributes for img and span tags.

* Allow class attr for p tags.

* Use safe_text for payment gateway titles.

* Make HtmlSanitizer available through Utils service provider.

* Update settings code to pull HtmlSanitizer as a service and to use the new sanitize() method.

* Remove `style` from list of allowed attributes.

Allowing arbitrary CSS rules through style could undo the intent of this change, since that would allow a range of positioning and sizing changes to be effected.

* Remove unusued import.

* If no (KSES) rules are specifed, then strip all tags (this is a safer default strategy).

* For better safety, only apply pre-processor callbacks; remove responsibility for trimming of strings.

Applying callbacks to a string after it ahs passed through wp_kses() could (potentially) undo the work done by that function, and result in unexpected tags in the sanitizer's output.

Co-authored-by: barryhughes <3594411+barryhughes@users.noreply.github.com>
Co-authored-by: Peter Fabian <peter.fabian.github@gmail.com>
2022-06-14 12:31:27 -05:00
Luigi Teschio 84ecebdad2
Update WooCommerce Blocks package to 7.8.0 (#33338)
* Update WooCommerce Blocks package to 7.8.1

Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>
2022-06-14 11:24:41 -03:00
Ilyas Foo 27041efdc5
Add event tracking product page spotlight tour (#33400)
* Update WooStep to have name in meta

* Add useProductStepChange hook and use it to detect form value changes in product tourkit, added tracking for tour view, tour dismiss, tour complete, and step complete

* Add tour view, tour dismiss, tour completion track to old product walkthrough

* Changelog

* Fix test

* Add listener to publish button for product spotlight tour

* Add track for old walkthrough publish button
2022-06-14 16:19:32 +08:00
Chi-Hsuan Huang 94367ca559
Migrate `@woocommerce/data` onboarding store to TS (#33401)
* Migrate onboarding data store to TS

* Update deprecated-tasks.tsx type annotations

* Fix onboarding resolvers
2022-06-14 10:23:40 +08:00
Chi-Hsuan Huang 257e558530
Update product template descriptions (#33397)
* Update product template descriptions

* Add changelog
2022-06-14 10:22:57 +08:00
Chi-Hsuan Huang 8fb9664b7a
Fix product tour spotlight location (#33395) 2022-06-14 10:22:43 +08:00
Vedanshu Jain 3fd9ee99aa
Fix typos COT verification messages. (#33207)
* Fix typos in migration error messages.
2022-06-13 16:08:57 -03:00
mrleemon 22721e6a28
Fix typos in CLIRunner.php (#33231)
Fix typos in CLIRunner.php

Co-authored-by: barryhughes <3594411+barryhughes@users.noreply.github.com>
2022-06-13 11:30:24 -07:00
Adrian Duffell 1e03b68598
Update onboarding email marketing checkbox default to false (#33292) 2022-06-13 09:55:57 +08:00
Paul Sealock 0efd480581 merge conflicts 2022-06-13 12:47:00 +12:00
Paul Sealock b166d45986
WooCommerce Plugin: Update Webpack to 5.x (#33354) 2022-06-13 09:09:23 +12:00
Joshua T Flowers 935f915cb5
Update scrollbar hover styles in new navigation (#33313)
* Update scrollbar hover styles in new navigation

* Update contrast ratio

* Add Firefox scrollbar properties

* Fix scrollbar-color and scrollbar-width values

Co-authored-by: Matt Sherman <matt@jam123.com>
2022-06-10 12:24:02 -04:00
Kathy 483d62f1cc
follow up to #33182 swap .woocommerce-info and .woocommerce-message colors in twenty twenty (#33377)
* swap .woocommerce-info and .woocommerce-message colors in twenty twenty
2022-06-10 15:38:31 +02:00
Kathy 19bea3832e
First pass: Twenty Twenty One notice styles. Closes #29560. (#33379) 2022-06-10 11:37:06 +02:00
Adp5067 4c164c3247
Make the option 'woocommerce_tracker_ua' load on demand. (#33274) 2022-06-10 08:55:10 +02:00
Chi-Hsuan Huang 558e5e322e
Fix continue button is enabled when email is null in setup wizard (#33362)
* Fix continue button is enabled even when email is null in setup wizard

* Add changelog
2022-06-10 10:35:11 +08:00
Paul Sealock 4fa634ee0e merge changes 2022-06-10 12:26:26 +12:00
Paul Sealock 5054105972 try manual rebase conflict fix 2022-06-10 12:21:48 +12:00
Christopher Allford b7931409f2
Migrate From Nx to Turborepo (#33079)
This replaces all `nx` commands with `turbo` commands and removes Nx from the repository. All of the `project.json` files have been removed and any commands that broke with Turborepo have been adjusted.
2022-06-09 14:40:07 -07:00
Chi-Hsuan Huang a3d42be6b0
Fix setup wizard click button loading state (#33358)
* Fix setup wizard usage button loading state

* Add e2e tests for usage button loading state
2022-06-09 17:30:06 +08:00
Sakri Koskimies e80312eef0
Change attribute slug length requirement and add wc_create_attribute tests (#31795)
* Allow for 28-character attribute slugs
* Add wc_create_attribute tests
2022-06-09 10:51:38 +02:00
Ilyas Foo e3744709c7
Wrap product spotlight tour under ExPlat logic (#33361)
* Add experiment wrap

* Changelog

* Move experiment check to bottom to minimize explat calls
2022-06-09 16:21:28 +08:00
Néstor Soriano fe267f355e
Add a new ArrayUtil::select method (#33347)
This new method is syntactic sugar for array_map. It scans an array
of arrays and/or objects and selects one value from each using
an array key name, an object method, or an object property.
2022-06-09 08:40:40 +02:00
Néstor Soriano e822b97619
[COT] Add database transactions support for data synchronization (#33255)
* Add optional usage of database transactions for orders sync.

Includes a new setting in Advanced - Custom data stores to enable
or disable transactions usage and to select the transaction
isolation level.

* Improve the selection of data to be updated when syncing orders.

The SQL query that chooses records to be migrated to core tables
now explicitly excludes unchanged records based on the column mappings.

Also when syncing meta tables with single meta values, records for
which the value hasn't changed are now excluded from the update.

* Fix MetaToCustomTableMigrator to work with order addresses table.

* Add unit tests for db transactions on PostsToOrdersMigrationController

Also add the DynamicDecorator::call_original_method method
2022-06-09 08:39:56 +02:00
Chi-Hsuan Huang 04a763d389
Add product page spotlight tour (#33268)
* Add product-tour admin script

* Update class-wc-admin-pointers.php to show experimental product tour

* Remove unnecessary window.onload

* Replace add new button with Enable guided mode button for product editing

* Show tour when tutorial query = true

* Add logic to show new tour only when a user select the physical product template

* Update product tour last step button text

* Add auto-scroll effect

* Fix i18n text

* Use bottom-start placement and align the arrow to the left

* Update pnpm-lock.yaml

* Update product tour effects

* Add changelog

* Add doc comments & check for tour-kit

* Add focus elements to product tour and wait initial element for tour showup

* Use spotlight query param to toggle new product tour feature

* Update wait seconds

* Update border style for product description & short description when editor is focused

* Add experimental-product-tour feature flag

* Refactor product-tour and support html editor focus style

Co-authored-by: moon <moon.kyong@automattic.com>
2022-06-09 13:02:40 +08:00
Chi-Hsuan Huang 6858195510
Update webpack.config.js to ensure we use styles from build-style (#33357)
* Update webpack.config.js to ensure we use styles from build-style

* Add changelog
2022-06-09 10:45:36 +08:00
jonathansadowski 21e6eea3cc
Update ActionScheduler to 3.4.2 (#33351) 2022-06-08 14:23:57 -05:00
Chi-Hsuan Huang 5db5c8b110
Add tour kit component (#33229)
* Add tour-kit component

* Add @types/wordpress__viewport to @woocommerce/components devDeps

* Add tour-kit README.md

* Add primaryButtonText option to tour kit step meta

* Add changelog

* Remove unneeded style import

* Set position and z-index style for tour-kit

* Add disable primary button feature for tour kit

* Export TourKitTypes

* Update style-build config for @automattic/* packages

* Add @automattic/* deps for components

* Ignore fs in webpack.config.js

* Update tour-kit stories

* Add tour-kit tests

* Update tour-kit README.md

* Update tour-kit types

* Update webpack.config.js

* Update style.scss

* Add auto focus feature

* Update type doc
2022-06-08 17:16:31 +08:00
Paul Sealock ce796e1cd7 build zip for release 2022-06-08 14:14:45 +12:00
Paul Sealock 734cfebd8c Clean up eslintrc in favour of defaults 2022-06-08 14:03:16 +12:00
Paul Sealock 1aec706943 Run linter on all js files 2022-06-08 13:58:25 +12:00
Paul Sealock bab0bf8298 Run lint:fix on js 2022-06-08 13:39:59 +12:00
Chi-Hsuan Huang 62313708aa
Add `tasklist_cancel_load_sample_products_click` event track for product task (#33327)
* Add tasklist_cancel_load_sample_products_click event track for product task

* Add changelog
2022-06-08 09:39:14 +08:00
Paul Sealock 8a30e307b6 changelog 2022-06-08 13:33:59 +12:00
Paul Sealock 2dce7b5bba Remove duplicated src folder/ 2022-06-08 13:31:16 +12:00
Paul Sealock 979fa45627 downgrade to @wordpress/scripts 19.2.4 2022-06-08 09:14:50 +12:00