Commit Graph

203 Commits

Author SHA1 Message Date
Bec Scott ad8f8c5b08 Rename admin notes classes and file names to fit conventions (https://github.com/woocommerce/woocommerce-admin/pull/5142)
* Rename admin notes classes and file names to fit conventions

* Use a facade class that adds deprecation warnings to each function call

* Tidy up after rebase

Co-authored-by: Rebecca Scott <me@becdetat.com>
2020-09-28 14:35:10 +10:00
Jeff Stieler 264aa8dee4 Add Variations Report (https://github.com/woocommerce/woocommerce-admin/pull/5167)
* Add initial Variations Report to analytics feature.

* Restrict query to variations when not specifying any product IDs.

* Add route to get variations without specifying a parent.

* Move variations table component to variations report directory.

* Add missing LIMIT clause to variations report query.

* Remove broken features from Variations table.

* Add Variations report controller to CSV emailer.

* Add initial Variation Stats endpoint, based on Product Stats.

* Hook Variations Report components up to new stats endpoint.

* Hook attribute filter up to variations report queries.

* Remove variation title filter usage.

See: https://github.com/woocommerce/woocommerce-admin/pull/5100

* Use filtered separator in variation name formatting.

* Add "single variation" to variations report, fix autocompleter API request.

* Fix segmentation by variation.

* Add comparison to variations report.

* Always include manually specified variations in report results.

* Fix variations report table comparison mode.

The ReportTable component expects the `filter` query param.

* Fixing styling of compare button without table search component.

* Add variation filter to Orders report.

* Link orders count to orders report filtered by variation.

* Orders report: include variation attributes in product names.

* Further style tweaks for variations report download button.

* Add variations filter to order stats query.

* Clean up "category includes" login in REST controllers.

Prep for "category excludes" in the Variations report.

* Support category exclusion in report filters.

* Fix filter param used by the variation report table component.

* Add category filter to variations report.

* Fix initial selected ReportTable rows when using non-default compareParam.

* Add a new autocompleter for variable products.

* Add products filter to variations report.

* Fix tests.

* Handle variation IDs that are no longer found.

* Add documentation.

* Use getSetting() instead of directly accessing window properties in client code.

* Fix ordering Variations by SKU.
2020-09-25 09:57:48 -04:00
Jeff Stieler 3abeda602a Search all variation attribute values, not just global ones. (https://github.com/woocommerce/woocommerce-admin/pull/5141)
* Search all variation attribute values, not just global ones.

* Fix variations test for WC < 4.4.
2020-09-16 09:57:38 -04:00
Jeff Stieler ebfd28a9e6 Add product attribute filter to Orders Report. (https://github.com/woocommerce/woocommerce-admin/pull/5068)
* Add product attribute filter to Orders report config.

* Add attribute args to Orders report controller.

* Include attribute filters in orders report query.

* Add attribute args to Orders Stats report controller.

* Include attribute filters in orders report stats query.

* Add test for product attribute filter in orders report.

* Add tests for invalid parameter values.

* Add tests for product attribute filter in order stats endpoint.

* Fix tests for PHP 5.6 and WC 3.8.x.
2020-09-03 10:08:06 -04:00
Jeff Stieler c16da34c30 Migrate export data store to wp.data (https://github.com/woocommerce/woocommerce-admin/pull/4958)
* Add export ID to success response and fix typos in endpoint schema.

* Initial export data store.

Allows for starting export, but not checking progress.

* Use new export data store in analytics report tables.

* Remove defunct report export wc-api files.

* Apply review feedback from another wp.data PR.

* Use getResourceName() util for more DRYness.

* Fix linter error.

* Add response status code to fetchWithHeaders control.

* Use HTTP status rather than response body to determine success.

* Fix tests.

* Remove unused import from actions.
2020-08-18 09:04:58 -04:00
Jeff Stieler 025860c879 Delete associated customer analytics data when user is deleted from WordPress. (https://github.com/woocommerce/woocommerce-admin/pull/4977)
* Delete customer lookup rows when their corresponding user is deleted.

* Asynchronously delete users from customer lookup table.

* Add user deletion test case.

* Fix user deletion test.
2020-08-13 09:23:51 -04:00
Joshua T Flowers 483055dd75 Migrate notes data store to wp data (https://github.com/woocommerce/woocommerce-admin/pull/4943)
* Add initial notes data store using wp data

* Cache individual note queries

* Update notes undo endpoint to batch update endpoint

* Allow batch updates of notes

* Add requesting state

* Update components to use new note store

* Remove old notes store from wc-api

* Get note IDs from json and validate data in REST API

* Add an updating state to each note

* Throw errors in actions so they can be caught by client

* Add store reducer tests

* Handle PR feedback

* Fix failing tests

* Don't set inbox panel visibility while batch updating

* Move woocommerce block to external dependencies
2020-08-13 16:23:38 +03:00
Joshua T Flowers 260843c528 Fix industry args type in REST API (https://github.com/woocommerce/woocommerce-admin/pull/4974)
* Fix industry args type in REST API

* Only allow object for industry param

* Fix onboarding industry object shape in test case.

Co-authored-by: Jeff Stieler <jeff.m.stieler@gmail.com>
2020-08-12 15:57:55 +03:00
Claudio Sanches 073a3f706f Fix usage of "package" tag in file headers (https://github.com/woocommerce/woocommerce-admin/pull/4940)
* Don't require package tag or file comment inside src

* Removed package tag from files inside src

* Fixed tests directory in phpcs.xml.dist

* Fixed usage of package tag

* Fixed new classes

* Fixed coding standards

* Fixed coding standards in tests
2020-08-11 16:18:47 -03:00
Jeff Stieler 7b4f825bc7 Fix PHP Fatals from Notes DataStore when columns are missing. (https://github.com/woocommerce/woocommerce-admin/pull/4831)
* Handle admin note data read exceptions.

* Add test for notes datastore encountering an exception in read().

* Fix WC_Admin_notes::get_note() helper.

* Throw exception from WC_Admin_Note class instead.

Mimicking WC_Order, etc.

* Use helper method to retrieve existing notes.

* Use self for static calls.

* Check for valid note before updating in WCPay note class.

* Don't specify columns when fetching notes from the database.

* Fix deprecated function call.

Avoid calling deprecated set_icon() when passing data to WC_Admin_Note constructor.
2020-07-20 11:28:00 -07: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
Jeff Stieler 727a8a8f04 Avoid Jetpack REST API when retrieving active modules (https://github.com/woocommerce/woocommerce-admin/pull/4755)
* Make API init class a singleton.

For aid in testing.

* Use static Jetpack methods instead of the REST API to get active modules.

Include some helper methods for easier testing.

* Fix Jetpack module mocking in indicators test.

* Check for the expected Jetpack module method before calling.

* Ensure active Jetpack modules is an array.
2020-07-06 16:11:45 -04:00
Jeff Stieler 96f06a28ec Fix inbox note deletion test cases. (https://github.com/woocommerce/woocommerce-admin/pull/4674)
Counts were incorrect.
2020-06-24 08:24:55 -04:00
Ron Rennick 8a22576a95 Count total unique customers instead of new/returning in order stats (https://github.com/woocommerce/woocommerce-admin/pull/4430)
* Count total unique customers instead of new/returning in order stats

* Add customer name to table instead of customer type

* Add customer total to segments

* Update tests for new stats

Co-authored-by: Joshua Flowers <joshuatf@gmail.com>
2020-06-18 20:43:56 +03:00
Jeff Stieler d591d77a53 Fix deleted products breaking Downloads Report (https://github.com/woocommerce/woocommerce-admin/pull/4582)
* Don't attempt order download information retrieval when the product has been deleted.

* Handle display of download names when product has been deleted.

* Add deleted product test case for download report endpoint.

* Fix date() usage in download report tests.
2020-06-16 09:47:27 -04:00
Fernando aefbafea9b Inbox notification: layout changes (https://github.com/woocommerce/woocommerce-admin/pull/4218)
* Inbox notification: Added layout changes (https://github.com/woocommerce/woocommerce-admin/pull/4256)

* Added notes layout and image to the API

Added note layout and note image to the API and the DB

* Unit test modified

Unit test where modified to adapt them to the new elements

* Changed the frontend following the new designs.

The fronted was changed to follow the new inbox messages design.

* Changed default layout type in DB

* Added all the requested visual element

Changed the cards' js, css and actions to achieve the visual requirements

* Added "layout" and "image" to inboxQuery

* Modal confirmation buttons repaired

* Added "layout" and "image" to docs examples.

* Removed "updateNote" from action.js

Removed "updateNote" from action.js, I left it by mistake.

* Spelling error corrected

The button text "Dismiss all message" was corrected

* noteName removed and icon added to make code reviewing easier

This commit removes the "noteName" from card.js and adds the icon to make code reviewing easier

* Dismiss action button refactor

Refactor of the dismiss action button in the InboxNoteCard class

* Removed unnecessary control

* Destructured all the note properties

* Colors replaced by existing variable

* Removed setting of layout and image in the creation of the notes

* Removed blank lines added by mistake

* Close dismiss dropdown when clicking away from the  popover.

* Prevented the closing of the inbox panel with an action in the modal

* Added small design changes

* Removed unused "Gridicon" import

* Prevent showing the image tag when the layout is blank

* The method name getDismissButton was changed to getDismissConfirmationButton

* Removed unnecessary vendor-prefixed properties

* Improved note filtering in unreadNotes method

* Update client/header/activity-panel/panels/inbox/style.scss

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

* Update client/header/activity-panel/panels/inbox/style.scss

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

* Update client/header/activity-panel/panels/inbox/style.scss

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

* Update client/header/activity-panel/panels/inbox/style.scss

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

Co-authored-by: Fernando Marichal <contacto@fernandomarichal.com>
Co-authored-by: Joshua T Flowers <joshuatf@gmail.com>

* Inbox notification: Remove icons (https://github.com/woocommerce/woocommerce-admin/pull/4258)

* Info icon removed from inbox notifications

The info icon was removed from inbox notifications

# Conflicts:
#	src/Notes/DataStore.php

* Removed "icon" from inboxQuery

* Tests repeared

Some problems with the unit tests were repaired in this commit

# Conflicts:
#	docs/examples/activity-panel-inbox.md

# Conflicts:
#	tests/api/admin-notes.php

* Removed icon from card.js

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

* Inbox notification: Add dismiss functionality (https://github.com/woocommerce/woocommerce-admin/pull/4262)

* Added is_deleted param to soft delete

# Conflicts:
#	src/API/Notes.php
#	src/Install.php
#	src/Notes/DataStore.php
#	src/Notes/WC_Admin_Note.php
#	src/Notes/WC_Admin_Notes.php
#	tests/api/admin-notes.php

* Added the Dismiss functionality

# Conflicts:
#	client/header/activity-panel/panels/inbox/action.js

* Where clause repeared

* Added Snackbar after action.

* API modified to dismiss notes

* Small refactor in "get_item" method

This commit adds a small refactor in "get_item" method to use "prepare_note_data_for_response"

* Added missing logic to Dismiss note

This commit adds missing client logic to Dismiss note.

# Conflicts:
#	client/header/activity-panel/panels/inbox/action.js
#	client/header/activity-panel/panels/inbox/card.js

* Moved the delete action to WC_Admin_Notes.php

The delete action was moved to WC_Admin_Notes.php to follow the pattern.

* Added changes to dismiss messages

This commit addeds changes to the  messages soft delete.

* DataStore.php repaired

This commits adds some code that was deleted by mistake and the param "is_deleted" has been escaped.

* Spelling error corrected

The button text "Dismiss all message" was corrected

* Repaired "get_notes_where_clauses" method

A problem with the deleted notes was repaired

* Added a comment to DataStore.php

* Stopped sending the "dismissType" to action.js

The "dismissType" is not sent to action.js anymore.

* Bugfix: now the method get_notes_with_name also returns deleted notes

* Bugfix: repaired empty notification list

This commit repairs a bug that happens when there isn't anything in the inbox notification list

* Small refactor to not use "some" Lodash method anymore

* Small refactor in rednderNotes method

* Added check to set_layout

* Added small refactor to delete_all_notes method

* Fixed code comment error

* Bugfix: repaired the "delete_note" call

* Inbox notification: Added layout changes (https://github.com/woocommerce/woocommerce-admin/pull/4256)

* Added notes layout and image to the API

Added note layout and note image to the API and the DB

* Unit test modified

Unit test where modified to adapt them to the new elements

* Changed the frontend following the new designs.

The fronted was changed to follow the new inbox messages design.

* Changed default layout type in DB

* Added all the requested visual element

Changed the cards' js, css and actions to achieve the visual requirements

* Added "layout" and "image" to inboxQuery

* Modal confirmation buttons repaired

* Added "layout" and "image" to docs examples.

* Removed "updateNote" from action.js

Removed "updateNote" from action.js, I left it by mistake.

* Spelling error corrected

The button text "Dismiss all message" was corrected

* noteName removed and icon added to make code reviewing easier

This commit removes the "noteName" from card.js and adds the icon to make code reviewing easier

* Dismiss action button refactor

Refactor of the dismiss action button in the InboxNoteCard class

* Removed unnecessary control

* Destructured all the note properties

* Colors replaced by existing variable

* Removed setting of layout and image in the creation of the notes

* Removed blank lines added by mistake

* Close dismiss dropdown when clicking away from the  popover.

* Prevented the closing of the inbox panel with an action in the modal

* Added small design changes

* Removed unused "Gridicon" import

* Prevent showing the image tag when the layout is blank

* The method name getDismissButton was changed to getDismissConfirmationButton

* Removed unnecessary vendor-prefixed properties

* Improved note filtering in unreadNotes method

* Update client/header/activity-panel/panels/inbox/style.scss

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

* Update client/header/activity-panel/panels/inbox/style.scss

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

* Update client/header/activity-panel/panels/inbox/style.scss

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

* Update client/header/activity-panel/panels/inbox/style.scss

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

Co-authored-by: Fernando Marichal <contacto@fernandomarichal.com>
Co-authored-by: Joshua T Flowers <joshuatf@gmail.com>

* Inbox notification: Remove icons (https://github.com/woocommerce/woocommerce-admin/pull/4258)

* Info icon removed from inbox notifications

The info icon was removed from inbox notifications

# Conflicts:
#	src/Notes/DataStore.php

* Removed "icon" from inboxQuery

* Tests repeared

Some problems with the unit tests were repaired in this commit

# Conflicts:
#	docs/examples/activity-panel-inbox.md

# Conflicts:
#	tests/api/admin-notes.php

* Removed icon from card.js

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

* Improved error handling for the set_layout method

* Bugfix: fixed error handling clicks inside dropdowns

* Bugfix: repaired dropdown onBlur handler

This commit repairs a weird behavior that the dropdown onBlur handler method had sometimes.

* Text error changed

Co-authored-by: Fernando Marichal <contacto@fernandomarichal.com>
Co-authored-by: Joshua T Flowers <joshuatf@gmail.com>

* Inbox notification: Add undo snackbar button after deletion (https://github.com/woocommerce/woocommerce-admin/pull/4281)

* Added undo snakbar button for a single note

# Conflicts:
#	client/wc-api/notes/mutations.js
#	src/Notes/DataStore.php
#	src/Notes/WC_Admin_Notes.php

* Added a button to undo the deletion of all notes

# Conflicts:
#	client/wc-api/notes/operations.js
#	src/API/Notes.php

* Code adapted to make code reviewing easier

There was some code that also was present in another PR, that code was removed to make code reviewing easier.

* UnitTest added

This commit adds some unit tests

* Added verification for API response

* Added casting to $note_id

* Inbox notification: Added layout changes (https://github.com/woocommerce/woocommerce-admin/pull/4256)

* Added notes layout and image to the API

Added note layout and note image to the API and the DB

* Unit test modified

Unit test where modified to adapt them to the new elements

* Changed the frontend following the new designs.

The fronted was changed to follow the new inbox messages design.

* Changed default layout type in DB

* Added all the requested visual element

Changed the cards' js, css and actions to achieve the visual requirements

* Added "layout" and "image" to inboxQuery

* Modal confirmation buttons repaired

* Added "layout" and "image" to docs examples.

* Removed "updateNote" from action.js

Removed "updateNote" from action.js, I left it by mistake.

* Spelling error corrected

The button text "Dismiss all message" was corrected

* noteName removed and icon added to make code reviewing easier

This commit removes the "noteName" from card.js and adds the icon to make code reviewing easier

* Dismiss action button refactor

Refactor of the dismiss action button in the InboxNoteCard class

* Removed unnecessary control

* Destructured all the note properties

* Colors replaced by existing variable

* Removed setting of layout and image in the creation of the notes

* Removed blank lines added by mistake

* Close dismiss dropdown when clicking away from the  popover.

* Prevented the closing of the inbox panel with an action in the modal

* Added small design changes

* Removed unused "Gridicon" import

* Prevent showing the image tag when the layout is blank

* The method name getDismissButton was changed to getDismissConfirmationButton

* Removed unnecessary vendor-prefixed properties

* Improved note filtering in unreadNotes method

* Update client/header/activity-panel/panels/inbox/style.scss

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

* Update client/header/activity-panel/panels/inbox/style.scss

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

* Update client/header/activity-panel/panels/inbox/style.scss

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

* Update client/header/activity-panel/panels/inbox/style.scss

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

Co-authored-by: Fernando Marichal <contacto@fernandomarichal.com>
Co-authored-by: Joshua T Flowers <joshuatf@gmail.com>

* Inbox notification: Remove icons (https://github.com/woocommerce/woocommerce-admin/pull/4258)

* Info icon removed from inbox notifications

The info icon was removed from inbox notifications

# Conflicts:
#	src/Notes/DataStore.php

* Removed "icon" from inboxQuery

* Tests repeared

Some problems with the unit tests were repaired in this commit

# Conflicts:
#	docs/examples/activity-panel-inbox.md

# Conflicts:
#	tests/api/admin-notes.php

* Removed icon from card.js

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

* Inbox notification: Add dismiss functionality (https://github.com/woocommerce/woocommerce-admin/pull/4262)

* Added is_deleted param to soft delete

# Conflicts:
#	src/API/Notes.php
#	src/Install.php
#	src/Notes/DataStore.php
#	src/Notes/WC_Admin_Note.php
#	src/Notes/WC_Admin_Notes.php
#	tests/api/admin-notes.php

* Added the Dismiss functionality

# Conflicts:
#	client/header/activity-panel/panels/inbox/action.js

* Where clause repeared

* Added Snackbar after action.

* API modified to dismiss notes

* Small refactor in "get_item" method

This commit adds a small refactor in "get_item" method to use "prepare_note_data_for_response"

* Added missing logic to Dismiss note

This commit adds missing client logic to Dismiss note.

# Conflicts:
#	client/header/activity-panel/panels/inbox/action.js
#	client/header/activity-panel/panels/inbox/card.js

* Moved the delete action to WC_Admin_Notes.php

The delete action was moved to WC_Admin_Notes.php to follow the pattern.

* Added changes to dismiss messages

This commit addeds changes to the  messages soft delete.

* DataStore.php repaired

This commits adds some code that was deleted by mistake and the param "is_deleted" has been escaped.

* Spelling error corrected

The button text "Dismiss all message" was corrected

* Repaired "get_notes_where_clauses" method

A problem with the deleted notes was repaired

* Added a comment to DataStore.php

* Stopped sending the "dismissType" to action.js

The "dismissType" is not sent to action.js anymore.

* Bugfix: now the method get_notes_with_name also returns deleted notes

* Bugfix: repaired empty notification list

This commit repairs a bug that happens when there isn't anything in the inbox notification list

* Small refactor to not use "some" Lodash method anymore

* Small refactor in rednderNotes method

* Added check to set_layout

* Added small refactor to delete_all_notes method

* Fixed code comment error

* Bugfix: repaired the "delete_note" call

* Inbox notification: Added layout changes (https://github.com/woocommerce/woocommerce-admin/pull/4256)

* Added notes layout and image to the API

Added note layout and note image to the API and the DB

* Unit test modified

Unit test where modified to adapt them to the new elements

* Changed the frontend following the new designs.

The fronted was changed to follow the new inbox messages design.

* Changed default layout type in DB

* Added all the requested visual element

Changed the cards' js, css and actions to achieve the visual requirements

* Added "layout" and "image" to inboxQuery

* Modal confirmation buttons repaired

* Added "layout" and "image" to docs examples.

* Removed "updateNote" from action.js

Removed "updateNote" from action.js, I left it by mistake.

* Spelling error corrected

The button text "Dismiss all message" was corrected

* noteName removed and icon added to make code reviewing easier

This commit removes the "noteName" from card.js and adds the icon to make code reviewing easier

* Dismiss action button refactor

Refactor of the dismiss action button in the InboxNoteCard class

* Removed unnecessary control

* Destructured all the note properties

* Colors replaced by existing variable

* Removed setting of layout and image in the creation of the notes

* Removed blank lines added by mistake

* Close dismiss dropdown when clicking away from the  popover.

* Prevented the closing of the inbox panel with an action in the modal

* Added small design changes

* Removed unused "Gridicon" import

* Prevent showing the image tag when the layout is blank

* The method name getDismissButton was changed to getDismissConfirmationButton

* Removed unnecessary vendor-prefixed properties

* Improved note filtering in unreadNotes method

* Update client/header/activity-panel/panels/inbox/style.scss

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

* Update client/header/activity-panel/panels/inbox/style.scss

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

* Update client/header/activity-panel/panels/inbox/style.scss

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

* Update client/header/activity-panel/panels/inbox/style.scss

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

Co-authored-by: Fernando Marichal <contacto@fernandomarichal.com>
Co-authored-by: Joshua T Flowers <joshuatf@gmail.com>

* Inbox notification: Remove icons (https://github.com/woocommerce/woocommerce-admin/pull/4258)

* Info icon removed from inbox notifications

The info icon was removed from inbox notifications

# Conflicts:
#	src/Notes/DataStore.php

* Removed "icon" from inboxQuery

* Tests repeared

Some problems with the unit tests were repaired in this commit

# Conflicts:
#	docs/examples/activity-panel-inbox.md

# Conflicts:
#	tests/api/admin-notes.php

* Removed icon from card.js

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

* Improved error handling for the set_layout method

* Bugfix: fixed error handling clicks inside dropdowns

* Bugfix: repaired dropdown onBlur handler

This commit repairs a weird behavior that the dropdown onBlur handler method had sometimes.

* Text error changed

Co-authored-by: Fernando Marichal <contacto@fernandomarichal.com>
Co-authored-by: Joshua T Flowers <joshuatf@gmail.com>

* Stopped sending the "dismissType" to action.js

The "dismissType" is not sent to action.js anymore.

# Conflicts:
#	client/header/activity-panel/panels/inbox/card.js

Co-authored-by: Fernando Marichal <contacto@fernandomarichal.com>
Co-authored-by: Joshua T Flowers <joshuatf@gmail.com>

* Bugfix: solved problem when a note was undismissed

There was a problem with the undismiss functionality. When a note was undismissed, it always was recovered with "plain" layout. This commit solves this problem.

* Inbox notification: add event recording (https://github.com/woocommerce/woocommerce-admin/pull/4320)

* Added events recording

This commit adds events recording to the inbox notifications

# Conflicts:
#	client/header/activity-panel/panels/inbox/index.js

* Added 'home_screen' verification

Changed recorded name, now when the client is in the WooCommerce 'home' page we record 'home_screen' instead of 'wc-admin'.

* Added a naming fix and a new prop to the recordEvent

* bugfix: added control before interaction with bodyNotificationRef

* Added more unit tests for new endpoints

This commit adds tests for deleting a single note and for deleting all the notes, both without permission.

* Modified variable name

* Refactor: prop rename and small logic change

* Screen name getter moved into the InboxNoteCard

This commit moves the screen name getter inside the InboxNoteCard.

# Conflicts:
#	client/header/activity-panel/panels/inbox/index.js

* Removed "screen" from state

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

* Refactor in admin-notes unit tests

Some unnecessary controls were removed from the admin-notes unit tests

* Indentation fixed in Install.php. Replaced spaces with tabs.

* Inbox notification: added new placeholder and empty card (https://github.com/woocommerce/woocommerce-admin/pull/4379)

* Added a new placeholder and an empty card

This commit adds a new placeholder and a new empty card to the inbox panel

# Conflicts:
#	client/header/activity-panel/panels/inbox/index.js
#	client/header/activity-panel/panels/inbox/style.scss

* Added border to read notes

* Improved note filtering in unreadNotes method and validNotes

# Conflicts:
#	client/header/activity-panel/panels/inbox/index.js

* Actions render refactored

The actions render was refactored in InboxNoteCard component

* Refactor of InboxPanel component

The methods getUnreadNotesCount and hasValidNotes were separated from the InboxPanel component

# Conflicts:
#	client/header/activity-panel/panels/inbox/index.js

* Refactor inbox panel subtitle classes

* Added changes for when a note is undismissed

This commit adds the requested changes in behavior and design for when a note is dismissed.

# Conflicts:
#	client/header/activity-panel/panels/inbox/index.js

* Bugfix: Added key to itemlist

The InboxNotePlaceholder is shown as an itemlist but it didn't have a key. This commit adds it.

* Removed unnecessary validation

* Refactored actionList map

This commit adds a refactor to the actionList map

* Changes to the getUndoDismissRequesting functionality

This commit adds a few changes to the getUndoDismissRequesting functionality

* Changed className prop

* Changed other className prop

* Modified InboxPanel rendering

* Removed unnecessary method in placeholder.js

* Simplified the card.js renderActions method

* Change renderActions return in card.js

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

* Inbox notification: add client unit tests (https://github.com/woocommerce/woocommerce-admin/pull/4386)

* Added client unit tests

* Added test cases for getUnreadNotesCount and hasValidNotes

* Corrected typo error

* Removed Enzyme and added React Testing Library

* Removed unnecessary param

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

* Resolved some conflicts with master

* Marketing note test repaired

This commit repairs the marketing note test

* Added note type 'marketing' to delete all functionality

* Removed set_icon method from some notes and docs

* Added set_icon method as deprecated to prevent errors.

Co-authored-by: Fernando Marichal <contacto@fernandomarichal.com>
Co-authored-by: Joshua T Flowers <joshuatf@gmail.com>
2020-06-03 08:43:35 -03:00
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 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
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
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
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
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
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 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 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
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
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 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 7dd4d2b791 PSR-4ify the reports time interval class. 2019-08-12 15:03:21 -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 e509e51552 PSR-4ify the sync class. 2019-08-12 15:03:11 -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