Commit Graph

546 Commits

Author SHA1 Message Date
louwie17 3bda07aec3 Add status param support for dismissing all notes (https://github.com/woocommerce/woocommerce-admin/pull/7743)
* Add status param support for dismissing all notes

* Add changelog

* Add unit test for new arg in /delete/all endpoint
2021-10-05 15:37:52 -03:00
Joshua T Flowers 93b42ad9ef Add an endpoint and method for actioning tasks (https://github.com/woocommerce/woocommerce-admin/pull/7746)
* Add checks for actioned task status

* Update completion logic for task

* Add rest route for actioning tasks

* Add action in data store for actioning tasks

* Add test for actioning task

* Only prune isActioned from task data
2021-10-05 13:07:50 -04:00
Joel Thiessen 9c5c39732b Only return viewable tasks from tasks endpoint (https://github.com/woocommerce/woocommerce-admin/pull/7718) 2021-09-29 16:47:01 -07:00
louwie17 33ca13abc9 Fix category lookup class (https://github.com/woocommerce/woocommerce-admin/pull/7709)
* Initial test

* Add category look up tests

* Add more tests

* Add changelog

* Update PR number in changelog
2021-09-28 13:59:10 -03:00
louwie17 da395281e7 Add changelog and enable promotion in core and plugin configs (https://github.com/woocommerce/woocommerce-admin/pull/7666)
* Add changelog and enable promotion in core and plugin configs

* Add PR number

* Make variation name a constant

* Clone spec as we are overwriting the is_visible prop

* Fix unit tests and support array and object

* Revert explat variation name

* Update changelog entry

* Update changelog once more

* Make sure the recommendations show up if marketplace suggestions is not defined defaulting to 'yes'
2021-09-27 10:24:47 -03:00
louwie17 3b2cce8814 Include yoast phpunit polyfills in phpunit tests (https://github.com/woocommerce/woocommerce-admin/pull/7695)
* Include yoast phpunit polyfills in phpunit tests

* Do a normal composer install

* Use original composer.lock

* Remove the use of composer 1

* Fix asset url

* Fix failed test with file rename

* Make sure plugin_dir_url is pointing at a file

* Fix asset url take 3

* Fix lint error
2021-09-23 18:01:52 +08:00
Joshua T Flowers b8b7c94bd1 Fix unsecured report files (https://github.com/woocommerce/woocommerce-admin/pull/7691)
* Fix unsecured report files

* Add changelog entry
2021-09-21 12:06:49 -07:00
Joshua T Flowers 9a361dde6c Add Task API (https://github.com/woocommerce/woocommerce-admin/pull/7665)
* Add Task model API

* Add task dismiss and snooze methods

* Add tests

* Fix snooze time check
2021-09-20 17:17:22 -04:00
louwie17 4fb6841e40 Add task list and activity panel E2E tests (https://github.com/woocommerce/woocommerce-admin/pull/7509)
* Add hide and show task list tests

* The start to adding tests for the activity panel

* Add activity panel tests and WP-API plugin on initialize

* Update task list tests to be more flexible

* Add changelog in package

* Update the re-enable task list logic to be more robust

* Use a more generic selector

* Make sure task list is shown in previous test

* Add test screenshot

* Remove screenshot and update logic

* Address PR feedback
2021-09-03 08:21:43 -03:00
Joshua T Flowers 8f836c292f Create task list APIs (https://github.com/woocommerce/woocommerce-admin/pull/7577)
* Add endpoint to hide task lists

* Migrate old setup task list hidden option

* Use option to store all hidden lists

* Add getter for deprecated options

* Migrate old task list options

* Move task lists into separate class

* Add TaskList class for individual task list control

* Update hidden checks to use TaskList api

* Update docs for hidden lists

* Update use of should_show_tasks to check for visible task lists

* Remove hide endpoint to reduce scope on PR

* Fix up failing tests

* Fix up rebase

* Add back in should_show_tasks with deprecation notice

* Add delay between payment tests
2021-09-02 17:40:02 -04:00
Adrian Duffell 6d23ab7ea1 Add newsletter signup to profiler (https://github.com/woocommerce/woocommerce-admin/pull/7601)
* Add email address field to store details step in OBW (https://github.com/woocommerce/woocommerce-admin/pull/7552)

* Subscribe store_email to MailChimp (https://github.com/woocommerce/woocommerce-admin/pull/7579)

* Add prefill for email field in OBW (https://github.com/woocommerce/woocommerce-admin/pull/7570)

* Add error handling for email validation errors from backend (https://github.com/woocommerce/woocommerce-admin/pull/7590)

* Remove OnboardingEmailMarketing note class (https://github.com/woocommerce/woocommerce-admin/pull/7595)

Co-authored-by: Ilyas Foo <foo.ilyas@gmail.com>
Co-authored-by: Moon <moon.kyong@automattic.com>
2021-08-31 12:39:04 +08:00
Moon aaf7832ddb Feature/add logger to rin (https://github.com/woocommerce/woocommerce-admin/pull/7194)
* Add evaluation logger

* Update readme

* Use simplified log format

* Add a new line at the end

* Move constant checking to consumer level

* Rename constant name

* Check constant before checking the value

* Fix test

* Add changelog

* Move initialization of the logger to RuleEvaluator and use more generic constant name

* Remove the default source value

* Update readme.txt

Co-authored-by: Joshua T Flowers <joshuatf@gmail.com>

* Update src/RemoteInboxNotifications/README.md

Co-authored-by: Joshua T Flowers <joshuatf@gmail.com>

* Update src/RemoteInboxNotifications/RuleEvaluator.php

Co-authored-by: Joshua T Flowers <joshuatf@gmail.com>

* Add soruce -- remote-inbox-notifications

* Move WC_ADMIN_DEBUG_RULE_EVALUATOR check to the logger

Co-authored-by: Joshua T Flowers <joshuatf@gmail.com>
2021-08-30 13:26:36 -07:00
Moon 59f0ffd1a6 Fix broken tests with the latest WC (https://github.com/woocommerce/woocommerce-admin/pull/7582) 2021-08-30 12:02:38 -07:00
David Levin c728cced1f Sentence case all the things analytics (https://github.com/woocommerce/woocommerce-admin/pull/6501)
* Sentence case all the things

* Update a few more things that were missed on the first round

* update documentation titles to use title case

* Add changelog

* Handle PR feedback

* Revert readme changelog changes

* Revert changes to ALT text in dev documentation

* Revert a change to ALT text in dev documentation

* Fix failing tests

Co-authored-by: David Levin <davidlevin@Davids-MacBook-Pro-2.local>
Co-authored-by: Joshua Flowers <joshuatf@gmail.com>
Co-authored-by: Adrian Duffell <9312929+adrianduffell@users.noreply.github.com>
2021-08-13 14:54:24 -04:00
Moon cd49514b3e Attempt to fix broken test in PHP 7 + WC latest + Composer 1.10.19 (https://github.com/woocommerce/woocommerce-admin/pull/7404)
* Fix broken test by replacing LegacyProxy from WC container
2021-07-22 15:09:57 -07:00
Moon 199b042e77 Use the original endpoint in products test (https://github.com/woocommerce/woocommerce-admin/pull/7388)
* Use the original endpoint

* Do not pass status param to use the default value.
2021-07-20 19:03:47 -07:00
Moon 6f163b4cee Fix/7358 stock api performance improvement (https://github.com/woocommerce/woocommerce-admin/pull/7377)
* Add a new endpoint to get low in stock products.

* Set images and attributes property

* WIP -- set last order date

* Do not join postmeta if store does not have any custom stock threshold

* Combine get_query() and get_query_for_sitewide_threshold() into one method and a few code clean ups

* Support status field

* Use new products/low-in-stock endpoint to count low in stock products.

* Use new products/low-in-stock to get low in stock products data.

* Remove low_in_stock support

* Deprecate low_in_stock

* Use the new ProductsLowInStock when low_in_stock is set

* Set cache-control header for the new endpoint

* Use wc_rest_prepare_date_response to format the response date

* Extract low in stock test to a separate file

* Make is_using_sitewide_stock_threshold_only protected

* Revert Products.php changes

* Add back low in stock test to products test

* Remove unnecessary if

* Make the controller final

* Deprecate low_in_stock

* Bug fix -- last_order_date was not setting correctly for variation post type. This commit fixes it

* Add changelog
2021-07-20 16:47:22 -07:00
Jeff Stieler 8e61f55017 Allow packages to be built in isolation. (https://github.com/woocommerce/woocommerce-admin/pull/7286)
* Use yarn instead of npm.

In prep for workspaces, since we're locked to npm < 7. See: https://github.com/woocommerce/woocommerce-admin/pull/7126#issue-661287749

* Initial workspace creation.

* Add initial tsc build to @woocommerce/number.

* Attempt to build experimental package.

* Try currency package.

* Define all packages as workspaces.

* Use tsconfig common to packages.

* Fix currency package build.

* Build csv-export with tsc.

* Try to build customer-effort-score with tsc.

* Fix JSX pragma.

* Build data package with tsc.

* Build date package with tsc.

* Build experimental package with tsc.

* Try to build explat package with tsc.

* Build navigation package with tsc.

* Build notices package with tsc.

* Build onboarding package with tsc.

* Build components package with tsc.

* Swap in package JS build into main script.

* Fix experimental package build.

* Try per-package css build with components.

* Try to run components package tests in isolation.

Broken on JSX in test files not being transformed.

* Move @woocommerce/wc-admin-settings into a package.

* Try to fix components package tests.

Fails because we aren't setting up the jest/jest-dom globals.

* Move JS test code to reusable (private) package.

* Enable incremental TS builds.

* Use workspaces to run JS tests.

* Use new jest configs for update snapshot scripts.

* Fix style builds.

* Fix package version in components.

* Fix client test debug and watch scripts.

* Update yarn lock.

* Update test-staged behavior.

* Try to fix storybook.

* Fix storybook.

* Update more npm commands to yarn.

* Add changelog.

* Fix lint errors.

* Update packages readme script references.

* Clean up unused gitignore match.

* Fix another npm command.

* Fix JS builds on watch.

* Fix start script.

* Fix start scripts for packages.

* Use tsc to build packages before tests

* yarn -> npm.

# Conflicts:
#	package-lock.json
#	package.json

* Fix linter error.

* Remove workspace definitions.

* Fix missing Fragment import.

* Fix package lock.

* Fix missing reference.

* Only build commonjs module for js-tests helper.

* Remove errant dependency from components.

* Remove noop scripts.

* Fix package JS build before testing.

* Revert noisy formatting changes.

* Fix precommit and test scripts.

* Fix minimum expected recommended extension count.

Japan test case breaks this.

* Revert babel config changes.

* chore(release): publish

 - @woocommerce/components@7.2.0
 - @woocommerce/csv-export@1.4.0
 - @woocommerce/currency@3.2.0
 - @woocommerce/customer-effort-score@1.1.0
 - @woocommerce/data@1.4.0
 - @woocommerce/date@3.1.0
 - @woocommerce/dependency-extraction-webpack-plugin@1.7.0
 - @woocommerce/eslint-plugin@1.3.0
 - @woocommerce/experimental@1.5.0
 - @woocommerce/explat@1.1.0
 - @woocommerce/js-tests@1.1.0
 - @woocommerce/navigation@6.1.0
 - @woocommerce/notices@3.1.0
 - @woocommerce/number@2.2.0
 - @woocommerce/onboarding@1.1.0
 - @woocommerce/tracks@1.1.0
 - @woocommerce/wc-admin-settings@1.1.0

* Add script for running 'start' in a package.

* Remove yarn from gitignore.

* Update package changelogs, prep versions for release.

* Try to fix E2E tests after main merge.

* Some cleanup.

* Add changelog.

Co-authored-by: Paul Sealock <psealock@gmail.com>
2021-07-14 16:38:57 -04:00
Ron Rennick 4af5eef27b Create E2E package (https://github.com/woocommerce/woocommerce-admin/pull/7084)
* bump E2E package versions to latest

* first pass on E2E test package.json

* move e2e specs to admin-e2e-tests

* add global types, reimplement tests/e2e/specs

* use consistent build dir with other packages

* add documentation, improve test:e2e script

* fix linting issues in admin-e2e-tests

* fix more linting issues

* disable lint on requires

* use e2e in the E2E container names

* move analytics overview test to package

* change extension on analytics-overview test file

* fix linting issues in e2e analytics overview

* remove package scripts from e2e package

* change test specs extensions to .tsx

* remove import from analytics overview test spec

* add .tsx to e2e test spec file extension list

* update e2e business features count expected
2021-07-13 16:38:05 -03:00
Jeff Stieler 12aa391cf0 Fix minimum expected recommended extension count. (https://github.com/woocommerce/woocommerce-admin/pull/7334)
* Fix minimum expected recommended extension count.

Japan test case breaks this.

* Just check for one or more extensions.
2021-07-12 20:03:55 -06:00
Joshua T Flowers d8d14fb9ca Localize payment gateway suggestions on wccom (https://github.com/woocommerce/woocommerce-admin/pull/7217)
* Localize payment gateway suggestions on wccom

* Add user locale as param to source URL

* Fix mock http request params
2021-07-05 17:50:26 -04:00
Joshua T Flowers 41f3d8e99a Remove old payment gateway task components (https://github.com/woocommerce/woocommerce-admin/pull/7224)
* Remove old payment gateway task components

* Move PaymentGatewaySuggestions up one directory

* Add feature check to tasks array

* Turn on payment gateway suggestions in all environments

* Handle PR feedback

* Use gateway suggestions from REST API in help panel

* Fix component path

* Remove BACS test due to SlotFill testing bug

* Await button selector

* Handle PR feedback round 2
2021-06-28 14:18:42 -04:00
louwie17 8b7b8b2011 Add E2E tests for analytics overview screen section removal (https://github.com/woocommerce/woocommerce-admin/pull/7238)
* Add E2E tests for analytics overview screen section removal

* Fix build errors

* Add tests for moving sections up and down
2021-06-24 17:08:16 -03:00
louwie17 c5657002d2 Add date range support to remaining notes (https://github.com/woocommerce/woocommerce-admin/pull/7222)
* Allow custom date range start for date range

* Make use of the date_range logic for any notes using active_for

* Add changelog

* Add a couple extra tests for date range
2021-06-24 11:32:02 -03:00
Jeff Stieler 9f63719baa Fix attribute filter for "any X" variations. (https://github.com/woocommerce/woocommerce-admin/pull/7046)
* Use order item data to match attributes.

Fixes matching on products with "any x" attributes.

* Fix attribute query on variations report.

* Fix variations report item count.

* Add test coverage.

* Add changelog entry.

* Fix non-string query prop warning in SelectControl component.

* Move custom attribute retrieval to a reusable Trait.

* Ensure all custom attribute terms are included in the API response.

* Combine all terms from custom attributes.

When they're split across multiple products.
2021-06-22 08:45:08 -04:00
Jeff Stieler b5f397fa89 Fix report arguments handling in CSV export. (https://github.com/woocommerce/woocommerce-admin/pull/7165)
* Ensure report args are mapped and sanitized before CSV export.

* Add test.

* Fix products query when there are no products in the specified categories.

* Add changelog.
2021-06-18 10:53:52 -06:00
Sam Seay d9daed0a4f Update the wordpress/babel-preset to avoid crashes in WP5.8 beta2 (https://github.com/woocommerce/woocommerce-admin/pull/7202)
* Update the wordpress/babel-preset to avoid crashes in WP5.8 beta2

* Also update other dependencies dropping IE11 support.

* Update data dep in data package.

* Add back regen runtime.

* Add regenerator-runtime dependency for setting up jest tests

Co-authored-by: Ilyas Foo <foo.ilyas@gmail.com>
2021-06-18 13:13:17 +08:00
Joshua T Flowers c558a5bceb Add unit tests for payment gateway suggestions data source poller (https://github.com/woocommerce/woocommerce-admin/pull/7153)
* Move data source filter name to constant

* Add unit tests for data source poller

* Handle PR feedback

* Add use statement for DataSourcePoller

* Fix trailing comma
2021-06-16 15:27:48 -04:00
Joshua T Flowers af39737d90 Add EvaluateSuggestion unit tests (https://github.com/woocommerce/woocommerce-admin/pull/7152) 2021-06-15 17:48:30 -04:00
Joshua T Flowers f57edb6e6c Add payment gateway suggestion unit tests (https://github.com/woocommerce/woocommerce-admin/pull/7142)
* Add payment gateway suggestions unit tests

* Fix up old key fields

* Fix up lingering semantic inconsistencies

* Add changelog entry

* Add in default payment gateways for tests

* Handle PR feedback

* Fix up rebased changelog entries
2021-06-15 17:24:10 -04:00
Taha Paksu 399ef81b11 Fix currency display errors in homescreen order activity card (https://github.com/woocommerce/woocommerce-admin/pull/7181) 2021-06-15 21:02:14 +03:00
Joshua T Flowers b9df97c984 Add unit tests around extended payment gateway controller (https://github.com/woocommerce/woocommerce-admin/pull/7133)
* Add unit tests around extended payment gateway controller

* Add changelog entry

* Add mock enhanced gateway and make REST API schema consistent
2021-06-14 10:23:04 -04:00
Jeff Stieler d3fd2f36d0 Include orders without coupons when excluding specific coupon IDs. (https://github.com/woocommerce/woocommerce-admin/pull/7021)
* Include orders without coupons when excluding specific coupon IDs.

* Add changelog entry.

* Fix default Orders before/after query args.

* Specify date range for test query.
2021-06-08 14:56:23 -04:00
Jeff Stieler f432b83365 Revert store setup task list title. (https://github.com/woocommerce/woocommerce-admin/pull/7129) 2021-06-07 11:33:40 -04:00
louwie17 baba993f85 Add remind me later support to task list (https://github.com/woocommerce/woocommerce-admin/pull/6923)
* Initial ellipses menu render on task list

* Added remind me later functionality

* Fixed tests and wrote tests for ellipsis menu

* Update tracks

* Add changelog and update css

* Fix up spacing and track name

* Address PR feedback and add extra integration tests

* Remove the should render correctly test, as the other tests cover this

* Move logic out of mark up

* Directly reference the EllipsisMenu for now to circumvent a circular dependency

* Fix direct import in jest tests

* Preload remind me later optoin

* Some styling animation changes for the task list

* Stagger transitions for dismissing within collapsible list

* Fix lint warnings

* Update logic to prevent the use of TS `as`

* Add tests and comments
2021-06-03 18:44:05 -03:00
Ilyas Foo d936b649fc Remove business step original flow (https://github.com/woocommerce/woocommerce-admin/pull/7103)
* Remove logic flags for business step A/B test

* Delete unused files

* Remove benefits step from profile wizard

* Update related e2e tests

* Update readme

* Rename SelectiveFeaturesBusinessStep to BusinessFeaturesList
2021-06-03 16:33:54 +08:00
Jeff Stieler c23d02bcc0 Add conditional copy/content and CTA to expanded task items (https://github.com/woocommerce/woocommerce-admin/pull/6956)
* Add action button to TaskItem.

* Pass through click event.

* Add separate action and label to onClick.

* Add initial copy for task expansion.

* Expand one task at a time.

* Add descriptive text to the payments step.

* Set the first incomplete task current by default.

* Revert expansion behavior.

* Fix margins.

* Curate purchase products task content based on selections.

* Fix appearance task copy.

* Fix payment task copy.

* Add conditional tax step title.

* Indicated if task is expanded to click handlers.

* Automatically enable WC Tax from the expanded CTA.

* Restore additional text property.

* Fix task title xpath selector in E2E test.

* Fix automatic tax setup query param logic.

* Add changelog entries.
2021-06-01 12:04:21 -06:00
Adrian Duffell 366ffb18b1 Fix formatting in coupons E2E test (https://github.com/woocommerce/woocommerce-admin/pull/7080) 2021-05-27 22:19:51 +08:00
Paul Sealock 40c22add0a Rule processing transformers: Add count rule (https://github.com/woocommerce/woocommerce-admin/pull/7037)
* Add count rule

* better return types

* rename test
2021-05-25 16:32:51 +12:00
Paul Sealock 3ba1afd0ab Rule Processing: pass in default (https://github.com/woocommerce/woocommerce-admin/pull/7009)
* pass default

* handle tests

* changelog
2021-05-25 16:23:49 +12:00
Ilyas Foo 154071c1bc Revert copy for setup checklist (https://github.com/woocommerce/woocommerce-admin/pull/7015)
* Revert copy for index.js and tasks.js

* Update changelog

* Update test

* Update tests

* Update tests again

* Lint
2021-05-21 09:13:40 +08:00
louwie17 7cfaa21db2 Add source support for notes query (https://github.com/woocommerce/woocommerce-admin/pull/6979)
* Add source support for notes query

* Add changelog

* Removed ternary condition
2021-05-14 13:13:51 -03:00
Moon e2d9a8792a Support transformers in remote inbox notifications (https://github.com/woocommerce/woocommerce-admin/pull/6948)
* Introduce Transformer to Remote Inbox Notification
* Added array_column, array_flatten, array_keys, array_search, array_values, and dot_notation transformers.
* Added tests
2021-05-13 21:27:35 -07:00
Joshua T Flowers 685c012dfe Add transient notices feature (https://github.com/woocommerce/woocommerce-admin/pull/6809)
* Add PluginInstaller class

* Redirect to referring page if one exists

* Store message and show after redirect

* Add transient notices feature

* Fix default and empty state of notices

* Use TransientNotices to display plugin notices

* Add transient notices readme

* Add feature unit tests

* Update notice queue client-side

* Add filter to queued option prior to notice creation

* Use the core/notices2 data store

* Fix filtered queued notices

* Add methods to get individual notices and queue

* Allow user ID specific notices

* Remove errant script asset dependencies

* Add user ID property to docs

* Use preloaded option instead of window var

* Refactor transient notices to directly use option instead of state

* Show error message from WP_Error in plugin installer

* Add tests around notice queue in client

* Add changelog entry
2021-05-13 09:08:31 -04:00
louwie17 295cd6b2c9 Add note date range logic (https://github.com/woocommerce/woocommerce-admin/pull/6969)
* Add notes helper method for date ranges

* Update two of the notes with date ranges

* Add tests and fix range logic

* Add changelog

* Update comments

* Update range name and added exception if invalid range passed in.

* Fix php unit tests

* Fix another test
2021-05-13 09:41:21 -03:00
Joel Thiessen 073a220b59 Adding Slotfill extension components for remote payments (https://github.com/woocommerce/woocommerce-admin/pull/6932) 2021-05-11 09:36:56 -07:00
louwie17 094b73561d Fix/6954 script asset filename (https://github.com/woocommerce/woocommerce-admin/pull/6955)
* Update the get_script_asset_filename function calls to match new format

* Added e2e test for the coupons page

* Add changelog

* Remove typo in changelog
2021-05-07 13:29:20 -03:00
Bec Scott 7a0b00ec0c Un-skip product import test, delete all products in the setup (https://github.com/woocommerce/woocommerce-admin/pull/6905)
* un-skip test, delete all products in the setup

* add to readme

* change fix to dev
2021-04-30 11:38:26 +10:00
louwie17 071a68b950 Update task list component to make use of new experimental list (https://github.com/woocommerce/woocommerce-admin/pull/6849)
* Add initial task item component with the new task list

* Switch components to functional components

* Some minor updates from the last rebase

* Fix missing variables.

* Fix tests

* Add animation for the experimental list

* Fix lint error

* Add changelog

* Fix E2E tests

* Update PR suggestions and export list from experimental package

* Fix dismiss styling issue

Co-authored-by: Jeff Stieler <jeff.m.stieler@gmail.com>
2021-04-27 12:23:34 -03:00
Waclaw Jacek 4c17776815 Throw custom exception in NoteTraits if notes are disabled (https://github.com/woocommerce/woocommerce-admin/pull/6771)
A custom exception `NotesUnavailableException` will be thrown on attempts to load the "admin-note" data store using the `Notes::load_data_store()` method introduced in this PR.

All calls to `\WC_Data_Store::load( 'admin-note' )` were replaced with calls to the above method.
2021-04-26 23:57:39 +02:00
louwie17 3ff1e1375e Update E2E config to support screenshots on test failure (https://github.com/woocommerce/woocommerce-admin/pull/6858)
* Add login page wait script for e2e tests

* Re-navigate to login page, if initial selector does not exist

* Add screenshot if login page did not render

* Add screenshot code, and screenshot artifacts to GH action

* Update screenshot logic for login

* Update artifact task

* Update upload artifact workflow

* Update jest config to make sure the screenshots work on test failures

* Remove old screenshot code

* Add screenshots to daily e2e tests as well incase of failure

* Add changelog
2021-04-26 13:41:38 -03:00
Moon 6846036594 Convert date to timestamp before passing to set_date_prop to persist … (https://github.com/woocommerce/woocommerce-admin/pull/6795)
* Convert date to timestamp before passing to set_date_prop to persist the correct timezone
2021-04-20 17:00:30 -07:00
louwie17 be7dd2dd5e Add recommended payment methods (https://github.com/woocommerce/woocommerce-admin/pull/6760)
* Add initial payment recommendations code for the payments settings

* Added request data for the recommended payments

* Some styling updates and make sure it does not show when marketplace suggestions is disabled

* Update url

* Update comment in php class

* Add tests

* Fix lint errors

* Remove unnecessary type

* Fix lint error

* Fix broken test

* Convert plugin package to typescript

* Fix lint errors

* Add changelog

* Add support for locale-data

* Fix track name

* Fix up the tests

* Fix lint errors

* Address PR feedback

* Add tests for option hydration

* Make types more robust in plugins reducer

* Made use of SlotFill component instead of page registry and router

* Removed console log, and fixed types

* Add newer version of i18n to data package, for newer types

* Make the request to WooCommerce.com more restrictive

* Fix path of import

* Update PHP with suggested changes

* Remove SlotFill with applyFilters

* Update copy and PR feedback

* Update package lock

* Updated package lock

* Fix the package lock

* Added dot, and some minor styling changes

* Add test instructions
2021-04-20 14:17:19 -03:00
Joshua T Flowers 8f018fc518 Add plugin installer to allow installation of plugins via URL (https://github.com/woocommerce/woocommerce-admin/pull/6805)
* Allow any plugin to be installed or activated

* Add PluginInstaller class

* Redirect to referring page if one exists

* Store message and show after redirect

* Add changelog and testing instructions
2021-04-16 15:45:43 -04:00
Jeff Stieler 9e05116326 Detect missed DB version number updates and fix them. (https://github.com/woocommerce/woocommerce-admin/pull/6818)
* Detect missed DB version number updates and fix them.

* Add changelog entry.
2021-04-16 15:01:04 -04:00
Adrian Duffell 6434ffb9c8 Add nonce support to note actions (https://github.com/woocommerce/woocommerce-admin/pull/6726)
* Add database columns

* Add support for nonces in note actions

* Add test for nonces in note actions

* Fix db values should default to null

* Fix a bug where URLs had encoded ampersands

* Update variable naming for clarity

* Add throwing an exception when note name not found

* Add tests for nonces in the datastore

* Add changelog

* Fix default paramater name

* Add changelog

* Revert "Add changelog"

This reverts commit f842bc58e4db66c8a497ca4f38d1b0294590192d.
2021-04-16 13:56:39 +08:00
Sam Seay b13feaeafd Add some tweaks to e2e tests to try and resolve flakyness issues (https://github.com/woocommerce/woocommerce-admin/pull/6812) 2021-04-16 10:47:21 +12:00
Paul Sealock 7ab756b76c Try ExPlat: Add A/A test (https://github.com/woocommerce/woocommerce-admin/pull/6669)
* Add basic ExPlat initialization

* add tsx support
2021-04-15 13:32:46 +12:00
Sam Seay 97d143b762 Add in missing awaits that could have been causing tests to be flaky. (https://github.com/woocommerce/woocommerce-admin/pull/6800) 2021-04-15 09:20:44 +12:00
Joshua T Flowers eb6186a29c Refactor payments to allow management of methods (https://github.com/woocommerce/woocommerce-admin/pull/6786)
* Add manage button for enabled and configured payments

* Enable methods only instead of toggling

* Update payment methods location

* Move ribbon to separate component

* Move setup container to separate component

* Move payment action to separate component

* Refactor payments to functional component

* Fix missing action props

* Fix broken onsetup callback

* Update payment method keys to match management pages

* Add changelog and testing instructions

* Revert key changes in favor of manageUrl

* Update e2e tests for payments
2021-04-14 15:26:50 -04:00
Jeff Stieler d819373057 Avoid updating customer info synchronously when "last active" is modified. (https://github.com/woocommerce/woocommerce-admin/pull/6765)
* Schedule (async) customer update when last active date is modified.

* Add test case for scheduled customer update.

* Add changelog entry.
2021-04-12 10:17:02 -04:00
louwie17 b29cd9a6c0 Add support for php8 unit tests (locally and in GH actions) (https://github.com/woocommerce/woocommerce-admin/pull/6678)
* Partial local version to run php8 unit tests

* Remove the post install scripts

* Remove tab

* Make sure woocommerce version contains patch number

* Remove unnecessary script

* Update bin settings and unit test script

* Remove phpunit binary

* Updated how php unit is being run

* Add specific phpunit version for php8

* Update bin phpunit composer.json

* Final cleanup of scripts

* Fix potential test where image is an object

* Move setting image below save

* Add changelog

* Do not convert obj/array to string for email_actions

* Remove some uses of tabs

* Set WP and WC version to minimum php 8 supported

* Remove unnecessary composer install within tests
2021-04-07 14:28:03 -03:00
Sam Seay 9dd75e83f8 Improve page object encapsulation, refactor e2e suite, add more e2e tests. (https://github.com/woocommerce/woocommerce-admin/pull/6682) 2021-04-05 12:09:36 +12:00
Adrian Duffell 20865df164 Fix various php lint errors (https://github.com/woocommerce/woocommerce-admin/pull/6705) 2021-03-31 07:43:34 +08:00
Adrian Duffell b48e2addeb Fix Database Table Creation Test (https://github.com/woocommerce/woocommerce-admin/pull/6670)
* Fix mistake in documentation

* Fix typo in query

* Fix a bug where the tables were not being dropped
2021-03-26 21:52:54 +08:00
Ilyas Foo 6296952949 Improve AddFirstProduct email note contents (https://github.com/woocommerce/woocommerce-admin/pull/6617)
* Add capability for merchant email note personalization, improve AddFirstProduct email note contents.

* Update heading

* Update readme and testing instructions

* Remove old image, fix typo and improve translation
2021-03-26 09:26:07 +08:00
louwie17 d5800c1a7a Check if value for contains comparison is an array (https://github.com/woocommerce/woocommerce-admin/pull/6645)
* Add warning and default to empty array for contains operation, when value is not array

* Add changelog

* Move option is array check and warning to the OptionRuleProcessor

* Added a check for the new_value as well, given we do the same for the old_value
2021-03-25 08:55:36 -03:00
Adrian Duffell 05d9cf3546 Add tests for database table creation (https://github.com/woocommerce/woocommerce-admin/pull/6658) 2021-03-25 13:21:03 +08:00
Sam Seay cc01b9816e Fix TypeScript build for `packages` and add types for wc/data's onboarding store (https://github.com/woocommerce/woocommerce-admin/pull/6595) 2021-03-25 10:29:37 +13:00
louwie17 9b180db614 Add Typescript and page objects to E2E suite (https://github.com/woocommerce/woocommerce-admin/pull/6582)
* Initial playwright

* Updated e2e to use playwright and typescript

* Update set up environment and jest package

* Add changelog

* Add await to uncheck

* Fix formatting

* Revert jset back to ~24, as >25 runs slower, see facebook/jestwoocommerce/woocommerce-admin#9457

* Removed some unnecessary uses of waitForSelector

* Fix eslint issue

* Fix the e2e tests with latest updates

* Running most tests, with typescript now

* Fix any outstanding queries for the tests to work

* Update changelog

* Remove unnecessary jest version and unnecessary transform setting

* Fix test case broken after rebase

* Add fix to make e2e tests more robust

* Making sure dropdown value is correct

* Reove the wcpay condition for features number
2021-03-17 16:22:09 -03:00
Moon fda300ff4f Improve WC Shipping & Tax logic (https://github.com/woocommerce/woocommerce-admin/pull/6547)
* Improve WC Shipping & Tax logic

* Add changelog

* Simplify return statement

* Add test for filtering selected extensions

* Fix broken test
2021-03-17 01:22:33 -07:00
Sam Seay e51e1401c5 Fix a bug where the JP connection flow would not activate (https://github.com/woocommerce/woocommerce-admin/pull/6521)
Fixes woocommerce/woocommerce-admin#6488

Changes.

* See the issue for the discussion, but we're changing the behaviour of triggering the connection flow as part of this. Before it was required that both wc-services and wc-admin were installed before triggering the flow.

* Also the plugins value was not being updated properly in the new flow, but plugins is not used in any useful way in the onboarding profile, so I have removed it completely. We now rely on the actual installed plugins to determine what is installed/activated.
2021-03-12 16:36:23 +13:00
Sam Seay 4ec75439c5 Remove rest API props from onboarding confirmed as no longer used. (https://github.com/woocommerce/woocommerce-admin/pull/6520) 2021-03-11 08:50:23 +13:00
Fernando 1267af3665 Business features step: include Mailpoet (https://github.com/woocommerce/woocommerce-admin/pull/6515)
* Added "MailPoet" option to new Business Details step

This commit adds "MailPoet" option to the new Business Details step

* Modified the Creative Mail copy

* Added changelog

* Added testing instructions

# Conflicts:
#	TESTING-INSTRUCTIONS.md

* Fixed testing instructions

* Fixed e2e tests

Co-authored-by: Fernando Marichal <contacto@fernandomarichal.com>
2021-03-10 14:27:58 -03:00
louwie17 cb3c1e88e8 Add tilde (~) option for client root directory (https://github.com/woocommerce/woocommerce-admin/pull/6517)
* Add tilde option for client root directory

* Support tilde start as internal to fix lint issues

* Update baseUrl and paths so auto complete works correctly

* Add changelogs

* Add eslint support for webpack resolvers

Co-authored-by: Matt Sherman <matt@jam123.com>
2021-03-10 11:11:37 -04:00
Fernando 0ebccd674b Fixed associated Order Number for refunds (https://github.com/woocommerce/woocommerce-admin/pull/6428)
* Fixed related orders problem

This commit fixes the related orders problem

* Fixed customer type query

* Fixed get_order_number filtering

* Added a default value to totalResults

This commit adds a default value to totalResults (in order to avoid errors)

* Added testing instructions

# Conflicts:
#	TESTING-INSTRUCTIONS.md

* Added changelog

# Conflicts:
#	readme.txt

* Fixed orders without products

* Added tests

Co-authored-by: Fernando Marichal <contacto@fernandomarichal.com>
2021-03-09 15:57:50 -03:00
louwie17 14e2becc9a Update/6487 target audience of business feature step (https://github.com/woocommerce/woocommerce-admin/pull/6508)
* Prune out old bundle flow and expand range of new one

* Add feature flag, default to true

* Update feature flag, and updated WcPay logic

* Fix lint errors

* Add changelog

* Onlly show WC payments task if part of the business extensions

* Remove stray console log

* Update copy of WCPay card

* Add a couple more e2e tests

* Add await for click

* Add test instructions
2021-03-08 10:23:39 -04:00
Joshua T Flowers 7a20e582a3 Add initial tests for navigation Menu class (https://github.com/woocommerce/woocommerce-admin/pull/6492)
* Add initial tests for navigation Menu class

* Add changelog entry
2021-03-03 08:09:33 -05:00
Joshua T Flowers a4785b7c2a Add navigation favorites tests (https://github.com/woocommerce/woocommerce-admin/pull/6409)
* Add navigation favorites tests

* Fix copy pasta

* Fix test comment

* Add changelog entry
2021-03-02 10:15:53 -05:00
Joshua T Flowers d5bed6a878 Add navigation screen unit tests (https://github.com/woocommerce/woocommerce-admin/pull/6421) 2021-02-24 10:45:41 -05:00
Ilyas Foo 168b1a17b1 Add CES track settings tab on updating settings (https://github.com/woocommerce/woocommerce-admin/pull/6368)
* Add settings_area prop to CES settings track

* Update readme and testing instructions

* Update comments

* Add test

* Fix testing instructions
2021-02-22 10:09:45 +08:00
Joshua T Flowers d4d0eb8870 Add settings client pages and plumbing (https://github.com/woocommerce/woocommerce-admin/pull/6092)
* Move wc-admin-settings folder

* Add the settings container

* Add settings client
2021-02-12 14:32:42 -05:00
Sam Seay 3ccf825e16 Adjust the timing of the Marketing.php note to 5 days. (https://github.com/woocommerce/woocommerce-admin/pull/6083) 2021-02-10 08:56:13 +13:00
louwie17 656eea0706 Skip intermittent failing test (https://github.com/woocommerce/woocommerce-admin/pull/6273) 2021-02-04 17:56:07 -04:00
Moon e02429dff3 Skip failing tests in WP 5.3 and 5.4 (https://github.com/woocommerce/woocommerce-admin/pull/6209)
* Skip failing tests in WP 5.3 and 5.4

* Add a reason for the skipping
2021-01-27 20:02:35 -08:00
Fernando 2ab28c977f Extended task list refactor (https://github.com/woocommerce/woocommerce-admin/pull/6081)
* Fixed hiding core task list

This commit fixes the hiding of the core task list

* Added tests

* Added fix to readme.txt

* Fixed readme.txt

* Added new test

* Hooks were fixed

* Refactored task lists handling

This commit refactors a few things related to the task lists handling

* Added tests

* Fixed task lists handling

* Fixed tests

* Renamed 'taskListHidden' to 'taskListsHidden'

* Added taskListsHidden util

* Fix completed tasks tracking infinite loop

This commit fixes the completed tasks tracking infinite loop (for multiple extended tasks)

* Refactored update check

* Hide task list if there aren't any visible tasks

* Fixed comment

* Fixed typo

* Renamed example method

* Fixed example extension

* Added tab to the extension example

* Fixed extended task list enabling option

* Added more tests

* Added PHP tests

* Fixed some comments

* Removed utils.js file

Co-authored-by: Fernando Marichal <contacto@fernandomarichal.com>
2021-01-27 15:40:02 -03:00
louwie17 b0126c36bf Delete all products before running tests (https://github.com/woocommerce/woocommerce-admin/pull/6178)
* Delete all products before running tests

* Delete products in tear down instead

* Only remove the color attribute, as other attitributes are necessary in other tests

* Make assertion more lenient, and remove all products deletion

* Fix lint errors

* Changed to check if imported is at-least 2 items
2021-01-27 13:57:58 -04:00
louwie17 74b3eccbc9 Add option to create product by template (https://github.com/woocommerce/woocommerce-admin/pull/5892)
* Initial product template modal

* Add custom product template for the new-post route

* Add test, and code for making use of the insert_post action

* Added ProductTemplates Datastore to create template with REST api

* Add back variation method, deleted by accident

* Move product from template endpoint to OnboardingTasks class

* Fix lint errors

* Added tracks and template hooks

* Rename product create permission check function, for less confusion

* Remove duplicate recommended option

* Fix stylelint errors

* PHP tests for the product_from_template endpoint

* Fix onboarding php unit tests

* Write tests for client product template options

* Refactored list component, to use it as a radio control list

* Fix lint errors

* REmove assertion as it fails on the ci

* Add changelog

* Updating tests to make sure all product attribute taxonomies are removed

* Add more specific assertions for importing sample products test

* Update the sample products test

* Deconstruct item object, from PR suggestion

* Fix PHP errors, by updating the createProductFromTemplate call
2021-01-25 12:52:42 -04:00
Moon b80b65bd46 Add a new note a day after adding the first product (https://github.com/woocommerce/woocommerce-admin/pull/6032)
* Add a new note a day after adding the first product
* Do not add note if store has been active for more than 14 days
2021-01-20 22:11:53 -08:00
Sam Seay 7041c3b2d3 Add the "Getting started in Ecommerce" inbox note (https://github.com/woocommerce/woocommerce-admin/pull/6086) 2021-01-21 16:13:23 +13:00
Moon 583e87f29a Add a new note about the variable product when the owner adds the fir… (https://github.com/woocommerce/woocommerce-admin/pull/6021)
* Add a new note about the variable product when the owner adds the first product
* Attempt to add a new note when a product gets published
* Change logic to check only post status and type
* Add tests cases
2021-01-14 15:33:22 -08:00
Fernando 513173a9d9 Add merchant email notifications (https://github.com/woocommerce/woocommerce-admin/pull/5922)
* Added MerchantEmailNotifications class

* Added new type and Events refactor

# Conflicts:
#	src/Events.php

* Added templates

* Refactored MerchantEmailNotifications and NotificationEmail

* Templates refactored

* Added email opening tracking endpoint

* Added templates handling

* Moved folder `MerchantEmailNotifications`

* Fixed template extensibility

* Fixed note `heading` check

* Added default type in `get_template_filename`

* Added tests

* Removed bypass

* Modified URL

* Added required noteTypes

* Added flag for functionallity

* Fixed plain link

* Fixed comment

* Turned email notifications on by default

This commit adds the code to turn email notifications on by default

* Fixed email styles

* Fixed typo

* Renamed method "possible_send" as "run"

* Removed unnecessary control

* Fixed another typo

* Renamed method as "get_notification_email_addresses"

* Refactored method "send_merchant_notification"

* Renamed plain-merchant-notification

* Fixed tests

* Merchant email notifications - Action triggering (https://github.com/woocommerce/woocommerce-admin/pull/5976)

* Added templates

# Conflicts:
#	includes/emails/plain-mechant-notification.php

# Conflicts:
#	includes/emails/html-merchant-notification.php

* Added note action triggering

This commit adds the note actions triggering

# Conflicts:
#	includes/emails/html-merchant-notification.php

* Fixed error handling

* Refactored "trigger_note_action" method

* Fixed actions url

* Fixed note URL

* Added external redirect

* Added image and html handling for email

* Fixed tests

* Fixed buttons style

Co-authored-by: Fernando Marichal <contacto@fernandomarichal.com>

* Add your first product: email notification (https://github.com/woocommerce/woocommerce-admin/pull/6024)

* Added AddFirstProduct note

# Conflicts:
#	src/Events.php

* Added "AddFirstProduct" email note

This commit adds the email note "AddFirstProduct"

* Fixed image

This commit removes the image img-product-light.svg to use a png instead. Otherwise, the gmail proxy would break the image

* Fixed readme.txt

Co-authored-by: Fernando Marichal <contacto@fernandomarichal.com>

* Added readme.txt

Co-authored-by: Fernando Marichal <contacto@fernandomarichal.com>
2021-01-12 21:09:22 -03:00
Sam Seay a2c4a6a306 A/B test creating a business features step for free extensions (https://github.com/woocommerce/woocommerce-admin/pull/5786)
This fixes woocommerce/woocommerce-admin#5287 

Major changes:

1. The `<Form>` component (which is a published component) gets a new optional prop (so its backward compatible), called `onChangeCallback`. This is called when any form value changes, allowing the controlling component to act on individual form changes. This was needed to utilise `<Form>` to revalidate and check if the user could access the next tab. This should not impact existing usages of the `<Form>`, but it could be good to test this.

2. Introduces a new flow for choosing business extensions that was specified in woocommerce/woocommerce-admin#5287 issue description. Please check the issue for reviewing the designs. The simplest way to implement this, ended up being keeping the existing flow intact and where necessary copy pasting code from those components into the new flow. This new flow is only shown if your segmentation matches the following: `Stores that selected the US as the country and Other or Food & Drinks as the industry
2021-01-07 11:08:57 +13:00
Ilyas Foo 71877be8dc Reverts work done in woocommerce/woocommerce-admin#4857 for automated shipping after OBW is completed (https://github.com/woocommerce/woocommerce-admin/pull/5971)
* Reverts work done in woocommerce/woocommerce-admin#4857 for automated shipping after OBW is completed

* Remove ReviewShippingSettings note

* Update readme.txt

* Add wc-admin-review-shipping-settings to delete note list
2021-01-01 15:30:28 +08:00
Jeff Stieler c8c544f70c Support custom product attributes in advanced filter (https://github.com/woocommerce/woocommerce-admin/pull/5848)
* Add product attributes autocomplete for Search control.

* Support single selection in Search component.

* Fix SelectControl input after selection in single mode.

* Remove label from Search component's inner SelectControl.

Placeholder is the behavior we want to avoid label and selection collision.

* Match Search component selected prop to SelectControl.

It's passed through anyhow.

* Rework attribute filter to use new endpoints for custom terms.

* Hook up custom attribute filter to report queries.

* Fix errant space in filter name.

* Fix SelectControl active status when control is disabled.

* Fix SelectControl "has tags" logic for non-multiple use cases.

* Fix attribute filter screen reader text.

* Update changelogs.

* Move custom attribute test to it's own function.

* Remove SelectControl input disabling.

This was supposed to improve keyboard behavior for non-multiple controls, but it was questionable.

* Fix backspace in attribute term field.
2020-12-17 09:59:01 -05:00
Adrian Duffell 9a0ffaeca7 Add Docker app for PHP Test Suite (https://github.com/woocommerce/woocommerce-admin/pull/5297) 2020-12-17 21:02:10 +08:00
Jeff Stieler 1ce3fb1436 Add Product Attributes Endpoint (https://github.com/woocommerce/woocommerce-admin/pull/5840)
* Add new product attributes endpoint that allows searching.

Including custom attributes in the results.

* Add endpoint to fetch custom attribute values by slug.

* Add initial tests for Product Attributes endpoint.

* Test Product Attribute search.

* Fix schema/params for attribute terms endpoint.

* Add tests for custom term values endpoint.

* Add a LIMIT to the attributes query.

* Add endpoint to retrieve single attribute by slug.

Fixes the 'self' link.
2020-12-14 10:28:48 -05:00
louwie17 484e945460 Fix updating WC customer without wordpress user (if multiple orders are present) (https://github.com/woocommerce/woocommerce-admin/pull/5825)
* Create get last order function that does not rely on Wordpress user, and add test for use case

* Add change log

* Make sure tests use the right index for comparison

* Order by date_created_gmt first and order id second, and wrote test for get_last_order

* Fix test assertion, and remove unnecessary parameter
2020-12-10 09:42:17 -04:00
Moon 13a738558c Hide shipping cost task if user has disabled shipping (https://github.com/woocommerce/woocommerce-admin/pull/5850)
* Hide shipping cost task if user has disabled shipping

* Add countries array to dataEndpoints

* Export the presentational component so that it can be tested

* Add a test for the shipping component
2020-12-09 17:24:36 -08:00
Adrian Duffell 300504ea94 Fix inconsistent customer Type parameter in REST endpoints (https://github.com/woocommerce/woocommerce-admin/pull/5823)
The wc-analytics/reports/orders and /wc-analytics/reports/orders/stats endpoints have inconsistent parameter names for filtering the customer type: customer_type vs customer.

This was affecting the Customer Type filter in the orders analytics, reported in issue woocommerce/woocommerce-admin#5803, where the component expects the parameter names to be the same. This is because it uses a parameter name based on the key in the filter configuration (customer_type).

To resolve this, this PR updates /wc-analytics/reports/orders/stats to accept both customer_type and customer as parameter names for this filter. The customer parameter has however been deprecated in its description to discourage usage.

Co-authored-by: Sam Seay <samueljseay@gmail.com>
2020-12-07 06:39:29 +08:00