* Provider progress
* Revert nonce change for debugging
* Working emitters
* Fix dismiss link alignment in notices
* Fix button state and double adds
* Remove old context file
* Add type defs
* Fix context name
* Leftovers from merge
* Hooks up the variation picker to cart context
* Group event emitters in context
* Fix external product display
* Pass product through to VariationAttributes
* Pass around dispatchers
* Update assets/js/base/context/add-to-cart-form/form-state/reducer.js
Co-authored-by: Darren Ethier <darren@roughsmootheng.in>
* Update assets/js/atomic/blocks/product-elements/add-to-cart/product-types/variable/variation-attributes/attribute-select-control.js
Co-authored-by: Darren Ethier <darren@roughsmootheng.in>
* Update assets/js/base/context/add-to-cart-form/form-state/reducer.js
Co-authored-by: Darren Ethier <darren@roughsmootheng.in>
* remove placeholder comment
* content->container
* Clarify variation method comment
* update comment
* Switch nesting of providers
* Variation attribute utils test coverage
* If nothing is selected yet, just return all variations.
* Comments to explain loops
* Use refs to avoid recalculation of attributes on every render
* Update memo usage
* typo
* move mock data to test file
* Switch to useShallowEqual
* trigger cart fragment refresh after add to cart
* Decode option entities
Co-authored-by: Darren Ethier <darren@roughsmootheng.in>
* enqueue and respect merchant option for disabling stripe express pay
* don't even register express payment method if merchant has disabled it
* add StripeServerData.allowPaymentRequest to typedef
* add changelog to readme.txt
* Add testing docs for release
* add some new commands to help with release testing phase
* Add testing notes for 3.0.0
* fix testing note typo
* updae notest to reference the new package-plugin:deploy script for use as part of the release process
* Add note about creating manual tag for the release.
* automate creation of dev tag for release.
* remove release branch from travis branches because we now do pull requests for releases
* remove duplicate back order badge for cart (https://github.com/woocommerce/woocommerce-blocks/pull/2890)
* update zip link in testing notes
* only update stable version in readme.txt if not a pre-release
* Add handling for conditional github release creation based on WP deploy question
* add distignore fir wp deploy builds
* Cart & Checkout: fix '0' visible when product stock was 0 and it allowed backorders (https://github.com/woocommerce/woocommerce-blocks/pull/2891)
* Create wordpress-deploy.yml
* fix cod not accounting for global rate values (https://github.com/woocommerce/woocommerce-blocks/pull/2894)
* ensure we’re only running checks for `wc_reserved_stock` table when necessary (https://github.com/woocommerce/woocommerce-blocks/pull/2895)
* update readme.txt changelog
* remove unnecesary variable definitions
* update github deploy script
* Bumping version strings to new version.
* add missing step for checking out code from tag
* fix exclusion for docker-compose.yml
* fix zip name (it differs from repository name)
Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>
* Product selection when out of context for price and title blocks
* Move product element name/description/icons to constant files
* Add attributes and hocs to all elements
* Standalone block rendering
* Add a placeholder if title has no content
* Revert "Add a placeholder if title has no content"
This reverts commit 29115154b33eedc661ccd3cc758acdbc5041ffbc.
* parentClassName is not always present
* Loading state
* Wrap description in P
* Fixed loading styles when nested
* Maintain product shape in useProductData
* feature gate elements from showing in inserter
* fix feature flag
* include price PR
* edit withProductSelector to be a hoc
* fix lint issue
Co-authored-by: Seghir Nadir <nadir.seghir@gmail.com>
* Fix Credit Card input font size in some themes
* Fix spacing between credit card icon and input label
* Fix min-width of credit card input fields
* Improvements to the way credit card input fields are resized
* Simplify min-width
* stub out COD payment method for checkout block
* consistently use sentence case for (default) payment tab labels
* expose COD `enable_for_virtual` option to client
* correct docblock return value comment Stripe::get_inline_cc_form()
* allow merchant to disable COD payment for virtual/downloadable orders
* tweak canMakePayment dev docs - add cart-dependent example use case
* only allow (show) COD if initially-selected shipping method(s) allow
* tweak `canMakePayment` payment extension API docs
* use $VID:$ substitution for `@since` version in new payment methods
* use FILTER_VALIDATE_BOOLEAN for payment method boolean options
* use more semantic `some` when hunting for COD-unsupported shipping
* clarify `canMakePayment` API docs
* re-select payment method if selected method disappears (e.g. COD) +
+ factor out early return into separate if at top for clarity
* Deregister core cart/checkout scripts and styles when rendering the blocks
* Fix regression: redirect to full cart when adding a product from empty cart
* Make it so it scrolls to the top
* Update assets/js/base/utils/legacy-events.js
Co-authored-by: Darren Ethier <darren@roughsmootheng.in>
* Add check for jQuery availability
* Listen to removed from cart event too
* Remove unnecessary useEffect dependency
* Remove jQuery event subscriptions on component unmount
* Fix tests
Co-authored-by: Darren Ethier <darren@roughsmootheng.in>
* Show backorder notice in the Cart block
* Don't render variation <div> if empty
* Create ProductBackorderNotification component
* Add product backorder notification to the checkout block
* Fix classname and comment
* Rename notification->badge and don't show low stock badge if backorder is shown
* Use ternary to dispaly backorder/low stock badge
* allow payment methods to disable based on shipping or other factors:
- renamed 'initialized' array 'available' to match primary purpose of
`canMakePayment` api - whether payment method should be available
- trigger refresh of available payment methods when shopper chooses
different shipping method
- rename resolveCanMakePayments => refreshCanMakePayments
- tweaked some variable names and scope for clarity
- added comments to clarify things
Note this should not affect behaviour yet - no existing payment methods
use this new feature. COD payment method will need this - woocommerce/woocommerce-blocks#2831
* optimise refreshCanMakePayments:
- useShallowEqual to avoid unnecessary call when shipping methods have
not actually changed (but object value has)
* replace ("set") payment methods in store, was appending:
- payment methods may come and go depending on cart/checkout state
- the previous SET action appended provided payment methods to the
collection
- this prevents dynamic payment methods e.g. COD from being able to hide
i.e. disable
* cache test payment request to avoid unnecessary stripe API calls:
- in the canMakePayment callback there's a test payment to determine if
chrome pay/apple pay is set up and available
- canMakePayment is now called multiple times as checkout state changes
- now the results of the test payment are stored in variable, and
returned on subsequent calls
* set init flag to avoid additional attempts to init stripe API:
+ tweak naming of init flag
* stubs for bank transfer payment method
* allow merchant to disable BACS payment method
* show customised BACS title & description in checkout
* re-add entry point for BACS payment method (lost in rebase)
* Reduce specificity of some button styles
* Submit container: make it possible for themes to change the shadow color without the need to rewrite shadow values
* Use background-color instead of background property in docs
* Add docs to style the button and the submit container
* Remove border from button
* Add back state styles to button component
* Docs improvements
* Undo unncessary changes in button component styles
* Add spaces
* Fix Cart test async logic
* tweak test
* refactor test to not call response twice
* add comment for why we're calling fetch twice
* fix duplicate calls
* reset empty test to normal value
* switch to mockResponse
* convert comment to todo block
Co-authored-by: Darren Ethier <darren@roughsmootheng.in>
* modify dashicon replacements to be consistent with other icon exports
This also involved modifying the dashicon module replacement to use `cloneElement` instead of `createElement`.
* import from packages not global
* export woo icon consistent with other icons from the library
The Woo category icon was not using the Icon system and not exported consistent with other icons.
* add missing viewbox to arrowBack
* add story for icon library
* Update assets/js/icons/stories/index.js
Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>
Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>
* Remove legacy files
* Use thumbnail product image for Cart, Checkout and Reviews blocks
* Add option to toggle between full size and cropped image to the Atomic Product image block
* Add attributes to API
* Add component
* API updates to return variation data
* Update to handle updated api responses
* Working picker
* Update tests
* update test
* Use SelectControl
* Add Picker to Form Block
* Code cleanup and splitting
* Inline todos
* Update todos
* Update assets/js/atomic/blocks/product/add-to-cart/product-types/variable/variation-attributes/index.js
Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>
* change classname and move styles within component
* Correct conditional
* Avoid nesting filters
* Remove exclude from getVariationsMatchingSelectedAttributes
* basic select styles
* remove custom select styles
Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>
* Update base/components classnames
* Fix class name conflict
* Fix some class names mismatch
* Fix review loading placeholder styles
* Fix docs format
* Update old class name
* Fix price slider regression
* Fix load more button component missing legacy class
* Fix wrong loading mask styles classname
* Remove 'checkout' from 'wc-block-components-checkout-payment-methods__save-card-info' classname
* Make it explicit legacy classes will be removed in the next major version
* Make product variation data styles belong to product metadata
* Improve docs sentence
* Form/button stucture
* Use registerBlockComponent
* Context for add to cart form
* Working cart button
* Tidy up button component
* Add todos
* Revert reg block
* Hide stock indicator if not purchasable
* Hide terms if empty
* Add url and type to API
* Skip default category from term response
* Rename form element
* Form for product types
* Tidy up context provider and expand todos
* No longer using qty icon
* Update todos
* Correct text domain
* registerExperimentalBlockType
* Duplicate method
* Remove prevent default
* Update docblock
* Description for button code
* Order summary: Add spacing between product name and price name
* Remove border from shipping options in the side bar
* Add a hasBorder prop to Panel
* Checkout Order summary: remove margin product description
* Fix padding when there are multiple packages and remove old code
* Simplify selector
* Add margin botton to no shipping options notice
* Make sure Checkout titles are aligned when there are no express payment methods
* Update step heading margins according to new designs
* Add theming docs
* Update some components to the new class name structure
* Add docs about class name updates
* Update coding guidelines
* Minor improvements
* Update docs/theming/class-names-update-280.md
Co-authored-by: Darren Ethier <darren@roughsmootheng.in>
Co-authored-by: Darren Ethier <darren@roughsmootheng.in>
* more setup configuration for rtl
* move default state for cart out of reducer
This also creates a file for default store states, it should make it easier to execute tests in various environments.
* Make sure there’s a default object for cart line item row
* set defaults for cartData
* add fetchMock as a global in eslint config
* add initial cart flow tests
This is just to get the ball rolling, the cart block needs more tests
* fix missing @wordpress/jest-console configs (because I overwrote the original configuration)
* update test because of change in branch
* switch import order
* add globals.d.ts file to declare globals we use.
This is a quick solution to prevent typescript linting warning about `fetchMock`. At some point we could also create a proper interface for it or import the types (if they exist) for the `jest-mock` package.
The new `globals.d.ts` file is excluded from published builds.
* Use same margin-bottom in credit card input as in checkout inputs
* Set cursor:text for Checkout input labels
* Increase line height of expiry and cvc input validation errors in large viewports
* Increase height of expiry and cvc input validation errors in small viewports