* Possibly use safe Text component
* Possibly use safe navigation components
* Add experimental package
* Update components to import from woocommerce/experimental
* Make experimental package private
* Reference experimental package relatively
* Update packages/experimental/README.md
Co-authored-by: Paul Sealock <psealock@gmail.com>
* Update packages/experimental/CHANGELOG.md
Co-authored-by: Paul Sealock <psealock@gmail.com>
* Update history state instead of mocking getQuery in tests
* Handle PR feedback
* Create excluded externals array and return early
Co-authored-by: Paul Sealock <psealock@gmail.com>
* One-shot to enable the homescreen for everybody
* Make the home page the default (only) experience
* remove option check in activity panel tabs, get tests working, fix lint issues
* Remove is-homescreen CSS class
* Remove extra home page route registration
Co-authored-by: Rebecca Scott <me@becdetat.com>
* Add option to not set up sales tax
* Correct JS lint errors
* Add abort option to plugin step
* Inline redirect to home page
* Use testing-library/react for the new test
* Also set woocommerce_calc_taxes to 'no'
Co-authored-by: Rebecca Scott <me@becdetat.com>
* Remove store page creation during new onboarding experience
* Remove onboarding feature flag
* Add back in onboarding feature flag to enable feature loading
* Add onboarding task status API endpoint.
* Add task status to onboarding data store.
* Update appearance task to use onboarding store for status info.
* Update main task list component to use onboarding data store for status info.
* Clear onboarding status info "cache" when setting shipping rates in the task list.
* Clear onboarding status info "cache" when enabling payment methods from the task list.
* Fix onboarding data store reducer tests.
* Clean up redundant code, nest task status settings under new key for hydration.
* Include tasks status in onboarding data hydration.
* Update tax task to use onboarding data store for status info.
* Avoid continually rehydrating onboarding data.
* Refactor payment task method retrieval to use onboarding data store.
* Fix bug with disappearing appearance tax steps.
* Update appearance completion faster by using hydrated onboarding value.
* Avoid PHP warnings when onboarding isn't enabled.
* Remove unused imports.
* Move controls to data package root
* Add reports data store in wp data
* Move report utils to data package
* Update error state and actions to match existing methods
* Update references to reports data store
* Add error setters
* Fix control registration path
* Add reports reducer tests
* Remove remaining report wc-api references
* Handle PR feedback
* reference packgage, not lib/date
Co-authored-by: Paul Sealock <psealock@gmail.com>
Fixeswoocommerce/woocommerce-admin#4592
This adds the functionality to support a store setup tab displayed in ActivityPanel. The tab currently just redirects to the home page, rather than implementing the nice-to-haves of displaying the task list in the panel. The reason for this, is that I found it would require significant refactoring of the task list to support this currently.
As part of this I have also refactored rendering of tabs inside into 2 new functional components: <Tabs> and <Tab>. The reason for this is to decompose large untestable components, test them and by virtue of being decomposed they will also be more reusable in future. Ideally would have been refactored to a functional component as well, but it would have been too large a task.
* Added personalization to purchase extension task
This commit adds personalization to purchase extension task
* Removed unnecessary naming fix
This commit removes an unnecessary naming fix
* Corrected param description
* Solved translation problem
* Naming corrected
The method 'getGroupedOnboardingProducts' was given a more accurate name.
* Modified string substitution
Co-authored-by: Fernando Marichal <contacto@fernandomarichal.com>
* add new woocommerce/eslint-plugin
* implement eslint-plugin (switch scripts to use wp-scripts etc)
* various linting fixes
* more lint fixes
* improve fix script
* more eslint fixes
* more eslint fixes
* temporary convert rules to warnings until they are all handled
* linting fixes
* update package-lock.json
* remove duplicates
* remove unnecessary `@wordpress/dependency-group` rule config
* add docs and adjust rules
* prettier fix
* fix merge artifact
* convert more rules to warnings
* change order to reflect importance
* install babel-preset-default
* remove unnecessary configuration for babel
* fix dependency group rule and test
* fix test
* handle collapsible whitespace
* add react testing library eslint plugin
* linter errors
* Add back in prettierrc
* package-lock update
* js lint fix with --fix
* disable whitespace in translation
* package-lock update
* make eslint actual dependency, not peer dependency
* pin eslint to v7
* I don't know why, but its working
* fix lint js
Co-authored-by: Paul Sealock <psealock@gmail.com>
Fixeswoocommerce/woocommerce-admin#4732
This updates `@wordpress/base-styles`, and because `@wordpress/components` depends on variables from it, that must be updated as well.
There are 3 major changes required as part of updating:
1. The $theme-color variable is no longer exposed by base-styles. Instead there are 3 css vars exposed. These are made available by use of a provided mixin. Situations where $theme-color was darkened using scss have been mapped as best as possible to the 2 other darkened shades of the css var that are available such as `--wp-admin-theme-color-darker-20` and `--wp-admin-theme-color-darker-10`. In some cases this means the colors are not exactly the same as before.
2. The post css `theme()` call is no longer available. All uses of this have been consolidated to use of the main theme css var `--wp-admin-theme-color`. This means that calls like `theme(secondary)` or `theme(outline)` etc have all been consolidated to the one color.
3. Many of the variables used for different shades of gray have been deprecated. These have been mapped across to the new gray variables. (Mapped according to the list described in woocommerce/woocommerce-admin#4732)
* 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>
* Bring homescreen styles into task list so it is styled correctly in the dashboard view
* Copy homescreen card styles to new .woocommerce-dashboard-card class
* Move styles to dashboard stylesheet.
Co-authored-by: Rebecca Scott <me@becdetat.com>
Co-authored-by: Timmy Crawford <timmydcrawford@gmail.com>
* Fix secondary button style in OBW.
* Center snackbar notices in OBW.
* Scope snackbar changes to just the OBW.
* Add busy treatment to Jetpack connect button when redirecting.
* Remove color override for form toggles in ellipsis menus.
* Fix styling of task list.
* Fix button styles in date range picker component.
* Use admin theme colors in calendar component selections.
* Fix datepicker styling on analytics settings page.
* 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.
* Changed some API responses
This commit adds changes to some API responses
* Changed "woocommerce_task_list_complete" loading in frontend
* Updated "$migrated_options" array
This commit updates "$migrated_options" array and adds a deletion control
* Changed "taskListComplete" in customizable.js
Co-authored-by: Fernando Marichal <contacto@fernandomarichal.com>
* Get Jetpack stats appearing on the home page
* Update hidden stats in stats overview test
* Make jetpack stats appear by default
* Add reportUrlType to dashboard store performance area
Co-authored-by: Rebecca Scott <me@becdetat.com>
* Migrate onboarding from wc-api to wp-data store
* Add tests for onboarding reducer
* Update references to onboarding data store
* Update tests for replacing profileItems
* Add onboarding hydration for profile items
* Prevent store from being registered twice
* Add requesting state to onboarding store
* Prevent duplicate registration on all wp data stores
* Update more components to use new wp data onboarding store
* Add tests for onboarding requesting state
* Update isRequesting to use isOnboardingRequesting
* Update task list to closer match new designs.
* Update TaskList placeholder to match the new design.
* Hook up store details task click.
* Don't show "skip" prompt for task list on new home screen.
* Update time estimates for tasks.
* Add progress indicator to TaskList.
* Use null container for store details task.
* Fix progress bar styling.
* Just use card menu for TaskList dismissal.
* Don't show TaskList on analytics overview if homepage feature is enabled.
* Initial refactor of TaskList to use WP card.
* Style TaskList items and card header.
* Style "hide" button for TaskList.
* Don't show TaskList after it's completion.
* Don't show TaskList placeholder when options are still loading.
Avoid a potential flash of the placeholder without showing the TaskList.
* Fix border radius on progress bar.
* Fix TaskList header style with homepage feature disabled.
* Remove defunct function.
* Remove unnecessary import.
* Some minor color tweaks (https://github.com/woocommerce/woocommerce-admin/pull/4436)
* Colors
* Only show time estimation for incomplete tasks
* Don't show chevron on completed tasks.
Co-authored-by: Jeff Stieler <jeff.m.stieler@gmail.com>
* Preload task list completed option, show placeholder when loading.
* Fix alignment of "hide this" button.
Co-authored-by: James Koster <james@jameskoster.co.uk>
* 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.
* Fix WCPay task Settings link
Fixeswoocommerce/woocommerce-admin#4293 by setting link type for new pageload.
* Check for success query param to show notice
* Shrink WCPay task footnote so it fits in one line
* Remove unnecessary Fragment wrapper
* Omit option update from client side
The payment method is already enabled when the connection is finalized on redirect.
* 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>
* Allow updateActivePlugins to add new plugins instead of replace
* Add autoConnect prop to Jetpack Connect component
* Add connect component to plugin benefits screen
* Add onError and missing prop types for Connect
* Update redirect URL after Jetpack connection
* Add tests for added active plugins
* Skip install if plugin error exists
* Update active and installed plugins to use replace flag
* Update tests to handle replace flag
* Refactor plugin install flow pending state
* 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
* Save payment skipped and event timestamp to options
* Add payments note
* Convert payments task timestamp to seconds
* Skip payments note if skip timestamp is not set
* 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>
* Move ProfileWizard component out of Dashboard.
* Don't trigger the OBW from the Analytics Dashboard (with new home screen).
* Trigger OBW from the new home screen.
* Fix duplicate import.
* Specify home screen in tracks event when enabled.
* Add Jetpack info to home page Tracks event.
* Use @wordpress/data's withSelect - no need for wc-api.
* Add plugins hydration to existing compose() call.
* Safer access of wcSettings object in plugins hydration.
* Remove redundant plugins hydration from TaskList and ProfileWizard.
* Change "Demo" to "Sample" products
A few years ago we had a discussion on the name of the files for test products and we choose "sample" data over "dummy" data. I think we should likely stick to that naming (which is also the name of the folder and the files in WC core: https://github.com/woocommerce/woocommerce/tree/master/sample-data)
This commit changes that wording
* Small update in caps of "Build a better WooCommerce"
All titles and questions in the new onboarding wizards only capitalise names and the first letter of the sentence. This seemed a tiny bit off.
* Remove auto connect steps from Stripe payment task
As of May 31 the API for stripe account auto creation will no longer be
supported. As a result, the Stripe payment on-boarding step will no
longer be able to auto create accounts for users.
This removes all auto connect functionality from this step, and instead
falls back to the oAuth setup flow.
See:
https://wcpay.wordpress.com/2020/02/06/stripe-ending-support-for-the-deferred-account-activation-api-on-may-31/#comment-2080
* Fix logic to decide which connect method to render
When the Stripe component renders for the first time, it
always returns the manual connect method. This is because there is
an additional call to requiresManualConfig() in getConnectStep which
looks for values in activePlugins that won't be present on the initial
component render.
This removes this check and instead relies on the isPending state to
help decide to render a connect method or wait for oAuth connectURL
to finish fetching.
* Remove redundant error modal render method
This removes the error modal render method as it is also no longer
needed with the removal of auto account creation.
This also removes errorMessage and errorTitle state along with any
references to these values.
* Changed element that is compared after choosing a theme
Onboarding - There was a problem in the theme verification where at the end of the profiler it always went into the installation flow. This problem was solved in this commit.
* Added check to choose the right flow (install or activate plugin)
Co-authored-by: Fernando Marichal <contacto@fernandomarichal.com>
* 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
* Enlarged competitors' Listbox in the Onboarding
Onboarding - Added a new class to enlarge the competitors' Listbox in the Business details step.
* Replaced fixed height with unset
Co-authored-by: Fernando Marichal <contacto@fernandomarichal.com>
* Added check to show WC Pay option only when Jetpack is connected
A verification was added to the Setup Checklist payment step, to show WC Pay option only when Jetpack is connected
* Changed the solution approach
Co-authored-by: Fernando Marichal <contacto@fernandomarichal.com>
* Bugfix on payments step in CBD flow
The `array_search` method was changed to `in_array`
* After pressing Connect a new tab opens with the Square webpage
* Updated behavior for non CBD Square payment connection
* Square option's name updated
* Replaced <p> tag with a <div> tag
Since there was a `validateDOMNesting` warning because we weren't adding only text inside a <p> tag, the `p` tag was changed to a `div`.
Co-authored-by: Fernando Marichal <contacto@fernandomarichal.com>
* Use plugin component with autoinstall in benefits step
* Cache plugins to install to prevent render changes on install
* Add busy state to button when installing
* Prevent multiple requests being fired when awaiting next step
* Disable buttons when actioned
* Hide some more performance indicators by default.
Don't show: AOV, Returns, Gross Sales.
* Fix default hidden dashboard chart identifiers.
They were missing the expected endpoint prefix.
* Pass specified totals/intervals fields parameter to the Order Stats Query.
* Only request stats used in render for report summaries and charts.
Implement Orders as an example.
* Specify stats fields for all report requests.
* Add 'fields' parameter handling to all stats endpoint controllers.
* Reduce stats fields requested by dashboard charts.
* Add feature flag for wcpay (https://github.com/woocommerce/woocommerce-admin/pull/3958)
* Add card to payments task for WooCommerce Payments (https://github.com/woocommerce/woocommerce-admin/pull/3978)
* Add card to payments task for WooCommerce Payments
* Add missing plugin and settings PHP constants for woocommerce payments
* Add endpoint to return url to kick off wcpay
* Fix incorrect option name
* I can haz purple with white text, plz
* Linkify TOS, settings
* Recommend wcpay when visible; move wcpay to list top
* Test for wcpay feature flag
* Improved handling of feature flag
* If the user is an agency, include wcpay docs link on card
* Reverse agency logic, LOL
* Camel case fillRule etc
* Turn off wcpay for core and plugin for now
Omit validation error (and resulting disabled "Continue" button) on the other platform name text field, in an edge case where the field is first required but value is missing, and then no longer required.
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)
* Refactor logic for showing dashboard reports and tasklist
* Check for complete option status instead of visible tasks in dashboard
* Update task list status on task list completion
* Track task completion event server-side on option add
* Add option to track previousdly completed events
* Track previously untracked tasks on option update
* Get flat rate and free shipping methods in Rates component
* Update shipping methods by type
* Disable all shipping methods except the one being updated
* Update toggleEnabled to be toggleable for readability
* Check if shipping method has cost before getting value
* Onboarding: Modified the recorded data in profile wizard
In the second step of the profile wizard, now 'industries_with_detail' is a 'string' instead of an 'object'.
* Selected industries converted to a string
Selected industries are converted to a string to send to recordEvent
Co-authored-by: Fernando Marichal <contacto@fernandomarichal.com>
* Add on Cash on Delivery method to payment methods
* Add direct bank transfer method
* Update enabled paymet methods in markConfigured
* Add missing bacs property
* Add bacs styling
* Add isConfigured property to all payment methods
* Remove payment configuration checks from server side
* Add isEnabled flags to all payment methods
* Add payment method toggle methods
* Extract payment methods
* Fix update options selectors
* Add error handling for payment method updates
* Remove configured from saved option
* Add event when payment is toggled
* Check if payment option exists before checking config
* Only fetch PayPal connection URL when plugin is active
* Only fetch Stripe connection URL when plugin is active
* Onboarding: business step: add Google Ads extension install
* Updated extension slug etc to match the extension
* Fix a couple of slugs that were missed
* Remove extra div that was breaking because of an unrelated change (reused class name)
Co-authored-by: Bec Scott <me@becdetat.com>
* Add new payment method cards
* Refactor payment methods
* Track payment configuration and completion client-side
* Record tasklist_payment_connect_method event in markConfigured
* Record event on payment setup
* Add recommended payment method ribbon
* Return to payments task even when previously configured