* 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
* 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>
* stubs for bank transfer payment method
* allow merchant to disable BACS payment method
* show customised BACS title & description in checkout
* re-add entry point for BACS payment method (lost in rebase)
* Reduce specificity of some button styles
* Submit container: make it possible for themes to change the shadow color without the need to rewrite shadow values
* Use background-color instead of background property in docs
* Add docs to style the button and the submit container
* Remove border from button
* Add back state styles to button component
* Docs improvements
* Undo unncessary changes in button component styles
* Add spaces
* 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>
* 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
* 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.
* 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>
* 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>
* 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>
* modify dashicon replacements to be consistent with other icon exports
This also involved modifying the dashicon module replacement to use `cloneElement` instead of `createElement`.
* import from packages not global
* export woo icon consistent with other icons from the library
The Woo category icon was not using the Icon system and not exported consistent with other icons.
* add missing viewbox to arrowBack
* add story for icon library
* Update assets/js/icons/stories/index.js
Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>
Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>
* Remove legacy files
* Use thumbnail product image for Cart, Checkout and Reviews blocks
* Add option to toggle between full size and cropped image to the Atomic Product image block
* Add attributes to API
* Add component
* API updates to return variation data
* Update to handle updated api responses
* Working picker
* Update tests
* update test
* Use SelectControl
* Add Picker to Form Block
* Code cleanup and splitting
* Inline todos
* Update todos
* Update assets/js/atomic/blocks/product/add-to-cart/product-types/variable/variation-attributes/index.js
Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>
* change classname and move styles within component
* Correct conditional
* Avoid nesting filters
* Remove exclude from getVariationsMatchingSelectedAttributes
* basic select styles
* remove custom select styles
Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>
* 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
* Update base/components classnames
* Fix class name conflict
* Fix some class names mismatch
* Fix review loading placeholder styles
* Fix docs format
* Update old class name
* Fix price slider regression
* Fix load more button component missing legacy class
* Fix wrong loading mask styles classname
* Remove 'checkout' from 'wc-block-components-checkout-payment-methods__save-card-info' classname
* Make it explicit legacy classes will be removed in the next major version
* Make product variation data styles belong to product metadata
* Improve docs sentence
* Form/button stucture
* Use registerBlockComponent
* Context for add to cart form
* Working cart button
* Tidy up button component
* Add todos
* Revert reg block
* Hide stock indicator if not purchasable
* Hide terms if empty
* Add url and type to API
* Skip default category from term response
* Rename form element
* Form for product types
* Tidy up context provider and expand todos
* No longer using qty icon
* Update todos
* Correct text domain
* registerExperimentalBlockType
* Duplicate method
* Remove prevent default
* Update docblock
* Description for button code
* 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
* 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>
* Order summary: Add spacing between product name and price name
* Remove border from shipping options in the side bar
* Add a hasBorder prop to Panel
* Checkout Order summary: remove margin product description
* Fix padding when there are multiple packages and remove old code
* Simplify selector
* Add margin botton to no shipping options notice
* Make sure Checkout titles are aligned when there are no express payment methods
* Update step heading margins according to new designs
* Add theming docs
* Update some components to the new class name structure
* Add docs about class name updates
* Update coding guidelines
* Minor improvements
* Update docs/theming/class-names-update-280.md
Co-authored-by: Darren Ethier <darren@roughsmootheng.in>
Co-authored-by: Darren Ethier <darren@roughsmootheng.in>
* more setup configuration for rtl
* move default state for cart out of reducer
This also creates a file for default store states, it should make it easier to execute tests in various environments.
* Make sure there’s a default object for cart line item row
* set defaults for cartData
* add fetchMock as a global in eslint config
* add initial cart flow tests
This is just to get the ball rolling, the cart block needs more tests
* fix missing @wordpress/jest-console configs (because I overwrote the original configuration)
* update test because of change in branch
* switch import order
* add globals.d.ts file to declare globals we use.
This is a quick solution to prevent typescript linting warning about `fetchMock`. At some point we could also create a proper interface for it or import the types (if they exist) for the `jest-mock` package.
The new `globals.d.ts` file is excluded from published builds.
* Add expected folder for testing instructions to the release PR template
* update release doc
Co-authored-by: Darren Ethier <darren@roughsmootheng.in>
* 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>
* 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
* 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)
* 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.
* 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
* 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
* 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.
* 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
* 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>
* 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
* 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>
* Fix Sale badge markup discrepancy. Fixeswoocommerce/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
* 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
* 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.
* 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>
* 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
* 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
* 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
* 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'
* 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
* 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
* 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
* 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>
* 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.
* 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
* Refactor usePaymentMethodRegistration so initialisation happens at same point as dispatch
* Update NoPaymentMethods conditonal
* Suggested changes to payment init
* 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>
* 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.
* 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>
* 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.
* 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>
* 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>
* 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>
* 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>
* 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
* 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)
* 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
* 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
- set appropriate padding for main cart container
- card padding is currently provided by Gutenberg component (?)
- overriding padding on totals card to match main container