Commit Graph

4 Commits

Author SHA1 Message Date
Mike Jolley 2d506f9f57 Fix/you do not need lodash (https://github.com/woocommerce/woocommerce-blocks/pull/9161)
* Remove lodash `without` usage

* isNumber

* Remove lodash `difference`

* Replace lodash isEmpty with type guard

* Replace isObject with type guard

* remove lodash noop

* Replace lodash clamp

* replace lodash uniqueId

* Remove uniqueId import

* Add eslint rule to restrict lodash import

* Replace lodash range

* Replace lodash has() function

Replace lodash has

* replace omitby

* Replace lodash isEqual with fastDeepEqual

* Replace kebabCase with change-case package

* Replace lodash camelCase

Replace lodash mapKeys with function

Move mapkeys to utility

Create camelCaseKeys which replaces usage of mapKeys

* Replace lodash debounce with custom utiity

* replace lodash keyby

* Replace lodash pick with native function

* Replace lodash cloneDeep with klona

* Replace snake case keys package with change case

* Replace sortBy with fast sort package

* replace isEmpty with type guard

* Replace pickBy usage in validation reducer

* Replace groupBy usage in search list control

* Replace flatten, uniqBy usage in getProducts()

* Remove setWith and clone from updateState

* Replace custom useThrottle with useThrottledCallback from use-debounce package

* onSelectRate can use-debounce

* Fix missing flatten

* Update assets/js/data/cart/test/push-changes.ts

Co-authored-by: Paulo Arromba <17236129+wavvves@users.noreply.github.com>

---------

Co-authored-by: Paulo Arromba <17236129+wavvves@users.noreply.github.com>
2023-04-28 11:29:45 +01:00
Michael P. Pfeiffer 521f93619b Upgrade wp-prettier to 2.6.2 and reformat the codebase (https://github.com/woocommerce/woocommerce-blocks/pull/6566)
* Remove mixed tabs and spaces in tsconfig.json

* Update formatting in json files

* Upgrade wp-prettier to 2.6.2
2022-06-15 11:56:52 +02:00
Daniel Dudzic 5a3c7be9a4 Revise Storybook entries for Checkout Blocks/totals components (https://github.com/woocommerce/woocommerce-blocks/pull/5853)
* Revise Storybook entries for Checkout Blocks/totals components

Revise Storybook entries for Checkout Blocks/totals components

Co-authored-by: Luigi Teschio <gigitux@gmail.com>

* Fix a typo in the Item label value

* set disable value for description and disable control for 'showRateAfterTaxName' prop

Co-authored-by: Luigi Teschio <gigitux@gmail.com>
2022-02-25 09:58:09 +01:00
M. L. Giannotta 703051b1bc Storybook and TS migration of some cart checkout components (https://github.com/woocommerce/woocommerce-blocks/pull/5324)
* Migrate stories for `ProductName` to latest Storybook. Also add props
documentation and add named export.
* Migrate `TotalsFooterItem` to TypeScript and latest Storybook
* Add a `LooselyMustHave` utility type.
* Export `allSettings` so that they can be manipulated in stories and tests

* Implement a way to easily define and reuse Storybook controls

Implement a currency control for a common use-case of selecting currencies.
It currently implements EUR and USD as they have different properties.

* Migrate `TotalsDiscount` to TypeScript and implement stories
* Migrate `TotalsCoupon` to TypeScript and fix stories
* Change Coupon name within Storybook
* Nicer handling of removal of a coupon from Storybook

It now dynamically calculates the discount from the actual coupons.
2021-12-15 17:30:17 +01:00