Commit Graph

51 Commits

Author SHA1 Message Date
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 17d79a2d67 Load chunked translation data from language packs. (https://github.com/woocommerce/woocommerce-admin/pull/4937)
* Combine all JSON translation chunks into one file.

* Use WP_Filesystem.

* Handle core WooCommerce text domain when running as a package.
2020-08-05 15:29:05 -04:00
Jeff Stieler fe1e422039 Fix PHP warning when preloading scripts on WPEngine (https://github.com/woocommerce/woocommerce-admin/pull/4856)
* Handle missing script dependencies when preloading.

* Updated terminology.
2020-07-23 15:02:31 -04:00
Fernando 88a83e4d84 Remove item "profiler" from the menu (https://github.com/woocommerce/woocommerce-admin/pull/4851)
* Lint detail solved

This commit resolves a small lint warning in the file Loader.php

* Removed "profiler" from menu

This commit removes the item "profiler" from the menu.

Co-authored-by: Fernando Marichal <contacto@fernandomarichal.com>
2020-07-22 15:24:33 -03: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
Timmy Crawford c992b2fa7c Build: Don't Attempt to Load non-minified Assets in Core Build (https://github.com/woocommerce/woocommerce-admin/pull/4747)
* Build: Only load non-minified js assets when they are available in the build.

* Avoid multiple Loader instances.

* Fix feature filter name in test bootstrap.

* Fix feature filter used in Loader tests.

Co-authored-by: Jeff Stieler <jeff.m.stieler@gmail.com>
2020-07-06 10:39:58 -07:00
Joshua T Flowers bfb8b68aa6 Remove navigation feature (https://github.com/woocommerce/woocommerce-admin/pull/4740) 2020-07-06 10:21:15 +03:00
Paul Sealock fea332b5b4 Change homepage to homesceen (https://github.com/woocommerce/woocommerce-admin/pull/4549) 2020-06-15 14:17:12 +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
Jeff Stieler 9be6bdd841 Fix loading of RTL styles in chunks. (https://github.com/woocommerce/woocommerce-admin/pull/4542) 2020-06-10 18:06:17 -05: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
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
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
Jeff Stieler 4f48ae9fb7 Fix Dashboard flash before OBW chunk loads. (https://github.com/woocommerce/woocommerce-admin/pull/4259)
* Document the `woocommerce_admin_is_loading` filter.

* Prevent dashboard from being visible during ProfileWizard chunk load.

* Delay removing loading class rather than adding full screen class prematurely.
2020-05-06 06:56:23 -06: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
Ron Rennick 5b201365dd POC store navigation (https://github.com/woocommerce/woocommerce-admin/pull/3202)
* Add base nav component

* Check if current screen is WC registered page

* Add core menu items

* Add param for menu items to migrate and hide old menu items

* Add body classes for wc navigation

* Check capability before adding menu items

* Add submenu items to frontend component

* Hide wc nav behind option

Co-authored-by: Joshua Flowers <joshuatf@gmail.com>
2020-04-27 12:30:32 +03:00
Daniel Bitzer 16fdae3d06 Hide Marketing Tab Recomended Extensions card if marketing suggestions are disabled (https://github.com/woocommerce/woocommerce-admin/pull/4194)
* Add allowMarketplaceSuggestions to woocommerce_shared_settings

* Convert to functional component

* Hide ReccomendedExtensions card if opted out from marketing suggestions
2020-04-24 15:41:57 -07:00
Paul Sealock 2f8ba63ec0 Homepage: Add Hello World, routing, and feature flag (https://github.com/woocommerce/woocommerce-admin/pull/4169)
* Homepage: Add hello world

* check feature flag

* homepage folder

* whitespace
2020-04-23 09:32:44 +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
Jeff Stieler 9973e7e36f Handle orphaned order statuses in analytics settings. (https://github.com/woocommerce/woocommerce-admin/pull/4090)
* Add method to retrieve all synced order statuses.

* Determine what unregistered order statuses we have and add to client-side settings object.

* Stop filtering out unregistered statuses from analytics settings.

* Add unregistered statuses to analytics settings fields.
2020-04-10 08:42:03 -06:00
Matt Sherman 3037eb6f35 Show admin notices on embedded pages. (https://github.com/woocommerce/woocommerce-admin/pull/4019) 2020-03-31 19:38:42 -04:00
Fernando 5242560972 Added hook to delete woocommerce_onboarding_homepage_post_id (https://github.com/woocommerce/woocommerce-admin/pull/4015)
* Added hook to delete woocommerce_onboarding_homepage_post_id

Added hook to delete woocommerce_onboarding_homepage_post_id when the homepage is deleted.

* Moved post type check further up in the method

Co-authored-by: Fernando Marichal <contacto@fernandomarichal.com>
2020-03-31 11:57:01 -03: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
Bec Scott dd279a5cc1 Make WooCommerce breadcrumbs use WooCommerce branding if it is installed (https://github.com/woocommerce/woocommerce-admin/pull/3798)
* Make WooCommerce breadcrumbs use WooCommerce branding if it is installed

* Undo everything

* Whoops, add missing reverted code

* Push 'WooCommerce' out to breadcrumbs from the server except for where it is built up on the client

* Pass translated 'WooCommerce' down from the server to the front end

* Fix comment

* Use `admin_url` to build up the URL

Co-Authored-By: Ron Rennick <ron@ronandandrea.com>

* Use admin_url()

Co-Authored-By: Ron Rennick <ron@ronandandrea.com>

* Show WooCommerce breadcrumb on analytics pages

* Stop double appending the admin URL to the root WooCommerce breadcrumb url

Co-authored-by: Rebecca Scott <me@becdetat.com>
Co-authored-by: Ron Rennick <ron@ronandandrea.com>
2020-03-24 08:57:16 +10: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
Bec Scott 2a7e4f0c97 Make analytics tables use the site's date format setting (https://github.com/woocommerce/woocommerce-admin/pull/3715)
* Make analytics tables use the site's date format setting

* Use getSetting instead of the wcSettings global

* Use configured date format in coupons analytics table

* Use default date format as fallback in analytics

* Rename downloads table class name
2020-02-17 11:12:35 +10:00
Timmy Crawford 02540f3b89 Fix for onboarding in 25.0 (https://github.com/woocommerce/woocommerce-admin/pull/3651) 2020-01-30 15:23:02 -08:00
Joshua T Flowers 243901a38f Onboarding: Mark profiler complete on WC update (https://github.com/woocommerce/woocommerce-admin/pull/3590)
* Mark profiler as complete if previous onboarding install has been handled

* Load features before WC updated hooks

* Add todo note about updating core install check
2020-01-29 11:47:04 -03:00
Paul Sealock 127ede4fd7 Dashboard: fix usermeta prefix (https://github.com/woocommerce/woocommerce-admin/pull/3586) 2020-01-21 08:06:38 +13:00
Jeff Stieler 25c09563a1 Don't modify the document title on existing WooCommerce pages. (https://github.com/woocommerce/woocommerce-admin/pull/3585) 2020-01-20 10:34:24 -07:00
Paul Sealock afd4573f4d Re-add stockStatuses to wcSettings (https://github.com/woocommerce/woocommerce-admin/pull/3573) 2020-01-17 13:42:02 +13:00
Jeff Stieler d57b99e6c7 Revamp uninstallation when WooCommerce Admin is in core. (https://github.com/woocommerce/woocommerce-admin/pull/3546)
* Don't truncate table data on uninstall if WooCommerce Admin is in core.

* DROP tables on uninstall (like core does).

* Migrate wc_ prefix options to woocommerce_.

This allows core WC to clean up when uninstalled.

* Migrate wc_ prefixed user meta fields to woocommerce_.

This allows core WC to clean up when uninstalled.

* Fix use of date().

* Update comment describing the option value filter.
2020-01-16 17:08:29 -07:00
Jeff Stieler 7804d010ed Add moment dependency to script registration. (https://github.com/woocommerce/woocommerce-admin/pull/3429)
Our app and packages expect momentjs as an external.
2019-12-17 08:35:51 -05:00
Ron Rennick d1b356919c don't load analytics dashboard for users without needed capability (https://github.com/woocommerce/woocommerce-admin/pull/3386)
* don't load analytics dashboard for users without needed capability

* add helper function
2019-12-10 10:04:39 -04: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
Paul Sealock 1f4e2fcdfe Use same wp-components version in bundle (https://github.com/woocommerce/woocommerce-admin/pull/3253)
* Use same wp-components version in bundle

* turn off short array rule
2019-11-21 09:36:44 +13:00
Joshua T Flowers 6bb8015cf2 Filter invalid statuses from saved statuses (https://github.com/woocommerce/woocommerce-admin/pull/3268) 2019-11-20 22:52:24 +08:00
Jeff Stieler f8fa7b6bc7 Fetch autocomplete countries from the API rather than wcSettings object. (https://github.com/woocommerce/woocommerce-admin/pull/3262) 2019-11-19 14:17:15 -05: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
Justin Shreve 2af8e7c656 Onboarding: Pass connection parameters to install extensions (https://github.com/woocommerce/woocommerce-admin/pull/3173)
* Generate the WooCommerce cart URL with connection params so installing extensions work

* Build cart URL client side

* Fix alignment
2019-11-06 09:41:38 -05:00
Joshua T Flowers 6520493738 Onboarding: Pre-fill profiler fields with data (https://github.com/woocommerce/woocommerce-admin/pull/3165) 2019-11-05 08:05:20 +08:00
Justin Shreve 973acde227 Fix asset image URL (https://github.com/woocommerce/woocommerce-admin/pull/3062) 2019-10-21 11:07:45 -04:00
Jeff Stieler e53d5daa94 Hook up download button to export endpoint. (https://github.com/woocommerce/woocommerce-admin/pull/2900)
* Move TableCard actions from packaged component to ReportTable.

* Build an IE stylesheet for the main app.

* Remove defunct TableCard download test.

* Update components changelog.

* Fix pagination.

Pull query from table data instead of ReportTable props.

* Initiate report export from download button (https://github.com/woocommerce/woocommerce-admin/pull/2951)

* Add report export operations to API spec.

* Initiate a report export job when there is more than one page of report data.

* Add report download "type" to Tracks event.

* Ensure WC_Emails class is hooked in before sending report download emails.

* Set email parameter for background CSV download requests.
2019-10-08 15:02:26 -07:00
Justin Shreve c2a340da55 Add Stripe, PayPal, Klarna, and Square Connection Flows to the Payments Task (https://github.com/woocommerce/woocommerce-admin/pull/2897)
* Add payment method configuration

* Add stripe connection code

* Finish stripe connection logic

* Add PayPal Connection Flows

* Handle PR feedback: Enable methods when configuring via manual mode, update error modal to just rely on the errorMessage state, add TOS link and acceptance to the profile wizard, update optionsIsRequesting usage, and update docblocks.

* Update TOS message / display

* Add missing success messages on manual save

* Add Square & Klarna to Payments Task (https://github.com/woocommerce/woocommerce-admin/pull/2960)

* Add Square to payments task

* Add logos to payment task

* Add Klarna configuration, and fix assetUrl usage
2019-10-03 12:03:29 -04:00
Justin Shreve 9a48461921 Catch notices earlier than priority 10 (https://github.com/woocommerce/woocommerce-admin/pull/2981) 2019-10-02 09:25:31 -04: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
Mike Jolley 1d8d0df790 Prevent fatal in pageController if get_current_screen is not available (https://github.com/woocommerce/woocommerce-admin/pull/2846) 2019-09-25 13:59:11 -04:00
Jeff Stieler 0be875d898 Reduce size of bundled JS, and overall plugin file size. (https://github.com/woocommerce/woocommerce-admin/pull/2933)
* Remove embed-page-specific Webpack entry.

* Stop @woocommerce/components from being bundled with the app code.
2019-09-24 08:55:39 -07: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