Commit Graph

397 Commits

Author SHA1 Message Date
Joshua T Flowers 53dde217f6 Handle multiple plugin installs in a single request (https://github.com/woocommerce/woocommerce-admin/pull/4411)
* Allow plugins API to install multiple plugins at once

* Update wpdata to handle installing multiple plugins and errors

* Remove client-side error message switch

* Update plugin tests for multiple plugins param

* Update plugins API to WP standards

* Add error for non-allowed plugins instead of silently failing

* Allow error handling for individual plugins

* Fix up js tests for new API response

* Add installed plugin to response on successful install
2020-05-27 10:28:13 +03:00
Joshua T Flowers cbc96b0253 Refactor notes and conditions for adding notes (https://github.com/woocommerce/woocommerce-admin/pull/4340)
* Add note traits to check for existence and generic conditions

* Add new note type for marketing notes

* Delete marketing notes when opted out

* Add tests for marketing notes
2020-05-22 16:48:40 +03: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
Ron Rennick 6720c17140 update unit test bootstrap for WC 4.2 (https://github.com/woocommerce/woocommerce-admin/pull/4312) 2020-05-13 09:56:05 -03:00
Joshua T Flowers 6fd251bfe4 Adds Jetpack stats to performance indicator endpoints (https://github.com/woocommerce/woocommerce-admin/pull/4291)
* Move allowed report analytics data to separate function

* Add function to retrieve allowed Jetpack module endpoints

* Fix API urls

* Add number format as default for jetpack modules

* Add module permissions and format to array

* Add filter for returned data from performance indicators API

* Filter jetpack stats by queried dates

* Fix empty date query filtering

* Mock the Jetpack API response

* Add tests for Jetpack stats in allowed endpoints

* Add tests for filtering Jetpack stats based on time

* Add tests for default args
2020-05-13 14:52:32 +03:00
Matt Sherman f639d4a32e Remove obsolete inbox messages (https://github.com/woocommerce/woocommerce-admin/pull/4182)
* Remove welcome note
* Remove store notice setting note
* Remove review your experience note
* Add tests for delete_notes_with_name
* Add filter support so that other code can add notes to be deleted on upgrade.
2020-05-05 15:38:16 -04: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 ea2c2f7707 Fix sorting to push Storefront to the top of the theme list (https://github.com/woocommerce/woocommerce-admin/pull/4187)
* Fix sorting to push Storefront to the top of the theme list

* Add test to ensure Storefront is sorted in get_themes()

* copy paste cleanup

* Refactor sorting logic.

* Fix linting errors

* Updates per feedback.

* Add check for products property

* Fix for 5.6 CI.

* Oh hey another CI fix

Co-authored-by: Timmy Crawford <timmydcrawford@gmail.com>
2020-04-28 14:47:05 -07:00
Chris Shultz 65f7a0cf7d Remove A/B testing from order page shipping prompt. (https://github.com/woocommerce/woocommerce-admin/pull/4180) 2020-04-23 10:33:42 -07: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
Steve Grunwell 27704012a6 Enable the default homepage template to be filtered (https://github.com/woocommerce/woocommerce-admin/pull/4072)
This commit adds the "woocommerce_admin_onboarding_homepage_template" filter, enabling themes/plugins to filter the default homepage template created by the WooCommerce onboarding process.
2020-04-09 09:26:03 +12:00
Jason Conroy e5bd8f3184 Marketing Tab MVP (https://github.com/woocommerce/woocommerce-admin/pull/3953)
* Add Marketing feature flag

* Add marketing page and menu item

* Register marketing page with layout controller

* Add initial marketing cards

* Add max-width to marketing overview page

* Add initial marketing WelcomeCard component

* Make marketing welcome card permanently dismiss

* Add a readme for the marketing page components

* Record tracks event when marketing welcome dismissed

* Match design width

* Add welcome image and initial styles

* Use gridicon for close button

* Fix whitespace

* Add PluginsHelper::get_plugin_data()

* Add initial Marketing\InstalledExtensions class

* Preload installed marketing extensions data

* Tweak extension statuses

* Add InstalledExtensionRow component

* Add initial extension data to InstalledExtensions card

* Refactor PluginsHelper::get_plugin_data method

Using the new get_plugin_path_from_slug method

* Ensure get_plugins() function is available for PluginsHelper

* Simplify using PluginsHelper method

* Add MailChimp configured status logic

* Add links to InstalledExtensionRow component

* Add key prop to extensions list

* Setup styles for InstalledExtensions card

* Display nothing if no installed extensions

* Add InstalledExtensions::get_allowed_plugins()

* Setup Marketing Overview API controller

* Add /activate-plugin marketing endpoint

* Add more extensions URL props

* Add Facebook extension configured status logic

* Update Facebook extension URL props

* Fix extenion data logic

* Move component into it’s own directory

* Setup /marketing/overview/recommended endpoint

* Initial marketing page card header styles

* Add basic extension data to RecommendedExtensions

* Use color as variable

* Tweak card header padding for design

* Add basic styling to RecommendedExtensions card

* settingsUrl is not available if the plugin is not active

* Add /marketing/overview/installed-plugins REST endpoint

* Add basic activation functionality to InstalledExtensions component

* Don’t throw error on success

* Add MVP data store for installed extensions card

* Add core dark blue color variable

* Add styles for installed extensions card

* Move knowledge-base component to its own directory

* Pull recommended marketing plugins from remote test site

* Hide description when configured

As per design

* Tweak colors based on design

* Finish off styling for RecommendedExtensions

* Limit recommended extensions to 6 items

* Add error handling to RecommendedExtensions card

* Rename ‘copy’ extension prop

* Add marketing button component to match design

* Create ProductIcon component for marketing

* Add InstalledExtension icons

* Fix icon image paths

* Add ProductIcon to InstallExtensionRow

* Final styling to installed extensions card row

* Knowledge base card placeholders

* Fix missing icons when plugin not activated

* Remove logging

* Tweak array structure to ensure we have an array in JS

and not an object

* Refactor KnowledgeBase marketing component

- We don’t need loop through every post when rendering, just pick the posts we need
- Remove unused classes

* Move padding from each slide to the container

* Improve slider animations by absolute positioning the slides

* Reduce the slider animation timeout and add a note

* Add in-app purchase flow url params for recommended extensions

* Fix slider animation

* Reset slider height on window resize

* Short slider animation, fix double margin on smaller screens

* Add initial marketing/knowledge-base endpoint

* Pull knowledge base posts from API

* Rename welcome card dismiss tracks event

* Record event on recommended product click

* Recond onclick events for installed extensions card

* Record event when carousel navigation clicked

* img elements must have an alt prop

* Remove import that is never used

* use camelCase

* Decode HTML entities from API call

* Remove unused container div

* Add card loading state

* Add images to knowledge base card

* Link knowledge base posts

* Use the Pagination component rather than duplicate it’s functionality

* Clean up and rename knowledge base slider

* Clean knowledge base CSS and update responsive styles for single post slide

* Add a README for button component

* Add README for product icon component

* Add initial readme for Slider component

* Add correct image sizes to knowledge base slider, finalize styles

* Fix extension link urls

* Resolve some code formatting issue

* Bind class click methods to this

* Wrap nodes in Fragment

* Fix wccom-back path

* Add placeholder author and gravatar

Default avatar url size returned from the API is currently set to 96 so I’ve done a simple replace with 16

* Fix style-lint expected new line

* Add docblock for get_knowledge_base_posts()

* Setup data store for marketing to handle installedExtensions card

* Fix function names

“Activating” not “installing”

* Move welcome card component to its own dir

* IconButton component is going to be deprecated

ref: https://github.com/WordPress/gutenberg/pull/19299

* Support multiple activating plugins in the data store

* Rename extension to plugin for consistency

* Add propTypes to component

* Rename data-store/ to data/

* Fix import paths

* Extract isActivatingPlugin logic into datastore

* Move data store selectors into own file

* POST requests are not cached

* Export apiFetch action

* Don’t wrap API response in object

* Implement data store for recommended extensions

* Implement data store for marketing knowledge base

* Tidy getRecommendedPlugins resolver

* Try a cross browser cover/crop image effect to fit proposed design

And help fit longer titles in

* Add caught errors to handler

* Adjust positioning so watermater is displayed

* InstalledExtensions phpcs fixes

* Marketing phpcs fixes

* Alignment fix

* MarketingOverview phpcs fixes

* Missing full stop

* Update breadcrumbs to use new approach

* Fix style lint issues

* Record `marketing_knowledge_article` track event on knowledge base post click

* Import apiFetch and controls from @wordpress/data-controls

* Hex color to lowercase

* Remove duplicate method after rebase

* Use new showPageArrowsLabel rather than hide with CSS

* Fix blurry avatars on hidpi displays

* Hide avatar if URL is falsy

* Replace test author data with live data

* Combine conditionals into ternary

* Combine conditionals into ternary

* Simplify class column logic

* Only preload option and component settings in the admin

* Fix isActivatingPlugin not updating

Component was not re-rendeding.

* Use querySelector over getElementsByClassName

* Hide Marketing Welcome Card immediately on click

* Use create-a-ticket url for supportUrl and make that the default

* Add getInstalledPlugins resolver with preloaded data

* Revert "Add getInstalledPlugins resolver with preloaded data"

This reverts commit b8b127ec6411bef15616576b3bb189dc31777c13.

* Load plugin data in a separate request after activation

* Update welcome image

* Don’t return plugin data in the activation request.

* A space is required before closing bracket

* Update Jest config to gracefully handle static assets

Ref: https://jestjs.io/docs/en/webpack#handling-static-assets

* Remove unused onExit property

* Remove placeholder README

* Use prop directly

* yield createNotice

* Add note to indicate which Category

* Increase transient time to 3 days

* Use $gap-small

* Add proptype

* Add debounce to slider height resize listener

* Clean up isLoading logic

* Dont show image elements if image data is empty

* Open knowledge base posts in a new window

* Add “noreferrer”

* Turn the tab on in all env

Co-authored-by: Daniel Bitzer <danielbitzer@gmail.com>
2020-03-28 06:48:27 -07:00
Fernando Espinosa b71bc861fb WooCommerce Shipping order page prompt (https://github.com/woocommerce/woocommerce-admin/pull/3955)
Co-authored-by: David Stone <david@nnucomputerwhiz.com>
Co-authored-by: Chris Shultz <chris.shultz@automattic.com>
Co-authored-by: Harris Wong <harris.wong@a8c.com>
2020-03-27 13:42:58 -07:00
Jason Conroy d237256aa9 Abstract onboarding plugin code into a PluginsHelper class (https://github.com/woocommerce/woocommerce-admin/pull/3999)
* Abstract WP plugin code into a PluginsHelper class

We plan to use these methods in the Marketing tab.

* Add PluginsHelper::is_plugin_active()

* Add PluginsHelper::is_plugin_installed()

* Add PluginsHelper::get_plugin_data()

* Add PluginsHelper::get_plugin_path_from_slug()

* Refactor PluginsHelper::get_plugin_data method

Using the new get_plugin_path_from_slug method

* Refactor is_plugin_installed and is_plugin_active

Also adds support for plugin slugs or paths as parameters.

* Ensure get_plugins() function is available for PluginsHelper

* Ensure plugin path is a string before checking if installed/active

* PHPCS fixes

* Add initial unit tests for PluginsHelper

* Check plugin data array keys rather than all values

Will make it less fragile when Woo plugin data changes

* Fix typos

Co-authored-by: Daniel Bitzer <danielbitzer@gmail.com>
2020-03-27 11:28:59 +10:30
Paul Sealock 6582975f98 Made the data store reading of content_data more resilient (https://github.com/woocommerce/woocommerce-admin/pull/3926) (https://github.com/woocommerce/woocommerce-admin/pull/3961)
Before 0.10.0 notes had a default content_data of array(). If stored in the database, these notes would be unable to be loaded. This adds some resiliency to the loading so that invalid content_data fields don't break WC_Admin_Note::set_content_data().

Co-authored-by: Christopher Allford <christopher.allford@automattic.com>
2020-03-24 13:10:33 +13:00
Ron Rennick 43a941ad16 remove replace_actionscheduler_store_class function (https://github.com/woocommerce/woocommerce-admin/pull/3936)
* remove replace_actionscheduler_store_class function from master

* remove AS store class file

* reuse variable

* Fix test helper queue action cancellation for AS 2.x.x.

* Remove WPPostStore logic from SchedulerTraits.

* Remove dead queue code from WC_Admin_Notes.

Missed in https://github.com/woocommerce/woocommerce-admin/pull/3662.

Co-authored-by: Paul Sealock <psealock@gmail.com>
Co-authored-by: Jeff Stieler <jeff.m.stieler@gmail.com>
2020-03-19 10:34:09 -06:00
Joshua T Flowers da3d5359a6 Fix failing tests after WC 4.0 merge (https://github.com/woocommerce/woocommerce-admin/pull/3870)
* Manually call on_plugins_loaded after loading plugins for testing

* Update import tests to cancel all pending actions in new AS tables

* Fix deprecated next method in AS

* Remove priority queue test for unused priority in AS 3.0

* Check only for pending status actions in batch queue tests

* Add cancel_actions_by_group method to WPPostStore

* Add method to check for next blocking job time

* Force delete scheduled actions on older versions of AS
2020-03-12 14:46:13 +01:00
Fernando 5946e8c855 Onboarding - business step: add more options in the competitors list and other fixes (https://github.com/woocommerce/woocommerce-admin/pull/3812)
* Modified question in the business step of the onboarding

* Added more options in the competitors list

Onboarding - Business step -> Add more options in the competitors list.

* Added an option input field to Onboarding, business step

To the Onboarding's business step added an input field when the user selects "Other".

* Added suggested improvements

* Added new param to "test_schema" test

Co-authored-by: Fernando Marichal <contacto@fernandomarichal.com>
2020-03-06 16:20:54 -03:00
Joshua T Flowers cb3fcbcf08 Onboarding: Remove old development flags (https://github.com/woocommerce/woocommerce-admin/pull/3809)
* Remove old onboarding flags

* Remove flag from onboarding docs

* Enable onboarding in tests
2020-03-04 09:46:02 +01:00
Darren Ethier 33c5b41e3f Align WooCommerce javascript code standards/linting/styles with WordPress core. (https://github.com/woocommerce/woocommerce-admin/pull/3674)
* align code styles with the same configuration as Woo-Blocks

* initial pass of reformat-files

* applies manual fixes to various new linting errors surfaced by the configuration change.

* Fix state mutation in image-upload

* remove unused pre-commit-hook.js

* requestAnimationFrame -> window.requestAnimationFrame

* wc-api eslint changes

* eslint fixes on client/lib and client/settings

* client/header eslint changes

* fixes for client/dashboard part 1

* fixes client/dashboard part 2 of 2

* client/analytics part 1

* client/analytics continued

* client/analytics, last batch

* rename __mock__ directory

* pass in useEffect, useState from React component or function

* remove '+' from sprintf string argument

* use ref instead of findDOMNode

* reformat and repaply package.json changes

* install deps before running linter in Travis

* useGetCountryStateAutofill

* counryStateAutofill

* countryStateAutofill

Co-authored-by: Paul Sealock <psealock@gmail.com>
2020-02-14 15:23:21 +13:00
Ron Rennick d192e55dda fix SQL error in category sort (https://github.com/woocommerce/woocommerce-admin/pull/3521)
* fix SQL error in category sort

Co-authored-by: Jeff Stieler <jeff.m.stieler@gmail.com>
2020-01-15 16:26:28 -04:00
Joshua T Flowers af5022c3d1 Reports sync refactor (https://github.com/woocommerce/woocommerce-admin/pull/3285) 2020-01-03 00:00:37 +08:00
Joshua T Flowers 3da148156e Onboarding: Add theme install and activation endpoints (https://github.com/woocommerce/woocommerce-admin/pull/3482)
* Add API endpoint to install themes

* Add API endpoint to activate a theme

* Add an array of allowed themes and sanitize slugs

* Limit allowed themes to already installed or free themes

* Add theme installation tests

* Add tests for theme activation

* Add onboarding theme installation and activation tests

* Remove unused argument in onboarding plugins API
2019-12-30 15:47:15 +08:00
Jeff Stieler 162a8cd550 Allow report caching layer to be filtered off. (https://github.com/woocommerce/woocommerce-admin/pull/3434)
* Add filter to conditionally disable report caching.

* Disable caching for Orders Stats unit tests.

Fixes the display of the last query when tests fail.
2019-12-17 16:21:44 -05:00
Ron Rennick ba30224098 Stardardize hooks (https://github.com/woocommerce/woocommerce-admin/pull/3339)
* rename woocommerce_reports_* hooks/filters to woocommerce_analytics_*

* introduce woocommerce_navigation_ filter prefix

* update remaining wc_admin_* filters/hooks

* phpcs sniff fixes for notes data store

* standardize woocommerce_note_ hook prefix

* one of filter renames

* update contributing readme, onboarding unit test

* missed _notes_ -> _note_ filter

* update ext example hooks
2019-12-06 12:06:11 +13:00
Justin Shreve 448e1f3e11 Remove Newspack Dependency (https://github.com/woocommerce/woocommerce-admin/pull/3302)
* Switch to @wordpress/component's Button

* Finish button conversion

* Move to @wp/component's CheckboxControl

* Add  ImageUpload component

* Remove Newspack package

* CSS Cleanup

* Handle PR feedback: Fix tests, add ImageUploader basic test, fix FireFox/Safari Display issues, and  currency input bug
2019-12-02 12:39:22 -05:00
Justin Shreve 50cc3edaed Update onboarding filters with a consistent prefix (https://github.com/woocommerce/woocommerce-admin/pull/3295)
* Update onboarding filters with a consistent prefix

* Rename woocommerce_onboarding_payments to match the other task list options
2019-11-25 11:15:22 -05:00
David Levin 52cb35f4de Correcting and clarifying analytics terms and calculations (https://github.com/woocommerce/woocommerce-admin/pull/3104)
* Relabel Net Revenue to Net Sales, revert previous refund work on Gross revenue and rename to total sales. Update the orer of all the things

* Add gross sales calculation to revenue stats endpoint.

* Restore coupon_total when updating order stats.

* Wire up gross sales to revenue report.

* Fix revenue report refunds calculation when there are no refunds.

* update net sales labels and cases in order, product and category tables

* Subtract refunded shipping and taxes from gross sales.

* pluses to minuses to fix the gross revenue and refund totals when refunding

* Add gross_sales to revenue stats orderby enum.

* Change refund labels to Returns

* Remove usage of defunct coupon_total column.

* Store refunded amount in stats table.

* Rename "gross_total" column to "total_sales".

* Net total for refund orders can be used instead of a new column.

* Rename gross_revenue to total_sales.

* Coalesce coupons total in order stats query.

SUM()ing all nulls gives null, not zero.

* Use segmentation selections to backfill missing data.

Fo when report columns and segmentation columns don't match.

* Remove errant gross_sales from expected interval test data.

* Fix gross sales tests for revenue/stats.

* Move missing segment fills back to their original locations.

* Fix remaining tests failing because of gross sales.

* Fix db upgrade function rename of gross_total column.

* Fix linter errors.
2019-11-22 10:06:14 -05:00
Ron Rennick f78c143f3b Move in-house rest endpoints to private namespace (https://github.com/woocommerce/woocommerce-admin/pull/3204)
* move in-house rest endpoints to private namespace

* PHPCS sniff fixes
2019-11-12 14:15:55 -04:00
Justin Shreve 5b80e321ba Enable onboarding in the plugin build for those who have opted-in (https://github.com/woocommerce/woocommerce-admin/pull/3184)
* Enable onboarding in the plugin build for those who have opted-in

* Update constant andd option value
2019-11-07 13:31:02 -05:00
Ron Rennick afed4fba36 Data store refactor (https://github.com/woocommerce/woocommerce-admin/pull/2961)
* Base Report data store utility functions - 1

Standardizing the data store classes will be easier if the base class contains simple utility functions
that can replace logic implemented in multiple data stores.

- set_db_table_name() assigns a WP DB table name class variable for the data store
- get_db_table_name() retrieves the WP DB table name
- prepend_table_name() prepends a field in a query fragment with the data store table name

* add context, clause handling, and filters to reports data store

* add generated SQL clauses to class properties

* reduce id getter logic to single function with filter, add phpdocs to new filters

* update table_name to private string for use in constructor

* extract SQL query clause handling to its own class

- Will allow for use in subquery processing without creating a get_data stub
- Swap parameter order in add_sql_clause for readability
- Add support for clearing multple clauses in one call

* add context var to SqlQuery class

* implement SqlQuery in Categories data store

* implement subquery in categories data store

* coupons data stores, more underlying refactor

- fix warnings
- make filtered id functions static
- add limit parameter handling
- update coupons data store
- update coupon stats data store

* refactor coupon stats data store

* refactor customers and customer stats data stores

* add context to subqueries

* add missed prepend table name call

* refactor downloads data store, fix some warnings

* fix warnings, add separator parameter to filtered IDs

* refactor taxes and tax stats data stores

* refactor variations data store

* refactor product and product stats data stores

* make table_name static throughout for compat with static hook functions

* refactor order and order stats datastores

- use consistent visibility on initialize_queries()
- update db_table_name logic to use static keyword instead of self

* fix missed whitespace

* fix segmenting query, add SqlQuery join clause

* DRY data store constructors, class properties

* prefix table name when not yet assigned

* fix unit tests, interpolations, WPDB delete calls

* DRY get_object_where_filter()

* remove redundant table prefix from unit test init

* fix refactored SQL queries

* restore product paging

* remove unused query param arrays

* add first pass on data docs readme

* remove debug code, errant SQL spacing

* refactor out outer_from query element

* merge wheres, joins before filtering

* move all report column definitions to assign_report_columns

* fix data readme markdown

* small code formating fixes from review

* remove static from query/datastore context

* missed self:: in previous, add comments, small code moves

* rename get_statement() to get_query_statement()

* remove temporary query references

* static reference, remove reference parameter, fix coupon compare

* add todo reminders

* use correct query parameter in coupon data stores
2019-11-07 10:28:37 -07:00
Jeff Stieler 1ac8577fc2 Match server-side CSV export format to client-side (https://github.com/woocommerce/woocommerce-admin/pull/2987)
* Add "exportable" report interface for defining CSV export values.

* Define export values for Orders Report.

* Define export values for Products Report.

* Define export values for Categories Report.

* Define export values for Coupons Report.

* Allow commas and double quotes in CSV exported values.

* Fix in-browser export formatting of orders report products.

* Align server-side orders report export formatting with in-browser.

* Cover comma and double quote escaping in CSV export package tests.

* Define export values for Customers Report.

* Embed response links when requesting data for CSV exports.

* Define export values for Downloads Report.

* Move reusable report export functions to a trait.

* Define export values for Stock Report.

* Define export values for Taxes Report.

* Define export values for Variations Report.

* Define export values for Revenue Report.

* Always pass export row data through the filter.

* Fix formatting in test case for CSV coupon export.

* Quote escape CSV headers in client-side export.

Escape values with spaces as well.

* Check if inventory is managed at the product level before using the stock status/quantity.

* Prevent CSV injection in csv-export package.
2019-10-24 09:41:16 -07:00
Justin Shreve e31e115e93 Update proceed without Jetpack/WCS to go to store details step (https://github.com/woocommerce/woocommerce-admin/pull/3040)
* Update proceed without Jetpack/WCS to go to store details step

* Adjust how we track the start/plugins step
2019-10-17 10:57:29 -04:00
Justin Shreve 5ee318064a Remove the Onboarding Levels API (https://github.com/woocommerce/woocommerce-admin/pull/3041) 2019-10-15 10:46:12 -04:00
Justin Shreve d8132942f3 Change usage tracking prompt to modal (https://github.com/woocommerce/woocommerce-admin/pull/2968)
* Move tracking usage question to modal

* Fix PHPCS errors

* Adjust button alignment, update PHPCS version.

* Fix options check

* Handle PR feedback
2019-10-10 10:05:13 -04:00
Joshua T Flowers 37fbdaf5c0 Add options REST API permission checks (https://github.com/woocommerce/woocommerce-admin/pull/3004) 2019-10-09 06:39:40 +08:00
Mike Jolley edcfc161fa Category Lookup Table - Fix Category Segments (https://github.com/woocommerce/woocommerce-admin/pull/2253)
* Look table class and installer

* New table + stats

* Working reports/initial population

* Remove test

* Refactor, remove depth

* Unused table

* Update todo

* Add docblocks and reorder get_insert_sql params for consistency

* Adjust css braces

* clear hook on deactivation

* PSR-4 category lookup

* linting CSS closing brace last char on line

* initialize category lookup table in unit tests

* missed linting fixes

* revert move of run_all_pending call

* use consistent reference for term_relationships in queries
2019-10-02 12:35:37 +13:00
Joshua T Flowers c70c7bfd68 Fix vendor scripts not autoloading (https://github.com/woocommerce/woocommerce-admin/pull/2907)
* Fix vendor scripts and test bootstrapping

* Escape the downloaded file URL in tests

* Generate feature config file for tests

* Run feature config generation before and after script tests
2019-09-25 14:20:15 -04:00
Darren Ethier d728d38219 Refactor: Alternative approach to implementing extendable settings from the server (https://github.com/woocommerce/woocommerce-admin/pull/2917)
* integrate with new asset data registration (php side)

- includes back-compatibility.

* update js configuration and implement settings alias

- this aliases `@woocommerce/wc-admin-settings` to the settings api exposed via blocks (either the blocks plugin or core) and all the settings provided via the server.
- Adds fallback for back-compat if `wc.wcSettings` is not available in the environment (fallsback to `wcSettings`).

* initial pass to update all wcSettings direct usage to the new api

- this is just an initial pass, more can be done in separate pulls.

* missed one spot for adding new filter implementation

* fix incorrect jest config

* Avoid unnecessary assignment and directly return.

* Remove unnecessary defaults

* Fix inline comment text case.

Co-Authored-By: Albert Juhé Lluveras <contact@albertjuhe.com>

* Remove unnecessary inline comment.

* use @todo instead of TODO

Co-Authored-By: Albert Juhé Lluveras <contact@albertjuhe.com>

* fix incorrect reference in webpack config.

* add missing import and slightly delay dependency injection for scripts

* update get-setting and set-setting callbacks

* disable lint rule for console.error on dev doc builds
2019-09-23 17:47:08 -04:00
Albert Juhé Lluveras 3406bd85e0 Fix variable name typo (https://github.com/woocommerce/woocommerce-admin/pull/2922) 2019-09-13 18:39:51 +02:00
Joshua T Flowers f095466442 Onboarding: Add create homepage logic to "Customize Appearance" step (https://github.com/woocommerce/woocommerce-admin/pull/2889) 2019-09-06 22:18:44 +08:00
Joshua T Flowers 52c295b820 Onboarding: Add "Import products" step (https://github.com/woocommerce/woocommerce-admin/pull/2868) 2019-09-06 10:06:29 +08:00
Jeff Stieler 2546a3faec Merge pull request woocommerce/woocommerce-admin#2832 from woocommerce/fix/2702-queue-customer-updates
Queue customer lookup updates.
2019-09-04 08:49:40 -07:00
Jeff Stieler b6c34109f0 Look for `title` properties when using JSON schema for indicator labels.
Fix the dashboard labels at the same time.
2019-09-04 07:49:37 -07:00
Jeff Stieler 3cb05f13d3 Test help queue runner - run until no more jobs remain. 2019-08-21 16:39:09 -07:00
Jeff Stieler 8f27a374f1 Fix tests. 2019-08-21 09:34:17 -07:00
Jeff Stieler bfefb2d647 Ignore refunded amounts when calculating gross total. 2019-08-20 11:41:28 -07:00
Jeff Stieler 953427bea5 Remove defunct filename prefix from remaining files.
Excluding the note classes for third party compatibility.
2019-08-12 15:06:36 -07:00
Jeff Stieler 13878db9ac PSR-4ify the feature plugin and install classes. 2019-08-12 15:03:21 -07:00
Jeff Stieler 7dd4d2b791 PSR-4ify the reports time interval class. 2019-08-12 15:03:21 -07:00
Jeff Stieler 88f6fd9d06 PSR-4ify report query classes. 2019-08-12 15:03:19 -07:00
Jeff Stieler b7912bc579 PSR4-ify the Reports data store classes. 2019-08-12 15:03:17 -07:00
Jeff Stieler b71d8c23c8 PSR4-ify core API subclasses. 2019-08-12 15:03:15 -07:00
Jeff Stieler 416ab09653 PSR-4ify the action schedule post store subclass. 2019-08-12 15:03:12 -07:00
Jeff Stieler e509e51552 PSR-4ify the sync class. 2019-08-12 15:03:11 -07:00
Jeff Stieler ce7267b198 PSR-4ify the report exporter classes. 2019-08-12 15:03:10 -07:00
Jeff Stieler ca68769205 Update admin notes classes to PSR-4. 2019-08-12 15:03:09 -07:00
Jeff Stieler 9c469a9f60 Fix tests. 2019-08-12 15:03:06 -07:00
Justin Shreve 708464fe8e Add revenue question to the business details page (https://github.com/woocommerce/woocommerce-admin/pull/2763)
* Add revenue question to the business details page

* Handle PR feedback: remove empty values, include currency in the stats api call.
2019-08-08 11:38:47 -04:00
Justin Shreve dca1b07377 Onboarding - Task List: Add store connection task (https://github.com/woocommerce/woocommerce-admin/pull/2718)
* Adds store connection task

* PR Feedback
2019-08-01 14:09:08 -04:00
Justin Shreve 1410e7ed29 Add a "this store is being setup for a client" store detail field (https://github.com/woocommerce/woocommerce-admin/pull/2727) 2019-08-01 13:29:35 -04:00
Ron Rennick 135ac032be update assertisWPError calls to assertWPError in unit tests 2019-07-19 16:45:52 -03:00
Ron Rennick 2260e60453 Merge pull request woocommerce/woocommerce-admin#2484 from woocommerce/fix/2400
use summary query to total coupons per order
2019-07-08 13:49:17 -03:00
Timmy Crawford dde788631c Notes: Type cast is_snoozeable on insert. (https://github.com/woocommerce/woocommerce-admin/pull/2573) 2019-07-08 09:48:38 -07:00
Ron Rennick 3cc9232c2b add unit test for multiple coupons on orders 2019-07-05 14:44:08 -03:00
Joshua T Flowers d640b15d09 Add a theme REST API to allow uploading themes (https://github.com/woocommerce/woocommerce-admin/pull/2568)
* Add theme upload REST api controller

* Add theme data to theme controller response

* Add tests for themes api

* Change user cap check to upload_themes

* Add test for users without theme capabilities
2019-07-05 16:01:35 +08:00
Justin Shreve 5a2f0c9da0 Onboarding - Add business extension recommendations (https://github.com/woocommerce/woocommerce-admin/pull/2551)
* Add business extension recommendations

* Fix failing test. Set max height and width for toggle

* Fix toggle display and fix when the extensions show (so they dont hide and disapear as "currently" selling is selected).
2019-07-04 11:56:28 -04:00
Jeff Stieler 5b905025fc Merge pull request woocommerce/woocommerce-admin#2526 from woocommerce/add/311-report-csv-exporter-endpoint
Add Report CSV Export Endpoint
2019-07-03 08:43:18 -06:00
Jeff Stieler c7d94cc929 Use the default "read reports" permission for the export endpoint. 2019-07-02 13:53:42 -06:00
Paul Sealock 8857635162 fix tests 2019-07-02 12:35:58 +12:00
Paul Sealock 563e94b7a2 add leading slash in path for Leaderboards 2019-07-02 12:19:55 +12:00
Justin Shreve aed4ea63b4 Server side route handling 2019-07-01 12:22:34 +12:00
Jeff Stieler 35d763fa8c Merge pull request woocommerce/woocommerce-admin#2463 from KZeni/patch-2
Add State alongside City (and other customer info).
2019-06-28 12:24:25 -06:00
Jeff Stieler fbd231acf4 Add test for reports export endpoint. 2019-06-28 11:10:13 -06:00
Jeff Stieler 8c40000ec2 Merge pull request woocommerce/woocommerce-admin#2496 from woocommerce/fix/rest-controller-default-params
Test that REST controllers work with their default parameters.
2019-06-28 08:52:16 -06:00
Ron Rennick 6982c21d3d Merge pull request woocommerce/woocommerce-admin#2519 from woocommerce/fix/2495
remove double slash from image urls, use string for download ID
2019-06-28 09:28:51 -03:00
Ron Rennick 9f76b02283 set all the unit test download IDs to strings 2019-06-27 17:46:56 -03:00
Jeff Stieler 7e87732dfb Rework test to rely on the REST server handling route defaults. 2019-06-27 11:38:54 -06:00
Jeff Stieler b8abe63d15 Don’t create a batch job that exceeds the range end. 2019-06-26 14:23:56 -06:00
Jeff Stieler 5b4d671833 Change test queue batch size.
Introduces error condition where range start is beyond the end.
2019-06-26 14:16:33 -06:00
Ron Rennick 57a8fbcb51 remove double slash from image urls, use string for download ID 2019-06-26 16:55:57 -03:00
Jeff Stieler 356f1ada77 Merge pull request woocommerce/woocommerce-admin#2502 from woocommerce/add/311-reports-csv-exporter-class
Add Reports CSV Exporter Class
2019-06-26 09:50:06 -06:00
Jeff Stieler 466ddda1a6 Add a test of the CSV export to the coupons report. 2019-06-24 19:26:33 -06:00
Jeff Stieler d6d3161bff Exclude IP download controller from defaults test. 2019-06-24 12:16:58 -06:00
Jeff Stieler 4711a4e11d Ensure coupons are enabled for testing. 2019-06-24 10:55:43 -06:00
Jeff Stieler 7e14630b3b Set default params on each test request, and use an admin user. 2019-06-24 10:55:40 -06:00
Jeff Stieler ff8615dac7 Test that all REST controllers can be called with default params. 2019-06-24 10:50:21 -06:00
Kurt Zenisek ce8d670420 Increased assertCount to accommodate the added data point 2019-06-20 14:24:14 -05:00
Jeff Stieler f75e3c7820 Check for good WC_Orders before using instance methods. 2019-06-20 08:31:10 -06:00
Joshua T Flowers 57416a2bdb Refactor customer name retrieval (https://github.com/woocommerce/woocommerce-admin/pull/2418)
* Return early from creating customer if order is false

* Refactor customer first and last name methods

* Separate customer name tests to create guest orders

* Check for parent_id before retrieving customer ID in refund

* Use registered customer ID in import report tests

* Compare absolute integer when checking for valid customer ID

* Check for order before getting customer ID when retrieving existing customer ID
2019-06-20 11:22:47 +08:00
Kurt Zenisek a39c885160 Added state alongside city & other info 2019-06-19 17:11:24 -05:00
Jeff Stieler d4e242b028 Add test to catch missing version updates. 2019-06-13 15:40:02 -06:00
Ron Rennick 241ebb63ff Merge pull request woocommerce/woocommerce-admin#2407 from woocommerce/fix/2354
Update Amount of {Item} to Number of {Item} when it's a count throughout
2019-06-13 13:41:15 -03:00
Joshua T Flowers 2f49a0a5a7 Prevent multiple imports from running simultaneously (https://github.com/woocommerce/woocommerce-admin/pull/2414)
* Prevent multiple imports from running simultaneously

* Cancel previous imports before importing again in tests
2019-06-13 23:32:58 +08:00
Ron Rennick 6b02ee217c Update Amount of Orders to Number of Orders throughout 2019-06-12 16:16:18 -03:00
Albert Juhé Lluveras 8bc2261c8a Add date_created_gmt property to orders endpoint (https://github.com/woocommerce/woocommerce-admin/pull/2086)
* Add date_created_gmt property to orders enpoint

* Make date_created properties of type date-time and improve descriptions
2019-06-12 11:21:56 +02:00
Paul Sealock dbd536c7a3 Settings: Add default date 2019-06-12 11:40:21 +12:00
Albert Juhé Lluveras 5d01cee56c Add progress bars to Historical Data Import screen (https://github.com/woocommerce/woocommerce-admin/pull/2312)
* Hook up import/status endpoint to Historical Data Import screen

* Fix PHP tests

* Add speak message when the import is complete

* Several fixes

* Cleanup

* Update progress bars every 3 seconds and bugfixes

* Rename ongoingImport to activeImport

* Use timestamp to identify queries

* Use timestamps for historical data state

* Add 'initializing' status

* Cleanup

* Pass less props around

* Refactor getStatus

* Set stop timestamp on request error

* Typo
2019-06-11 14:47:53 +02:00
Justin Shreve 821408fc83 Add Muriel/Newspack components for use in onboarding (https://github.com/woocommerce/woocommerce-admin/pull/2313)
* Add Muriel/Newspack components for use in onboarding

* Adjust some alignment
2019-05-28 10:05:55 -04:00