Mike Jolley
901e996cc5
Add money formatting to API responses ( https://github.com/woocommerce/woocommerce-blocks/pull/1367 )
...
* Implement basic version of MoneyValue with decimal conversion
* Implement MoneyValue in cart classes
* Add minor unit to schema
* Update tests
* Add tests
* Tweak minor unit description
* Replace pow
* Dump rounding mode and use constant values
* Only return strings
* prepare_money_response method
* Update types back to string
* Remove unnecessary parentheses
* Feedback; force integer rounding mode to prevent notices
2019-12-13 15:37:11 +00:00
Rua Haszard
e5bc742853
add pricing discount info to cart line items api ( https://github.com/woocommerce/woocommerce-blocks/pull/1325 )
...
* add more pricing detail to cart line items api:
- total line price, before any coupon/discount
- saving, aka discount amount (if any)
- boolean if saving > 0
* add new cart price info properties to schema
* tidy field naming – line subtotal=pre discounts, line total=discounted
* remove saving / discount fields from API – could be calculated on client
* return numbers (not string) for price fields
* rename API field "price" to product price for clarity
* fix schema type for total fields (now float)
* Total descriptions in schema
* Format all costs as strings to follow core rest api
* Add totals to cart schema
* Update tests
* tax_lines
2019-12-12 10:31:25 +00:00
Mike Jolley
a753cbb25c
Store API: Add shipping rate api ( https://github.com/woocommerce/woocommerce-blocks/pull/1344 )
...
* Add basic controllers
* Schema
* Collections
* Updated schema
* Remove package ID
* Destination handling
* Destination validation
* Rename method for extra clarity
* Tests
* RestContoller type
* typos
* Fix object/array definitions
* Fix shipping-rate definition
* Fix tests
* Add docs
* Tweak description
2019-12-10 13:54:18 +00:00
Mike Jolley
c55a387657
Prevent multiple collection data requests using debounce ( https://github.com/woocommerce/woocommerce-blocks/pull/1233 )
...
* Add context for collection data query
* Introduce useCollectionData hook
* Implement hook in filter blocks
* Update API to handle nuances of counts instead of client side
* Clone requests so original is untouched
* Prevent dupe requests is working
* Cleanup
* Update assets/js/base/hooks/use-collection-data.js
Co-Authored-By: Albert Juhé Lluveras <aljullu@gmail.com>
* Update assets/js/base/hooks/use-collection-data.js
Co-Authored-By: Albert Juhé Lluveras <aljullu@gmail.com>
* Feedback
* Remove context
2019-11-23 17:04:30 +00:00
Seghir Nadir
1d67ec5ce9
Add on_sale to Store API for it to work. ( https://github.com/woocommerce/woocommerce-blocks/pull/1185 )
...
* add on sale to store api
* fix onsale to on_sale
* update preview to use on_sale
* update tests to use on_sale
2019-11-15 19:11:03 +01:00
Mike Jolley
c412dde269
Store API - Add tests for product attributes endpoints ( https://github.com/woocommerce/woocommerce-blocks/pull/1151 )
...
* Add product attribute unit tests
* Add missing description param
* Allow returning empty terms
* Attribute terms tests
* Update tests/php/RestApi/StoreApi/Controllers/ProductAttributes.php
Co-Authored-By: Albert Juhé Lluveras <aljullu@gmail.com>
* Update tests/php/RestApi/StoreApi/Controllers/ProductAttributeTerms.php
Co-Authored-By: Albert Juhé Lluveras <aljullu@gmail.com>
2019-11-12 12:04:19 +00:00
Mike Jolley
c038a7fed4
Filter all products block by attribute ( https://github.com/woocommerce/woocommerce-blocks/pull/1127 )
...
* Block setup
* Working filtering and intersection of arrays
* Implement block settings and no attribute placeholder
* Correctly toggle counts
* Implement filtering
* Fix price slider constraints
* Fix price slider constraints
* Edit mode
* Rename ProductAttributeControl to ProductAttributeTermControl
* Attribute ID saving
* fix incorrect test fixtures
* fix incorrect regex for parsing model (or resource names) from the route.
* Fix query classes for some endpoints
* Style improvements
* Update inline comments
* use previous tests
* Show attribute control in sidebar
* Remove displayStyle option
* Sort attributes by name
* Show more/less toggle
* Use renderFrontend
* Only sort when adding values
* Rename memo placeholder
* More specific CSS for pointer
* Update assets/js/base/hooks/use-query-state.js
Co-Authored-By: Albert Juhé Lluveras <aljullu@gmail.com>
* Remove always true taxonomy check
* Update assets/js/blocks/attribute-filter/block.js
Co-Authored-By: Albert Juhé Lluveras <aljullu@gmail.com>
* Remove lodash join
* native js for string casting
* Move internal deps
* hyphenate attributes
* Correct data set names
* Remove unwanted dependency
* Moving imports
* Missing deps
* replace yoda conditonal
* Missing deps
* Missing deps
* Check value exists
* Remove undefined filter
* renderedOptions usememo
* Set defaults in checkbox list
* Show more/less refactor
* Use getAdminLink
* Fix object length check
* Correct AND query handling for counts
* useQueryStateByContext
* Add store rest endpoints
* Update assets/js/base/components/checkbox-list/index.js
Co-Authored-By: Albert Juhé Lluveras <aljullu@gmail.com>
* Update assets/js/base/components/checkbox-list/index.js
Co-Authored-By: Albert Juhé Lluveras <aljullu@gmail.com>
* Update assets/js/base/components/checkbox-list/index.js
Co-Authored-By: Albert Juhé Lluveras <aljullu@gmail.com>
* Update assets/js/blocks/attribute-filter/block.js
Co-Authored-By: Albert Juhé Lluveras <aljullu@gmail.com>
* Feedback
* feedback
* API readme
* Fix API relation queries for multiple attributes
* Prevent all options flashing visible during loads
* null check
* Improve loading state
* Remove null options change - it's no longer needed
2019-11-11 10:32:56 +00:00
Mike Jolley
524de4555e
Move "prices" data from rest API to store API ( https://github.com/woocommerce/woocommerce-blocks/pull/1128 )
2019-11-05 16:47:32 +00:00
Darren Ethier
dafd1c22c0
add additional data to new products store endpoint ( https://github.com/woocommerce/woocommerce-blocks/pull/1116 )
2019-11-01 13:50:01 +00:00
Mike Jolley
9d79403db2
REST API - Store API - Product filtering data, products endpoint, and cart refinements ( https://github.com/woocommerce/woocommerce-blocks/pull/1055 )
...
* Cart add endpoint and schema
* Empty card DELETE method
* Merge into single controller
* Revise verb usage
* PUT/update requests
* Move under rest api namespace
* Basic test coverage
* Invalid tests with status check
* Variation handling
* Update src/RestApi/StoreApi/Schemas/CartItemSchema.php
Co-Authored-By: Albert Juhé Lluveras <contact@albertjuhe.com>
* Remove key arg for delete endpoint
* code comment for creation
* rename param to product_id
* Renaming methods from _item to _cart_item
* Prepare storeAPI products endpoint for public use
* Price filter headers
* Attribute counts
* Add Rating filter
* Rating counts
* Fix counts
* Moved utilities
* API docs
* Use correct response for cart item
* Attributes filtering
* Stats
* Products/Stats unit tests
* Rename stats to collection data
* Remove `embed` from schema
* Add since $VID:$ tags
* Improve operator logic and add isset checks
* Force cart schema to be readonly
2019-10-25 10:43:52 +01:00
Mike Jolley
b0b5cc51a3
Introduce a Cart API on top of the REST API ( https://github.com/woocommerce/woocommerce-blocks/pull/1046 )
...
* Cart add endpoint and schema
* Empty card DELETE method
* Merge into single controller
* Revise verb usage
* PUT/update requests
* Move under rest api namespace
* Basic test coverage
* Invalid tests with status check
* Variation handling
* Update src/RestApi/StoreApi/Schemas/CartItemSchema.php
Co-Authored-By: Albert Juhé Lluveras <contact@albertjuhe.com>
* Remove key arg for delete endpoint
* code comment for creation
* rename param to product_id
* Renaming methods from _item to _cart_item
2019-10-21 12:11:52 +01:00
Darren Ethier
e5bf616dca
Add bundlesize package and tweak travis config ( https://github.com/woocommerce/woocommerce-blocks/pull/822 )
...
- adds bundlesize package and travis config to run it on pulls (reports size as a check on pulls)
- reconfigure travis configuration so that jobs are split by task for easier review/reporting
- Fix failing phpunit tests exposed as a result of the travis reconfiguration
- Fix legit fail exposed by failing phpunit test in products REST endpoint (permissions related)
- Don't abort plugin initialization when detecting no build asset file but still throw notice (necessary to ensure php tests run in travis because we don't build js/css assets unnecessarily for those tests)
2019-08-09 14:08:31 -04:00
Mike Jolley
51ece61df6
Update namespaces to include Automattic prefix ( https://github.com/woocommerce/woocommerce-blocks/pull/653 )
...
* Update namespaces with Automattic prefix.
* Use static methods for stateless class
2019-06-27 11:28:52 +01:00
Mike Jolley
8bc02c3b0c
Include blocks api in feature plugin ( https://github.com/woocommerce/woocommerce-blocks/pull/628 )
...
* Progress moving endpoints
* Handle rest api registration
* Add tag_operator to blocks API
From https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/555
* Unit tests
* update travis
* Composer before install
* Travis config
* switch dir running composer
* nodev mode
2019-06-27 11:03:21 +01:00