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

Implement Terms and Conditions block for Checkout i2 #4436

Merged
merged 19 commits into from
Jul 12, 2021

Conversation

senadir
Copy link
Member

@senadir senadir commented Jul 7, 2021

This PR adds terms and conditions block for checkout i2 + various fixes to core blocks to reduce settings clutter like removing reusable button and not showing them on the inserter because we add them on the code.

@senadir senadir requested a review from mikejolley July 7, 2021 12:34
@senadir senadir requested a review from a team as a code owner July 7, 2021 12:34
@senadir senadir removed the request for review from a team July 7, 2021 12:35
@senadir senadir force-pushed the add/block-locking branch from b1363b4 to 13424f3 Compare July 7, 2021 12:36
Comment on lines +58 to +61
<span
className="wc-block-components-checkbox__label"
dangerouslySetInnerHTML={ { __html: label } }
/>
Copy link
Member Author

Choose a reason for hiding this comment

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

This so we can support dynamic labels that contain links, not sure if this is accessible.

@github-actions
Copy link
Contributor

github-actions bot commented Jul 7, 2021

Size Change: +25.9 kB (+3%)

Total Size: 1.05 MB

Filename Size Change
build/active-filters.js 7.85 kB -1 B (0%)
build/all-products.js 37.3 kB -72 B (0%)
build/all-reviews.js 9.56 kB -5 B (0%)
build/atomic-block-components/add-to-cart--atomic-block-components/button--atomic-block-components/image---a7e2bb9b.js 2.57 kB +8 B (0%)
build/atomic-block-components/add-to-cart--atomic-block-components/button.js 1.82 kB -4 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.js 7.74 kB +19 B (0%)
build/atomic-block-components/button.js 874 B -3 B (0%)
build/atomic-block-components/image.js 1.35 kB -1 B (0%)
build/atomic-block-components/price.js 2.11 kB +1 B (0%)
build/atomic-block-components/sale-badge.js 870 B +2 B (0%)
build/atomic-block-components/sku.js 394 B -1 B (0%)
build/atomic-block-components/stock-indicator.js 611 B -1 B (0%)
build/atomic-block-components/summary.js 910 B -2 B (0%)
build/atomic-block-components/tag-list.js 471 B -1 B (0%)
build/atomic-block-components/title.js 1.29 kB +1 B (0%)
build/attribute-filter.js 11.9 kB -6 B (0%)
build/cart.js 45.9 kB -111 B (0%)
build/checkout-frontend.js 82.5 kB +24 B (0%)
build/checkout-i2.js 45.1 kB +25.5 kB (+131%) 🆘
build/checkout.js 48.8 kB +664 B (+1%)
build/featured-category.js 7.4 kB +4 B (0%)
build/featured-product.js 9.56 kB +16 B (0%)
build/handpicked-products.js 6.56 kB +1 B (0%)
build/price-filter.js 9.6 kB -5 B (0%)
build/product-best-sellers.js 6.73 kB +1 B (0%)
build/product-categories.js 3.39 kB -5 B (0%)
build/product-category.js 7.59 kB -4 B (0%)
build/product-new.js 6.89 kB +3 B (0%)
build/product-on-sale.js 7.24 kB +10 B (0%)
build/product-search.js 2.68 kB -2 B (0%)
build/product-tag.js 6.7 kB +10 B (0%)
build/product-top-rated.js 6.85 kB +4 B (0%)
build/products-by-attribute.js 7.82 kB +6 B (0%)
build/reviews-by-product.js 13.1 kB +5 B (0%)
build/single-product.js 9.86 kB +12 B (0%)
build/wc-blocks-editor-style-rtl.css 15.1 kB -42 B (0%)
build/wc-blocks-editor-style.css 15.1 kB -42 B (0%)
build/wc-blocks-style-rtl.css 19.8 kB +20 B (0%)
build/wc-blocks-style.css 19.8 kB +23 B (0%)
build/wc-blocks-vendors.js 239 kB -113 B (0%)
ℹ️ View Unchanged
Filename Size
build/active-filters-frontend.js 8.27 kB
build/all-products-frontend.js 23.1 kB
build/atomic-block-components/add-to-cart-frontend.js 8.65 kB
build/atomic-block-components/button-frontend.js 1.74 kB
build/atomic-block-components/category-list-frontend.js 467 B
build/atomic-block-components/category-list.js 476 B
build/atomic-block-components/image-frontend.js 1.88 kB
build/atomic-block-components/price-frontend.js 2.09 kB
build/atomic-block-components/rating-frontend.js 560 B
build/atomic-block-components/rating.js 567 B
build/atomic-block-components/sale-badge-frontend.js 859 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/title-frontend.js 1.44 kB
build/attribute-filter-frontend.js 18 kB
build/blocks-checkout.js 20.6 kB
build/cart-frontend.js 78.3 kB
build/checkout-i2-frontend.js 39.5 kB
build/price-filter-frontend.js 14.3 kB
build/price-format.js 1.37 kB
build/reviews-by-category.js 11.5 kB
build/reviews-frontend.js 9.17 kB
build/single-product-frontend.js 25.7 kB
build/vendors--atomic-block-components/price-frontend.js 5.71 kB
build/wc-blocks-data.js 10.8 kB
build/wc-blocks-google-analytics.js 1.99 kB
build/wc-blocks-middleware.js 1.48 kB
build/wc-blocks-registry.js 2.74 kB
build/wc-blocks-shared-context.js 1.54 kB
build/wc-blocks-shared-hocs.js 1.75 kB
build/wc-blocks-vendors-style-rtl.css 1.05 kB
build/wc-blocks-vendors-style.css 1.05 kB
build/wc-blocks.js 3.51 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
build/wc-settings.js 2.92 kB

compressed-size-action

@@ -21,6 +21,12 @@ registerFeaturePluginBlockType( 'woocommerce/checkout-actions-block', {
align: false,
html: false,
multiple: false,
reusable: false,
Copy link
Member Author

Choose a reason for hiding this comment

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

Removes this button
image

@@ -21,6 +21,12 @@ registerFeaturePluginBlockType( 'woocommerce/checkout-actions-block', {
align: false,
html: false,
multiple: false,
reusable: false,
inserter: false,
Copy link
Member Author

Choose a reason for hiding this comment

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

Removes the block from this list
image

@mikejolley mikejolley force-pushed the feature/checkout-i2 branch 2 times, most recently from e4414a0 to 869172c Compare July 8, 2021 15:08
@mikejolley
Copy link
Member

This can be rebased now @senadir

@senadir senadir force-pushed the add/block-locking branch from b29ef0a to 205fd24 Compare July 9, 2021 15:30
@senadir
Copy link
Member Author

senadir commented Jul 9, 2021

This can now be tested

@mikejolley mikejolley merged commit 9348da6 into feature/checkout-i2 Jul 12, 2021
@mikejolley mikejolley deleted the add/block-locking branch July 12, 2021 12:51
mikejolley added a commit that referenced this pull request Jul 15, 2021
* 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]>
mikejolley added a commit that referenced this pull request Jul 20, 2021
* 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]>
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 added this to the Behind Feature Flag milestone Aug 2, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants