Commit Graph

7 Commits

Author SHA1 Message Date
Mike Jolley 435e341fe6 Expose cart errors as notices (https://github.com/woocommerce/woocommerce-blocks/pull/8162)
* Scroll to errors when interacting with radio buttons

* Fix full stop wrapping in checkout

* Make type guard for api response reusable

* Merge useShippingData  and useSelectShippingRate

Overlapping functionality and responsibility easily merged into a single hook.

* ShippingDataProvider Typescript

* Create errors when receiving errors via thunk

* Update DEFAULT_ERROR_MESSAGE

* Update tests since all errors are set via new action

* Correct SET_ERROR_DATA

* Update json error text and allow it to be dismissed

* Add back missing comment in types

* Put back typedef

* Allow Store Notice Containers to display subContexts without changing original context

* receiveError handles cart

* Update assets/js/data/cart/notify-errors.ts

Co-authored-by: Thomas Roberts <5656702+opr@users.noreply.github.com>

* Update assets/js/base/context/hooks/shipping/types.ts

Co-authored-by: Thomas Roberts <5656702+opr@users.noreply.github.com>

* Remove debug

* Revise type (remove as)

* rename to unregisteredSubContexts

* getNoticeContexts comment

* Add test for unregistered errors

* Update comment

Co-authored-by: Thomas Roberts <5656702+opr@users.noreply.github.com>
2023-01-19 16:40:52 +00:00
Mike Jolley c611635179 Handle Local Pickup Selection in the Cart (https://github.com/woocommerce/woocommerce-blocks/pull/7958)
* Shipping and collection method block package support (https://github.com/woocommerce/woocommerce-blocks/pull/7383)

* Shipment wordage

* Hide panel if collection is not available for an item

* Update selection when displayed

* Register a global local pickup method for the block based checkout (https://github.com/woocommerce/woocommerce-blocks/pull/7414)

* Register a blocks local pickup method globally

* Remove local pickup plucking from store api

* Multiple pickup locations

* Unused code

* Translate meta data

* Update UI to match zones table

* Description

* Handle new shipping method in client

* Improve location rendering

* Only split out pickup location methods

* Fix enabled toggle

* Show and hide shipping text in sidebar based on pickup

* No need for "from" when min and max are the same price

* Update sample data for the editor

* fix errors

* Force method/pickup in the checkout layout (https://github.com/woocommerce/woocommerce-blocks/pull/7910)

* Split up ShippingRatesControl for readability

* Alignment styling

* Split tidy packages for readability

* Combine hooks to prevent circular dependency

* Notice styling

* Conflict

* Hide notice with 1 package

Co-authored-by: Nadir Seghir <nadir.seghir@gmail.com>
2023-01-12 15:42:43 +01:00
Niels Lange 3d55668983 Create Cross-Sells product list (https://github.com/woocommerce/woocommerce-blocks/pull/6645)
* Create Cross-Sells product list

* Show “Read more” button for out-of-stock cross-sells products

* Update assets/js/blocks/cart/inner-blocks/cart-cross-sells-products/block.tsx

Co-authored-by: Thomas Roberts <5656702+opr@users.noreply.github.com>

* Update assets/js/blocks/cart/cart-cross-sells-product-list/index.tsx

Co-authored-by: Thomas Roberts <5656702+opr@users.noreply.github.com>

* Remove obsolete isLoading and placeholderRows

* Fix TS errors

* Rename crossSellsProduct to product

* Fix critical error

* Lock “Cart Cross-Sells products” inner block

* Update assets/js/blocks/cart/inner-blocks/cart-cross-sells-products/block.json

Co-authored-by: Saad Tarhi <saad.trh@gmail.com>

* Prevent moving of the Cross-Sells block

Co-authored-by: Thomas Roberts <5656702+opr@users.noreply.github.com>
Co-authored-by: Saad Tarhi <saad.trh@gmail.com>
2022-09-21 13:04:15 +07:00
Thomas Roberts a6bff7e6e8 Change `shippingRatesLoading` to `isLoadingRates` (https://github.com/woocommerce/woocommerce-blocks/pull/5999)
* Change `shippingRatesLoading` to `isLoadingRates`

* Revert isLoadingRates back to old name in payment method interface

* Update docs with correct names returned by usePaymentMethodInterface

* Update TS to name the selectShippingRate method correctly

* Change method name on usePaymentMethodInterface back
2022-03-14 11:29:25 +00:00
Mike Jolley dbbb99d55e Move Block Type Settings into Block Type Classes (https://github.com/woocommerce/woocommerce-blocks/pull/4059)
* BLOCK SETTINGS: Remove unused constants/settings

* AssetDataRegistry: Helpers to check for settings that exist, and registering page ID/permalinks

* Move checkout and cart block settings to checkout and cart blocktypes

* Move isShippingCalculatorEnabled to cart block

* Remove HAS_DARK_EDITOR_STYLE_SUPPORT and IS_SHIPPING_CALCULATOR_ENABLED in favour of getSetting

* Move displayCartPricesIncludingTax to blocktypes, and implement getSetting

* Move block settings to core settings and blocktypes

* Fix namespace usage

* Move review settings

* move tag settings

* Keep productCount in core data

* Move min and default height

* Improve storePages code

* Move attributes to attribute filter block type

* Move $word_count_type outside of settings array

* Remove unneeded setting in preview data (shippingCostRequiresAddress)

* Move min/max settings dependency from GridLayoutControl to Blocks themselves and use getSettings

* DEFAULT_COLUMNS and ROWS to settings

* Move product columns/rows to block types

* Add grid settings to AllProducts block

* Correct default rows

* correct min rows default

* Move hasDarkEditorStyleSupport

* Move hideOutOfStockItems to block type settings

* Move build settings to inline script dependency

* Pass data through asset api and move restApiRoutes

* Export all core settings as constants

* Remove WORD_COUNT_TYPE from core settings

* Move some other core settings to assets

* Update constants

* Make settings use TypeScript

* Update CURRENT_USER_IS_ADMIN usage

* WORD_COUNT_TYPE

* REST_API_ROUTES

* REVIEW_RATINGS_ENABLED and SHOW_AVATARS

* Remove REVIEW_RATINGS_ENABLED and SHOW_AVATARS constants

* Remove MIN_HEIGHT

* Remove DEFAULT_HEIGHT

* PLACEHOLDER_IMG_SRC

* LIMIT_TAGS

* HAS_PRODUCTS

* HOME_URL

* HAS_TAGS

* COUPONS_ENABLED

* SHIPPING_ENABLED

* TAXES_ENABLED

* DISPLAY_ITEMIZED_TAXES

* SHIPPING_COST_REQUIRES_ADDRESS

* SHIPPING_STATES and SHIPPING_COUNTRIES

* STORE_PAGES

* ALLOWED_COUNTRIES

* ALLOWED_STATES

* SHIPPING_METHODS_EXIST

* PAYMENT_GATEWAY_SORT_ORDER

* CHECKOUT_SHOW_LOGIN_REMINDER

* CHECKOUT_ALLOWS_GUEST and CHECKOUT_ALLOWS_SIGNUP

* ATTRIBUTES

* DISPLAY_CART_PRICES_INCLUDING_TAX

* DISPLAY_CART_PRICES_INCLUDING_TAX

* update build for TS files

* fix build dir

* Move blocks build config params

* Move placeholderImgSrc to core settings

* Move rest api hydration hoc to shared hocs and provide it restApiRoutes directly to avoid asset data registration

* Move wordCountType to abstract block

* Remove WORD_COUNT_TYPE in favour of getSetting

* Move IS_LARGE_CATALOG and PRODUCT_COUNT to abstract block type and use getSetting inline

* Add wcBlocksConfig

* fix tests

* Remove unused $asset_data_registry

* remove console.log

* Move build settings to abstract block

* Trigger build again

* Move hydration back to regular hocs for compatibility with trunk (merge conflict)

* Removed wcSharedHocsConfig

* esc home url

* Update search fixture

* Update search snap

* 40000 timeout

* hasProducts -> productCount

* Product Count is part of blocks config

* update mocks

* Use version comparison to determine if batching is enabled

* Change isWpVersion

* scrollTo button
2021-04-22 12:37:27 +01:00
Mike Jolley 8c98c1eaac Support for multiple fee rows in the cart (https://github.com/woocommerce/woocommerce-blocks/pull/3678)
* Inject the routes controller

* Cart totals need to be calculated on cart routes or fees will be missing

* Add fees to schema and response

* Add fees to useStoreCart

* Fix styling of multiple fee rows

* Fix test shape
2021-01-13 16:57:42 +00:00
Albert Juhé Lluveras 02174c5431 Add stories to Cart & Checkout totals components (https://github.com/woocommerce/woocommerce-blocks/pull/3533)
* Add stories to Cart & Checkout totals components

* Create @woocommerce/knobs alias

* Update TotalsFooterItem default values so they are in line with other stories
2020-12-14 09:15:50 +01:00