Skip to content
This repository has been archived by the owner on Feb 23, 2024. It is now read-only.

Checkout i2: Enable shipping toggle in the editor #4457

Merged
merged 1 commit into from
Jul 14, 2021

Conversation

mikejolley
Copy link
Member

For Checkout i2, to make the editor better reflect the frontend, this re-enables the "Use same address" checkbox so that you can preview how it looks with this on and off.

When the billing section is visible, everything remains editable, so the toggle is not persisted and does not affect saving. Since the billing and shipping sections now share address field configs, it doesn't matter if billing is hidden by default.

Note; whilst the sections can be moved right now, this will be disabled in the final version, so the position of the billing and shipping sections does not matter at this point if moving blocks around.

Fixes #4443

How to test the changes in this Pull Request:

  1. Add Checkout i2 to a page
  2. Try toggling the "Use same address" checkbox to show/hide billing address
  3. Confirm address fields are still disabled.

@mikejolley mikejolley added status: needs review skip-changelog PRs that you don't want to appear in the changelog. labels Jul 12, 2021
@mikejolley mikejolley self-assigned this Jul 12, 2021
@mikejolley mikejolley requested a review from a team as a code owner July 12, 2021 13:25
@mikejolley mikejolley requested review from frontdevde and removed request for a team July 12, 2021 13:25
@mikejolley mikejolley changed the base branch from trunk to feature/checkout-i2 July 12, 2021 13:25
@github-actions
Copy link
Contributor

Size Change: +87.3 kB (+9%) 🔍

Total Size: 1.05 MB

