* Make option API fail when using a disallowed option name in non-produciton environments and update permission list
* Add changelog
* Change Option API deprecated notice version to WC 6.3
* Change install-async to install-activate-async
* Add changelog
* Add comment for activated function
* Fix tests and rename install-activate-async to install-and-activate-async
* Rename callback function to static
* Filter by date_paid and date_completed on list table orders based on configuration
* Use separate query param 'order_date_type' to filter orders
* Add clarifying comment
* Add missing phpcs ignore
* Refactor to use 'm' and 'order_date_type' query parameters
When WC is provided only the country for the option `woocommerce_default_country` then it will fail to select a default state within the listed states.
Try this by manually setting `woocommerce_default_country` to "US" and you will see it selects the first country in the list instead of the first state within that country.
This only happens for countries that have states like US and CA for instance.
This ensures that the instance of the page controller class that
is used to set up the HPOS order admin screens is accessible and has
all its properties set correctly for use with the new is_order_screen
method.
* Make `ready` call jQuery 3 valid
* Another call during setup.
* Add changelog.
* Trigger CI
---------
Co-authored-by: Jorge A. Torres <jorge.torres@automattic.com>
* Add lint-branch.sh
* Add doc block and make var name more explicit
* Add changelog file
* Update composer's lint and lint-staged scripts
It turns out that using single brackets for a test doesn't work
sometimes when the variable contains spaces or multiple items.
Double brackets handles this better, so should make the scripts more
robust.
* Use double brackets in lint-branch script
Using double brackets for a test is more robust and may be able to
handle some cases that single brackets can't, such as a variable that
contains spaces or multiple items.
Note that this also required updating the shebang at the top of the
script file from `sh` to `bash` since double brackets is a syntax
introduced in Bash.
This PR adds support to HPOS for order edit locking in the admin (similar to what posts and custom post types get by default). Specifically, the following is implemented:
* The lock is stored in order meta for interoperability with WP's implementation.
* Orders that are being edited by a user other than the current one will appear with a lock icon next to them in the list table. This lock icon/status is updated live via heartbeat with no page refresh necessary.
* When opening an order that is being edited by another user, a warning will be displayed, with the ability to take over the order:
* When someone has taken over an order you're editing, you'll get a warning about it automatically via heartbeat (no page refresh involved)
Fixes#37108
* Change attributes of tracks event product_attributes_add
* Don't send used_for_variations_count if it's not variable product type
* Explicitly add null values in product_attributes_add when the attribute is sent on the other call
* Rename product_attributes_add on the product page to product_attributes_save
Fix inverted local and global attributes count
Remove unnecessary parameters
Refactor code
* Update changelog
* Remove sample data from product templates for product task
* Add changelog
* Update product templates
* Remove unused columns from product templates and set Published to -1
This PR fixes the bug the where we were only verifying shop_order orders. This also adds the option to provide a list separated by , of order types to verify.
Fixes#38317
* Refactor Layout component to functional component
* Add class to pages based on page path
* Add styling for interface skeleton on product pages
* Add changelog entries
* Move product page styles out of product editor package and into client
* Fix linting issues
* Check for location before checking path in page tracking
* Dont add body classes when no page path exists
* Record page view without router location for embed pages
add: fetch extensions and countries from API for core profiler
- prefetch it once in the machine init so that it's instant when used later
- fetch it again in preExtensions state and store it to context
- added prefetch for getCountries as well
* Remove unused $job_id argument
* Support WP_Upgrader argument -- helps for testing
* Minor refactor to support a custom logger in install_plugins
* Support a custom logger in install_plugins
* Support swapping out WP_Upgrader impl.
* Added woocommerce_plugins_install_async_callback callback to call install_plugins with a custom logger from action scheduler
* Add a new REST endpoint for onboarding plugins
* POST /wc-admin/onboarding/plugins/install-async -- queues plugin installs to action scheudler
* GET /wc-admin/onboarding/plugins/scheduled-installs/:job_id -- returns current status of given job id
* Remove WP_Upgrader support -- not using it
* Add changelog
* Fix phpcs errors
* Call complete
* Update test to wait 1 sec before checking the action scheduler
* Remove test that requires waiting an async action
* Add test for 404 status
* Add status field
* Remove woocommerce_plugins_install_async_callback action -- no longer used
* Call run-in-background endpoint with blocking=false to simulate a background process
* Update plugins/woocommerce/src/Admin/PluginsInstallLoggers/AsynPluginsInstallLogger.php
Co-authored-by: Chi-Hsuan Huang <chihsuan.tw@gmail.com>
* Update plugins/woocommerce/src/Admin/PluginsInstallLoggers/PluginsInstallLogger.php
Co-authored-by: Chi-Hsuan Huang <chihsuan.tw@gmail.com>
* Update plugins/woocommerce/tests/php/src/Admin/API/OnboardingPluginsTest.php
Co-authored-by: Chi-Hsuan Huang <chihsuan.tw@gmail.com>
* Update plugins/woocommerce/tests/php/src/Admin/API/OnboardingPluginsTest.php
Co-authored-by: Chi-Hsuan Huang <chihsuan.tw@gmail.com>
* Update plugins/woocommerce/tests/php/src/Admin/API/OnboardingPluginsTest.php
Co-authored-by: Chi-Hsuan Huang <chihsuan.tw@gmail.com>
* Update plugins/woocommerce/src/Admin/PluginsInstallLoggers/PluginsInstallLogger.php
Co-authored-by: Chi-Hsuan Huang <chihsuan.tw@gmail.com>
* Fix incorrect logger name
* Add max_execution_time setting
* Remove test code
* Skip failing test -- hard to test as the function uses site url and test env does not actaully have a running WP
* code format
* Revert background process changes
* Add install and activate endpoint
* Update plugins/woocommerce/src/Admin/PluginsInstallLoggers/AsynPluginsInstallLogger.php
Co-authored-by: Ilyas Foo <foo.ilyas@gmail.com>
* Update plugins/woocommerce/src/Admin/API/OnboardingPlugins.php
Co-authored-by: Ilyas Foo <foo.ilyas@gmail.com>
* Require activate_plugins permission
* Add test to check for permissions
* Update install and activate schema
* Fix: import AsyncPluginsInstallLogger correctly
* Fix: add missing comments
---------
Co-authored-by: Chi-Hsuan Huang <chihsuan.tw@gmail.com>
Co-authored-by: Ilyas Foo <foo.ilyas@gmail.com>
Co-authored-by: James Collins <james@om4.com.au>
Co-authored-by: Nestor Soriano <konamiman@konamiman.com>
Includes UI detailing how many webhooks are assigned to each of the users being deleted, and explaining how the re-assignment works.
* Remove block registration from within the Editor component
* Expose the initBlocks function to be used outside of the product package
* Register blocks within the ProductPage component
* Add changelog files
* Unregister blocks when product page gets unmounted
* Add core profiler - welcome to woo page
* Update checkbox styles
* Add tracks
* Update default tracking value
* Update copies
* using invoked promise instead of useState
- take advantage of xstate's built ins for side effects instead of useEffect/hooks
- discovered that error result wasn't really handled in original useEffect
- use text labels instead of inline functions so that we can decouple the implementation from the machine model
- todo: can move the invoked function out elsewhere and also tests if needed (not necessary here because it's a simple call)
* add: core profiler scaffolding using xstate
* Add navigation and progress-bar components
* fix css lint error
* Update plugins/woocommerce-admin/client/core-profiler/components/navigation/woologo.tsx
Co-authored-by: Chi-Hsuan Huang <chihsuan.tw@gmail.com>
* Update plugins/woocommerce-admin/client/core-profiler/components/progress-bar/progress-bar.tsx
Co-authored-by: Chi-Hsuan Huang <chihsuan.tw@gmail.com>
* Update plugins/woocommerce-admin/client/core-profiler/components/navigation/navigation.tsx
Co-authored-by: Chi-Hsuan Huang <chihsuan.tw@gmail.com>
* Remove var from __ function
* Use woocommerce prefix for classnames
* Fix css lint error
* Fix broken tests
* Add business location page
* Remove unwanted changes from rebase
* Remove unwanted changes from rebase
* Redirect to Woo Home on exit
* Add tracks
* Fix js lint error
* Add loader page
* Support meta value from nested states
* Use navigateTo
* Add tests for getCountryStateOptions
* Use Country type from navigation package
* Rename useStages to getLoaderStageMeta
* Add changelog
* Move progress from 20 to 80
* Fix xstate warning
* Fix broken pnpm lock
* Fix eslint errors
* Update plugins/woocommerce-admin/client/core-profiler/services/country.ts
Co-authored-by: RJ <27843274+rjchow@users.noreply.github.com>
* Update plugins/woocommerce-admin/client/core-profiler/index.tsx
Co-authored-by: RJ <27843274+rjchow@users.noreply.github.com>
* Save country to option
* Fix jslint error
* Update plugins/woocommerce-admin/client/core-profiler/services/country.ts
Co-authored-by: Chi-Hsuan Huang <chihsuan.tw@gmail.com>
* Update plugins/woocommerce-admin/client/core-profiler/style.scss
Co-authored-by: Chi-Hsuan Huang <chihsuan.tw@gmail.com>
* Fix eslint error
* Use decodeEntities directly
* Update comment for artificial 3 seconds wait
* Disable Go to my store button when country is empty
* Style for mobile devices
* Style updates for the country dropdown
* Fix js lint error
* Update country dropdown border color
* Style the loader
* Fix css lint
---------
Co-authored-by: Chi-Hsuan Huang <chihsuan.tw@gmail.com>
Co-authored-by: rjchow <me@rjchow.com>
Co-authored-by: RJ <27843274+rjchow@users.noreply.github.com>
* Add `aria-describedby` to select options button
* add a changelog
* update the chnagelog file
* fix type
* fix the function name
* remove `aria-describedby`s if with value
* suggestions implemented
* Minor PHPCS fixes
---------
Co-authored-by: Jorge A. Torres <jorge.torres@automattic.com>
We change the behavior of how we decide whether to continue or stop the migration. Earlier, when deciding, we were counting all pending orders which was slow especially on large sites, and will continue to get slower as the migration processes. However, now we will only fetch if there is any order that needs migrating to decide whether to go ahead with the migration or not, which should be much faster then calculating the total count.
* Add create-page.spec.js
Create e2e test for Critical Flow: Merchant > Pages > Can create a new page
* Add changelog entry
* Update selector for close dialog
---------
Co-authored-by: Jon Lane <jon.lane@automattic.com>
* Create new attribute to calculate more accurately if activity tab has something "new"
* Fix wrong attribute name
* Revert previous change, rename functions and remove isPanelOpen clause from hasAbbreviatedNotifications logic
* Rename functions
* Updated `wp-env` To 7.0.0
* Adopted `wp-env` Changes To `update-wp-env.php`
* Updated E2E Test Bootstrapping
With the changes to `wp-env` we can update our
test bootstrapping to use the new functionality.
* Changelogs
* Restored `update-wp-env.php` Usage
There's a bit of work to do in support of this and I
don't want it to hold up the pull request!
* Fixed `wp-env` JSON Problems
It was writing an empty array in places where the
expectation was an empty object.
* Fixed Broken Echo Escape
* Fixed Init Quoting
* Update close button locator
* Reverted Quote Removal
There is an upstream bug relating to quotes that needs to be resolved!
* Reverted Quote Removal
---------
Co-authored-by: rodelgc <rodel.calasagsag@automattic.com>
* Add test for inbox_note_view event
* Add tracks test for Layout's page_view
* Add test to inbox_action_click
* Add tests to analytics_filter tracks event
* Add tracks event test to activity_panel_open
* Add tests to tracks event activity_panel_orders_orders_begin_fulfillment
* Add tracks tests to activity_panel_stock_update_stock
* Improve tests based on code review comments
* Mock recordEvent and recordPageView globally
* Add missing mock
* Improve inbox panel tests
PR 36218 implemented child order upshifting (setting their parent
order id to 0) when the parent order is deleted, but this needs to
happen only when the post type of the parent order is hierarchical,
otherwise child orders need to just be deleted. This commit fixes that.
* Add a 24px spacing between the Manage my store header and the Marketing & Merchandising heading
* Add changelog
* Update store management card style
* Update .woocommerce-store-management-links__card-body padding
* Add LayoutContextProvider to embedded body layout to fix shipping tour error
* Show an error notice and record track when failing to update shipping option
* Add changelog
* Update error message
* Remove unused import