Commit Graph

2195 Commits

Author SHA1 Message Date
Albert Juhé Lluveras 8bb217cec6 Show express payment methods in the Cart block (https://github.com/woocommerce/woocommerce-blocks/pull/3004)
* Shown express payment methods in Cart block

* Fixes

* Create usePositionRelativeToViewport hook

* Typo

* Style fixes

* Remove footer push div

* Styling fixes

* Improve code clarity

* Split ExpressCheckoutFormControl into two components

* Rename visibilityObserver to referenceElement

* Replace 'useEffect' with 'useLayoutEffect'

* Add tests for usePositionRelativeToViewport

* Self-closing div

* Add explanatory comment

* Create a shim for IntersectionObserver

* Update express payment components class names

* Add todo comment to remove IntersectionObserver shim when we drop IE11 support
2020-08-20 16:14:12 +02:00
Seghir Nadir 996925dab8 update versions 2020-08-19 16:03:20 +01:00
Seghir Nadir ab99e7d19e Release 3.2 (https://github.com/woocommerce/woocommerce-blocks/pull/3016)
* add testing checklist

* add zip to file

* add changelog

* Bumping version strings to new version.

* remove version from composer

* fix version number in package.json

* pin wc to 4.3.3

* add jetpack constant to travis
2020-08-19 15:50:12 +01:00
renovate[bot] 2f6dd1e5cd Lock file maintenance (https://github.com/woocommerce/woocommerce-blocks/pull/2984)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2020-08-18 10:55:08 -04:00
renovate[bot] 1f6a3f651d Update dependency autoprefixer to v9.8.6 (https://github.com/woocommerce/woocommerce-blocks/pull/2967)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2020-08-18 10:51:16 -04:00
renovate[bot] 18bc3b37b9 Update babel monorepo (https://github.com/woocommerce/woocommerce-blocks/pull/2964)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2020-08-18 10:41:34 -04:00
Seghir Nadir 28d3bd7dda remove suspense polyfill (https://github.com/woocommerce/woocommerce-blocks/pull/3015) 2020-08-18 12:32:40 +01:00
Darren Ethier fad8c06b23 Add defensive checks for cart instance (https://github.com/woocommerce/woocommerce-blocks/pull/3009) 2020-08-18 07:30:28 -04:00
Seghir Nadir 69ff731b4e use TextControl instead of PlainText (https://github.com/woocommerce/woocommerce-blocks/pull/3014)
* use TextControl instead of PlainText

* update e2e test

* revert changes for label

* update test
2020-08-18 12:25:48 +01:00
Darren Ethier c0dbb08ef9 Deprecate wc.wcSettings.setSetting function. (https://github.com/woocommerce/woocommerce-blocks/pull/3010)
* Add deprecation notice for setSettings

* add todo for followup issue to actually remove the function

* update todo

* fix tests

* fix todo

* Update assets/js/settings/shared/set-setting.js

Co-authored-by: Seghir Nadir <nadir.seghir@gmail.com>
2020-08-18 10:40:08 +01:00
Rua Haszard 0fbc366746 update minimum required version of WordPress core to 5.3 (https://github.com/woocommerce/woocommerce-blocks/pull/3013)
* update min version of WordPress core to 5.3 in readmes

* update min WP version to 5.3 - main plugin file & admin compat notice

* remove WordPress 5.2 travis e2e test build

* disable legacy (WP <5.3) webpack entry points

* add "update user docs" step to release process, incl min WP/Woo reqs

* add 5.5 test

* allow test to fail

Co-authored-by: Seghir Nadir <nadir.seghir@gmail.com>
2020-08-17 15:20:51 +01:00
Rua Haszard 506806065f rename `ProductQueryFilters` file to match class name (PSR4 compatible) (https://github.com/woocommerce/woocommerce-blocks/pull/3012) 2020-08-17 13:07:23 +01:00
Seghir Nadir 85ed96b58e Add dark colors support to Cart & Checkout controls (https://github.com/woocommerce/woocommerce-blocks/pull/2981)
* add dark styles setting

* add attributes to blocks

* add colors to input and select

* cover rest of items

* tweak select contrast

* fix ie11 issue

* fix focus

* include checkbox styles

* fix extra spacing after phone number

* add styling to quantity selector

* remove extra rule

* remove editor styles for radio control

* use border-color

* rename variables and classes and wording

* adjust colors

* provide tighter control over colors

* remove redudant outline rule

* add more variables

* add support for order note

* use variables for textarea

* move dark mode panel to last
2020-08-14 12:08:16 +01:00
Seghir Nadir 1fddb9451d Use real previews for the Cart and Checkout blocks (https://github.com/woocommerce/woocommerce-blocks/pull/2992)
* Use real previews for the cart and checkout

* remove extra files and css
2020-08-13 14:24:51 +01:00
renovate[bot] 44591f2db5 Update dependency mini-css-extract-plugin to v0.10.0 (https://github.com/woocommerce/woocommerce-blocks/pull/2999)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2020-08-13 08:02:42 +02:00
renovate[bot] 4e2917fa69 Update dependency eslint-plugin-jest to v23.20.0 (https://github.com/woocommerce/woocommerce-blocks/pull/2998)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2020-08-13 08:02:36 +02:00
renovate[bot] dbfda4df8b Update dependency @types/react to v16.9.46 (https://github.com/woocommerce/woocommerce-blocks/pull/2997)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2020-08-13 08:02:27 +02:00
renovate[bot] 5c480f91db Update dependency @testing-library/jest-dom to v5.11.3 (https://github.com/woocommerce/woocommerce-blocks/pull/2996)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2020-08-13 08:02:18 +02:00
Darren Ethier 3078b97534 Fix phpunit test config (https://github.com/woocommerce/woocommerce-blocks/pull/3001)
* set path for WP install on unit tests to ensure latest is always installed.

* fix tests using deprecated method
2020-08-12 10:54:02 -04:00
Rua Haszard 39270f5657 Remove generic payment method icons (Stripe CC + Cheque) (https://github.com/woocommerce/woocommerce-blocks/pull/2968)
* remove generic icons from Cheque & Stripe CC payment methods

* remove icon prop from PaymentMethodLabel - no longer supported:
- icons should only be used for recognisable brands
- generic icons (e.g. credit card) are not recommended

* Revert "remove icon prop from PaymentMethodLabel - no longer supported:"

This reverts commit 1990028a6c98b82750fb917ff3086dbe022ef41d.
2020-08-12 08:44:19 +12:00
Seghir Nadir 66876c4216 allow wp 5.4 + GB to fail (https://github.com/woocommerce/woocommerce-blocks/pull/2990) 2020-08-11 16:13:03 +01:00
Albert Juhé Lluveras a16af68975 Hide saved payment methods if their gateway is disabled (https://github.com/woocommerce/woocommerce-blocks/pull/2975)
* Hide saved payment methods if their gateway is disabled

* Fix wrong type-def

* Remove extra blank line

* Rename var

* Use FILTER_VALIDATE_BOOLEAN instead of comparing to 'yes'

* Use data from Payment Method context instead of reading setting from the server

* Use data from Payment Method context instead of reading setting from the server
2020-08-11 15:43:03 +02:00
Albert Juhé Lluveras 339c0532f1 Fix text input and select error styles on focus (https://github.com/woocommerce/woocommerce-blocks/pull/2974) 2020-08-11 11:55:26 +02:00
Seghir Nadir 145db3ff5d fix issue with no margins on phone input (https://github.com/woocommerce/woocommerce-blocks/pull/2989)
* fix issue with overlapping margins

* move styles out of select

* remove extra spacing

* remove extra spacing from cart

* move styles to state input and remove extra position.
2020-08-11 10:00:53 +01:00
Seghir Nadir fc9f6fe71a Use SVG for checkbox (https://github.com/woocommerce/woocommerce-blocks/pull/2320)
* use svg for checkbox

* update borders

* switch to rems

* define a rem function

* fix ie11 issue

* fix focus

* add ie hack

* fix spacing and switch to em

* switch to rem
2020-08-11 09:59:59 +01:00
David Levin 4a8026623e It's its not it's unless it's it's. (https://github.com/woocommerce/woocommerce-blocks/pull/2988)
Co-authored-by: David Levin <davidlevin@Davids-MacBook-Pro-2.local>
2020-08-10 16:33:17 +01:00
Rua Haszard b8137587c3 Link cart/checkout merchant (editor) feedback prompt to special GitHub issue type (https://github.com/woocommerce/woocommerce-blocks/pull/2976)
* issue template for cart & checkout feedback

* fix example desktop OS (not iOS!)

* delete `withFeedbackPrompt` - not used

* link cart/checkout editor feedback to GitHub issue:
- add new CartCheckoutFeedbackPrompt with specialised text & url
- use in cart/checkout blocks
- tweaked wording of feedback prompt text

* use speech bubble icon to represent feedbackiness

* simplify cart/checkout feedback prompts

* add default labels to all issue templates

* use markdown heading syntax for headings (was basic bold previously)

* tweak wording (remove hint of frustration) and use new "feedback" label
2020-08-10 08:18:36 +12:00
Darren Ethier a74ca7ddeb Update handling-releases.md 2020-08-07 21:36:48 -04:00
Darren Ethier dcdc5c48ce Improve behaviour of draft order cleanup to account for clobbered custom shop order status. (https://github.com/woocommerce/woocommerce-blocks/pull/2912)
* improve behaviour of draft order cleanup with tests

* hide error logging output from tests

* fix doc

* fix status check and test setup/teardown
2020-08-07 15:36:55 -04:00
Seghir Nadir 0dd2dce09a Fix undefined variable in php closure (https://github.com/woocommerce/woocommerce-blocks/pull/2962) 2020-08-07 14:10:35 -04:00
Albert Juhé Lluveras cbf6ee3e7e Add docs about CSS build system (https://github.com/woocommerce/woocommerce-blocks/pull/2953)
* Add docs to CSS build system

* Add docs to CSS build system (II)
2020-08-07 13:57:57 -04:00
Albert Juhé Lluveras dfec03202d Fix JS-rendered blocks inside Empty Cart (https://github.com/woocommerce/woocommerce-blocks/pull/2904)
* Fix JS-rendered blocks inside Empty Cart

* Add deprecation rules

* Performance improvements

* Typo

* Remove 'is-loading' class requirement

* Undo changes moved to woocommerce/woocommerce-blocks#2952

* Improve some comments

* Improve code

* IE 11 fix

* Minor fixes

* Assign default value in arguments destructuring

* Refacot renderFrontend code to make it easier to understand

* Revert "Assign default value in arguments destructuring"

This reverts commit 04ae943c675b94e599a1d1700075a79ef8be5004.
2020-08-07 13:33:32 -04:00
renovate[bot] 20b0f5aaf0 Update dependency @testing-library/react to v10.4.8 (https://github.com/woocommerce/woocommerce-blocks/pull/2966)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2020-08-07 09:06:39 +12:00
Rua Haszard e18c036f5e use static pos for payment errors so they push out other content: (https://github.com/woocommerce/woocommerce-blocks/pull/2977)
- default styling for validation errors is absolute
- this requires the layout provides appropriate space for errors
- payment form is too compact to provide room for errors,
  - especially when checkout is narrow due to window or theme
2020-08-07 07:30:27 +12:00
Mike Jolley b680686c34 Add inspector notice for unsupported product types (https://github.com/woocommerce/woocommerce-blocks/pull/2944)
* Add notice for unsupported product types

* Simple products can be added to cart, not others
2020-08-06 10:28:20 -04:00
renovate[bot] bdb7044830 Update dependency @types/react to v16.9.44 (https://github.com/woocommerce/woocommerce-blocks/pull/2965)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2020-08-05 15:24:32 +02:00
Darren Ethier 733d29c3b9 Add section on configuring WordPress site
Includes required and recommended constants to define in wp-config.php for developing Woo Blocks.
2020-08-05 08:37:49 -04:00
Albert Juhé Lluveras d21a8950f4 Add missing class dot in theming docs (https://github.com/woocommerce/woocommerce-blocks/pull/2946) 2020-08-05 11:38:43 +01:00
Seghir Nadir 9ea9d0afd2 Add JETPACK_AUTOLOAD_DEV to wp-env instances (https://github.com/woocommerce/woocommerce-blocks/pull/2960) 2020-08-05 11:28:11 +01:00
Seghir Nadir 96819fc2d2 account for negative sale values (https://github.com/woocommerce/woocommerce-blocks/pull/2955) 2020-08-05 11:27:59 +01:00
Albert Juhé Lluveras fcf8f5c51f Show Checkout block in editor also when guest checkout is not allowed (https://github.com/woocommerce/woocommerce-blocks/pull/2958) 2020-08-05 10:35:38 +02:00
Albert Juhé Lluveras 5a300b91c2 Fix All Products block 'No products' placeholder link (https://github.com/woocommerce/woocommerce-blocks/pull/2961) 2020-08-05 10:35:08 +02:00
Rua Haszard afe77fb1e3 Show payment gateways in correct (merchant-configured) order (https://github.com/woocommerce/woocommerce-blocks/pull/2934)
* enqueue order of payment gateways as script data

* use configured gateway order for payment method tabs

* clarify name of payment gateway sort order setting

* fix formatting

Co-authored-by: Darren Ethier <darren@roughsmootheng.in>

* fix bug - express payment methods not working due to ordering logic:
- move ordering code to payment methods in usePaymentMethods hook;
  - this only applies to standard (non express) payment methods
- also any code that uses payment methods will get them in correct order

* why did this formatting not happen pre-commit?

* move method ordering into refreshPaymentMethods to avoid infinite loop:
- pass keys of express payment methods so they work correctly (show up)
- refreshPaymentMethods dispatches availablePaymentMethods to redux
  store; I suspect this was causing infinite loop as the callback
  depends on registeredPaymentMethods
- handle case when a payment method is not in PAYMENT_GATEWAY_SORT_ORDER
  - this happens with COD when dependent on shipping

* fix formatting

* use shallow equal to prevent refreshCanMakePayments infinite loop

* use native Set instead of lodash.union for unique gateway names

* code formatting

* check to ensure we register paymentGatewaySortOrder asset once only

* fix COD tab showing out of order if not available at page load:
- return ALL gateways in sort order array
  - note this includes gateways that are not enabled by merchant

* reinstate return bool from usePaymentMethods hook (broken in refactor)

* add basic typedefs for payment methods hooks

Co-authored-by: Darren Ethier <darren@roughsmootheng.in>
2020-08-05 13:56:33 +12:00
renovate[bot] f70268b9ee Lock file maintenance (https://github.com/woocommerce/woocommerce-blocks/pull/2951)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2020-08-04 10:51:41 +02:00
Albert Juhé Lluveras e73e5ba3fe Simplify reviews render method (https://github.com/woocommerce/woocommerce-blocks/pull/2952) 2020-08-04 10:29:02 +02:00
Darren Ethier aebedc9930 Fixes related to Jetpack Autoloader 2.0 package bump (https://github.com/woocommerce/woocommerce-blocks/pull/2949)
* regenerate auto load maps after version change.

* make sure composer.json is updated with version change for deploys (also necessary for correct auto-load map regeneration)

* update WC tested up to string

* Detect if `JETPACK_AUTOLOAD_DEV` is defined in `wp-config.php` when developing the plugin.
2020-08-03 12:11:46 +02:00
Albert Juhé Lluveras 3d0d6cab87 Add autocapitalize attribute to Address Form fields (https://github.com/woocommerce/woocommerce-blocks/pull/2884)
* Add autocapitalize attribute to Address Form fields

* Set autocapitalize attribute to 'sentences' in address form
2020-08-03 10:53:42 +02:00
Darren Ethier 84e3cabcbf Update handling-releases.md
Clarify when package version bumps happen in WooCommerce core.
2020-07-31 14:55:19 -04:00
Albert Juhé Lluveras 311d8ddf12 Add 'Order notes' to Checkout block (https://github.com/woocommerce/woocommerce-blocks/pull/2877)
* Add Checkout Order notes (UI)

* Add Checkout Order notes (context)

* Add missing useEffect dependencies

* Remove duplicate toggle in editor

* Minor fixes

* Check whether orderNotes have changed before creating a new state object

* Rename showCounter to showStepNumber

* Rename 'onChange' with 'onTextChange'

* Add comment and tests to FormStep component

* Rename 'with-counter' to 'with-step-number'

* Fix wrong prop

* Make it so order notes are persisted when toggling the checkbox

* Update type-defs

* Set showStepNumber default value to true
2020-07-31 17:17:01 +02:00
Mike Jolley 36c1bb7361 Add to cart context provider (https://github.com/woocommerce/woocommerce-blocks/pull/2903)
* 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>
2020-07-30 11:57:22 +01:00
renovate[bot] fc3735564a Update dependency @octokit/graphql to v4.5.3 (https://github.com/woocommerce/woocommerce-blocks/pull/2930)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2020-07-30 10:07:01 +01:00
renovate[bot] aa5bd62c93 Pin dependency glob to 7.1.6 (https://github.com/woocommerce/woocommerce-blocks/pull/2927)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2020-07-30 10:06:49 +01:00
renovate[bot] 047f2d4323 Update dependency webpack to v4.44.1 (https://github.com/woocommerce/woocommerce-blocks/pull/2933)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2020-07-30 10:06:20 +01:00
renovate[bot] bd3178b62e Update dependency eslint-plugin-jest to v23.19.0 (https://github.com/woocommerce/woocommerce-blocks/pull/2932)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2020-07-30 10:04:52 +01:00
Albert Juhé Lluveras b29f5d4e86 Fix WP_CONTENT_DIR path in PHP unit tests (https://github.com/woocommerce/woocommerce-blocks/pull/2935) 2020-07-30 10:41:13 +02:00
Rua Haszard e2b82561bd enqueue and respect merchant option for disabling stripe express pay (https://github.com/woocommerce/woocommerce-blocks/pull/2920)
* 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
2020-07-30 10:29:58 +12:00
Albert Juhé Lluveras de65c2ff8e Update version numbers to 3.2.0-dev 2020-07-29 18:20:17 +02:00
Albert Juhé Lluveras 2f2aa6280c Release: 3.1.0 (https://github.com/woocommerce/woocommerce-blocks/pull/2938)
* Fix  missing permissions_callback arg in StoreApi route definitions (https://github.com/woocommerce/woocommerce-blocks/pull/2926)

* make sure permission_callback is set correctly for all public routes

* add permission_callback definition to all routes

* add hover style to ensure consistent margin/padding for order summary so it doesn't jump on mouseover (https://github.com/woocommerce/woocommerce-blocks/pull/2921)

* add hover style to ensure consistent margin/padding for order summary

* decrease specificity of panel__button hover/active etc styles

* Add 3.1.0 testing instructions

* Update WP tested up to version to 5.5 (https://github.com/woocommerce/woocommerce-blocks/pull/2937)

* Fix typo in state property for idle status in checkout state reducer (https://github.com/woocommerce/woocommerce-blocks/pull/2925)

* fix typo in state property for idle status in checkout state reducer

* remove arg causing failure in phpunit tests on travis

* Add 3.1.0 changelog

* Added ZIP file to 3.1.0 testing docs

* Update wp.deploy workflow adding slack hook (https://github.com/woocommerce/woocommerce-blocks/pull/2939)

This will notify rubik's slack channel when this workflow starts and finishes.

* Add testing docs for regressions

* Update 310.md

* Update 310.md

* Add more details to testing doc

* Fix reviews blocks in WP 5.2 (https://github.com/woocommerce/woocommerce-blocks/pull/2940)

* Fix Reviews editor styles (https://github.com/woocommerce/woocommerce-blocks/pull/2941)

* Update ZIP link

* Fix testing doc title hirerarchy

Co-authored-by: Darren Ethier <darren@roughsmootheng.in>
Co-authored-by: Rua Haszard <rua.haszard@automattic.com>
2020-07-29 18:01:01 +02:00
Albert Juhé Lluveras 7e6968e68e Fix Reviews editor styles (https://github.com/woocommerce/woocommerce-blocks/pull/2941) 2020-07-29 16:07:21 +02:00
Albert Juhé Lluveras 8d21c7257e Fix reviews blocks in WP 5.2 (https://github.com/woocommerce/woocommerce-blocks/pull/2940) 2020-07-29 16:06:44 +02:00
Albert Juhé Lluveras 8ace5dbcf8 Add attributes and view toggle tests to the Cart block (https://github.com/woocommerce/woocommerce-blocks/pull/2883)
* Add more tests to the Cart block

* Add page settings

* Cleanup
2020-07-29 14:39:15 +01:00
Darren Ethier ae1e2c3dcd Update wp.deploy workflow adding slack hook (https://github.com/woocommerce/woocommerce-blocks/pull/2939)
This will notify rubik's slack channel when this workflow starts and finishes.
2020-07-29 13:36:33 +02:00
Darren Ethier a0b28f2a06 Fix typo in state property for idle status in checkout state reducer (https://github.com/woocommerce/woocommerce-blocks/pull/2925)
* fix typo in state property for idle status in checkout state reducer

* remove arg causing failure in phpunit tests on travis
2020-07-29 13:00:26 +02:00
Albert Juhé Lluveras 9e79b0cbf3 Update WP tested up to version to 5.5 (https://github.com/woocommerce/woocommerce-blocks/pull/2937) 2020-07-29 12:59:32 +02:00
renovate[bot] f8366be2c9 Update Node.js to v12.18.3 (https://github.com/woocommerce/woocommerce-blocks/pull/2928)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2020-07-29 11:20:34 +01:00
Rua Haszard 2cc98391a0 add hover style to ensure consistent margin/padding for order summary so it doesn't jump on mouseover (https://github.com/woocommerce/woocommerce-blocks/pull/2921)
* add hover style to ensure consistent margin/padding for order summary

* decrease specificity of panel__button hover/active etc styles
2020-07-29 11:50:06 +02:00
Darren Ethier 92985bd201 Fix missing permissions_callback arg in StoreApi route definitions (https://github.com/woocommerce/woocommerce-blocks/pull/2926)
* make sure permission_callback is set correctly for all public routes

* add permission_callback definition to all routes
2020-07-29 10:39:54 +02:00
renovate[bot] afe86d53b6 Update dependency @testing-library/jest-dom to v5.11.2 (https://github.com/woocommerce/woocommerce-blocks/pull/2931)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2020-07-29 14:25:21 +12:00
Darren Ethier b091ef151f fix build:deploy script. 2020-07-28 12:03:43 -04:00
renovate[bot] 1a21b1e6ca Lock file maintenance (https://github.com/woocommerce/woocommerce-blocks/pull/2916)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2020-07-28 11:48:38 +01:00
Darren Ethier e6d4b58828 update package-lock with dev version 2020-07-27 10:57:51 -04:00
Darren Ethier c9b88620a1 bump dev version 2020-07-27 10:56:35 -04:00
renovate[bot] ab8e30e41c Update dependency reakit to v1.1.2 (https://github.com/woocommerce/woocommerce-blocks/pull/2865)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2020-07-23 16:35:13 +01:00
renovate[bot] 7fbfcd56c2 Update dependency autoprefixer to v9.8.5 (https://github.com/woocommerce/woocommerce-blocks/pull/2863)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2020-07-23 15:06:24 +00:00
renovate[bot] 00e97d92a1 Update dependency webpack to v4.43.0 (https://github.com/woocommerce/woocommerce-blocks/pull/2902)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2020-07-23 15:31:46 +01:00
renovate[bot] 9becff0ae0 Update dependency eslint-plugin-jest to v23.18.0 (https://github.com/woocommerce/woocommerce-blocks/pull/2830)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2020-07-23 15:05:01 +01:00
renovate[bot] f05057a666 Lock file maintenance (https://github.com/woocommerce/woocommerce-blocks/pull/2790)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2020-07-23 14:44:47 +01:00
renovate[bot] f082e1f60c Update dependency request-promise to v4.2.6 (https://github.com/woocommerce/woocommerce-blocks/pull/2901)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2020-07-23 14:42:26 +01:00
renovate[bot] 7f9fb19e9e Update dependency @testing-library/jest-dom to v5.11.1 (https://github.com/woocommerce/woocommerce-blocks/pull/2898)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2020-07-23 14:39:41 +01:00
renovate[bot] ce53bb908f Update dependency @octokit/graphql to v4.5.2 (https://github.com/woocommerce/woocommerce-blocks/pull/2897)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2020-07-23 14:23:17 +01:00
renovate[bot] ed28e8252b Update dependency typescript to v3.9.7 (https://github.com/woocommerce/woocommerce-blocks/pull/2866)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2020-07-23 13:51:25 +01:00
renovate[bot] 1a8e270fe4 Update dependency html-react-parser to v0.13.0 (https://github.com/woocommerce/woocommerce-blocks/pull/2864)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2020-07-23 13:44:45 +01:00
renovate[bot] 0fb10a6396 Update dependency @types/react to v16.9.43 (https://github.com/woocommerce/woocommerce-blocks/pull/2862)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2020-07-23 13:28:48 +01:00
renovate[bot] 229afc281e Update babel monorepo to v7.10.5 (https://github.com/woocommerce/woocommerce-blocks/pull/2861)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2020-07-23 13:23:47 +01:00
Phellipe K Ribeiro 2db08a1383 Add query filter when searching for a table (https://github.com/woocommerce/woocommerce-blocks/pull/2886)
* Add query filter when searching for a table

* Fix lint errors
2020-07-22 15:50:46 -04:00
Darren Ethier 59ca5ad19c Release: 3.0.0 (https://github.com/woocommerce/woocommerce-blocks/pull/2887)
* 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>
2020-07-22 12:36:55 -04:00
Darren Ethier 34de45c6fe update release docs to include details on new automation 2020-07-22 10:11:55 -04:00
Darren Ethier 29db167a38 Update wordpress-deploy.yml
Add missing step for checking out code from tag
2020-07-22 09:32:28 -04:00
Darren Ethier 7e206c9481 Create .distignore
Add .distignore file that will be used for wp-deploy action.
2020-07-22 09:14:45 -04:00
Mike Jolley cd9f7e0ccb ⚛️ Introduce Product Element Blocks (https://github.com/woocommerce/woocommerce-blocks/pull/2871)
* 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>
2020-07-22 13:20:54 +01:00
Albert Juhé Lluveras ff2f135e7e Make stylesheets order consistent between build and dev (https://github.com/woocommerce/woocommerce-blocks/pull/2818)
* Add specific webpack config for styles

* Remove style.scss file from story

* Fix storybook

* Extract progressbarplugin config

* Add back ignore-loader

* Fix styling entries

* Cleanup

* Simplify webpack-entries.js

* Add appropiate exclude handles to styling config

* Add back MergeExtractFilesPlugin

* Unify style entries suffix

* Fix experimental flag

* Replace MergeExtractFiles plugin with RemoveFiles

* Prevent duplicate reviews frontend scripts

* Fix unnecessary files being created

* Remove editor.js file generate by MiniCssExtractPlugin

* Remove CSS generation from payment methods config

* Remove unnecessary config

* Simplify styling entries name

* Cleanup

* Refactor webpack-entries
2020-07-22 14:05:56 +02:00
renovate[bot] a59529c719 Update dependency @testing-library/react to v10.4.7 (https://github.com/woocommerce/woocommerce-blocks/pull/2899)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2020-07-22 11:39:58 +02:00
renovate[bot] 02a9851a28 Update dependency use-debounce to v3.4.3 (https://github.com/woocommerce/woocommerce-blocks/pull/2900)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2020-07-22 10:16:09 +01:00
Darren Ethier aef46f57e8 ensure we’re only running checks for `wc_reserved_stock` table when necessary (https://github.com/woocommerce/woocommerce-blocks/pull/2895) 2020-07-21 16:27:58 -04:00
Darren Ethier 21b7637ef5 fix cod not accounting for global rate values (https://github.com/woocommerce/woocommerce-blocks/pull/2894) 2020-07-21 15:57:21 -04:00
Darren Ethier ebf3b6a61a Create wordpress-deploy.yml 2020-07-21 13:56:43 -04:00
Albert Juhé Lluveras a69a50856a Cart & Checkout: fix '0' visible when product stock was 0 and it allowed backorders (https://github.com/woocommerce/woocommerce-blocks/pull/2891) 2020-07-21 17:41:14 +02:00
Seghir Nadir 9eabf73a65 Update ⚛️ Product Price (https://github.com/woocommerce/woocommerce-blocks/pull/2881)
* use currency as block symbol

* add color and font size support for price block

* support align

* revert to two options

* fix feature gating
2020-07-21 14:28:59 +01:00
Seghir Nadir 5299d7267b Update ⚛️ ‎‎‏‏‎ Product Title (https://github.com/woocommerce/woocommerce-blocks/pull/2860)
* rename heading-toolbar to heading-switcher

* update icon

* add controls to title block

* fix typos in css rules

* feature gate changes in Product Title

* fix jsdoc types

* fix onChange param

* fix missing textDomain

* fix modifier prefix

* move styling to util

* hardcode line height

* move settings near color
2020-07-21 14:27:41 +01:00
Albert Juhé Lluveras 4ef64a4453 Fix Credit Card input font size in some themes (https://github.com/woocommerce/woocommerce-blocks/pull/2869)
* 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
2020-07-20 13:56:22 +02:00
Mike Jolley fca4598866 Fix undefined index 'enabled' for multiple payment method registrations (https://github.com/woocommerce/woocommerce-blocks/pull/2878)
* get settiing helper

* Make use of helper when getting settings
2020-07-20 11:50:22 +01:00
Darren Ethier 4cc3990af1 Update CODEOWNERS
fix incorrect team assignment
2020-07-17 11:14:31 -04:00
Albert Juhé Lluveras c11b7e5dc5 Extract progressbarplugin config (https://github.com/woocommerce/woocommerce-blocks/pull/2875) 2020-07-17 10:55:55 -04:00
Darren Ethier cc5fef8994 release docs for 2.7.2 2020-07-16 14:12:22 -04:00
Darren Ethier 60b1422cf6 Move Draft order logic behind feature flag. (https://github.com/woocommerce/woocommerce-blocks/pull/2874)
* refactor all draft order functionality to be in it’s own class and feature gate it.

* move and fix tests for draft order deletes

* add test to ensure only draft orders are deleted

* implement review feedback and assert valid results before deleting

* update tests

* doh method can’t be protected

* fix conditional for removing scheduled action

* switch to use Woo Core function for catching the exception

* add tests for error handling.

* use `$wpdb->prepare` and remove temp group on test
2020-07-16 12:19:31 -04:00
Rua Haszard aee97ceb3f Support cash on delivery payment method in checkout block (https://github.com/woocommerce/woocommerce-blocks/pull/2831)
* 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
2020-07-15 10:14:41 -04:00
renovate[bot] 08969b7fb8 Update dependency @testing-library/react to v10.4.6 (https://github.com/woocommerce/woocommerce-blocks/pull/2829)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2020-07-15 10:33:10 +01:00
Albert Juhé Lluveras 8bfb95c808 Deregister core cart/checkout scripts and styles when rendering the blocks (https://github.com/woocommerce/woocommerce-blocks/pull/2842)
* 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>
2020-07-14 15:46:44 -04:00
Albert Juhé Lluveras d894fed1df Cart block: show products on backorder (https://github.com/woocommerce/woocommerce-blocks/pull/2833)
* 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
2020-07-14 17:25:53 +02:00
Mike Jolley be513c8875 Lazy Loading Atomic Components (https://github.com/woocommerce/woocommerce-blocks/pull/2777)
* Implement lazy loading with basics spinner

* Add chunkFilename

* chunkFilename breaks render

* Suspense at inner block level

* Suspense for all products block

* Update assets/js/atomic/blocks/component-init.js

Co-authored-by: Darren Ethier <darren@roughsmootheng.in>

* Handle lazy components in registerBlockComponent

* update tests

* Update locks

* Update assets/js/blocks-registry/block-components/register-block-component.js

Co-authored-by: Darren Ethier <darren@roughsmootheng.in>

Co-authored-by: Darren Ethier <darren@roughsmootheng.in>
2020-07-14 12:35:15 +01:00
Rua Haszard 1df11f5461 allow payment methods to disable based on shipping (API change) (https://github.com/woocommerce/woocommerce-blocks/pull/2840)
* 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
2020-07-14 10:52:13 +12:00
renovate[bot] ea1435457a Update dependency @stripe/stripe-js to v1.8.0 (https://github.com/woocommerce/woocommerce-blocks/pull/2828)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2020-07-13 15:20:23 +02:00
Albert Juhé Lluveras 0f43c3af0f Remove classes from dashicons (https://github.com/woocommerce/woocommerce-blocks/pull/2848) 2020-07-10 14:20:57 -04:00
Albert Juhé Lluveras 8c06276b00 Unify Chip styles (https://github.com/woocommerce/woocommerce-blocks/pull/2765)
* Improve cross character used in dropdown selector

* Add is-open and has-checked classes to dropdown selector so we stop relying on complex pseudoselector combinations

* Update Chip component with new props

* Update Chip styles

* Update dropdown selector selected chip with the Chip component

* Update active filters chip with the Chip component

* Style fixes

* Update snapshots and add tests

* Change onRemove prop signature

* Fix wrong bottom margin

* Fix misaligned remove icon

* Update assets/js/base/components/chip/index.js

Co-authored-by: Darren Ethier <darren@roughsmootheng.in>

* Update assets/js/base/components/chip/index.js

Co-authored-by: Darren Ethier <darren@roughsmootheng.in>

* Add missing default prop

* Prettier

* Ensure showScreenReaderText is a bool

* Rename removeOnClick with removeOnAnyClick

* Update snapshots

* Fix Chip aria-label logic

* Split Chip and RemovableChip

* Replace chip close character with an icon

* Fix outdated comment

Co-authored-by: Darren Ethier <darren@roughsmootheng.in>
2020-07-10 11:09:49 +02:00
Darren Ethier 92067c0d04 update automattic/jetpack-autoloader to 2.0 branch (https://github.com/woocommerce/woocommerce-blocks/pull/2847) 2020-07-10 10:54:55 +02:00
Rua Haszard de91ead0db lots of release process doc tweaks (https://github.com/woocommerce/woocommerce-blocks/pull/2832)
* lots of release process doc tweaks:

- add outcomes for all H4s (we may be able to remove some similar material from "body" content)
- mention that svn is needed
- clarify relationship to PR and PR checklist in a few places
  - we have 2 docs to follow now, which could be confusing
- clarify release metadata step - this is metadata, not version number
- clarify relationship to woo core
- add dev blog post as final happy 🎉 step

* fix typo

Co-authored-by: Darren Ethier <darren@roughsmootheng.in>

Co-authored-by: Darren Ethier <darren@roughsmootheng.in>
2020-07-10 09:20:08 +12:00
Albert Juhé Lluveras d12ffcd4e5 Update minimum required versions in readme.txt to align it with readme.md (https://github.com/woocommerce/woocommerce-blocks/pull/2834) 2020-07-09 12:36:52 -04:00
renovate[bot] a38203f2c2 Pin dependency rimraf to 3.0.2 (https://github.com/woocommerce/woocommerce-blocks/pull/2827)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2020-07-08 13:10:23 +12:00
Rua Haszard 1d364a04bf Support bank transfer (BACS) payment method in checkout block (https://github.com/woocommerce/woocommerce-blocks/pull/2821)
* 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)
2020-07-08 12:39:16 +12:00
Albert Juhé Lluveras 2fadea064e Document Cart & Checkout button styles (https://github.com/woocommerce/woocommerce-blocks/pull/2814)
* 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
2020-07-07 11:59:51 +02:00
Albert Juhé Lluveras adfecb4259 Split up webpack files for better readability (https://github.com/woocommerce/woocommerce-blocks/pull/2817)
* Split up webpack files for better readability

* Fix storybook

* Fix tests

* update progress-bar-webpack-plugin and implement better feedback

- updates progress-bar-webpack-plugin to latest version which includes more granular output of what webpack event is being processed.
- Improve asset build complete summary to include what build was completed.

* remove unnecessary s suffix

* Add back package-lock

Co-authored-by: Mike Jolley <mike.jolley@me.com>
Co-authored-by: Darren Ethier <darren@roughsmootheng.in>
2020-07-07 11:05:06 +02:00
Albert Juhé Lluveras 9c1c075be9 Don't load frontend scripts in the editor (https://github.com/woocommerce/woocommerce-blocks/pull/2788)
* Move register_block_script and get_block_asset_build_path to src/Assets/Api

* Only load block scripts in the frontend

* Fix version_compare numbers so they match 5.2.x versions

* Use register_scripts from AssetApi class
2020-07-07 10:15:46 +02:00
Rua Haszard 6232bad7c3 2.10.0-dev next-version bump 2020-07-07 11:23:22 +12:00
Rua Haszard d664d27fa6 Release: 2.9.0 (https://github.com/woocommerce/woocommerce-blocks/pull/2816)
* update version number in readme.txt

* 2.9.0 changelog

* flesh out changelog + consistent punctuation

* fix changelog prefixes

* remove extraneous .

* testing instructions for 2.9.0

* tweak testing instructions - delete shortcode

* 2.9 version in package-lock

* 2.9 version numbers

* 2.9 release version in package-lock

* Bumping version strings to new version.
2020-07-07 11:19:17 +12:00
Mike Jolley 8cd96950e8 Reviews by product/category e2e tests (https://github.com/woocommerce/woocommerce-blocks/pull/2808)
* Tests for reviews by product

* reviews by category
2020-07-06 14:48:39 -04:00
Darren Ethier e3dc2e9c86 Update javascript-testing.md 2020-07-03 08:11:00 -04:00
Albert Juhé Lluveras 2013c5e0f5 Dashicon module replacement: prevent cloning a non-element (https://github.com/woocommerce/woocommerce-blocks/pull/2804) 2020-07-03 10:51:37 +02:00
Rua Haszard c49a7af270 add basic docs for running e2e tests (https://github.com/woocommerce/woocommerce-blocks/pull/2800)
* add basic docs for running e2e tests

* shift common dependencies info to top, clarify iterate-test comment

* link out to wp-env docs

Co-authored-by: Darren Ethier <darren@roughsmootheng.in>

* remove extra bracket, tweak wp-env docs link

* typo

Co-authored-by: Darren Ethier <darren@roughsmootheng.in>
2020-07-03 09:26:23 +12:00
Seghir Nadir 81570d733c Tweak some logic in our cart Integration test. (https://github.com/woocommerce/woocommerce-blocks/pull/2778)
* 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>
2020-07-02 15:10:19 -04:00
Darren Ethier 76ab006219 bump versions to 2.9.0-dev 2020-07-02 09:51:05 -04:00
Seghir Nadir 7ed01f9254 Release: 2.8.0 (https://github.com/woocommerce/woocommerce-blocks/pull/2768)
* update readme file

* add testing docs

* Bumping version strings to new version.
2020-07-02 09:48:08 -04:00
Rua Haszard 29e7aa9bdf basic e2e test for instantiating All Reviews block (https://github.com/woocommerce/woocommerce-blocks/pull/2799)
* add e2e test for instantiating All Reviews block:
- adapted code from @senadir in-progress PR
https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/2756

* remove pptr-testing-library - not needed for this test

* Don't skip tests for the review block on < 5.3

Co-authored-by: Mike Jolley <mike.jolley@me.com>
2020-07-02 11:32:42 +01:00
renovate[bot] 661ebc196a Update dependency autoprefixer to v9.8.4 (https://github.com/woocommerce/woocommerce-blocks/pull/2797)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2020-07-02 07:59:02 +02:00
renovate[bot] c417003e56 Update babel monorepo to v7.10.4 (https://github.com/woocommerce/woocommerce-blocks/pull/2794)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2020-07-02 07:53:31 +02:00
renovate[bot] 5bdba6f0a3 Update Node.js to v12.18.2 (https://github.com/woocommerce/woocommerce-blocks/pull/2793)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2020-07-02 07:50:59 +02:00
renovate[bot] 346ce3ae16 Update dependency @testing-library/jest-dom to v5.11.0 (https://github.com/woocommerce/woocommerce-blocks/pull/2795)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2020-07-02 07:50:43 +02:00
renovate[bot] cdf75babed Update dependency @types/react to v16.9.41 (https://github.com/woocommerce/woocommerce-blocks/pull/2796)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2020-07-01 16:10:16 +02:00
renovate[bot] 30b1f0fb38 Update dependency css-loader to v3.6.0 (https://github.com/woocommerce/woocommerce-blocks/pull/2798)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2020-07-01 16:06:14 +02:00
Rua Haszard cb4ee3e632 update wporg readme docs to link to primary docs on docs.woocommerce.com (https://github.com/woocommerce/woocommerce-blocks/pull/1758)
* link to official docs in WPORG readme and remove old block docs

* simplify block list in readme - remove inline docs + add cart/checkout
2020-07-01 11:50:28 +01:00
Mike Jolley 00b7204f1c Sort states and countries correctly using `deep_sort_with_accents` (https://github.com/woocommerce/woocommerce-blocks/pull/2779)
* deep_sort_with_accents

* Fancy sorting fixes
2020-07-01 11:49:16 +01:00
Darren Ethier 4f5693e63c Add storybook story for icon library (https://github.com/woocommerce/woocommerce-blocks/pull/2787)
* 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>
2020-06-26 10:22:41 -04:00
Mike Jolley c65fd05a73 Reorder dependencies (https://github.com/woocommerce/woocommerce-blocks/pull/2774) 2020-06-26 13:01:35 +01:00
Mike Jolley d25d233f27 Replace usage of `cart-checkout/button` with `@woocommerce/base-components/button` (https://github.com/woocommerce/woocommerce-blocks/pull/2781)
* Change to base component

* Remove todo
2020-06-25 16:50:48 +01:00
Seghir Nadir 73adef6c85 Add custom matcher (https://github.com/woocommerce/woocommerce-blocks/pull/2780) 2020-06-25 14:00:27 +01:00
renovate[bot] 5247a77a43 Pin dependencies (https://github.com/woocommerce/woocommerce-blocks/pull/2770)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2020-06-25 11:28:06 +01:00
renovate[bot] 8927095e5e Update babel monorepo to v7.10.3 (https://github.com/woocommerce/woocommerce-blocks/pull/2772)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2020-06-25 09:44:56 +00:00
renovate[bot] 5f07d2192b Update Node.js to v12.18.1 (https://github.com/woocommerce/woocommerce-blocks/pull/2771)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2020-06-25 09:47:23 +01:00
renovate[bot] 28d9d48978 Update dependency @testing-library/react to v10.4.3 (https://github.com/woocommerce/woocommerce-blocks/pull/2773)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2020-06-25 09:46:46 +01:00
Rua Haszard 98413f2c40 Auto-merge renovate dependency updates (except major versions) (https://github.com/woocommerce/woocommerce-blocks/pull/2742)
* configure renovate to automerge all but major upgrades

* remove renovate weekly schedule - we want automerged updates ASAP :)

* mention dependency updates in release process

* fix heading levels in `Create a release pull request` section

* Revert "remove renovate weekly schedule - we want automerged updates ASAP :)"

This reverts commit c07ae84120a81fad4bc8d138623128bc0876e8d2.

* fix indentation (should be tabs)
2020-06-24 16:37:19 +12:00
Darren Ethier 19ab667672 implement `page.waitForNavigation` for handling the page load after clicking the search submit (https://github.com/woocommerce/woocommerce-blocks/pull/2769) 2020-06-23 10:38:48 -04:00
Darren Ethier 1953d4f96a remove unnecessary await (https://github.com/woocommerce/woocommerce-blocks/pull/2764) 2020-06-23 09:22:18 -04:00
Albert Juhé Lluveras 3fae904643 Use WooCommerce thumbnail images in Blocks (https://github.com/woocommerce/woocommerce-blocks/pull/2755)
* 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
2020-06-23 13:25:28 +01:00
Mike Jolley b40600a8b2 Update stock when a row already exists (https://github.com/woocommerce/woocommerce-blocks/pull/2747) 2020-06-23 11:35:10 +01:00
Albert Juhé Lluveras b74b85dc03 Remove text color from Cart and Checkout blocks (https://github.com/woocommerce/woocommerce-blocks/pull/2745)
* Remove text color from Cart and Checkout blocks

* Fix Cart price column misalignement. woocommerce/woocommerce-blocks#2744
2020-06-23 11:13:53 +01:00
Mike Jolley 94306573bc Call add to cart in click handler (https://github.com/woocommerce/woocommerce-blocks/pull/2763) 2020-06-23 11:10:06 +01:00
renovate[bot] 74b6cc5764 Lock file maintenance (https://github.com/woocommerce/woocommerce-blocks/pull/2760)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2020-06-22 11:04:41 +01:00
Albert Juhé Lluveras dfa6fca924 Cart & Checkout: show shipping method prices with taxes depending on settings (https://github.com/woocommerce/woocommerce-blocks/pull/2748) 2020-06-22 10:47:35 +02:00
Darren Ethier a1768ad3ec Remove reference to REST API feature plugin. 2020-06-20 08:21:46 -04:00
Mike Jolley 98d240d5e6 Introduce Variation Picker Component (https://github.com/woocommerce/woocommerce-blocks/pull/2497)
* 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>
2020-06-19 15:51:09 +01:00
Darren Ethier 1026ff8fd4 Switch to use `wp-env` as the development/test environment (https://github.com/woocommerce/woocommerce-blocks/pull/2730)
* Switch to use wp-env

* fix travis config

* fix spacing?

* doh need to install packages before starting environment!

* more fixes for errors in travis environment

* hmm still have node-git issues

* nope must use dash

* maybe it’s a caching issue (we’re caching node_modules?)

* remove configs

* add wp-env override json to gitignore

* remove obsolete scripts

* fix config in travis

* restore default env (for phpunit)

* for e2e manually set WORDPRESS_BASE_URL

* doh fix variable for wp version

* run phpunit via docker and fix WordPress version used for tests

* find out what’s going on with this thing

* don’t escape?

* doh phpunit needs dev installed from composer!

* fix versions

* looks liek we have to make sure wp db is up to date?!?

- also moves pre-configuration stuff all into one file for easier maintenance.

* see if I can get insight into what the siteurl is in the wp environment on travis

* try env setup (known that will break phpunit but possible it might fix e2e?)

* output plugin list to see what is active in travis

* try flushing rules

* do a hard fulsh

* fix argument syntax

* move things around and add pre-configuration as files so all wp commands run at once

* revert back to running each container command separately

Not sure, but this might affect permissions issues?

* maybe re-ordering before the file sync will help?

also try some configuration changes

* another attempt at travis config

In this attempt:
- map .htaccess to the server on the environment start
- try changing permissions of wp-content and wp-content/plugins as a part of the e2e test bootup

* use default wp version for gute build

* refactor to run all wp commands in one go

* don’t return promise from setup function

- this might fix the sporadic fails related to the fixtures being setup (and potential race conditions there).

* make sure we activate gutenberg plugin (previously we were just installing)

The syntax of the command was incorrect.

* try alternative syntax for installing and activating plugin
2020-06-17 16:28:11 -04:00
renovate[bot] 0be5642d3a Update dependency @testing-library/jest-dom to v5.10.1 (https://github.com/woocommerce/woocommerce-blocks/pull/2733)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2020-06-17 14:12:26 +01:00
renovate[bot] 6e9da71bbb Update dependency @types/react to v16.9.37 (https://github.com/woocommerce/woocommerce-blocks/pull/2734)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2020-06-17 14:12:07 +01:00
renovate[bot] d030669f5f Update dependency @octokit/graphql to v4.5.1 (https://github.com/woocommerce/woocommerce-blocks/pull/2732)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2020-06-17 14:11:42 +01:00
renovate[bot] 4db5e67371 Pin dependencies (https://github.com/woocommerce/woocommerce-blocks/pull/2731)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2020-06-17 14:11:13 +01:00
Mike Jolley cae6cbb191 `registerInnerBlock` ->`registerBlockComponent` (https://github.com/woocommerce/woocommerce-blocks/pull/2688)
* registerBlockComponent

* BW compat and docs

* Add tests for deprecated methods
2020-06-17 14:10:46 +01:00
Albert Juhé Lluveras 610e082f9c Update base/components classnames (https://github.com/woocommerce/woocommerce-blocks/pull/2711)
* 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
2020-06-17 11:53:42 +02:00
Mike Jolley 09aa20d0d3 Introduce Atomic Add to Cart Block (https://github.com/woocommerce/woocommerce-blocks/pull/2705)
* 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
2020-06-17 10:52:03 +01:00
Mike Jolley 340cf01255 Update documentation indexes and add checkout docs (https://github.com/woocommerce/woocommerce-blocks/pull/2720)
* Fix existing indexes

* Update indexes

* Stock docs
2020-06-16 16:50:09 +01:00
Albert Juhé Lluveras e26b60f00e Add 2.7.1 testing instructions 2020-06-16 15:47:42 +02:00
Albert Juhé Lluveras d509745530 Add 2.7.1 changelog 2020-06-16 15:47:30 +02:00
Seghir Nadir de10d09afd Expand travis matrix (https://github.com/woocommerce/woocommerce-blocks/pull/2686)
* Expand travis matrix to cover diffrent WP versions

* skip tests on older wp versions

* duplicate tests

* add wp version to phpunit tests

* skip all products in 5.2

* fix tests

* tweak command to account for e2e-util version

* tag snapshots

* Revert "tag snapshots"

This reverts commit b55ba2e522c5a248590039a3bb224f81da2653c5.

* use hook instead of HOC

* add todo to code

* fix borked conflict

* remove dubplicate single product test

* revert assets/js/blocks/product-search/edit.js to master
2020-06-16 13:18:34 +01:00
Albert Juhé Lluveras b0ef232271 Fix Product Categories List align attribute (https://github.com/woocommerce/woocommerce-blocks/pull/2700)
* Fix Product Categories List with align attribute

* Add support to align attribute to the Product Categories List block
2020-06-16 13:18:04 +02:00
Mike Jolley 582ba8797f Update references to use main 2020-06-16 10:38:19 +01:00
Darren Ethier 63fb5dda69 Fix missing scoped variable in closure and missing schema definitions. (https://github.com/woocommerce/woocommerce-blocks/pull/2724)
* make sure anonymous function receives taxonomy in scope

* fix schema errors
2020-06-16 10:58:19 +02:00
Darren Ethier 7f6dacdea6 Fix undefined index notice for query_type on the product collection data endpoint. (https://github.com/woocommerce/woocommerce-blocks/pull/2723)
* if `$query_type` isn’t defined, use default.

* add defensive checks for `taxonomy` index as well
2020-06-16 10:58:08 +02:00
Darren Ethier 4f50def038 Fix notices on variations without prices (https://github.com/woocommerce/woocommerce-blocks/pull/2722)
* ensure response of `wc_format_decimal` is a float before doing calculating

* Fix notice when empty array passed into min/max
2020-06-16 10:58:02 +02:00
Seghir Nadir dbd3c7ef16 Generate block pages for tests. (https://github.com/woocommerce/woocommerce-blocks/pull/2707)
* add util folder and add util to generate pages

* add loader to insert and remove pages

* update tests to use the new page creator

* refactor tests to not create pages

* remove fullscreen check

* update single product test.

The test kept failing for me locally (it wasn’t deleting the block), when I manually tested following the same manual steps would not delete the block.

* add `quiet-pull` flag to docker command to hopefully reduce noice on builds

* adjust page loader to simplfy the loop

* remove extra comment

* add docs

* move promise inside map

Co-authored-by: Darren Ethier <darren@roughsmootheng.in>
2020-06-15 15:59:18 +01:00
Albert Juhé Lluveras 2004c48c5e Remove background color from Express Checkout title (https://github.com/woocommerce/woocommerce-blocks/pull/2704)
* Remove background color from Express Checkout title

* Fix Express checkout title padding not visible on npm run build

* Add explanatory comment
2020-06-15 13:39:46 +02:00
Darren Ethier 582b5f60bb convert code to be IE11 friendly (https://github.com/woocommerce/woocommerce-blocks/pull/2708) 2020-06-12 15:58:31 -04:00
Albert Juhé Lluveras f46bc68f6e Fix Cart and Checkout sidebar styling issues (https://github.com/woocommerce/woocommerce-blocks/pull/2694)
* 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
2020-06-12 14:07:02 +02:00
renovate[bot] 50ead0508e Pin dependency html-react-parser to 0.10.5 (https://github.com/woocommerce/woocommerce-blocks/pull/2679)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2020-06-11 16:14:33 -04:00
renovate[bot] 01a4c870f0 Update dependency @stripe/stripe-js to v1.7.0 (https://github.com/woocommerce/woocommerce-blocks/pull/2680)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2020-06-11 16:13:54 -04:00
renovate[bot] 0ca600204a Update dependency @testing-library/react to v10.2.1 (https://github.com/woocommerce/woocommerce-blocks/pull/2681)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2020-06-11 16:13:28 -04:00
renovate[bot] fdb9903687 Update dependency eslint-plugin-jest to v23.13.2 (https://github.com/woocommerce/woocommerce-blocks/pull/2682)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2020-06-11 16:12:57 -04:00
Albert Juhé Lluveras 1a0c50078a Add theming docs (https://github.com/woocommerce/woocommerce-blocks/pull/2691)
* 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>
2020-06-11 19:38:31 +02:00
Mike Jolley 52496a3506 Stock Indicator Block (https://github.com/woocommerce/woocommerce-blocks/pull/2675)
* Stock Indicator Block

* Add to block map

* Put behind flag

* Move EditProductLink context

* stock text props
2020-06-11 10:02:00 +01:00
Darren Ethier 41ca430ffe Add initial cart flow tests (https://github.com/woocommerce/woocommerce-blocks/pull/2678)
* 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.
2020-06-10 14:21:34 -04:00
Mike Jolley 2c6d8d7f97 Add Atomic Category and Tag blocks (https://github.com/woocommerce/woocommerce-blocks/pull/2667)
* Add categories and tags to the API

* Add atomic categories block

* Add tag list block

* Add edit views

* Add correct icons

* Update styles

* Update assets/js/atomic/blocks/product/category-list/style.scss

Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>

* Update margin

* Use registerExperimentalBlockType

Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>
2020-06-10 16:56:13 +01:00
Seghir Nadir cadeb15e29 Pass WP version to docker-compose as ENV var (https://github.com/woocommerce/woocommerce-blocks/pull/2683)
* Pass WP version to docker-compose as ENV var

* change to 5.3

* rename to WP_VERSION to match unit-tests
2020-06-10 15:55:40 +01:00
Albert Juhé Lluveras 9b05b19028 Add aria-expanded to Change address button (https://github.com/woocommerce/woocommerce-blocks/pull/2603) 2020-06-10 15:38:39 +02:00
Albert Juhé Lluveras 27c68c520d Add expected folder for testing instructions to the release PR template (https://github.com/woocommerce/woocommerce-blocks/pull/2677)
* Add expected folder for testing instructions to the release PR template

* update release doc

Co-authored-by: Darren Ethier <darren@roughsmootheng.in>
2020-06-09 11:50:15 -04:00
Albert Juhé Lluveras 211728b401 Fix release PR template link in docs (https://github.com/woocommerce/woocommerce-blocks/pull/2665) 2020-06-09 16:24:23 +02:00
Albert Juhé Lluveras ae0f3b8200 Update version to 2.8.0-dev 2020-06-09 16:02:13 +02:00
Albert Juhé Lluveras c52d5cad5c Release: 2.7.0 (https://github.com/woocommerce/woocommerce-blocks/pull/2666)
* Add 2.7.0 changelog

* Add 2.7.0 testing steps

* Add woocommerce/woocommerce-blocks#2664 to readme

* Update testing notes to add checklist app creation link

* Add note that 'No shipping methods placeholder when they are all disabled' requires WC 4.3

* Bumping version strings to new version.

* Update readme.txt date

Co-authored-by: Darren Ethier <darren@roughsmootheng.in>
2020-06-09 15:58:19 +02:00
Darren Ethier c25a45c3a4 Ignore dashicons imports (https://github.com/woocommerce/woocommerce-blocks/pull/2664)
* ignore dashicons imports

* need to provide a path to module replacement

* add in replacements for used dashicons

* fix spelling

* use classnames
2020-06-08 11:27:40 -04:00
Albert Juhé Lluveras f68f11c6ca Update Checkout step progress indicator design (https://github.com/woocommerce/woocommerce-blocks/pull/2649) 2020-06-08 13:13:34 +02:00
Albert Juhé Lluveras c4e7191269 Fix credit card validation errors alignment (https://github.com/woocommerce/woocommerce-blocks/pull/2662)
* 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
2020-06-08 12:55:10 +02:00
Albert Juhé Lluveras 40426cbf93 Fix styling issues introduced in woocommerce/woocommerce-blocks#2597 and woocommerce/woocommerce-blocks#2619 (https://github.com/woocommerce/woocommerce-blocks/pull/2652)
* Move order summary styles to component style.scss

* Fix wrong class name in Order summary

* Move express payment methods a little bit higher

* Fix shipping options panel misaligned in the Cart sidebar

* Add right padding to panel button so text doesn't overlap the arrow

* Fix wrong class name in Order summary (II)
2020-06-08 11:28:58 +02:00
renovate[bot] 4dfd5bd687 Lock file maintenance (https://github.com/woocommerce/woocommerce-blocks/pull/2595)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2020-06-07 18:55:11 -04:00
Darren Ethier 2bbe2e63c6 Fix retrying after failed payment processed server side. (https://github.com/woocommerce/woocommerce-blocks/pull/2655)
* add state for selected saved token in payment data

* add handling for flipping payment status back to pristine when checkout has error

If payment status is successful client side, but the checkout state goes into an error after server side processing, then we reset payment status to pristine to allow for reprocessing of payment method client side.

This is skipped for saved payment method tokens because they effectively are _only_ processed server side.
2020-06-07 16:47:16 -04:00
Seghir Nadir 0ac76337d4 Expand Feature flags (https://github.com/woocommerce/woocommerce-blocks/pull/2591)
* Revert "Move blocks to stable flag (https://github.com/woocommerce/woocommerce-blocks/pull/2261)"

This reverts commit a005649ab8.

* migrate to number based gating

* add todo to watch feature flag

* remove flags from build

* change flag in travis

* load flag in right order

* expose flag to js

* simplify flag definition

* more feature flags

* wrap flag in check

* add helper functions

* add helpers in PHP

* fix typo in flag

* move php code to src/domain/package

* tweak if condition

* return flag to travis

* fix broken block name
2020-06-05 20:13:51 +01:00
Seghir Nadir baefb8d6e9 Add fixtures data for all entities. (https://github.com/woocommerce/woocommerce-blocks/pull/2548)
* change entrypoint setup and install wc-rest-api

* enable pretty links in docker

* create fixtures functions

* create and load global setup and teardown files

* support multiple shipping zones

* use env values

* refactor command

* fix typo in command

* more to import instead of require

* add docs

* refactor test data to its own file and refactor shipping methods

* revert to commonJS require

* rename function name

* rename global variable

* update fixture functions to accept fixture as param

* document fixture data

* pin wc rest api

* update package-lock

* remove forgetten test line
2020-06-05 17:49:07 +01:00
Darren Ethier 5dafeac1ab Audit payment method interface API (https://github.com/woocommerce/woocommerce-blocks/pull/2622)
* remove obsolete useStoreOrder hook and implementation.

This hook was actually never completed and was only implemented in the `usePaymentMethodInterface` hook/api. The original purpose was to expose order details to registered payment methods, but that is now exposed via checkout state event emitters so it’s no longer needed.

OrderId is exposed via the `CheckoutState` context provider.

* remove setBillingData from being exposed to payment methods directly

billingData is updated via event emitter callback responses (see payment method data context provider) and is not something that should be set directly via payment methods.

We want checkout to have control over how billing data is updated in the state.
2020-06-05 11:20:05 -04:00
Albert Juhé Lluveras eaeedd31e0 Update item count badge styles (https://github.com/woocommerce/woocommerce-blocks/pull/2619)
* Update item count badge styles

* Make sure item count badge doesn't break in multiple lines

* Make item count badge have white background

* Add docs

* Move order summary CSS properties outside of the sidebar class to reduce specificity

* Move Order summary to its own component
2020-06-05 17:03:48 +02:00
Seghir Nadir 177b30f940 Refactor E2E setup routine (https://github.com/woocommerce/woocommerce-blocks/pull/2544)
* skip test and delete unneeded ones

* update comment
2020-06-05 15:50:17 +01:00
Mike Jolley 2925d0d0ee Add Atomic SKU block (https://github.com/woocommerce/woocommerce-blocks/pull/2645)
* Add SKU block

* Edit product link in inspector
2020-06-05 15:36:07 +01:00
Albert Juhé Lluveras 1b51a8e050 Unify Cart headers (https://github.com/woocommerce/woocommerce-blocks/pull/2615)
* Unify Cart headers

* Change Cart title to 'Your cart (x items)'
2020-06-05 16:30:49 +02:00
Albert Juhé Lluveras f2f60b3ff2 Rename wc-single-product script name (https://github.com/woocommerce/woocommerce-blocks/pull/2648) 2020-06-05 13:19:57 +01:00
Mike Jolley da58a8b44f Add Inner Block Rendering and Atomic Block Styles (https://github.com/woocommerce/woocommerce-blocks/pull/2607)
* Register Atomic Blocks and save some block content

* renderInnerBlocks utility

* Frontend Rendering

* Clean up atomic block classnames

* Move shared styles

* Create a hoc for attribute mapping

* Rename some unpluralised class names

* Remove prefixes from atomic component class names

* Updated styles

* Update styles from master

* Revert product list styles

* 2020 fixes

* Separate renderFrontend from renderInnerBlocks

* Lazy loading of components

* Tweak loading classes

* FIx all products loading state

* Revert lazy implementation - creates too many unneccessary files due to webpack config

* Cleanup

* Remove wcBlocksBuildUrl

* Move call to register_atomic_blocks

* Remove duplicate key

* reuse render frontend

* Corectly handle frontend attribute mapping to keep editor working

* Style updates

* Update side effects

* Remove width style from rating to fix alignment

* Move ssr grid styles to main stylesheet

* Put back prefixed classnames

* 2020 styling fixes

* Create frontend files instead of doing it all in block map

* Update assets/js/atomic/utils/get-block-map.js

Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>

* Update assets/js/atomic/utils/render-parent-block.js

Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>

* Fix last child alignment regardless of block type

* More specificity fixes

* 2020 button alignment

* static fix to prevent offsets

* fix placeholder image in firefox

* Issues reported in feedback

Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>
2020-06-05 13:18:16 +01:00
Darren Ethier 2e8a3c8d6e Update README.md with a note about L2 version support. (https://github.com/woocommerce/woocommerce-blocks/pull/2644) 2020-06-05 07:20:34 -04:00
Albert Juhé Lluveras 104850deb5 Update WC tested version to 4.2 (https://github.com/woocommerce/woocommerce-blocks/pull/2643) 2020-06-05 12:57:25 +02:00
Albert Juhé Lluveras 77b68795d8 Update Cart & Checkout heading styles (https://github.com/woocommerce/woocommerce-blocks/pull/2597)
* Honor heading styles in Cart and Checkout blocks

* Replace Panel with DisclosureWidget and remove Card

* Remove panel-style from main entry

* Rename DisclosureWidget props

* Simplify TitleTag assign

* Add aria-expanded attribute

* Rename DisclosureWidget to Panel

* Make Panel button clickable area smaller

* Fix specificity issues with Twenty Twenty

* Reset italics in reset-typography mixin

* Make C&C titles font size large

* Add padding to shipping options when in the sidebar
2020-06-05 12:00:19 +02:00
Albert Juhé Lluveras 8a65d7297b Make sure Select styles don't change on hover (https://github.com/woocommerce/woocommerce-blocks/pull/2647) 2020-06-05 11:12:34 +02:00
renovate[bot] 04691be547 Update babel monorepo to v7.10.2 (https://github.com/woocommerce/woocommerce-blocks/pull/2609)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2020-06-04 06:57:07 -04:00
renovate[bot] 348bbe9051 Update Node.js to v12.18.0 (https://github.com/woocommerce/woocommerce-blocks/pull/2608)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2020-06-03 10:53:27 -04:00
renovate[bot] 8fc7e7ab77 Update dependency @testing-library/jest-dom to v5.9.0 (https://github.com/woocommerce/woocommerce-blocks/pull/2612)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2020-06-03 10:52:34 -04:00
renovate[bot] 0dda29d36a Update dependency @stripe/stripe-js to v1.6.0 (https://github.com/woocommerce/woocommerce-blocks/pull/2611)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2020-06-03 10:51:26 -04:00
renovate[bot] 3e58b5e096 Update dependency @octokit/graphql to v4.5.0 (https://github.com/woocommerce/woocommerce-blocks/pull/2610)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2020-06-03 10:47:43 -04:00
Darren Ethier 0ff1db36f4 2.6.0 followups for release process etc. (https://github.com/woocommerce/woocommerce-blocks/pull/2598)
* Add a pull request template for releases

* add testing instructions for 2.6.0 in a new testing/releases folder

* add create todo list button and fixt typo

* Add additional notes to release process

- Include about creating a release pull request and the template to use.
- Include about the process for creating the package update bump in WooCommerce core.

* add testing docs for 2.6.1 release

* Apply suggestions from code review

Co-authored-by: Mike Jolley <mike.jolley@me.com>
Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>

* improve wording to account for merging changes to master from the release branch

* Changes to pull request template

- make checklist more assertive instead of inquisitive.
- Provide more direction via notes and leading text in the template.
- include section on devnotes.

* remove section on updating the wiki

Co-authored-by: Mike Jolley <mike.jolley@me.com>
Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>
2020-06-03 09:39:48 -04:00
renovate[bot] 4880374c41 Update dependency @testing-library/react to v10.0.6 (https://github.com/woocommerce/woocommerce-blocks/pull/2613)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2020-06-03 10:19:43 +01:00
Darren Ethier e890446029 VID replacements for 2.6.0 release
# Conflicts:
#	package.json
#	woocommerce-gutenberg-products-block.php
2020-06-02 16:31:14 -04:00
Albert Juhé Lluveras 13e79f21b4 Fix product grid blocks markup & design inconsistencies (https://github.com/woocommerce/woocommerce-blocks/pull/2428)
* Fix Sale badge markup discrepancy. Fixes woocommerce/woocommerce-blocks#2107

* Fix product link markup discrepancy

* Use same class name for ratings markup in product grid blocks

* Remove editor specific class name for product title

* Unify price layout between product grid blocks and All Products block

* Change specificity raising classes to avoid editor class names

* Make small images fill the available width in product grid blocks

* Avoid increasing selector specificity in the frontend

* Undo AbstractProductGrid.php template changes

* Do not remove .wc-block-grid__product-rating__stars from CSS

* Add theming docs
2020-06-02 17:06:28 +02:00
Mike Jolley 28d516050e Add context support to Atomic Blocks (https://github.com/woocommerce/woocommerce-blocks/pull/2592)
* Bulk rename InnerBlockConfiguration to InnerBlockLayout context

* Refactor button to use context and handle null product data

* Move preview data to context

* Update blocks to support context

* fix button

* Update assets/js/atomic/blocks/product/title/block.js

Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>

* remove falsey check

* Update product retrieval code

* Update product prop usage

Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>
2020-06-02 12:14:46 +01:00
Albert Juhé Lluveras a6da13920d Fix Cart sidebar styles after font size changes (https://github.com/woocommerce/woocommerce-blocks/pull/2593)
* Fix Cart sidebar styles after font size changes

* Margin/padding cleanup
2020-06-02 09:33:10 +02:00
Albert Juhé Lluveras 31b5f4e00c Fixes to Twenty Twenty product grid styles (https://github.com/woocommerce/woocommerce-blocks/pull/2573)
* Remove underline from discounted prices

* Fix position of on sale badge in Twenty Twenty

* Make sure we reset styles from Core

* Fix image on sale badge not correctly positioned

* Fix sale badge alignment when they are on in the right
2020-06-02 09:18:34 +02:00
Darren Ethier 3e0a2c580e update changelog in readme.txt for 2.6.1 release 2020-06-01 14:49:29 -04:00
Mike Jolley 55b8be7d76 Remove CURRENT_TIMESTAMP default on the stock table (https://github.com/woocommerce/woocommerce-blocks/pull/2590)
* Remove the default timestamp value which requires mysql 5.6.5

* Change REPLACE INTO with INSERT INTO .. ON DUPLICATE KEY UPDATE

This will allow us to set the timestamp value on first insert only.
2020-06-01 13:40:03 -04:00
Darren Ethier 576686b3d2 fix package version 2020-06-01 13:06:50 -04:00
Albert Juhé Lluveras 00b0a81874 Make filter font sizes named (https://github.com/woocommerce/woocommerce-blocks/pull/2594) 2020-06-01 06:45:40 +02:00
Mike Jolley 2361c5f52c Add "edit product" card to single product block sidebar (https://github.com/woocommerce/woocommerce-blocks/pull/2585)
* Add edit product card

* Replace with div
2020-05-29 14:50:12 +01:00
Mike Jolley a5b09b7a43 Update atomic block structure (https://github.com/woocommerce/woocommerce-blocks/pull/2587)
* Move components to blocks dir

* Update import

* Create edit.js for each block

* Remove components/fix title

* Update imports

* Pass corect attributes on edit

* Import

* remove lightBlockWrapper
2020-05-29 14:49:56 +01:00
Mike Jolley 18480b0d68 Add layour editor to the single product block (https://github.com/woocommerce/woocommerce-blocks/pull/2586) 2020-05-29 12:28:04 +01:00
Albert Juhé Lluveras d1685bda7b Use named font sizes instead of values in px (https://github.com/woocommerce/woocommerce-blocks/pull/2533)
* Use named font sizes instead of values in px

* Convert rem mixin to em

* Remove unnecessary line-height

* 'Design' -> 'layout'

* Add comment to magic line-heihgt number

* Update a couple of class names to use BEM

* Use consistent name for SCSS variables

* Fix order summary line heights

* Update docs/contributors/coding-guidelines.md

Co-authored-by: Mike Jolley <mike.jolley@me.com>

Co-authored-by: Mike Jolley <mike.jolley@me.com>
2020-05-29 12:16:33 +02:00
Mike Jolley 597c9ded72 Single Product Block Edit Mode (https://github.com/woocommerce/woocommerce-blocks/pull/2577)
* Previews

* Edit mode

* Remove preview alt text

* Remove unused styles
2020-05-28 12:41:10 +01:00
Albert Juhé Lluveras 0ba29d28d4 Update placeholder styles (https://github.com/woocommerce/woocommerce-blocks/pull/2456)
* Convert several default buttons to primary

* Align primary and tertiary buttons

* Align select controls of placeholders

* Don't force a placeholder background color

* Add border to placeholder lists

* Add work-around for SearchListComponent compatibility with last version of @wordpress/components
2020-05-28 12:20:47 +02:00
renovate[bot] b7430d2197 Update babel monorepo to v7.10.1 (https://github.com/woocommerce/woocommerce-blocks/pull/2572)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2020-05-28 11:03:32 +01:00
Mike Jolley 2dc0e8112a Create shared contexts handle for inner blocks (https://github.com/woocommerce/woocommerce-blocks/pull/2568)
* Create shared contexts

* At to jest config
2020-05-28 11:02:10 +01:00
Darren Ethier 401cb20af1 update readme.txt and bump development version 2020-05-27 15:25:20 -04:00
Darren Ethier 926a46b31e make sure set variable is implemented! (https://github.com/woocommerce/woocommerce-blocks/pull/2580) 2020-05-27 13:48:05 -04:00
Darren Ethier 9f0bf26ac3 verify index is present before using (https://github.com/woocommerce/woocommerce-blocks/pull/2580) 2020-05-27 13:35:24 -04:00
Darren Ethier 5699778cad Ensure payment method assets are initialized before main block assets are. (https://github.com/woocommerce/woocommerce-blocks/pull/2579) 2020-05-27 12:34:29 -04:00
Albert Juhé Lluveras bc51052b04 Checkout steps improvements (https://github.com/woocommerce/woocommerce-blocks/pull/2530)
* Don't render step heading content if there is no content

* Make checkout step headings h2

* Add empty alt value to form step counter
2020-05-27 16:48:23 +02:00
Mike Jolley a06aa1eb39 Create single product block placeholder (https://github.com/woocommerce/woocommerce-blocks/pull/2569)
* Create single product block placeholder

* test

* Placeholder frontend js

* Update imports

* Update src/BlockTypes/SingleProduct.php

Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>

* Update src/BlockTypes/SingleProduct.php

Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>

Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>
2020-05-27 15:45:18 +01:00
Mike Jolley 1d2f3e8d3c Delete orders using delete method in batches of 20 (https://github.com/woocommerce/woocommerce-blocks/pull/2574)
* Delete orders using delete method in batches of 20

* Batch size to variable

* Tweak conditional for unit tests

* Force delete of draft orders rather than trash
2020-05-27 10:06:44 -04:00
renovate[bot] 38a050bb01 Lock file maintenance (https://github.com/woocommerce/woocommerce-blocks/pull/2550)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2020-05-27 14:55:44 +01:00
renovate[bot] 051b7d928f Update Node.js to v12.17.0 (https://github.com/woocommerce/woocommerce-blocks/pull/2571)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2020-05-27 14:54:50 +01:00
Albert Juhé Lluveras 35d4031d18 Add arguments to wc_get_shipping_method_count() (https://github.com/woocommerce/woocommerce-blocks/pull/2543) 2020-05-27 15:47:49 +02:00
Mike Jolley a3c20b0dd8 Update abstract block class (https://github.com/woocommerce/woocommerce-blocks/pull/2566) 2020-05-27 11:11:47 +01:00
Mike Jolley b062a67faf Accept object parameters in renderFrontend util (https://github.com/woocommerce/woocommerce-blocks/pull/2567) 2020-05-27 11:11:30 +01:00
Darren Ethier a5b6061dcc Ensure all inline @todos in code are covered by issues and obsolete @todos removed. (https://github.com/woocommerce/woocommerce-blocks/pull/2557)
* Remove todos for colors (see woocommerce/woocommerce-blocks#1331)

* remove todo for payment method express payments placeholder

No placeholder is needed because we don’t want to show this at all if there are no payment methods setup (or initialized based on `canMakePayment`). The payment methods step will have instructions in the editor for users to setup their payment methods.

So this todo was invalid.

* Remove todo comment for useStoreOrder (see woocommerce/woocommerce-blocks#2555)

* remove obsolete todos for usePaymentMethodInterface

* changed todo into a Note for the useQueryState tests

With focused work happening on tests, this is better as a note that can be picked up when this file is touched again.

* remove obsolete todo from payment method registration validation

* remove todo covered by created issue (see woocommerce/woocommerce-blocks#2166)

* remove obsolete todo for stripe utils

* Convert todo to a Note for Checkout Block php registration

For now, I think having the comment block noting what is happening here is sufficient. Whether or not we extend the blocks to cover the other endpoints is something that will surface in future planning and putting in an issue right now coudl be premature (and likely just land the issue in the icebox)

* Remove todo related to ReserveStock covered by woocommerce/woocommerce-blocks#2556

* Remove todo in AbstractRoute covered by issue in WooCommerce project

see https://github.com/woocommerce/woocommerce/pull/26219 for the issue.

* Convert todo to note for wp_version check in Library class
2020-05-26 13:31:33 -04:00
Albert Juhé Lluveras d81444f208 Use absint for per-page param validation (https://github.com/woocommerce/woocommerce-blocks/pull/2563)
* Revert "Fix Products by Category JSON response error (https://github.com/woocommerce/woocommerce-blocks/pull/2551)"

This reverts commit 19f7247d8f.

* Fix Products by Category JSON response error
2020-05-26 07:34:11 -04:00
Albert Juhé Lluveras 79359e7056 Fix Cart style discrepancies (editor-frontend) (https://github.com/woocommerce/woocommerce-blocks/pull/2486)
* Fix different heading size of Cart block between frontend and editor

* Increase Cart submit button specificity so styles are applied in the editor

* Ensure buttons don't inherit borders

* Simplify styles

* Create Title component

* Rename 'level' prop to 'headingLevel'
2020-05-25 18:45:38 +02:00
Darren Ethier 0ae5a8d516 Fix links and extra redundant header in README.md 2020-05-25 10:15:13 -04:00
Darren Ethier 4ab10fb2e3 More improvements to README.md
- remove usage of word stable
- add better wording in initial sentence.
2020-05-25 10:13:06 -04:00
Darren Ethier 5de4e97463 Update README.md with new version requirements 2020-05-25 10:11:14 -04:00
Albert Juhé Lluveras 19f7247d8f Fix Products by Category JSON response error (https://github.com/woocommerce/woocommerce-blocks/pull/2551)
* Fix Products by Category JSON response error

* Create wrapper for the 'intval' function

* Make get_intval public

* Small improvements
2020-05-25 10:05:16 -04:00
Darren Ethier a25cfaa064 Improve readme.txt with note about nature of feature plugin (https://github.com/woocommerce/woocommerce-blocks/pull/2553)
* add improvements to readme.txt

* some more tweaks to align with README.md

* Fix up TOC

* Remove errant “This.”
2020-05-25 09:39:21 -04:00
Albert Juhé Lluveras 5f69fd93ba Exclude three more files from the build ZIP (https://github.com/woocommerce/woocommerce-blocks/pull/2514) 2020-05-25 13:12:04 +02:00
Darren Ethier ce1e334c56 Fix broken dynamic address fields dependent on locale for selected country. (https://github.com/woocommerce/woocommerce-blocks/pull/2547)
* add missing dependency

* Don’t include all defaultAddressFields in address field config
2020-05-25 07:00:26 -04:00
Darren Ethier a5bca5708c Reakit tab already handles selecting the default tab if it isn’t set. (https://github.com/woocommerce/woocommerce-blocks/pull/2545) 2020-05-22 15:32:41 -04:00
Darren Ethier 5668f58f2c Include `onSubmit` handler for CheckoutForm component. (https://github.com/woocommerce/woocommerce-blocks/pull/2532)
* include `onSubmit` handler for CheckoutForm component and implement

* remove redundant preventDefault
2020-05-22 10:51:38 -04:00
Albert Juhé Lluveras 6d1cb26d63 Import TwentyTwenty block styles from Core (https://github.com/woocommerce/woocommerce-blocks/pull/2513)
* Add TwentyTwenty styles from Core

* Increase product on sale selector specificity

* Add theme class name to admin

* Fix some more style discrepancies

* Use em instead of rem
2020-05-21 19:09:50 +02:00
renovate[bot] 89f3b97041 Pin dependencies (https://github.com/woocommerce/woocommerce-blocks/pull/2508)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2020-05-21 16:10:11 +01:00
Albert Juhé Lluveras a59966350d Align Product Categories List select and button (https://github.com/woocommerce/woocommerce-blocks/pull/2517) 2020-05-21 10:53:13 +02:00
Seghir Nadir 6862938653 Add React Testing Library (https://github.com/woocommerce/woocommerce-blocks/pull/2528)
* refactor sidebar to its own component

* install RTL

* wrap component in EditorPreview

* remove example test
2020-05-20 20:33:16 +01:00
Albert Juhé Lluveras 60c0ebfdb7 Fix misalignment between value and label in form components (https://github.com/woocommerce/woocommerce-blocks/pull/2518)
* Fix misalignment between value and label in form components

* Do the calculation in SCSS
2020-05-20 15:54:37 +02:00
renovate[bot] d6779c4a8b Update dependency autoprefixer to v9.8.0 (https://github.com/woocommerce/woocommerce-blocks/pull/2511)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2020-05-20 14:41:55 +01:00
renovate[bot] 6fce572f3a Update dependency eslint-plugin-jest to v23.13.1 (https://github.com/woocommerce/woocommerce-blocks/pull/2512)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2020-05-20 14:41:36 +01:00
renovate[bot] dd18c75163 Update dependency @types/jest to v25.2.3 (https://github.com/woocommerce/woocommerce-blocks/pull/2509)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2020-05-20 14:29:11 +01:00
Albert Juhé Lluveras 0dc7e9e6f1 Fix decimal ratings not correctly displayed (https://github.com/woocommerce/woocommerce-blocks/pull/2507)
* Fix decimal ratings not correctly displayed

* Fix aria label rounding ratings
2020-05-19 17:24:20 +02:00
Albert Juhé Lluveras 8f2003df4b Remove some unique font-size (https://github.com/woocommerce/woocommerce-blocks/pull/2498)
* Remove font-sizes which are already inherited

* Remove font sizes from buttons with no text

* Make summary item quantity font-size 12px
2020-05-19 08:06:35 -04:00
Albert Juhé Lluveras b18e2a7d0d Add notices docs (https://github.com/woocommerce/woocommerce-blocks/pull/2502)
* Query state docs fixes

* Add notices docs

* Improve format

* Typo

* Avoid repeating in each method that current context is used.
2020-05-19 07:40:48 -04:00
Darren Ethier 989ec4a673 Fix version for workflow 2020-05-18 16:12:19 -04:00
Darren Ethier 9c8059dfab Create project-management-automations.yml
Hook up the woocommerce project management automations with the todo automation.
2020-05-18 16:09:32 -04:00
Mike Jolley 13bf17559a Add 2.5.16 changelog 2020-05-18 18:10:35 +02:00
Albert Juhé Lluveras 89b94e7cf2 Bumping version strings to new version. 2020-05-18 17:21:41 +02:00
Albert Juhé Lluveras 1fea56d8cd Remove class 'button' from Button component (https://github.com/woocommerce/woocommerce-blocks/pull/2494) 2020-05-18 12:53:57 +02:00
renovate[bot] 199231f94a Lock file maintenance (https://github.com/woocommerce/woocommerce-blocks/pull/2501)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2020-05-18 11:06:17 +01:00
Albert Juhé Lluveras d91de709df Remove ProductPreview component (https://github.com/woocommerce/woocommerce-blocks/pull/2499) 2020-05-18 11:20:00 +02:00
Seghir Nadir c48518de54 Use Reakit in payment tabs (https://github.com/woocommerce/woocommerce-blocks/pull/2371)
* WIP

* convert to reakit

* rebase and fix styling issues

* add forget initialTabName

* delete button and force manual select

* fix git diff problem in package-lock

* directly render tabs

* fix regression

* gaurd against unset values

* update reakit and guard against empty tabs
2020-05-15 14:55:17 -04:00
Darren Ethier 121cf0a893 swap rate pricing for preview data (https://github.com/woocommerce/woocommerce-blocks/pull/2496) 2020-05-15 11:07:24 -04:00
Darren Ethier 519ca4febd Fix Editor performance issues with checkout block. (https://github.com/woocommerce/woocommerce-blocks/pull/2495)
* add missing typedef

* make sure default shipping address is consistent with everywhere else

* fix test for new expectation
2020-05-15 08:48:45 -04:00
Albert Juhé Lluveras b59a6d56e3 Checkout block: fix error 'setIsSuppressed' in editor (https://github.com/woocommerce/woocommerce-blocks/pull/2492) 2020-05-15 07:09:36 -04:00
Darren Ethier e2d6e4a038 Fix shipping rate and address handling in Stripe payment request payment method. (https://github.com/woocommerce/woocommerce-blocks/pull/2484)
* fix dependencies

* refactor stripe payment-request to extract things into smaller units

- adds/fixes typedefs
- fixes dependencies
- improves logic.

* implement memoizing for functions.

* if same shipping address is selected, just call updateWith immediately

* add separate handler for failed shipping rate retrieval

* improve logic around shipping rate fail/success status

* add notice suppression logic to store notices.

- this is implemented in checkout processor to suppress notices when express payment methods are active.

* add error detection for shipping address errors and update the shipping status accordingly

* update type-def

* set billingData before shippingData

This is needed because of the shipping data and billing data sync logic in use-checkout-address.

* have to tighten dependencies to prevent unnecessary firing

With us now adding error status setters for shippping, the potential for the shipping status changes to trigger the effect went up. So tightening the dependencies to only the stati we care about prevent unnecessary effect calls.

* refactor event handlers to be named and remove all listeners.

This is an undocumented api on the stripe `paymentRequest.on` return value, but I’m trusting it will be relatively stable for this api.

The need for this is caused by the fact that without it, the listeners are re-registered on the paymentRequest event everytime the paymentRequest modal is closed and reopened.

* fix typo in doc block
2020-05-14 19:55:22 -04:00
Rua Haszard 89f843b2b7 respect stripe saved cards store setting (https://github.com/woocommerce/woocommerce-blocks/pull/2455)
* expose a allowSavedCards option to JS on stripe settings data

* hide 'save my card' checkbox if merchant disables saved cards

* use stripe allowSavedCards option to control "Save my card" checkbox

* (linter) remove unnecessary useEffect dependency:

- stripePromise const is defined outside component, so hook doesn't
depend on it

* clarify comment about saved cards and supports( tokenization )

* correct comment about save card merchant option - doesn't affect paying with previously saved payment methods

* use true boolean value for stripe allow saved cards setting:

previously was using woo option `yes no` style, other JS settings all use true bool

Co-authored-by: Darren Ethier <darren@roughsmootheng.in>

* fix client side check now `allowSavedCards` is true boolean

Co-authored-by: Darren Ethier <darren@roughsmootheng.in>
2020-05-15 11:35:17 +12:00
Mike Jolley e5c500c70d Only set to pristine when checkout is idle, not when idle status changes (https://github.com/woocommerce/woocommerce-blocks/pull/2485) 2020-05-14 18:18:18 -04:00
Albert Juhé Lluveras 631a07dbf2 Add docs for CSS specificity (https://github.com/woocommerce/woocommerce-blocks/pull/2479)
* Add docs for CSS specificity

* Update docs/contributors/coding-guidelines.md

Co-authored-by: Mike Jolley <mike.jolley@me.com>

* Update docs/contributors/coding-guidelines.md

Co-authored-by: Mike Jolley <mike.jolley@me.com>

* Update docs/contributors/coding-guidelines.md

Co-authored-by: Mike Jolley <mike.jolley@me.com>

* Update docs/contributors/coding-guidelines.md

Co-authored-by: Mike Jolley <mike.jolley@me.com>

* Update docs/contributors/coding-guidelines.md

Co-authored-by: Mike Jolley <mike.jolley@me.com>

* Update docs/contributors/coding-guidelines.md

Co-authored-by: Mike Jolley <mike.jolley@me.com>

* Remove 'popular' from title

Co-authored-by: Mike Jolley <mike.jolley@me.com>
2020-05-14 12:03:43 +02:00
Albert Juhé Lluveras 11981947c5 Add CSS resets for better theme compatibility (https://github.com/woocommerce/woocommerce-blocks/pull/2478) 2020-05-14 11:07:21 +02:00
Darren Ethier a5a62359d7 Fix all shipping address changes in stripe payment request timing out with no rate update. (https://github.com/woocommerce/woocommerce-blocks/pull/2482)
* remove unnecessary shipping field and shipping fields setter

* remove a commented out block

* account for billingData having values but billingFields not when shipping address changes.
2020-05-13 20:05:09 -04:00
Mike Jolley 24035a1508 Update Stripe Method to display generic icon and text in label, with cards below (https://github.com/woocommerce/woocommerce-blocks/pull/2466)
* Support card alignment as a prop

* Add generic card icon to stripe

* Add icons to stripe content

* Update styles

* Label element with icon whitelist

* Update assets/js/base/components/payment-methods/payment-methods.js

Co-authored-by: Darren Ethier <darren@roughsmootheng.in>

* Remove activePaymentMethod

* Remove spread operator

Co-authored-by: Darren Ethier <darren@roughsmootheng.in>
2020-05-13 16:48:03 +01:00
Mike Jolley 2395137790 Ensure email and phone are persisted through `setBillingData` (https://github.com/woocommerce/woocommerce-blocks/pull/2477)
* Force inclusion of email and phone

* Update deps

* update deps
2020-05-13 15:39:26 +01:00
renovate[bot] 9e4755ad04 Update dependency @octokit/graphql to v4.4.0 (https://github.com/woocommerce/woocommerce-blocks/pull/2472)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2020-05-13 15:24:14 +01:00
renovate[bot] 425b039dee Update dependency eslint-plugin-jest to v23.11.0 (https://github.com/woocommerce/woocommerce-blocks/pull/2476)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2020-05-13 15:23:51 +01:00
Darren Ethier 0f53b24f1a Fix regression for payment methods in incognito mode. (https://github.com/woocommerce/woocommerce-blocks/pull/2473)
* ensure we set initial tab if it’s not set

* set appropriate defaults for supports if we don’t have payment method configuration object yet.
2020-05-13 05:34:05 -04:00
renovate[bot] 21fe9d05bc Update dependency @types/react to v16.9.35 (https://github.com/woocommerce/woocommerce-blocks/pull/2475)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2020-05-13 10:30:59 +01:00
renovate[bot] 0dff6c6b95 Pin dependencies (https://github.com/woocommerce/woocommerce-blocks/pull/2471)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2020-05-13 10:30:16 +01:00
Rua Haszard f822e8dbb5 Ensure order summary is displayed :) - (https://github.com/woocommerce/woocommerce-blocks/pull/2470)
correct logic for early bail while container width thing is setting up
2020-05-13 09:54:44 +12:00
Seghir Nadir 4cc81731fc Account for middlewares as effectful code (https://github.com/woocommerce/woocommerce-blocks/pull/2469) 2020-05-13 09:46:43 +12:00
Mike Jolley 9caf01c354 Update wp.editor references, bump min version support (https://github.com/woocommerce/woocommerce-blocks/pull/2434)
* Update wp.editor references to wp.blockEditor

* Bump min version requirment to 5.2

* Update packages

* Revert "Update packages"

This reverts commit 7565c83a14fe8efd2e7c52473eeeaa5f837fa9fb.

* Undo server side render import changes

* bump min wp version variable
2020-05-13 08:31:49 +12:00
Mike Jolley 9a7658179b Refactor `usePaymentMethodRegistration` to ensure payment methods are populated once initialization is true (https://github.com/woocommerce/woocommerce-blocks/pull/2467)
* Refactor usePaymentMethodRegistration so initialisation happens at same point as dispatch

* Update NoPaymentMethods conditonal

* Suggested changes to payment init
2020-05-12 12:40:08 -04:00
Rua Haszard fd91263986 Allow shopper to save Stripe payment method in user account for subsequent purchases (https://github.com/woocommerce/woocommerce-blocks/pull/2453)
* always default "save my card for next time" checkbox to unchecked:

This is based on the previous checkout behaviour.
I.e. the shopper has to actively opt-in to save their card.

* Implement "save payment method for next purchase" in checkout:

- send "save card" option using existing post key
  - wc-stripe-new-payment-method
- comment out inappropriate use of "save" when using a saved card (tbc)

* don't hard code the payment gateway name in 'save payment method' key

* refactor "save payment info" checkbox so payment methods can opt-in:

- Add options.allowSavePaymentToken to payment method
registration / config.
- Opt-in in Stripe CC, it allows saved cards.
- Remove render of "save my card" checkbox from Stripe CC UI component.
- Render "save my card" checkbox automatically in payment method tab
(based on allowSavePaymentToken option).
+ todo/follow up comments

* rejig "save my payment method" behaviour so it's generic:

- Any payment method that supports "save" can opt-in:
  - options.allowSavePaymentToken = true/false
  - handle `wc-XXX-new-payment-method` key server side to persist
- Add support in payment context/state reducer for storing checkbox
state, expose value and action via context
- Convert state flag to appropriate API key/value in payment processor
- Remove previous stripe-specific implementation
+ bonus add comment to payment context about preserving state in
PRISTINE action

* rename payment method "allow save" option, more consistent with UI

* remove last vestiges of gateway-specific "save card" impl:

- No need to pass CheckboxControl to payment methods; checkbox is
now handled automatically by checkout.
- Remove shouldSavePayment prop passing through various layers of
stripe payment processing code. (Now handled in context/processor.)

* change new option property name and shape. Also adds validation.

* update type-defs

* use more reliable `activePaymentMethod` for saved payment method

Co-authored-by: Darren Ethier <darren@roughsmootheng.in>
2020-05-12 11:12:28 -04:00
Mike Jolley 22d8d02463 Avoid const and let in inline JS (https://github.com/woocommerce/woocommerce-blocks/pull/2464) 2020-05-12 15:17:45 +01:00
Mike Jolley 73abba295e Use display table instead of flex in radio control group (https://github.com/woocommerce/woocommerce-blocks/pull/2461)
* Use display table instead of flex

* Target direct child span only
2020-05-12 15:17:02 +01:00
Albert Juhé Lluveras 53c64600a3 Remove Shipping totals editor.scss file (https://github.com/woocommerce/woocommerce-blocks/pull/2465) 2020-05-12 15:56:09 +02:00
Mike Jolley fae3028c8a Update labels to match frontend sorting dropdown (https://github.com/woocommerce/woocommerce-blocks/pull/2462) 2020-05-12 11:05:38 +01:00
Darren Ethier 27508537f2 If product is changed for featured product block, update the link in the button. (https://github.com/woocommerce/woocommerce-blocks/pull/1894)
* If product is changed for featured product block, update the link in the button

* add handling to _only_ update the product url when the product is changed.
2020-05-12 05:08:53 -04:00
Albert Juhé Lluveras f09367b62f Add 'Handpicked Products' block keyword (https://github.com/woocommerce/woocommerce-blocks/pull/2463) 2020-05-12 10:47:57 +02:00
Mike Jolley 1d154364cb Introduce ContainerQueryContextProvider - hide order summary on mobile (https://github.com/woocommerce/woocommerce-blocks/pull/2432)
* Add ContainerQueryContextProvider

* Implement ContainerQueryContextProvider

* Rename based on feedback

* Update assets/js/type-defs/contexts.js

Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>

* Update assets/js/type-defs/contexts.js

Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>

Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>
2020-05-11 17:07:22 +01:00
Darren Ethier 4ad741329b Fix saved payment method selection not working for purchases. (https://github.com/woocommerce/woocommerce-blocks/pull/2425)
* fix arguments

* only set payment status to pristine if it isn’t already successful

* add server side handling for saved tokens

* ensure correct gateway is selected when using saved card:
- reset the active payment method when user selects saved payment method
(card); this ensures that the correct gateway is used when switching
from another gateway to a saved card

* enhance radiocontrol to receive option specific change events.

* implement specific option change events

This commit:

- ensures selecting a saved payment option updates active payment method for the selected option.
- Sets the saved token key for the selected option correctly.

* remove unnecessary php side code

* fix bug with default saved payment option not applying:

When the payment options are initialised, we now call the onChange
handler for the default (`is_default`) option. This triggers payment
success() so checkout succeeds with default payment method, even if user
doesn't touch payment options.

* fix effect dependencies

Co-authored-by: Rua Haszard <rua.haszard@automattic.com>
2020-05-11 09:29:57 -04:00
Seghir Nadir 39199778f8 fix broken cart styles in Editor (https://github.com/woocommerce/woocommerce-blocks/pull/2448)
* fix broken cart styles in Editor

* remove rule.
2020-05-11 13:12:47 +01:00
renovate[bot] f6ca3f30e4 Lock file maintenance (https://github.com/woocommerce/woocommerce-blocks/pull/2454)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2020-05-11 13:11:56 +01:00
Darren Ethier e7781ba407 Fixes regression with payment method validation (https://github.com/woocommerce/woocommerce-blocks/pull/2450)
* add typedefs for store notice context

* improve useStoreNotices hook so returned interfaces are fairly constant

* fix dependencies, defaults, and add types

* fix dependencies

* fix dependencies

* improve functions exposed on validation context so they are more constant

* fixing dependencies

* normalize tokenId to string everywhere

Assuming the token is a number is a bad idea because it is feasible that source for some payment methods could be a string. Also when retrieved as an input value, the id will be a string anyways.
2020-05-10 19:41:10 -04:00
Darren Ethier ea3d817db1 Fix multiple extra stripe createSource requests than necessary (https://github.com/woocommerce/woocommerce-blocks/pull/2444)
* refactor to move payment processing into it’s own effect

- this is the first step in trying to improve the createSource behaviour.

* memoize setValidationErrors so onPaymentProcessing event effect doesn’t re-run unnecessarily.

* Update assets/js/payment-method-extensions/payment-methods/stripe/credit-card/use-payment-processing.js

Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>

* fix docs alignment

Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>
2020-05-08 11:32:20 -04:00
Mike Jolley 657e5005ff Fix X-WC-Store-API-Nonce updates (https://github.com/woocommerce/woocommerce-blocks/pull/2429)
* Move store api nonce js to separate middleware entry

* Make middleware a depedency of block-data

* Build
2020-05-08 10:39:03 -04:00
Brent Shepherd 976556748b Fix PayPay file name (https://github.com/woocommerce/woocommerce-blocks/pull/2443) 2020-05-08 12:42:58 +01:00
Albert Juhé Lluveras 76878eff0d Fix wrong frontend error button class names (https://github.com/woocommerce/woocommerce-blocks/pull/2431) 2020-05-08 09:02:18 +02:00
Darren Ethier 467097de0c add eslint configuration for react hooks (https://github.com/woocommerce/woocommerce-blocks/pull/2436) 2020-05-07 17:21:05 -04:00
Mike Jolley 3c55918e62 Add an inline skeleton sizing script (https://github.com/woocommerce/woocommerce-blocks/pull/2420)
* Add an inline skeleton sizing script

* const/let
2020-05-07 10:53:07 +01:00
Albert Juhé Lluveras e970e4e86f SCSS mixins cleanup (https://github.com/woocommerce/woocommerce-blocks/pull/2405)
* Cleanup some old mixins

* Make font-size() mixin use parameters with units

* Remove hover-state mixin

* Cleanup mixins file
2020-05-07 10:48:38 +02:00
Mike Jolley 4436bdd23f Allow text inputs to focus on mount (https://github.com/woocommerce/woocommerce-blocks/pull/2416) 2020-05-06 15:04:00 -04:00
Mike Jolley dd811b1491 Update Stripe/payment payment notices (https://github.com/woocommerce/woocommerce-blocks/pull/2417)
* Update notices to say `card` instead of `card's`

* Track isEmpty per field so placeholders are not visible when focusing and defocusing other fields

* Make payment notices non-dissmissable, and removed on payment method switch

* Don't add validation notices

* implement nullish coalescing operator

Co-authored-by: Darren Ethier <darren@roughsmootheng.in>
2020-05-06 14:58:31 -04:00
Mike Jolley 74a4e55075 Remove API summaries in favour of client side code (https://github.com/woocommerce/woocommerce-blocks/pull/2387)
* Remove summary from API

* Add wordCountType to assets

* Update packages

* Remove summary from test data

* Featured product uses short desc

* Pass description instead of summary

* Use new Summary Component

* Component and tests

* Increased versititilty of methods

* Update assets/js/base/components/cart-checkout/product-summary/index.js

Co-authored-by: Darren Ethier <darren@roughsmootheng.in>

* Extra tests for html tags

Co-authored-by: Darren Ethier <darren@roughsmootheng.in>
2020-05-06 11:30:15 +01:00
Mike Jolley 87e8b26e6f Store billing address to local state and persist globally to prevent loss of data (https://github.com/woocommerce/woocommerce-blocks/pull/2374)
* Remove unused shippingAsBilling prop from billing data context

* Move functions out of component and add docblocks

* Local address state

* Refactor into new custom hook

* Remove TODO and code fixed in core

* useShallowEqual to prevent updates on all field changes

* Fix stale validation errors

* cleanup

* Should be setting local state not global state for email and phone

* Combine useEffects and pass correct deps

* Update assets/js/base/hooks/checkout/use-checkout-address.js

Co-authored-by: Seghir Nadir <nadir.seghir@gmail.com>

* Prettier

* Move validation update check into updateValidationError

* Fix state updaters

* Fix context definition for setShippingAddress

* Fix validation updates

* errorId dep

* Reapply changes to checkout block

* Update equality checks

Co-authored-by: Seghir Nadir <nadir.seghir@gmail.com>
2020-05-06 11:21:30 +01:00
renovate[bot] 058d22a980 Update dependency eslint-plugin-jest to v23.9.0 (https://github.com/woocommerce/woocommerce-blocks/pull/2410)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2020-05-06 10:59:34 +01:00
renovate[bot] 371544a255 Update babel monorepo to v7.9.6 (https://github.com/woocommerce/woocommerce-blocks/pull/2409)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2020-05-06 10:59:23 +01:00
renovate[bot] 539236ff6e Update dependency jest to v25.5.4 (https://github.com/woocommerce/woocommerce-blocks/pull/2412)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2020-05-06 10:58:56 +01:00
renovate[bot] bad073d34e Update dependency node-sass to v4.14.1 (https://github.com/woocommerce/woocommerce-blocks/pull/2413)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2020-05-06 10:20:07 +01:00
Rua Haszard 44346274d2 clarify various checkout block editor sidebar wording (https://github.com/woocommerce/woocommerce-blocks/pull/2401)
* tweak various checkout block editor sidebar wording

* fix accidental sentence-casing of Return to cart label
2020-05-06 09:25:41 +12:00
Rua Haszard 440ee2e3b1 move checkout submit & related elements into "main" element (https://github.com/woocommerce/woocommerce-blocks/pull/2400) 2020-05-05 14:19:47 +01:00
Albert Juhé Lluveras 30c281c524 Use container queries to load Cart and Checkout responsive styles (https://github.com/woocommerce/woocommerce-blocks/pull/2370)
* Use container queries to load Cart and Checkout responsive styles

* Update package-lock.json

* Make form-step react to container queries instead of media queries

* Make sidebar layout inner padding relative to the full-width

* Make container queries breakpoints smaller
2020-05-05 10:10:02 +02:00
Rua Haszard b7d4b48b57 remove radius from Checkout submit, consistent with theme buttons (https://github.com/woocommerce/woocommerce-blocks/pull/2390) 2020-05-05 08:13:13 +12:00
Rua Haszard 9d0217419c decode html entities in ProductName component (https://github.com/woocommerce/woocommerce-blocks/pull/2389) 2020-05-04 15:44:23 -04:00
Rua Haszard da8fa3b870 Don't show checkout block for logged out users unless store is configured to allow guest checkout (https://github.com/woocommerce/woocommerce-blocks/pull/2375)
* expose guest checkout related options to blocks

* don't show checkout if user is not logged in and guest checkout is disabled

* checkout block doesn't yet support signup:
- if logged out / guest, don't show checkout
- even if store allows sign up at checkout

* only show login prompt if user is not logged in

* link to login page (as needed) if checkout requires login

* rejig hide login link when necessary:
- use customerId from checkout context
- revert currentUserLoggedIn setting - not needed

* add redirect param to checkout login links (so checkout can continue)
2020-05-04 15:40:09 -04:00
Albert Juhé Lluveras b5497147d5 Fix long product names regression (https://github.com/woocommerce/woocommerce-blocks/pull/2391) 2020-05-04 17:15:32 +02:00
Darren Ethier 88e397154d Add Todo Probot config (https://github.com/woocommerce/woocommerce-blocks/pull/2384)
* Add todo bot config

* tweak todo comment to test
2020-05-02 15:56:33 -04:00
Darren Ethier 76d0b9bb2e Update release notes to reflect changes in release process. 2020-05-01 17:29:20 -04:00
Darren Ethier 1e917f5a54 Ensure stripe payment request "canMakePayment" configuration uses site country. (https://github.com/woocommerce/woocommerce-blocks/pull/2372)
* export baseLocation for `@woocommerce/settings`

* implement country code from site base location instead of cart shipping country
2020-05-01 07:24:28 -04:00
Mike Jolley a640a230ca Assets/Block settings: Only lookup page if ID > 0 (https://github.com/woocommerce/woocommerce-blocks/pull/2369)
* Only lookup page if ID > 0

* Check for valid post

* Maybe fix test path
2020-05-01 11:02:20 +01:00
Mike Jolley bf8cff6f50 Rename the discount section when discount total is zero (https://github.com/woocommerce/woocommerce-blocks/pull/2367)
* Rename the discount section when discount total is zero

* Cleanup variable naming
2020-05-01 10:59:27 +01:00
Mike Jolley a3ca37bade Change when innerblocks are rendered (https://github.com/woocommerce/woocommerce-blocks/pull/2366) 2020-05-01 10:33:55 +01:00
Mike Jolley 5a39df880f Fix summary styles and margins/padding woocommerce/woocommerce-blocks#2340 (https://github.com/woocommerce/woocommerce-blocks/pull/2368) 2020-05-01 10:31:09 +01:00
Rua Haszard be968c9103 only show checkout login prompt if store allows it (https://github.com/woocommerce/woocommerce-blocks/pull/2364) 2020-04-30 13:54:43 +01:00
Albert Juhé Lluveras 9e7623567e Make all font sizes accessible + add docs about font-size() mixin (https://github.com/woocommerce/woocommerce-blocks/pull/2291)
* Switch all font-sizes to use the mixin

* Add notice in coding-guidelines to use accessible font sizes

* Fix label alignment in forms with big font-sizes

* Fix Stripe input boxes font-size not being responsive

* Fix select overflowing in small font sizes

* Add rem function from woocommerce/woocommerce-blocks#2320

* Make the font-size() mixin set relative line-height values

* Convert several magic numbers to use the new mixins

* Update docs

* Update input/select paddings to use the rem mixin

* Add lineHeight comment

* Interpolate rem() mixin inside calc

* Make input padding use only relative units
2020-04-30 12:18:12 +02:00
Mike Jolley 3122447ae4 Update payment-method-integration.md 2020-04-30 10:55:57 +01:00
Mike Jolley 4c16280977 Add placeOrderButtonLabel docs 2020-04-30 10:55:26 +01:00
Mike Jolley 1fd0fa79a9 Payment methods `placeOrderButtonLabel` config (https://github.com/woocommerce/woocommerce-blocks/pull/2362)
* Add payment method configs

* Remove submitLabel

* Enhance useCheckoutSubmit to handle button text

* copy paste error
2020-04-30 10:52:36 +01:00
Mike Jolley 6df5903e0f Checkout Block Order Summary Styles (https://github.com/woocommerce/woocommerce-blocks/pull/2355)
* Update checkout styles

* remove item prices from summary
2020-04-30 10:51:08 +01:00
Albert Juhé Lluveras 2593c711ad Fix payment method error notices issues (https://github.com/woocommerce/woocommerce-blocks/pull/2352)
* Prevent payment method errors appearing twice. Fixes woocommerce/woocommerce-blocks#2327

* Remove payment method errors on submit. Fixes woocommerce/woocommerce-blocks#2217

* Simplify useEffect dependencies

* Pass context name to removeNotice
2020-04-30 11:43:56 +02:00
Darren Ethier 06d84997e5 Update testing instructions cart stock error. 2020-04-29 16:01:52 -04:00
Albert Juhé Lluveras fce0e2d71c Fix Cart block interaction in the editor (mobile) (https://github.com/woocommerce/woocommerce-blocks/pull/2354)
* Prevent SnackbarList from loading in the editor

* Fix snackbar styles leaking into the editor

* Prevent 'Proceed to Checkout' button being fixed to the bottom in the editor
2020-04-29 17:45:29 +02:00
Mike Jolley 8424934149 Update API status codes (https://github.com/woocommerce/woocommerce-blocks/pull/2353)
* Update HTTP status codes

* Catch JSON parsing errors.
2020-04-29 15:47:05 +01:00
Rua Haszard 7abe9dffb3 align cart main heading and totals sidebar heading: (https://github.com/woocommerce/woocommerce-blocks/pull/2346)
- set appropriate padding for main cart container
- card padding is currently provided by Gutenberg component (?)
- overriding padding on totals card to match main container
2020-04-29 13:35:42 +01:00
Mike Jolley 95809b30bb Update payment method config to include icons (https://github.com/woocommerce/woocommerce-blocks/pull/2267)
* Remove strong and cleanup existing configs

* Fix TS validation for blocks-registry

* Allow label to be string

* Split up button and icons for cart

* Make icons and payment methods available on cart page

* Fix payment method enqueuing

* Icon normalization and Stripe implementation

* PayPal Icon

* adjust spacing

* Fix string handling

* Remove paypal icon config

* Check for an object before creating icon

* Add payment icons to Stripe label

* Update common-icons.js

* Update Cart.php

* Update jest.config.json
2020-04-29 11:57:58 +01:00
Albert Juhé Lluveras 60cf16a334 Fix low stock badge not breaking in a new line (https://github.com/woocommerce/woocommerce-blocks/pull/2348) 2020-04-29 12:57:04 +02:00
Darren Ethier 58abb408c2 make sure we import from external not direct files (https://github.com/woocommerce/woocommerce-blocks/pull/2330) 2020-04-29 11:20:52 +01:00
Mike Jolley 8c88870d2d Merge branch 'add/pin-woocommerce' 2020-04-29 11:07:02 +01:00
renovate[bot] cb467c8696 Update dependency @types/wordpress__data to v4.6.7 (https://github.com/woocommerce/woocommerce-blocks/pull/2333)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2020-04-29 10:53:21 +01:00
Mike Jolley afe5f4d706 Update shipping should extend the correct route (https://github.com/woocommerce/woocommerce-blocks/pull/2328) 2020-04-29 10:44:07 +01:00
renovate[bot] 4785151037 Update Node.js to v12.16.3 (https://github.com/woocommerce/woocommerce-blocks/pull/2331)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2020-04-29 10:25:12 +01:00
renovate[bot] 0a6c23ba8e Update dependency @stripe/stripe-js to v1.5.0 (https://github.com/woocommerce/woocommerce-blocks/pull/2332)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2020-04-29 10:24:52 +01:00
renovate[bot] 9c41e1bfcc Update dependency @types/wordpress__element to v2.4.1 (https://github.com/woocommerce/woocommerce-blocks/pull/2334)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2020-04-29 10:23:55 +01:00
renovate[bot] 808e40a089 Update dependency css-loader to v3.5.3 (https://github.com/woocommerce/woocommerce-blocks/pull/2336)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2020-04-29 10:23:29 +01:00
renovate[bot] a9b14b2b4e Update dependency jest to v25.5.0 (https://github.com/woocommerce/woocommerce-blocks/pull/2337)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2020-04-29 10:23:13 +01:00
Rua Haszard 1b596b94dc Quantity badge white separator + center tweak (https://github.com/woocommerce/woocommerce-blocks/pull/2347)
* add extra white border to quantity badge

* nudge checkout quantity badge so it's roughly centered with image corner
2020-04-29 10:22:12 +01:00
Mike Jolley a58420a60e Table creation validation for install routine (https://github.com/woocommerce/woocommerce-blocks/pull/2287)
* Bump package version for testing

* New install routine and db version

* Revert "Bump package version for testing"

This reverts commit c3fee55a34e75429b731cd7a2cc07e841010df6d.

* Update bootstrap to ensure blocks is installed properly before tests are ran

* Restore errors after install

* Use enabled method instead of comparing db version

* Moved installer code to admin_init

* Tweak test bootstrap
2020-04-28 16:36:37 +01:00
Mike Jolley ad93ddd891 Add PayPal Standard (https://github.com/woocommerce/woocommerce-blocks/pull/2288)
* Add paypal files

* Add PayPal Icon/resolve feedback
2020-04-28 11:13:48 +01:00
Seghir Nadir 476ae5dcd5 remove order note (https://github.com/woocommerce/woocommerce-blocks/pull/2318) 2020-04-28 11:07:05 +01:00
renovate[bot] 0a9ce1206b Lock file maintenance (https://github.com/woocommerce/woocommerce-blocks/pull/2290)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2020-04-27 17:26:29 +01:00
Seghir Nadir 797ded1efc Add notice errors to add to cart button and All products (https://github.com/woocommerce/woocommerce-blocks/pull/2278)
* expose errors when adding to cart

* clear notices

* make notice dismissible

* decode entities
2020-04-27 17:24:54 +01:00
Mike Jolley e85b6fe9a9 Inject block attributes rather than save them (https://github.com/woocommerce/woocommerce-blocks/pull/2273)
* Inject attributes rather than saving them

* Update snaps
2020-04-27 12:06:58 -04:00
Mike Jolley 30ecea188f Avoid loading Assets API during REST requests (https://github.com/woocommerce/woocommerce-blocks/pull/2286)
* Move is built to method

* Moved payment related logic into single controller class for better organization

* Only load assets on non-rest requests
2020-04-27 16:51:50 +01:00
Seghir Nadir d70174aa57 Pin WooCommerce version 2020-04-26 14:30:31 +01:00
Mike Jolley e5589727fc Support itemized taxes (https://github.com/woocommerce/woocommerce-blocks/pull/2276) 2020-04-24 14:44:44 +01:00
Mike Jolley 8bf58b4596 Trigger fragment refresh after editing cart item quantities (https://github.com/woocommerce/woocommerce-blocks/pull/2266)
* Make util to fire legacy events

* Update button to use util

* Trigger event when quantity changes

* Trigger event on removal

* Move comments to util
2020-04-24 14:41:32 +01:00
Mike Jolley 7f85c1bcc0 Migrate REST API usage to the Store API (https://github.com/woocommerce/woocommerce-blocks/pull/2282)
* Remove unused wc/blocks/cart endpoint

* remove unused withProducts hoc

* Remove getProducts util

* Use store API products endpoint in product blocks

* Remove product endpoint tests

* Remove controller

* Switch attributes endpoint to store api

* Refactor withAttributes to use store API

* Migrate tags and cats to store API

* MIgrate variations to store api

* Migrate reviews to store API

* Drop dedicated variation endpoint

* Move tests

* Move cart init

* Fix reviews

* Comment out broken tests

* Remove old class based with-attributes test
2020-04-24 14:36:47 +01:00
Albert Juhé Lluveras 72c7b38022 Add screen reader text to remove item icon (https://github.com/woocommerce/woocommerce-blocks/pull/2285) 2020-04-24 15:11:14 +02:00
Albert Juhé Lluveras 96e8ccf1a4 Cart & Checkout: Update styles to better match designs (https://github.com/woocommerce/woocommerce-blocks/pull/2283)
* Add ending dot to sentence

* Open links to products from Cart and Checkut blocks in new tabs

* Makes sure product names are broken if they overflow the container

* Use native find instead of lodash method

* Update styles to better match designs

* Revert "Open links to products from Cart and Checkut blocks in new tabs"

This reverts commit 9b64aa5f2e81bf0cf09d5640a3cfe1cc1085c046.

* Fix product name overflowing remove menu on mobile

* Remove @todo comments from form step CSS

* Make letter-spacinguse em instead of px

* IE11: Correctly align text in quantity selector

* Fix long product names overflowing in Checkout block on IE11
2020-04-24 13:23:25 +01:00
Seghir Nadir 7863a99de7 Abstract Page selector and fix some issues in sidebar. (https://github.com/woocommerce/woocommerce-blocks/pull/2270)
* abstract pageSelector to its own component and fix titles

* fix unwrapped context

* move control styles outside editor-wrapper

* restore condition to previous state

* move condition outisde

* rename condition

* keep pageSelect visible till next refresh

* remove comment
2020-04-22 17:44:12 +01:00
Mike Jolley 953712941b Update StoreApi namespaces/move files (https://github.com/woocommerce/woocommerce-blocks/pull/2277)
* `use` is never relative - absolute is always used so backslash is not needed

* Move process_legacy_payment code to rest api class

* Move storeapi directory

* Updated namespaces and moved tests
2020-04-22 15:39:19 +01:00
Mike Jolley 5a2ee88905 Fixes to totals recalculation and taxes (https://github.com/woocommerce/woocommerce-blocks/pull/2275)
* Hide tax totals row when taxes are disabled in core

* Trigger recalcs if hash changes

* move recalc until later on in rest call

* Unused class
2020-04-22 14:16:17 +01:00
Albert Juhé Lluveras 7fa4b76c52 Prevent All Products block from crashing when error has no json method (https://github.com/woocommerce/woocommerce-blocks/pull/2269) 2020-04-22 12:09:20 +02:00
renovate[bot] 5d25790d95 Update dependency jest to v25.4.0 (https://github.com/woocommerce/woocommerce-blocks/pull/2272)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2020-04-22 11:06:39 +01:00
renovate[bot] 3e9b6ad26c Update dependency eslint-config-prettier to v6.11.0 (https://github.com/woocommerce/woocommerce-blocks/pull/2271)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2020-04-22 11:06:13 +01:00
Mike Jolley db145deb70 Decode billing address from server (https://github.com/woocommerce/woocommerce-blocks/pull/2268) 2020-04-21 15:24:04 +01:00
Mike Jolley 880d4e19b4 Decode entities in cart shipping data (https://github.com/woocommerce/woocommerce-blocks/pull/2265) 2020-04-21 14:43:49 +01:00
Mike Jolley d0d0cfc565 Checkout: Rename address2 attribute (https://github.com/woocommerce/woocommerce-blocks/pull/2264)
* Rename address2 attribute

* Update snap
2020-04-21 11:51:11 +01:00
Darren Ethier 493a826e44 modify emitters so it handles non object or invalid object responses correctly. (https://github.com/woocommerce/woocommerce-blocks/pull/2249)
With these changes:

- If an observer returns an object wthout a type property an error is thrown and the emitter is aborted with an error type response.
- For anything else returned from an observer, it’s discarded.

Tests are updated for the new expectations
2020-04-21 04:33:16 +02:00
Seghir Nadir a005649ab8 Move blocks to stable flag (https://github.com/woocommerce/woocommerce-blocks/pull/2261)
* remove feature flag

* catch blocks.ini error
2020-04-20 15:55:59 +01:00
Seghir Nadir 106e187bd7 Merge branch 'master' of https://github.com/woocommerce/woocommerce-gutenberg-products-block 2020-04-20 15:13:49 +01:00
Seghir Nadir dc2d0dd6ae mark heading in docs 2020-04-20 15:13:38 +01:00
Mike Jolley a074260266 Revert "Improvements to REST API performance (https://github.com/woocommerce/woocommerce-blocks/pull/2248)" (https://github.com/woocommerce/woocommerce-blocks/pull/2259)
This reverts commit 30c0182fbe.
2020-04-20 14:59:17 +01:00
Seghir Nadir bb9f688ee4 fix some typos in testing checklist 2020-04-20 14:58:19 +01:00
Seghir Nadir 3a71233d4b Testing checklist (https://github.com/woocommerce/woocommerce-blocks/pull/2196)
* initial draft for testing

* fix typos and add table of content

* add how to report section

* finish the rest of the docs

* add free shipping section

* add create todo badge

* fix misplaced button

* add a general flow section

* change image link

* fix typos
2020-04-20 14:47:11 +01:00
Seghir Nadir 2e9b21ef8a Fix snackbar being too high and covering coupon section (https://github.com/woocommerce/woocommerce-blocks/pull/2255)
* fix snackbar issue

* fix some styles
2020-04-20 14:23:44 +01:00
Mike Jolley 248c552baf Add quantity limit at product level (https://github.com/woocommerce/woocommerce-blocks/pull/2256)
* Add quantity limit at product level

* Stock checks only needed when backorders are disabled

* Use remaining stock, not stock qty in messages etc

* Prevent duplicate validation from core
2020-04-20 14:10:39 +01:00
Mike Jolley de53038872 Check for instance of WP_Block (https://github.com/woocommerce/woocommerce-blocks/pull/2258) 2020-04-20 14:07:08 +01:00
Mike Jolley 30c0182fbe Improvements to REST API performance (https://github.com/woocommerce/woocommerce-blocks/pull/2248)
* Rejig methods and only load assets on non-api requests

* Avoid cart recalc on every request

* link to pr
2020-04-20 14:06:30 +01:00
renovate[bot] 6a8643f531 Update dependency @stripe/stripe-js to v1.4.0 (https://github.com/woocommerce/woocommerce-blocks/pull/2222)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2020-04-20 11:13:52 +01:00
Albert Juhé Lluveras 1b2e8dd435 Do not scroll to top when payment methods have an error (https://github.com/woocommerce/woocommerce-blocks/pull/2247)
* Do not scroll to top when payment methods emit an error

* Simplify code and add check for hasValidationErrors
2020-04-20 11:11:32 +01:00
renovate[bot] 75f6eb97fb Lock file maintenance (https://github.com/woocommerce/woocommerce-blocks/pull/2254)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2020-04-20 10:37:25 +01:00