Filename Size Change
build/active-filters-frontend.js 8.27 kB -7 B (0%)
build/active-filters.js 7.85 kB +5 B (0%)
build/all-products-frontend.js 23.2 kB +195 B (+1%)
build/all-products.js 37.3 kB -192 B (-1%)
build/all-reviews.js 9.6 kB -9 B (0%)
build/atomic-block-components/add-to-cart--atomic-block-components/button--atomic-block-components/image---a7e2bb9b.js 2.57 kB +4 B (0%)
build/atomic-block-components/add-to-cart--atomic-block-components/button.js 1.82 kB -1 B (0%)
build/atomic-block-components/add-to-cart--atomic-block-components/image--atomic-block-components/title.js 334 B +1 B (0%)
build/atomic-block-components/add-to-cart-frontend.js 8.65 kB -7 B (0%)
build/atomic-block-components/add-to-cart.js 7.73 kB +6 B (0%)
build/atomic-block-components/button-frontend.js 1.74 kB +4 B (0%)
build/atomic-block-components/button.js 874 B +1 B (0%)
build/atomic-block-components/category-list-frontend.js 467 B -2 B (0%)
build/atomic-block-components/category-list.js 476 B -1 B (0%)
build/atomic-block-components/image-frontend.js 1.88 kB +9 B (0%)
build/atomic-block-components/image.js 1.35 kB +2 B (0%)
build/atomic-block-components/price-frontend.js 2.09 kB -1 B (0%)
build/atomic-block-components/price.js 2.11 kB -2 B (0%)
build/atomic-block-components/rating-frontend.js 560 B -2 B (0%)
build/atomic-block-components/sale-badge-frontend.js 859 B +3 B (0%)
build/atomic-block-components/sale-badge.js 867 B -1 B (0%)
build/atomic-block-components/sku.js 392 B -1 B (0%)
build/atomic-block-components/stock-indicator.js 612 B +1 B (0%)
build/atomic-block-components/summary.js 911 B -1 B (0%)
build/atomic-block-components/title-frontend.js 1.44 kB +3 B (0%)
build/atomic-block-components/title.js 1.29 kB +3 B (0%)
build/attribute-filter.js 11.9 kB +171 B (+1%)
build/blocks-checkout.js 20.6 kB +394 B (+2%)
build/cart-frontend.js 78.3 kB -90 B (0%)
build/cart.js 45.9 kB +134 B (0%)
build/checkout-frontend.js 82.5 kB -87 B (0%)
build/checkout.js 48.7 kB +620 B (+1%)
build/featured-category.js 7.39 kB +9 B (0%)
build/featured-product.js 9.55 kB +11 B (0%)
build/handpicked-products.js 6.56 kB +5 B (0%)
build/price-filter-frontend.js 14.3 kB -46 B (0%)
build/price-filter.js 9.6 kB +25 B (0%)
build/price-format.js 1.37 kB -1 B (0%)
build/product-best-sellers.js 6.72 kB -3 B (0%)
build/product-categories.js 3.39 kB +6 B (0%)
build/product-new.js 6.88 kB +2 B (0%)
build/product-on-sale.js 7.23 kB -2 B (0%)
build/product-search.js 2.68 kB +3 B (0%)
build/product-tag.js 6.7 kB +10 B (0%)
build/product-top-rated.js 6.85 kB +3 B (0%)
build/products-by-attribute.js 7.82 kB +9 B (0%)
build/reviews-by-category.js 11.6 kB +10 B (0%)
build/reviews-by-product.js 13.1 kB +22 B (0%)
build/reviews-frontend.js 9.22 kB -3 B (0%)
build/single-product-frontend.js 25.7 kB +6 B (0%)
build/single-product.js 9.85 kB -13 B (0%)
build/vendors--atomic-block-components/price-frontend.js 5.71 kB +1 B (0%)
build/wc-blocks-data.js 10.8 kB -8 B (0%)
build/wc-blocks-editor-style-rtl.css 15.1 kB +210 B (+1%)
build/wc-blocks-editor-style.css 15.1 kB +207 B (+1%)
build/wc-blocks-middleware.js 1.48 kB -1 B (0%)
build/wc-blocks-registry.js 2.74 kB -7 B (0%)
build/wc-blocks-shared-hocs.js 1.75 kB +2 B (0%)
build/wc-blocks-style-rtl.css 19.8 kB +549 B (+3%)
build/wc-blocks-style.css 19.8 kB +557 B (+3%)
build/wc-blocks-vendors.js 235 kB -68 B (0%)
build/wc-blocks.js 3.51 kB +4 B (0%)
build/wc-settings.js 2.92 kB -11 B (0%)
build/checkout-i2-frontend.js 39.5 kB +39.5 kB (new file) 🆕
build/checkout-i2.js 45.1 kB +45.1 kB (new file) 🆕
ℹ️ View Unchanged
Filename Size
build/atomic-block-components/rating.js 568 B
build/atomic-block-components/sku-frontend.js 388 B
build/atomic-block-components/stock-indicator-frontend.js 610 B
build/atomic-block-components/summary-frontend.js 906 B
build/atomic-block-components/tag-list-frontend.js 465 B
build/atomic-block-components/tag-list.js 471 B
build/attribute-filter-frontend.js 18 kB
build/product-category.js 7.59 kB
build/wc-blocks-google-analytics.js 1.99 kB
build/wc-blocks-shared-context.js 1.54 kB
build/wc-blocks-vendors-style-rtl.css 1.05 kB
build/wc-blocks-vendors-style.css 1.05 kB
build/wc-payment-method-bacs.js 812 B
build/wc-payment-method-cheque.js 807 B
build/wc-payment-method-cod.js 903 B
build/wc-payment-method-paypal.js 844 B
build/wc-payment-method-stripe.js 12.3 kB

compressed-size-action

@mikejolley mikejolley removed the request for review from frontdevde July 12, 2021 15:57
Copy link
Contributor

@frontdevde frontdevde left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested as per testing instructions on both the feature branch and this branch. Can confirm that now with this branch the shipping toggle is enabled in the editor while it wasn't on the feature branch. The text fields are disabled as expected in both cases.

I've noticed that the block doesn't show on the Frontend of the site. That's the case on the feature branch for me too though, so I assume it's known/unrelated and I'm ✅ with that in mind.

@github-actions github-actions bot added this to the 5.6.0 milestone Jul 13, 2021
@mikejolley mikejolley merged commit a2c1a79 into feature/checkout-i2 Jul 14, 2021
@mikejolley mikejolley deleted the enhancement/shipping-toggle-4443 branch July 14, 2021 11:54
mikejolley added a commit that referenced this pull request Jul 22, 2021
* Duplicate checkout block

* Contact information block

* form step block

* shipping address block

* Setup atomic blocks

* Container structure

* More formal steps rather than generic form step

* Add billing and shipping forms

* add checkout actions block

* add order note block

* Add order summary

* add payment block

* Add inspector controls for address fields

* frontend WIP

* move attributes

* wrap shipping with form step

* PhoneNumber to typescript

* Remove column block

* form steps

* move payment logic to frontend

