Commit Graph

7 Commits

Author SHA1 Message Date
Paul Sealock 23846221e6 jsDoc: Fix errors (https://github.com/woocommerce/woocommerce-admin/pull/4985)
* jsDoc errors, round 1

* round 2

* round 3

* voila

* root0 -> props
2020-08-18 09:36:24 +12:00
Darren Ethier dc5304823b Add @woocommerce/eslint-plugin (https://github.com/woocommerce/woocommerce-admin/pull/4714)
* 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>
2020-07-28 14:32:58 +12: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
Darren Ethier 33c5b41e3f Align WooCommerce javascript code standards/linting/styles with WordPress core. (https://github.com/woocommerce/woocommerce-admin/pull/3674)
* align code styles with the same configuration as Woo-Blocks

* initial pass of reformat-files

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

* Fix state mutation in image-upload

* remove unused pre-commit-hook.js

* requestAnimationFrame -> window.requestAnimationFrame

* wc-api eslint changes

* eslint fixes on client/lib and client/settings

* client/header eslint changes

* fixes for client/dashboard part 1

* fixes client/dashboard part 2 of 2

* client/analytics part 1

* client/analytics continued

* client/analytics, last batch

* rename __mock__ directory

* pass in useEffect, useState from React component or function

* remove '+' from sprintf string argument

* use ref instead of findDOMNode

* reformat and repaply package.json changes

* install deps before running linter in Travis

* useGetCountryStateAutofill

* counryStateAutofill

* countryStateAutofill

Co-authored-by: Paul Sealock <psealock@gmail.com>
2020-02-14 15:23:21 +13:00
Darren Ethier b57b52ff0c fix error due to fallback not loading when needed for getAdminLink (https://github.com/woocommerce/woocommerce-admin/pull/3297) 2019-11-22 19:30:46 -05:00
Jeff Stieler c2020507e3 Decouple Navigation from `wcSettings`. (https://github.com/woocommerce/woocommerce-admin/pull/3294)
* Move getAdminLink to wc-admin-settings.

* Add changelog entries.

* Look for `getAdminLink()` in @woocommerce/settings first.
2019-11-22 12:07:26 -05: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