Commit Graph

496 Commits

Author SHA1 Message Date
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 06f99af525 Use gridicons as ReactElement versus SVG to fix blank screen (https://github.com/woocommerce/woocommerce-admin/pull/7237)
* Use gridicons as ReactElement versus SVG

* Add changelog
2021-06-24 11:18:29 -03:00
Sam Seay 77906db0ff Use sass-migrator to migrate division to math.div (https://github.com/woocommerce/woocommerce-admin/pull/7136) 2021-06-10 17:09:27 +08: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
louwie17 b642576e34 Remove the use of Dashicons and replace with `@wordpress/icons` or `gridicons` (https://github.com/woocommerce/woocommerce-admin/pull/7020)
* Updated mobile banner icon with cross-small gridicon

* Update analytics dashboard icons, removing use of dashicon

* Remove use of dash icon in tag component

* Remove dash icon from ellipsis menu

* Remove use of dashicon in calendar

* Update icon imports and remove use of Dashicon in collapsible list

* Remove Dashicon usage from store alerts as it is depreciated

* Remove dashicon usage in shipping label

* Fix up old css for icons

* Removed dashicon usage in favorite button

* Update the wordpress/icons package

* Add changelogs

* Fix broken test
2021-05-25 12:14:14 -03: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
Fernando 09d6bd9164 Fixed a few console errors in JS tests (https://github.com/woocommerce/woocommerce-admin/pull/6472)
* Fixed connect test

* Fixed plugins test

* Fixed stock panel tests

* Added changelog

# Conflicts:
#	readme.txt

* Removed blank line

* Changelog line removed

Co-authored-by: Fernando Marichal <contacto@fernandomarichal.com>
2021-03-04 09:15:03 -03:00
David Levin f00721fa3e Fix summary number style regression on analytics reports (https://github.com/woocommerce/woocommerce-admin/pull/5913)
* Update summary number styles

* Add changelog

* Add testing instructions

Co-authored-by: David Levin <davidlevin@Davids-MacBook-Pro-2.local>
Co-authored-by: Adrian Duffell <9312929+adrianduffell@users.noreply.github.com>
2021-03-02 13:07:35 +08:00
Joel Thiessen bb446c8543 Adding text content to new navigation toggle & chart period select for screen-reader visibility (https://github.com/woocommerce/woocommerce-admin/pull/6224) 2021-02-01 16:43:37 -08:00
Joshua T Flowers bc998444a3 Future proof experimental components (https://github.com/woocommerce/woocommerce-admin/pull/5961)
* Possibly use safe Text component

* Possibly use safe navigation components

* Add experimental package

* Update components to import from woocommerce/experimental

* Make experimental package private

* Reference experimental package relatively

* Update packages/experimental/README.md

Co-authored-by: Paul Sealock <psealock@gmail.com>

* Update packages/experimental/CHANGELOG.md

Co-authored-by: Paul Sealock <psealock@gmail.com>

* Update history state instead of mocking getQuery in tests

* Handle PR feedback

* Create excluded externals array and return early

Co-authored-by: Paul Sealock <psealock@gmail.com>
2021-01-07 18:57:09 -05:00
Joshua T Flowers 8d99e637c5 Update dashboard charts to use WP Card (https://github.com/woocommerce/woocommerce-admin/pull/5897)
* Update dashboard charts to use WP Card

* Fix lint and test errors
2020-12-21 14:06:41 -05:00
Joshua T Flowers 6a3b30a2b2 Update task list to use wp card component (https://github.com/woocommerce/woocommerce-admin/pull/5895)
* Update task list to use wp card component

* Fix lint errors
2020-12-21 14:05:29 -05:00
Moon 8fec9af1ad Check for empty spaces by trimming the values (https://github.com/woocommerce/woocommerce-admin/pull/5828) 2020-12-07 10:44:24 -08:00
Fernando 0801b56cd5 Store setup task list - purchase flow copy changes (https://github.com/woocommerce/woocommerce-admin/pull/5727)
* Changed purchase task copy

This commit changes the purchase task copy

* Changed modal copy

This commit changes the purchase modal copy and CTA button copy

Co-authored-by: Fernando Marichal <contacto@fernandomarichal.com>
2020-12-01 08:55:27 -03:00
Sam Seay be47d9d795 Only import the Gridicons we need, to reduce package size. (https://github.com/woocommerce/woocommerce-admin/pull/5668) 2020-11-19 09:52:24 +13:00
Sam Seay 5c50c4cc03 Restyle the setup task list to match new designs (https://github.com/woocommerce/woocommerce-admin/pull/5520)
Dev: Add the new `<Badge>` component to @woocommerce/components
Dev: Restyle the setup task list header to display incomplete tasks
2020-11-05 10:48:26 +13:00
Bec Scott 90567853de Enable the home screen for everybody (https://github.com/woocommerce/woocommerce-admin/pull/5108)
* One-shot to enable the homescreen for everybody

* Make the home page the default (only) experience

* remove option check in activity panel tabs, get tests working, fix lint issues

* Remove is-homescreen CSS class

* Remove extra home page route registration

Co-authored-by: Rebecca Scott <me@becdetat.com>
2020-09-15 09:44:46 +10:00
Bec Scott 5310944f17 Add option to not charge sales tax (https://github.com/woocommerce/woocommerce-admin/pull/5111)
* Add option to not set up sales tax

* Correct JS lint errors

* Add abort option to plugin step

* Inline redirect to home page

* Use testing-library/react for the new test

* Also set woocommerce_calc_taxes to 'no'

Co-authored-by: Rebecca Scott <me@becdetat.com>
2020-09-14 08:50:02 +10:00
Bec Scott cd128488df Add initial end to end test suite (https://github.com/woocommerce/woocommerce-admin/pull/5028)
Co-authored-by: Ron Rennick <ron@ronandandrea.com>
Co-authored-by: Rebecca Scott <me@becdetat.com>
Co-authored-by: Sam Seay <samueljseay@gmail.com>
2020-09-04 14:31:09 +12:00
Paul Sealock 3c6483e842 Remove wc api 🎉 (https://github.com/woocommerce/woocommerce-admin/pull/5075)
* remove wc-api selects and constansts

* remove extendedItems dependence on wc-api

* remove wc-api

* PR feedback
2020-09-04 09:45:40 +12:00
Jeff Stieler 5e7f2af61d Rename "profile" to "store details". (https://github.com/woocommerce/woocommerce-admin/pull/4965)
* Rename "profile" to "store details".

* Missed some /profiler links.

* Fix linter error.

* Store details => Setup Wizard.

* Rename task list item.
2020-08-27 08:10:23 -04:00
Joshua T Flowers d4dd74e44a Remove onboarding feature flag and a/b testing (https://github.com/woocommerce/woocommerce-admin/pull/4999)
* Remove store page creation during new onboarding experience

* Remove onboarding feature flag

* Add back in onboarding feature flag to enable feature loading
2020-08-25 00:51:41 +03:00
Jeff Stieler eea63f602f Refactor task list status to onboarding data store. (https://github.com/woocommerce/woocommerce-admin/pull/4998)
* Add onboarding task status API endpoint.

* Add task status to onboarding data store.

* Update appearance task to use onboarding store for status info.

* Update main task list component to use onboarding data store for status info.

* Clear onboarding status info "cache" when setting shipping rates in the task list.

* Clear onboarding status info "cache" when enabling payment methods from the task list.

* Fix onboarding data store reducer tests.

* Clean up redundant code, nest task status settings under new key for hydration.

* Include tasks status in onboarding data hydration.

* Update tax task to use onboarding data store for status info.

* Avoid continually rehydrating onboarding data.

* Refactor payment task method retrieval to use onboarding data store.

* Fix bug with disappearing appearance tax steps.

* Update appearance completion faster by using hydrated onboarding value.

* Avoid PHP warnings when onboarding isn't enabled.

* Remove unused imports.
2020-08-24 09:20:57 -04:00
Paul Sealock 74e8d7622e Items dataStore: Migrate from wc-api (https://github.com/woocommerce/woocommerce-admin/pull/5009)
* Create wp.data folder

* order panel

* fix isUnboundedRequest with Categories

* products report

* products table

* indicators and leaderboards

* orders and stock panels

* utils

* tests

* save

* updateStock

* remove wc-api items

* updateItems -> setItems
2020-08-21 11:37:41 +12:00
Daniel Bitzer d8098d6fd7 Adds `@woocommerce/tracks` package (https://github.com/woocommerce/woocommerce-admin/pull/5017)
* Add @woocommerce/tracks package.json

* Add @woocommerce/tracks .npmrc

* Move lib/tracks.js in to tracks package

* Add tracks package debug dependency

* Add readme for tracks package

* Add changelog for tracks package

* Add info about debugging and opt-ins to tracks package readme

* Load tracks package script

* Add tracks package to packages readme

* Add tracks package to webpack config

* Add tracks package external to starter-pack

* Replace lib/tracks uses with @woocommerce/tracks

* Update package-lock.json
2020-08-20 14:29:52 +09:30
Paul Sealock 8afad405d4 Remove unused lib/date (https://github.com/woocommerce/woocommerce-admin/pull/4987) 2020-08-18 09:53:13 +12:00
Joshua T Flowers 1d339174f8 Migrate reports data store to wp data (https://github.com/woocommerce/woocommerce-admin/pull/4966)
* Move controls to data package root

* Add reports data store in wp data

* Move report utils to data package

* Update error state and actions to match existing methods

* Update references to reports data store

* Add error setters

* Fix control registration path

* Add reports reducer tests

* Remove remaining report wc-api references

* Handle PR feedback

* reference packgage, not lib/date

Co-authored-by: Paul Sealock <psealock@gmail.com>
2020-08-14 14:19:04 +03:00
Jeff Stieler 5fbc511f25 Don't directly import from React, use @wordpress/element. (https://github.com/woocommerce/woocommerce-admin/pull/4978) 2020-08-13 08:29:29 -04:00
Paul Sealock c145783e0a Fix dependency declarations (https://github.com/woocommerce/woocommerce-admin/pull/4972)
* renmove WC comment block

* client routes

* more fixes

* moar search

* getting there

* by hand now

* david beating goliath

* mission accomplished

* client filepath

* save

* got it

* remove script

* fixes

* deal with package internal dep

* remove webpack alias

* fix webpack relative paths

* remove commented rule

* remove extra line

* remove unused modules entry
2020-08-13 14:05:22 +12:00
Sam Seay 0d95facf92 Task list - add a shortcut back to store setup (https://github.com/woocommerce/woocommerce-admin/pull/4853)
Fixes woocommerce/woocommerce-admin#4592

This adds the functionality to support a store setup tab displayed in ActivityPanel. The tab currently just redirects to the home page, rather than implementing the nice-to-haves of displaying the task list in the panel. The reason for this, is that I found it would require significant refactoring of the task list to support this currently.

As part of this I have also refactored rendering of tabs inside into 2 new functional components: <Tabs> and <Tab>. The reason for this is to decompose large untestable components, test them and by virtue of being decomposed they will also be more reusable in future. Ideally would have been refactored to a functional component as well, but it would have been too large a task.
2020-08-06 10:02:24 +12:00
Fernando a39e6fee62 Added personalization to purchase extension task (https://github.com/woocommerce/woocommerce-admin/pull/4849)
* Added personalization to purchase extension task

This commit adds personalization to purchase extension task

* Removed unnecessary naming fix

This commit removes an unnecessary naming fix

* Corrected param description

* Solved translation problem

* Naming corrected

The method 'getGroupedOnboardingProducts' was given a more accurate name.

* Modified string substitution

Co-authored-by: Fernando Marichal <contacto@fernandomarichal.com>
2020-08-03 16:24:57 -03:00
Darren Ethier dc5304823b Add @woocommerce/eslint-plugin (https://github.com/woocommerce/woocommerce-admin/pull/4714)
* add new woocommerce/eslint-plugin

* implement eslint-plugin (switch scripts to use wp-scripts etc)

* various linting fixes

* more lint fixes

* improve fix script

* more eslint fixes

* more eslint fixes

* temporary convert rules to warnings until they are all handled

* linting fixes

* update package-lock.json

* remove duplicates

* remove unnecessary `@wordpress/dependency-group` rule config

* add docs and adjust rules

* prettier fix

* fix merge artifact

* convert more rules to warnings

* change order to reflect importance

* install babel-preset-default

* remove unnecessary configuration for babel

* fix dependency group rule and test

* fix test

* handle collapsible whitespace

* add react testing library eslint plugin

* linter errors

* Add back in prettierrc

* package-lock update

* js lint fix with --fix

* disable whitespace in translation

* package-lock update

* make eslint actual dependency, not peer dependency

* pin eslint to v7

* I don't know why, but its working

* fix lint js

Co-authored-by: Paul Sealock <psealock@gmail.com>
2020-07-28 14:32:58 +12:00
Paul Sealock ac91a8fd60 Summary number bg (https://github.com/woocommerce/woocommerce-admin/pull/4858) 2020-07-28 11:45:36 +12:00
Paul Sealock 2b56a9c015 Dashboard: Fix filter extensibility (https://github.com/woocommerce/woocommerce-admin/pull/4758)
* pass filterQuery to components

* pass filters to charts

* apply formatting
2020-07-21 10:17:28 +12:00
Sam Seay b448ff60b7 Update @wordpress/base-styles and replace deprecated variables (https://github.com/woocommerce/woocommerce-admin/pull/4759)
Fixes woocommerce/woocommerce-admin#4732

This updates `@wordpress/base-styles`, and because `@wordpress/components` depends on variables from it, that must be updated as well.

There are 3 major changes required as part of updating:

1. The $theme-color variable is no longer exposed by base-styles. Instead there are 3 css vars exposed. These are made available by use of a provided mixin. Situations where $theme-color was darkened using scss have been mapped as best as possible to the 2 other darkened shades of the css var that are available such as `--wp-admin-theme-color-darker-20` and `--wp-admin-theme-color-darker-10`. In some cases this means the colors are not exactly the same as before.

2. The post css `theme()` call is no longer available. All uses of this have been consolidated to use of the main theme css var `--wp-admin-theme-color`. This means that calls like `theme(secondary)` or `theme(outline)` etc have all been consolidated to the one color.

3. Many of the variables used for different shades of gray have been deprecated. These have been mapped across to the new gray variables. (Mapped according to the list described in woocommerce/woocommerce-admin#4732)
2020-07-17 12:11:42 +12:00
Fernando a7a59583c9 Added skip profiler functionality (https://github.com/woocommerce/woocommerce-admin/pull/4721)
* Added skip profiler functionality

This commit adds the skip profiler functionality, leaving the Home screen `Store details` as incomplete.

# Conflicts:
#	client/task-list/tasks.js

* Unit tests repaiared

* Added OBW page

This commit makes the necessary changes to add an OBW page

# Conflicts:
#	client/profile-wizard/index.js

* Event name changed

This commit renames the event name we were recording since it was wrong.

* Redirection modified

This commit modifies the way we do redirection

# Conflicts:
#	client/profile-wizard/index.js

* Removed `profiler` feature flag

* Removed `profiler` feature flag

This commit removes the `profiler` feature flag

* Added error handling for `updateProfileItems`

This commit adds error handling for the method `updateProfileItems`

* Update client/profile-wizard/index.js

Co-authored-by: Matt Sherman <matt.sherman@automattic.com>

* Removed "throw" from "then"

* Update client/dashboard/index.js

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

* Update client/profile-wizard/index.js

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

* Modified redirection URL

This commit modifies the redirection URL.

# Conflicts:
#	client/task-list/tasks.js

# Conflicts:
#	client/profile-wizard/index.js

* Removed the variable "lastStep" and the related logic.

* Removed change of state for variable "skipped"

* Added error trowing to onboarding actions

This commit adds error trowing to onboarding actions

* Removed response handling for `updateProfileItems`

* Added default value for "profileItems" in Homescreen and Dashboard

* Removed `step` from OnboardingProfile and test

This commit removes the `step` from OnboardingProfile.php and from tests

Co-authored-by: Fernando Marichal <contacto@fernandomarichal.com>
Co-authored-by: Matt Sherman <matt.sherman@automattic.com>
Co-authored-by: Joshua T Flowers <joshuatf@gmail.com>
2020-07-16 12:17:10 -03:00
Joshua T Flowers 774fd910c2 Refactor Jetpack connection flows (https://github.com/woocommerce/woocommerce-admin/pull/4655)
* Resolve Jetpack connection URL on benefits screen

* Resolve Jetpack connection URL in connection stats

* Fix up error handling for Jetpack connection flows

* Remove autoConnect option from Connect component
2020-06-25 15:01:33 +03:00
Bec Scott 7011603c82 Fix dashboard task list menu placement (https://github.com/woocommerce/woocommerce-admin/pull/4664)
* Bring homescreen styles into task list so it is styled correctly in the dashboard view

* Copy homescreen card styles to new .woocommerce-dashboard-card class

* Move styles to dashboard stylesheet.

Co-authored-by: Rebecca Scott <me@becdetat.com>
Co-authored-by: Timmy Crawford <timmydcrawford@gmail.com>
2020-06-25 08:14:44 +10:00
Paul Sealock ee360d14b3 UserPrefs store: Introduce optimistic update (https://github.com/woocommerce/woocommerce-admin/pull/4637)
* optimistically save woo meta

* dashboard

* save only once
2020-06-23 09:25:01 +12:00
Jeff Stieler 9794fed139 Disable task list on analytics dashboard when homepage is enabled. (https://github.com/woocommerce/woocommerce-admin/pull/4617)
Regression from 8a2750c973.
2020-06-18 10:56:30 -04:00
Paul Sealock 03db742cdd Currency package: make naming clearer (https://github.com/woocommerce/woocommerce-admin/pull/4560) 2020-06-18 11:33:40 +12:00
Jeff Stieler 6e85cf977a Style cleanup from components update (https://github.com/woocommerce/woocommerce-admin/pull/4606)
* Fix secondary button style in OBW.

* Center snackbar notices in OBW.

* Scope snackbar changes to just the OBW.

* Add busy treatment to Jetpack connect button when redirecting.

* Remove color override for form toggles in ellipsis menus.

* Fix styling of task list.

* Fix button styles in date range picker component.

* Use admin theme colors in calendar component selections.

* Fix datepicker styling on analytics settings page.
2020-06-17 08:58:35 -04:00
Paul Sealock fea332b5b4 Change homepage to homesceen (https://github.com/woocommerce/woocommerce-admin/pull/4549) 2020-06-15 14:17:12 +12:00
Joshua T Flowers 0eb906f56d Use single dash for country/state dropdown options (https://github.com/woocommerce/woocommerce-admin/pull/4553) 2020-06-12 10:47:14 +03:00
Paul Sealock 41481a7299 Button: Remove deprecated isDefault (https://github.com/woocommerce/woocommerce-admin/pull/4548) 2020-06-12 07:22:20 +12:00
Paul Sealock d7aec170f1 Runtime feature config override (https://github.com/woocommerce/woocommerce-admin/pull/4523) 2020-06-11 12:26:20 +12:00
Paul Sealock 41eeb4f9f9 Options: Add data store (https://github.com/woocommerce/woocommerce-admin/pull/4144) 2020-06-11 11:49:27 +12:00
Jeff Stieler 8a2750c973 Migrate user store to wp.data (https://github.com/woocommerce/woocommerce-admin/pull/4505)
* Initial user preferences custom hook (wc meta).

* Organize dependencies.

* Specify dependencies in useSelect() call.

* Remove specifying preference keys.

There's currently no performance benefit to be had.

* Add HoC for hydrating current user data.

* Add user prefs update method.

* Export user prefs hook and HoC in data package.

* Handle error condition when updating user preferences.

* Use closure to get user ID for prefs update.

* Refactor analytics dashboard to use new user hook.

* Refactor ReportTable component to use new user hook.

* Move prop access to top of function component.

* Add todo for potential manual resolution logic.

* Refactor DashboardCharts component to use new user preferences hook.

* Move code out of functional component where possible.

* Fix chart interval query property.

* Refactor Leaderboards component to use new user preferences hook.

* Move code out of functional component where possible.

* Refactor Inbox panel to use user prefs hook.

@todo - updating last read isn't working.

* Use user prefs hook in StatsOverview component.

* Export user preferences store name.

* Use new store for unread inbox indicator.

* Hydrate current user data higher up in the app.

* Update "last read" timestamp in inbox panel.

* Fix StatsOverview test.

* Remove unused dispatch method from StorePerformance component.

* Remove now defunct user methods from wc-api spec.

* Add tests for isRequesting.

* JSON decode WC meta on updated user object.

* Test user prefs retrieval and save.

* Remove todo comment.

* Use user prefs hook in Jetpack install CTA on homepage.
2020-06-10 11:46:46 -05:00
Fernando 289636abba Modified layout.js withSelect (https://github.com/woocommerce/woocommerce-admin/pull/4480)
* Changed some API responses

This commit adds changes to some API responses

* Changed "woocommerce_task_list_complete" loading in frontend

* Updated "$migrated_options" array

This commit updates "$migrated_options" array and adds a deletion control

* Changed "taskListComplete" in customizable.js

Co-authored-by: Fernando Marichal <contacto@fernandomarichal.com>
2020-06-10 10:33:30 -03:00
Paul Sealock 134be1c08b Update/@wordpress components base styles (https://github.com/woocommerce/woocommerce-admin/pull/4427) 2020-06-10 13:55:06 +12:00
Bec Scott b4c735f0de Jetpack stats on home page (https://github.com/woocommerce/woocommerce-admin/pull/4481)
* Get Jetpack stats appearing on the home page

* Update hidden stats in stats overview test

* Make jetpack stats appear by default

* Add reportUrlType to dashboard store performance area

Co-authored-by: Rebecca Scott <me@becdetat.com>
2020-06-05 09:14:55 +10:00
Paul Sealock 7f8149563b Homescreen: Add option to disable (https://github.com/woocommerce/woocommerce-admin/pull/4450)
* Add homescreen option

* change opt name to homescreen
2020-06-04 08:42:30 +12:00
Paul Sealock 4cddf7f671 Remove old OBW wc-api method (https://github.com/woocommerce/woocommerce-admin/pull/4469) 2020-05-30 22:59:10 +12:00
Paul Sealock 16cb332f28 IconButton: Replace with Button (https://github.com/woocommerce/woocommerce-admin/pull/4415) 2020-05-29 14:32:37 +12:00
Joshua T Flowers d14fd4dbe1 Migrate onboarding data store to wp data (https://github.com/woocommerce/woocommerce-admin/pull/4433)
* Migrate onboarding from wc-api to wp-data store

* Add tests for onboarding reducer

* Update references to onboarding data store

* Update tests for replacing profileItems

* Add onboarding hydration for profile items

* Prevent store from being registered twice

* Add requesting state to onboarding store

* Prevent duplicate registration on all wp data stores

* Update more components to use new wp data onboarding store

* Add tests for onboarding requesting state

* Update isRequesting to use isOnboardingRequesting
2020-05-28 11:51:40 +03:00
Jeff Stieler cd146b388e Update TaskList design (https://github.com/woocommerce/woocommerce-admin/pull/4434)
* Update task list to closer match new designs.

* Update TaskList placeholder to match the new design.

* Hook up store details task click.

* Don't show "skip" prompt for task list on new home screen.

* Update time estimates for tasks.

* Add progress indicator to TaskList.

* Use null container for store details task.

* Fix progress bar styling.

* Just use card menu for TaskList dismissal.

* Don't show TaskList on analytics overview if homepage feature is enabled.

* Initial refactor of TaskList to use WP card.

* Style TaskList items and card header.

* Style "hide" button for TaskList.

* Don't show TaskList after it's completion.

* Don't show TaskList placeholder when options are still loading.

Avoid a potential flash of the placeholder without showing the TaskList.

* Fix border radius on progress bar.

* Fix TaskList header style with homepage feature disabled.

* Remove defunct function.

* Remove unnecessary import.

* Some minor color tweaks (https://github.com/woocommerce/woocommerce-admin/pull/4436)

* Colors

* Only show time estimation for incomplete tasks

* Don't show chevron on completed tasks.

Co-authored-by: Jeff Stieler <jeff.m.stieler@gmail.com>

* Preload task list completed option, show placeholder when loading.

* Fix alignment of "hide this" button.

Co-authored-by: James Koster <james@jameskoster.co.uk>
2020-05-27 10:08:39 -06:00
Paul Sealock 96a4856940 OBW: Get utils plugins data from wp.data (https://github.com/woocommerce/woocommerce-admin/pull/4362)
* OBW: utils, get plugins from dataStore

* better

* add installedPlugins argument
2020-05-25 12:26:08 +12:00
Jeff Stieler 3c8490c26b Add existing TaskList component to new home screen (https://github.com/woocommerce/woocommerce-admin/pull/4378)
* Move TaskList component up in directory tree.

* Render the TaskList on the new home screen.

* Render single tasks in isolation on new home screen.

* Fix "is requesting" selection for options API.

* Add loading placeholder for TaskList.

* Add initial test for the task list on the home screen.

* Fix dynamic imports under test.

* Add test for inline TaskList on home screen.

* Test that single task view works on new home screen.

* Restore Jest mocks between tests.

* Fix linting errors.
2020-05-21 11:15:08 -06:00
Paul Dechov 0972cac0d0 Task List: Small fixes and adjustments to WCPay task (https://github.com/woocommerce/woocommerce-admin/pull/4373)
* Fix WCPay task Settings link

Fixes woocommerce/woocommerce-admin#4293 by setting link type for new pageload.

* Check for success query param to show notice

* Shrink WCPay task footnote so it fits in one line

* Remove unnecessary Fragment wrapper

* Omit option update from client side

The payment method is already enabled when the connection is finalized on redirect.
2020-05-20 14:25:28 -04:00
Joshua T Flowers 1f11358cfb Separate Jetpack connection logic in shipping task (https://github.com/woocommerce/woocommerce-admin/pull/4381)
* Separate Jetpack connection logic in shipping task

* Don't check for Jetpack activation on Connect step
2020-05-20 12:43:09 +03:00
Daniel Bitzer c6371c32db Fix in app purchase back link for recommend marketing extensions card (https://github.com/woocommerce/woocommerce-admin/pull/4301)
* Add getInAppPurchaseUrl lib function

* Implement getInAppPurchaseUrl for marketing tab

* Include the directory with the wccom-site param

* use getInAppPurchaseUrl helper function in onboarding CartModal component

* Fix 'addQueryArgs' is defined but never used

* Fix Missing JSDoc @return description

* Make connectNonce setting a global setting rather than a marketing once

Co-authored-by: Jason Conroy <jason@findingsimple.com>
2020-05-20 15:03:58 +09:30
Joshua T Flowers 65145bf92c Add Jetpack connection to plugin benefits step (https://github.com/woocommerce/woocommerce-admin/pull/4374)
* Allow updateActivePlugins to add new plugins instead of replace

* Add autoConnect prop to Jetpack Connect component

* Add connect component to plugin benefits screen

* Add onError and missing prop types for Connect

* Update redirect URL after Jetpack connection

* Add tests for added active plugins

* Skip install if plugin error exists

* Update active and installed plugins to use replace flag

* Update tests to handle replace flag

* Refactor plugin install flow pending state
2020-05-19 12:47:25 +12:00
Paul Sealock 8430b1cba7 Homepage: Add stats numbers (https://github.com/woocommerce/woocommerce-admin/pull/4288) 2020-05-14 15:23:03 +12:00
Jeff Stieler 3e48eba385 Get installed plugins from new plugin settings object. (https://github.com/woocommerce/woocommerce-admin/pull/4357) 2020-05-12 18:29:41 -06:00
Paul Sealock 3fc69b9739 Homepage: Add stats overview selection (https://github.com/woocommerce/woocommerce-admin/pull/4264)
* Homwpage: add stats overview stat toggle

* toggle stats

* fix

* tests

* better hook name

* clean up

* add back in Fragment

* remove extra prop

* better test name
2020-05-05 10:58:39 +12:00
Joshua T Flowers 586760c561 Adds the onboarding payments note (https://github.com/woocommerce/woocommerce-admin/pull/4157)
* Save payment skipped and event timestamp to options

* Add payments note

* Convert payments task timestamp to seconds

* Skip payments note if skip timestamp is not set
2020-05-04 14:33:11 +03:00
David Stone 8ebd33fe6b Use Route based code splitting to optimize bundle size (https://github.com/woocommerce/woocommerce-admin/pull/4094)
* Use lazy loading to split up the size of the js downloaded

* Use lazy loading to split up the size of the js downloaded

* Add Moment Timezone plugin to reduce size of data file.

* Lazy load header panels and use Dashicons for faster loading

* Load assets from the correct publicPath

* Load assets from the correct publicPath

* PHP cs fixes

* Fix missing quotes on string literal.

* Fix PropType warning for lazy loaded component.

* Separate the task list and dashboard chunks.

* Lazy load dashboard sections.

* Restore original icons and reduce size by importing only the icons needed

* Lazy load alerts to save more Kb on initial load

* Minify built JS in production mode.

* Add preload tags for WC Admin assets. (https://github.com/woocommerce/woocommerce-admin/pull/4162)

* Fix linting errors.

* Add modified UnminifiedWebpackPlugin.

* Produce minified and unminified bundles for all builds.

* Remove unused variable from webpack config.

* Run unminify after sourcemap generation.

* Only hook after optimization if we're using a devtool.

* Add minification suffix in Loader::get_url().

* Lazy load OBW on new home screen.

* Move OBW style up a level to layout.

* Hydrate ProfileWizard independently of withSelect and withDispatch

* Fix order of composition and fallback function when using hydration.

Co-authored-by: Jeff Stieler <jeff.m.stieler@gmail.com>
Co-authored-by: Paul Sealock <psealock@gmail.com>
2020-04-29 12:01:27 -06:00
Jeff Stieler e893ce3c54 Fix OBW when new home screen is enabled. (https://github.com/woocommerce/woocommerce-admin/pull/4215)
* Move ProfileWizard component out of Dashboard.

* Don't trigger the OBW from the Analytics Dashboard (with new home screen).

* Trigger OBW from the new home screen.

* Fix duplicate import.
2020-04-27 08:56:15 -06:00
Jeff Stieler 6140e7994f New home screen pageview tracking (https://github.com/woocommerce/woocommerce-admin/pull/4189)
* Specify home screen in tracks event when enabled.

* Add Jetpack info to home page Tracks event.

* Use @wordpress/data's withSelect - no need for wc-api.

* Add plugins hydration to existing compose() call.

* Safer access of wcSettings object in plugins hydration.

* Remove redundant plugins hydration from TaskList and ProfileWizard.
2020-04-27 08:41:26 -06:00
Job 41f3859ad5 Change "Demo" to "Sample" products (https://github.com/woocommerce/woocommerce-admin/pull/4184)
* Change "Demo" to "Sample" products

A few years ago we had a discussion on the name of the files for test products and we choose "sample" data over "dummy" data. I think we should likely stick to that naming (which is also the name of the folder and the files in WC core: https://github.com/woocommerce/woocommerce/tree/master/sample-data)

This commit changes that wording

* Small update in caps of "Build a better WooCommerce"

All titles and questions in the new onboarding wizards only capitalise names and the first letter of the sentence. This seemed a tiny bit off.
2020-04-24 12:23:45 +02:00
Rasmy Nguyen 4fd6a17154 Remove auto connect functionality from Stripe payment task (https://github.com/woocommerce/woocommerce-admin/pull/4164)
* Remove auto connect steps from Stripe payment task

As of May 31 the API for stripe account auto creation will no longer be
supported. As a result, the Stripe payment on-boarding step will no
longer be able to auto create accounts for users.

This removes all auto connect functionality from this step, and instead
falls back to the oAuth setup flow.

See:
https://wcpay.wordpress.com/2020/02/06/stripe-ending-support-for-the-deferred-account-activation-api-on-may-31/#comment-2080

* Fix logic to decide which connect method to render

When the Stripe component renders for the first time, it
always returns the manual connect method. This is because there is
an additional call to requiresManualConfig() in getConnectStep which
looks for values in activePlugins that won't be present on the initial
component render.

This removes this check and instead relies on the isPending state to
help decide to render a connect method or wait for oAuth connectURL
to finish fetching.

* Remove redundant error modal render method

This removes the error modal render method as it is also no longer
needed with the removal of auto account creation.

This also removes errorMessage and errorTitle state along with any
references to these values.
2020-04-24 09:28:29 +09:00
Fernando 9712f4259c OBW: "activated" success message upon continuing with existing theme (https://github.com/woocommerce/woocommerce-admin/pull/4148)
* Changed element that is compared after choosing a theme

Onboarding - There was a problem in the theme verification where at the end of the profiler it always went into the installation flow. This problem was solved in this commit.

* Added check to choose the right flow (install or activate plugin)

Co-authored-by: Fernando Marichal <contacto@fernandomarichal.com>
2020-04-21 09:13:04 -03:00
Joshua T Flowers acd158057c Add profiler step view tracks (https://github.com/woocommerce/woocommerce-admin/pull/4141)
* Add profiler step view tracks

* Track plugins to install on benefits screen

* Use getCurrentStep method instead of prop query to check step
2020-04-21 12:19:32 +03:00
Paul Sealock 8e22e30228 OBW: respect Store Location async (https://github.com/woocommerce/woocommerce-admin/pull/4149)
* OBW: respect Store Location async

* Fix "Configure" button on "Configure tax rates" step

* Wait and check for settings errors when updating automated tax

* remove this.completeStep() froom async callback

* Revert "remove this.completeStep() froom async callback"

This reverts commit 51a43b31d779db6aa4587ee1dd0a8fb012728439.

* Check if update hasn't already put user on success screen

Co-authored-by: Matt Sherman <matt@jam123.com>
2020-04-21 12:12:38 +12:00
Paul Sealock 28c85668fb Plugins: Move API out of Onboarding (https://github.com/woocommerce/woocommerce-admin/pull/4093)
* Plugins DataStore: decouple from onboarding (https://github.com/woocommerce/woocommerce-admin/pull/4048)

* Plugins DataStore: Add client side store

* change active_plugins to public static function

* don't change shape of allowed plugins
2020-04-20 14:04:13 +12:00
Paul Sealock c500d3fa98 Plugins DataStore: decouple from onboarding (https://github.com/woocommerce/woocommerce-admin/pull/4048)
* Plugins DataStore: Add client side store
2020-04-17 11:58:36 +12:00
Paul Sealock 67b417af03 Store details: check if industries exist before trimming (https://github.com/woocommerce/woocommerce-admin/pull/4120) 2020-04-14 11:46:41 -07:00
Paul Sealock 61f650a2a2 OBW: allow CBD only for US stores (https://github.com/woocommerce/woocommerce-admin/pull/4117)
* OBW: allow CBD only for US stores

* fix if user goes back

* industry.js feedback

* store-details feedback

* better naming
2020-04-14 13:41:51 +12:00
Fernando b96ee37992 Onboarding - business details step: increase max-height on competitors listbox (https://github.com/woocommerce/woocommerce-admin/pull/4111)
* Enlarged competitors' Listbox in the Onboarding

Onboarding - Added a new class to enlarge the competitors' Listbox in the Business details step.

* Replaced fixed height with unset

Co-authored-by: Fernando Marichal <contacto@fernandomarichal.com>
2020-04-13 11:43:57 -03:00
Fernando 1e1daaa6bb Added check to show WC Pay option only when Jetpack is connected (https://github.com/woocommerce/woocommerce-admin/pull/4105)
* Added check to show WC Pay option only when Jetpack is connected

A verification was added to the Setup Checklist payment step, to show WC Pay option only when Jetpack is connected

* Changed the solution approach

Co-authored-by: Fernando Marichal <contacto@fernandomarichal.com>
2020-04-10 11:10:47 +12:00
Fernando 866487ee27 Bugfix on payments step in CBD flow (https://github.com/woocommerce/woocommerce-admin/pull/4061)
* Bugfix on payments step in CBD flow

The `array_search` method was changed to `in_array`

* After pressing Connect a new tab opens with the Square webpage

* Updated behavior for non CBD Square payment connection

* Square option's name updated

* Replaced <p> tag with a <div> tag

Since there was a `validateDOMNesting` warning because we weren't adding only text inside a <p> tag, the `p` tag was changed to a `div`.

Co-authored-by: Fernando Marichal <contacto@fernandomarichal.com>
2020-04-08 16:17:32 -07:00
Timmy Crawford acfae2c356 Setup Checklist: Remove Setup Menu Item and I'll Do This Later link (https://github.com/woocommerce/woocommerce-admin/pull/4085)
* Remove  menu item

* Remove 'do this later' link
2020-04-08 14:27:24 -07:00
Timmy Crawford 28a43f18c1 Setup Checklist: Fix exception in shipping. (https://github.com/woocommerce/woocommerce-admin/pull/4071) 2020-04-08 08:19:38 -07:00
Joshua T Flowers 94eec721c0 Fix double prefixed wcadmin events (https://github.com/woocommerce/woocommerce-admin/pull/4065) 2020-04-08 14:35:16 +03:00
Jeff Stieler ecd0568c8c OBW: fix use of unbound this in business details step. (https://github.com/woocommerce/woocommerce-admin/pull/4070) 2020-04-07 12:08:17 -06:00
Paul Sealock cb4ba39e30 Dynamic Currency with Context API (https://github.com/woocommerce/woocommerce-admin/pull/4027)
* Make currency setting dynamic with context API

* reference Currency

* what is 'this'

* remove comment

* All report tables

* Customers report

* activity panel

* leaderboard test

* business details

* store details

* single source of truth

* shipping rates

* remove currency-format.js

* tidy up

* make Currency a factory function

* factory revenue table

* tables

* Chart y-axis labels

* customers table

* cleanup

* business details

* shipping

* number-format

* stock and downloads tables

* changelog

* cleanup

* SQL example: update to dynamic currencies (https://github.com/woocommerce/woocommerce-admin/pull/4033)
2020-04-03 10:54:38 +13:00
Brent Shepherd 7cf441038f Update WC Pay Dev Mode doc link (https://github.com/woocommerce/woocommerce-admin/pull/4026)
Updates placeholder doc link added in woocommerce/woocommerce-admin#3978
2020-04-01 08:26:50 -07:00
Joshua T Flowers 1f7ca63289 Onboarding: Remove plugins step from profiler (https://github.com/woocommerce/woocommerce-admin/pull/3974)
* Use plugin component with autoinstall in benefits step

* Cache plugins to install to prevent render changes on install

* Add busy state to button when installing

* Prevent multiple requests being fired when awaiting next step

* Disable buttons when actioned
2020-04-01 08:24:51 -07:00
Jeff Stieler 92a0f19058 Update default dashboard view. (https://github.com/woocommerce/woocommerce-admin/pull/4035)
* Hide some more performance indicators by default.

Don't show: AOV, Returns, Gross Sales.

* Fix default hidden dashboard chart identifiers.

They were missing the expected endpoint prefix.
2020-03-31 18:58:06 -06:00
Jeff Stieler 0fd403ea20 Fix aria-label attribute. (https://github.com/woocommerce/woocommerce-admin/pull/4034) 2020-03-31 18:57:40 -06:00
Jeff Stieler f8bc173cfb Only query requested stat totals in reports. (https://github.com/woocommerce/woocommerce-admin/pull/4009)
* Pass specified totals/intervals fields parameter to the Order Stats Query.

* Only request stats used in render for report summaries and charts.

Implement Orders as an example.

* Specify stats fields for all report requests.

* Add 'fields' parameter handling to all stats endpoint controllers.

* Reduce stats fields requested by dashboard charts.
2020-03-31 09:08:40 -06:00
Allen Snook a33a65222c Use a Recommended pill (not a ribbon) for WooCommerce Payments (https://github.com/woocommerce/woocommerce-admin/pull/4024)
* Use recommend pill not ribbon for wcpay

* Tweak CSS, dark purple too plz
2020-03-31 05:58:11 -07:00
Allen Snook 078de3e9c0 Merge add/wc-pay to master, enabled for development only (https://github.com/woocommerce/woocommerce-admin/pull/4022)
* Add feature flag for wcpay (https://github.com/woocommerce/woocommerce-admin/pull/3958)

* Add card to payments task for WooCommerce Payments (https://github.com/woocommerce/woocommerce-admin/pull/3978)

* Add card to payments task for WooCommerce Payments

* Add missing plugin and settings PHP constants for woocommerce payments

* Add endpoint to return url to kick off wcpay

* Fix incorrect option name

* I can haz purple with white text, plz

* Linkify TOS, settings

* Recommend wcpay when visible; move wcpay to list top

* Test for wcpay feature flag

* Improved handling of feature flag

* If the user is an agency, include wcpay docs link on card

* Reverse agency logic, LOL

* Camel case fillRule etc

* Turn off wcpay for core and plugin for now
2020-03-27 16:24:32 -07:00
Matt Sherman 0f18d6a326 Change "Google Shopping" to "Google Ads" and update Google Ads logo (https://github.com/woocommerce/woocommerce-admin/pull/4007) 2020-03-27 13:18:27 -04:00
Paul Dechov 0e5cfb23c0 Onboarding: only validate other platform name for 'other' selling venues (https://github.com/woocommerce/woocommerce-admin/pull/4011)
Omit validation error (and resulting disabled "Continue" button) on the other platform name text field, in an edge case where the field is first required but value is missing, and then no longer required.
2020-03-27 11:57:25 -04:00
Darren Ethier 783f613815 wp.data Settings refactor
add data store for settings using wp.data

add use-select-with-refresh example

replace fresh-data usage with new settings data store for settings page

Add data package

move to packages

Fix isDirty after save

Add isBusy to primary button when saving

update Readme

remove comment

readme to use useSelect

Revert "update Readme"

This reverts commit 7402fd49b8f384fde5878e0bee0616f0a87bb4f6.

Data Layer: Settings page to use Settings store (https://github.com/woocommerce/woocommerce-admin/pull/3430)

* Data Layer: Settings store as source of truth for settings page

This reverts commit 7402fd49b8f384fde5878e0bee0616f0a87bb4f6.

* fixup

* save on reset

* non mutable constants

* add set/getSettings

* save using setSettings

* separate HOC

* cleanup

* remove settingsToData

* withHydration

* remove withSettings HOC

* renmove useSettins for now

* withSettingsHydration updates

* Revert "withSettingsHydration updates"

This reverts commit f2adf108fbe19b574978fea5925a1a18e7ed3007.

* rename withSettingsHydration

* redo withSettingsHydration simplification

* restore

* useSettings

* render using useSettings

* handleInputChange working

* get setIsDirty working

* saving works

* reset and cleanup

* cleanup

* use snake case on hook files

* use clearIsDirty

* Avoid mutation on setting update

* remove @todo

* persiting -> isPersisting

* better reducer ternaries

* add wcSettings as arg to withSettingsHydration

reset package-lock

Settings: split out mutable wcAdminSettings (https://github.com/woocommerce/woocommerce-admin/pull/3675)

Settings: handle async settings groups (https://github.com/woocommerce/woocommerce-admin/pull/3707)
2020-03-25 16:20:17 +13:00
Joshua T Flowers 1088a0ce8c Onboarding: Add task completion and task list completion tracks (https://github.com/woocommerce/woocommerce-admin/pull/3967)
* Refactor logic for showing dashboard reports and tasklist

* Check for complete option status instead of visible tasks in dashboard

* Update task list status on task list completion

* Track task completion event server-side on option add

* Add option to track previousdly completed events

* Track previously untracked tasks on option update
2020-03-23 13:47:12 -07:00
Joshua T Flowers 1db98a78d9 Onboarding: Create flat rate and free shipping methods from task list (https://github.com/woocommerce/woocommerce-admin/pull/3927)
* Get flat rate and free shipping methods in Rates component

* Update shipping methods by type

* Disable all shipping methods except the one being updated

* Update toggleEnabled to be toggleable for readability

* Check if shipping method has cost before getting value
2020-03-23 17:25:02 +02:00
Fernando cbf0405b95 Onboarding - payments task: filter payment gateways if the user selects CBD (https://github.com/woocommerce/woocommerce-admin/pull/3745)
* Added redirect for the specified conditions

Added redirect to "https://squareup.com/t/f_partnerships/d_referrals/p_woocommerce/c_general/o_none/l_us/dt_alldevice/pr_payments/?route=/solutions/cbd" for the specified conditions

* Added control for CBD payments gateways

Added control for CBD payments gateways. Now only Square is available for CBD

* Changed CBD industry control

* Added 'hasCbdIndustry' declaration in methods.js

Co-authored-by: Fernando Marichal <contacto@fernandomarichal.com>
2020-03-20 15:33:18 -03:00
Fernando 675591a593 Onboarding: Modified the recorded data in profile wizard (https://github.com/woocommerce/woocommerce-admin/pull/3929)
* Onboarding: Modified the recorded data in profile wizard

In the second step of the profile wizard, now 'industries_with_detail' is a 'string' instead of an 'object'.

* Selected industries converted to a string

Selected industries are converted to a string to send to recordEvent

Co-authored-by: Fernando Marichal <contacto@fernandomarichal.com>
2020-03-19 09:13:14 -03:00