* Express block

* inline payment block

* Add shipping method block

* Render inner blocks (not standalone blocks) and add classes to Atomic Block list on php side

* lazy again

* Add more wrappers from old frontend file

* add layout

* Checkout wrappers were missing

* Enqueue payment methods for new block

* Add missing classnames

* Move shipping as billing state to context provider

* express payments rendering

* try/block-registry

* Remove atomic components (unused)

* Fix attribute persistance due to template locking

* Fix shipping display when not needed

* Set correct parent blocks for inner blocks

* pass data to blocks

* demo/newsletter

* Skeleton styling

* only apply styles to loading state for now

* shipping method block frontend

* rename express block

* lock template

* fix ts warning for __webpack_public_path__

* Refactor to avoid duplicating atomic block logic

* remove changes in save method

* Add zones and shipping methods to the sidebar for the shipping inner block

Closes #4320

* Fix script handles

* Fix method display when there are none

* Add shipping phone

* Add phone to api and sync with billing correctly

* Clear hidden fields on load

* fix requirePhoneField property

* Enable shipping and billing phone fields

* readonly field support

* Handle context attributes

* Fix createInterpolateElement usage

* add totalswrapper

* Implement Terms and Conditions block for Checkout i2  (#4436)

* Setup atomic blocks

* frontend WIP

* Express block

* try/block-registry

* Set correct parent blocks for inner blocks

* Skeleton styling

* Refactor to avoid duplicating atomic block logic

* add block locking

* add terms and conditions block

* hardcore settings image

* lock blocks from being deleted

* hide original checkout block

* mark blocks as side effectful

* move variations to block register function

* prevent core checkout blocks from needlessly showing in the inserter

* enable checkout i1

* fix broken rebase

* move save back

* Localise default text

Co-authored-by: Mike Jolley <[email protected]>

* Add add-hoc Block locking from WooCommerce Blocks side. (#4454)

* add locking

* use subscribe instead

* fix condition

* add locking to blocks

* check if the item is not a text field

* Tidy up hacks CSS class handling

* Fix error if node is undefined

* Hide menu when move is disabled

* update package lock

* Add todo and fix issue where selector returns null

* split todos

* move todo

* edit comment

Co-authored-by: Mike Jolley <[email protected]>

* Un-disable the billing checkbox in the editor (#4457)

* Add missing Slot fill provider on frontend

Fixes #4441 by adding the slot fill provider to the checkout-i2 block.

* Use column style appender

* Add padding/styles to actions

* Add/update icon library

* Multiline checkbox alignment

* Icons and copy changes for i2 blocks

* Add terms by default

* Add notice if text is missing links (#4466)

* Swap variations for toggle

* Add payment settings to inspector

* Update package lock

* Add inline docs to block registry

* Add inner block areas below each form step.

This does not include the form step contents, just adds inner blocks after existing content. Moving content within the inner block area is a separate discussion.

This closes #4306

* Sample block registration + docs

* Add tests for registerCheckoutBlock

* Fix lazy component detection in tests

* Add basic transform between i1 and i2

* remove template lock todo

* Update scroll to top hoc

* Move shared settings to new context providers

Closes #4472

* Remove readonly field support (unused)

* Remove context code

* Experimental

* remove invalid typedef

* FIx scrolling on validation due to misplaced context provider

* Update assets/js/base/context/providers/cart-checkout/checkout-state/index.tsx

Co-authored-by: Darren Ethier <[email protected]>

* Update comment to remove reference to phone

* Update packages/checkout/blocks-registry/README.md

Co-authored-by: Darren Ethier <[email protected]>

* Rename ScrollToTopComponent

* Add explicit list of expectedType in TypeScript definition

* Add todo to remove custom shipping phone handling

* Remove dangerouslySetInnerHTML in External Link Card Component

* Add ExternalLinkCard to storybook

* update todo wording

* Refactor withScrollToTop to remove useCallback and use typescript

* Support children on CheckboxControl, with added Typescript

* Spread getRegisteredBlocks return value

Co-authored-by: Nadir Seghir <[email protected]>
Co-authored-by: Darren Ethier <[email protected]>
@Aljullu Aljullu modified the milestones: 5.6.0, Behind Feature Flag Aug 2, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
skip-changelog PRs that you don't want to appear in the changelog.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Checkout i2: "use same address for billing" toggle in the editor
3 participants