* 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)
* 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.
* 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.
* 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>
* Decouple date package from wcSettings.
* Update missed documentation and example.
* Expect simpler prop values for date filter.
* Remove unused props from primary/secondary dates.
* Avoid introducing moment dependency for type checking.
* Handle null moment/date values in DateRangeFilterPicker.
* Fix missing ISO date format.
* Fix moment instance detection.
* 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.
* Save section/block preferences in user data
* Optimize updateSection code
* Remove no longer used prop
* Refactor dashboard blocks to make them extendable
* Check that defaultSection exists before merging
* Rename 'sectionsDefinion' to 'defaultSections'
* Add Dashboard README
* Update README with new props
* Update settings when moving/removing dashboard sections
* Add missing props to README example
* Move 'section.js' inside 'components' folder
* Fix README sentence
* Allow renaming Dashboard sections
* Create a wrapper 'Section' component that handles the section title events
* Add blank lines in ellipsis-menu code
* PR feedback
* Remove onToggle prop from EllipsisMenu
* Get rid of default title
* Translation call text domain change from “wc-admin” to “woocommerce-admin”.
* Fix .pot file generation.
* Fix errantly closed array item in /revenue/stats controller.
* Rename plugin zip, main file, and repo name to "woocommerce-admin".
* Make column filter menu items not focusable
* Check if onInvoke exists before calling it
* Revert "Check if onInvoke exists before calling it"
This reverts commit e3b63edd51395c0f967991e2d20fccf867e37b91.
* Revert "Make column filter menu items not focusable"
This reverts commit 3e0ac949fa057a0c235876731768b6f312ced998.
* Add isCheckbox prop to MenuItem component
* Fix arrow keys navigation in checkbox menu items
* Table: don't update showCols state when the headers prop changes
history.createHashHistory() is being called whenever this package is
imported, which causes the URL to redirect to a hash. This is
unnecessary in cases where elements of wc-admin are used outside of a
completely controlled/routed page.
This lazy-creates the history object only when it's needed and therefore
avoids the URL redirection unless history features are in use.
* Add dashboard chart links to reports
* Remove extra css background property from screen reader text
* Remove elements from previous click handler attempt
* Concat translation strings with sprintf
* Change chart hover interactions
* Move i18n to external dependencies
* Make legend buttons match background on hover
* Add user preferences for shown dashboard charts
* Add user preferences for dashboard chart type
* Check if user preferences are set before assigning to state
* Move API update methods out of callbacks and use xor