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

Update ValidatedTextInput TypeScript & move to @woocommerce/blocks-checkout #7583

Merged
merged 13 commits into from
Nov 10, 2022

Conversation

opr
Copy link
Contributor

@opr opr commented Nov 4, 2022

This PR moves ValidatedTextInput, TextInput, and ValidationInputError to the @woocommerce/blocks-checkout package.

Fixes #7445

Previously this was not possible de to validation data being stored in a context, but now since it lives in wc/store/validation it can be moved to the package.

This will make it easier for extensions to integrate with the blocks by offering the same UI component that we use in the blocks. Previous integrations had to recreate this component themselves.

I have annotated my changes in the file review screen which I hope will be helpful.

Testing

Automated Tests

  • Changes in this PR are covered by Automated Tests.
    • Unit tests
    • E2E tests

User Facing Testing

Please ensure you can check out correctly and that correct validation errors are displayed when you use invalid inputs on the Checkout block.

  1. Enter an invalid ZIP code, ensure the error appears.
  2. Leave the First name/Last name fields blank, ensure errors appear under them.
  • Do not include in the Testing Notes

WooCommerce Visibility

  • WooCommerce Core
  • Feature plugin
  • Experimental

Changelog

Add ValidatedTextInput and ValidationInputError to the @woocommerce/blocks-checkout package.

@opr opr added status: needs review type: enhancement The issue is a request for an enhancement. focus: components Work that introduces new or updates existing components. focus: blocks Specific work involving or impacting how blocks behave. labels Nov 4, 2022
@rubikuserbot rubikuserbot requested review from a team and senadir and removed request for a team November 4, 2022 17:55
@@ -6,8 +6,8 @@ import classNames from 'classnames';
import type { ReactElement, HTMLProps } from 'react';

interface LabelProps extends HTMLProps< HTMLElement > {
label?: string;
screenReaderLabel?: string;
label?: string | undefined;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is required because of the changes in #5312 where "exactOptionalPropertyTypes": true was added to tsconfig.base.json. The same applies for other instances where I added | undefined to optional props.

@@ -46,7 +57,7 @@ const ValidatedTextInput = ( {
const inputRef = useRef< HTMLInputElement >( null );

const { setValidationErrors, hideValidationError, clearValidationError } =
dispatch( VALIDATION_STORE_KEY );
useDispatch( VALIDATION_STORE_KEY );
Copy link
Contributor Author

Choose a reason for hiding this comment

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

We can use the hook version here, since we're within a React component.

@github-actions
Copy link
Contributor

github-actions bot commented Nov 4, 2022

The release ZIP for this PR is accessible via:

https://wcblocks.wpcomstaging.com/wp-content/uploads/woocommerce-gutenberg-products-block-7583.zip

@github-actions
Copy link
Contributor

github-actions bot commented Nov 4, 2022

TypeScript Errors Report

Files with errors: 440
Total errors: 2097

⚠️ ⚠️ This PR introduces new TS errors on 4 files:

packages/checkout/blocks-registry/test/index.js

packages/checkout/components/text-input/test/validated-text-input.tsx

packages/checkout/components/totals/item/index.tsx

packages/checkout/filter-registry/test/index.js

if (
isString( passedErrorMessage ) &&
passedErrorMessage !== '' &&
isObject( passedErrorMessage )
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Previously, if validationError was not an object, this would error because you can't access .message on undefined.

@github-actions
Copy link
Contributor

github-actions bot commented Nov 4, 2022

Script Dependencies Report

The compare-assets action has detected some changed script dependencies between this branch and trunk. Please review and confirm the following are correct before merging.

Script Handle Added Removed
wc-blocks.js wp-blocks, wp-compose, wp-element, wp-hooks, wp-i18n, wp-polyfill, wp-primitives ⚠️
handpicked-products.js lodash, react, wc-settings, wp-api-fetch, wp-block-editor, wp-blocks, wp-components, wp-compose, wp-element, wp-escape-html, wp-html-entities, wp-i18n, wp-polyfill, wp-primitives, wp-server-side-render, wp-url ⚠️
product-best-sellers.js lodash, wc-settings, wp-api-fetch, wp-block-editor, wp-blocks, wp-components, wp-compose, wp-element, wp-escape-html, wp-html-entities, wp-i18n, wp-polyfill, wp-primitives, wp-server-side-render, wp-url ⚠️
product-category.js lodash, wc-settings, wp-api-fetch, wp-block-editor, wp-blocks, wp-components, wp-compose, wp-element, wp-escape-html, wp-html-entities, wp-i18n, wp-polyfill, wp-primitives, wp-server-side-render, wp-url ⚠️
product-categories.js wp-block-editor, wp-blocks, wp-components, wp-element, wp-i18n, wp-polyfill, wp-primitives, wp-server-side-render ⚠️
product-new.js lodash, wc-settings, wp-api-fetch, wp-block-editor, wp-blocks, wp-components, wp-compose, wp-element, wp-escape-html, wp-html-entities, wp-i18n, wp-polyfill, wp-primitives, wp-server-side-render, wp-url ⚠️
product-on-sale.js lodash, wc-settings, wp-api-fetch, wp-block-editor, wp-blocks, wp-components, wp-compose, wp-element, wp-escape-html, wp-html-entities, wp-i18n, wp-polyfill, wp-primitives, wp-server-side-render, wp-url ⚠️
product-top-rated.js lodash, wc-settings, wp-api-fetch, wp-block-editor, wp-blocks, wp-components, wp-compose, wp-element, wp-escape-html, wp-html-entities, wp-i18n, wp-polyfill, wp-primitives, wp-server-side-render, wp-url ⚠️
products-by-attribute.js lodash, wc-settings, wp-api-fetch, wp-block-editor, wp-blocks, wp-components, wp-compose, wp-element, wp-escape-html, wp-html-entities, wp-i18n, wp-polyfill, wp-primitives, wp-server-side-render, wp-url ⚠️
featured-product.js lodash, react, wc-settings, wp-api-fetch, wp-block-editor, wp-blocks, wp-components, wp-compose, wp-data, wp-element, wp-escape-html, wp-html-entities, wp-i18n, wp-is-shallow-equal, wp-polyfill, wp-primitives, wp-url ⚠️
all-reviews.js lodash, react, wc-settings, wp-api-fetch, wp-block-editor, wp-blocks, wp-components, wp-compose, wp-element, wp-escape-html, wp-html-entities, wp-i18n, wp-is-shallow-equal, wp-polyfill, wp-primitives ⚠️
reviews-by-product.js lodash, react, wc-settings, wp-api-fetch, wp-block-editor, wp-blocks, wp-components, wp-compose, wp-element, wp-escape-html, wp-html-entities, wp-i18n, wp-is-shallow-equal, wp-polyfill, wp-primitives, wp-url ⚠️
reviews-by-category.js lodash, react, wc-settings, wp-api-fetch, wp-block-editor, wp-blocks, wp-components, wp-compose, wp-element, wp-escape-html, wp-html-entities, wp-i18n, wp-is-shallow-equal, wp-polyfill, wp-primitives, wp-url ⚠️
product-search.js wc-settings, wp-block-editor, wp-blocks, wp-components, wp-compose, wp-data, wp-element, wp-i18n, wp-polyfill, wp-primitives ⚠️
product-tag.js lodash, wc-settings, wp-api-fetch, wp-block-editor, wp-blocks, wp-components, wp-compose, wp-element, wp-html-entities, wp-i18n, wp-polyfill, wp-primitives, wp-server-side-render, wp-url ⚠️
featured-category.js lodash, react, wc-settings, wp-api-fetch, wp-block-editor, wp-blocks, wp-components, wp-compose, wp-data, wp-element, wp-escape-html, wp-html-entities, wp-i18n, wp-is-shallow-equal, wp-polyfill, wp-primitives, wp-url ⚠️
all-products.js lodash, react, wc-blocks-checkout, wc-blocks-data-store, wc-blocks-registry, wc-blocks-shared-context, wc-blocks-shared-hocs, wc-price-format, wc-settings, wp-a11y, wp-api-fetch, wp-autop, wp-block-editor, wp-blocks, wp-components, wp-compose, wp-data, wp-deprecated, wp-dom, wp-element, wp-escape-html, wp-hooks, wp-html-entities, wp-i18n, wp-is-shallow-equal, wp-polyfill, wp-primitives, wp-url, wp-warning, wp-wordcount ⚠️
price-filter.js lodash, react, wc-blocks-data-store, wc-price-format, wc-settings, wp-block-editor, wp-blocks, wp-components, wp-compose, wp-data, wp-element, wp-i18n, wp-is-shallow-equal, wp-polyfill, wp-primitives, wp-url ⚠️
attribute-filter.js lodash, react, wc-blocks-checkout, wc-blocks-data-store, wc-settings, wp-a11y, wp-block-editor, wp-blocks, wp-components, wp-compose, wp-data, wp-deprecated, wp-dom, wp-element, wp-html-entities, wp-i18n, wp-is-shallow-equal, wp-keycodes, wp-polyfill, wp-primitives, wp-url, wp-warning ⚠️
stock-filter.js lodash, react, wc-blocks-checkout, wc-blocks-data-store, wc-settings, wp-a11y, wp-block-editor, wp-blocks, wp-components, wp-compose, wp-data, wp-element, wp-html-entities, wp-i18n, wp-is-shallow-equal, wp-polyfill, wp-primitives, wp-url ⚠️
active-filters.js lodash, react, wc-blocks-data-store, wc-price-format, wc-settings, wp-block-editor, wp-blocks, wp-components, wp-compose, wp-data, wp-element, wp-html-entities, wp-i18n, wp-is-shallow-equal, wp-polyfill, wp-primitives, wp-url ⚠️
rating-filter.js lodash, react, wc-blocks-checkout, wc-blocks-data-store, wc-settings, wp-a11y, wp-block-editor, wp-blocks, wp-components, wp-data, wp-element, wp-i18n, wp-is-shallow-equal, wp-polyfill, wp-primitives, wp-url ⚠️
cart.js lodash, react, wc-blocks-checkout, wc-blocks-data-store, wc-blocks-registry, wc-blocks-shared-context, wc-blocks-shared-hocs, wc-price-format, wc-settings, wp-a11y, wp-api-fetch, wp-autop, wp-block-editor, wp-blocks, wp-components, wp-compose, wp-core-data, wp-data, wp-deprecated, wp-dom, wp-editor, wp-element, wp-hooks, wp-html-entities, wp-i18n, wp-is-shallow-equal, wp-keycodes, wp-plugins, wp-polyfill, wp-primitives, wp-url, wp-warning, wp-wordcount ⚠️
checkout.js lodash, react, wc-blocks-checkout, wc-blocks-data-store, wc-blocks-registry, wc-price-format, wc-settings, wp-a11y, wp-api-fetch, wp-autop, wp-block-editor, wp-blocks, wp-components, wp-compose, wp-core-data, wp-data, wp-deprecated, wp-dom, wp-editor, wp-element, wp-hooks, wp-html-entities, wp-i18n, wp-is-shallow-equal, wp-keycodes, wp-plugins, wp-polyfill, wp-primitives, wp-url, wp-warning, wp-wordcount ⚠️
mini-cart.js react, wc-price-format, wc-settings, wp-block-editor, wp-blocks, wp-components, wp-dom, wp-element, wp-i18n, wp-polyfill, wp-primitives ⚠️
mini-cart-contents.js lodash, react, wc-blocks-checkout, wc-blocks-data-store, wc-blocks-registry, wc-price-format, wc-settings, wp-a11y, wp-autop, wp-block-editor, wp-blocks, wp-components, wp-compose, wp-data, wp-deprecated, wp-dom, wp-element, wp-hooks, wp-html-entities, wp-i18n, wp-is-shallow-equal, wp-keycodes, wp-polyfill, wp-primitives, wp-url, wp-warning, wp-wordcount ⚠️
single-product.js lodash, react, wc-blocks-checkout, wc-blocks-data-store, wc-blocks-registry, wc-blocks-shared-context, wc-blocks-shared-hocs, wc-price-format, wc-settings, wp-api-fetch, wp-autop, wp-block-editor, wp-blocks, wp-components, wp-compose, wp-data, wp-deprecated, wp-dom, wp-element, wp-escape-html, wp-hooks, wp-html-entities, wp-i18n, wp-is-shallow-equal, wp-polyfill, wp-primitives, wp-url, wp-warning, wp-wordcount ⚠️
legacy-template.js wc-settings, wp-block-editor, wp-blocks, wp-components, wp-data, wp-element, wp-i18n, wp-polyfill, wp-primitives ⚠️
product-query.js wc-settings, wp-block-editor, wp-blocks, wp-components, wp-data, wp-element, wp-hooks, wp-i18n, wp-polyfill, wp-primitives ⚠️
filter-wrapper.js wp-block-editor, wp-blocks, wp-element, wp-i18n, wp-polyfill, wp-primitives ⚠️

This comment was automatically generated by the ./github/compare-assets action.

@opr
Copy link
Contributor Author

opr commented Nov 4, 2022

⚠️ ⚠️ This PR introduces new TS errors on 4 files:

I think these errors are unrelated to my changes!

@opr opr force-pushed the update/validation-components branch from 3a26598 to 43982fa Compare November 4, 2022 18:01
@github-actions
Copy link
Contributor

github-actions bot commented Nov 4, 2022

Size Change: -7.9 kB (-1%)

Total Size: 991 kB

Filename Size Change
build/active-filters-wrapper-frontend.js 6.02 kB -1 B (0%)
build/active-filters.js 7.32 kB -3 B (0%)
build/all-products-frontend.js 26.5 kB +10 B (0%)
build/all-products.js 33.5 kB -177 B (-1%)
build/all-reviews.js 7.79 kB +1 B (0%)
build/attribute-filter-wrapper-frontend.js 7.12 kB +1 B (0%)
build/attribute-filter.js 12.2 kB -31 B (0%)
build/blocks-checkout.js 18.5 kB +991 B (+6%) 🔍
build/cart-blocks/cart-accepted-payment-methods-frontend.js 1.37 kB -2 B (0%)
build/cart-blocks/cart-cross-sells-products--product-add-to-cart-frontend.js 5.47 kB -159 B (-3%)
build/cart-blocks/cart-cross-sells-products-frontend.js 4.68 kB -4 B (0%)
build/cart-blocks/cart-express-payment--checkout-blocks/express-payment-frontend.js 4.93 kB -168 B (-3%)
build/cart-blocks/cart-express-payment-frontend.js 784 B -1 B (0%)
build/cart-blocks/cart-items-frontend.js 298 B -1 B (0%)
build/cart-blocks/cart-line-items--mini-cart-contents-block/products-table-frontend.js 5.31 kB -2 B (0%)
build/cart-blocks/cart-line-items-frontend.js 1.07 kB -1 B (0%)
build/cart-blocks/cart-order-summary-frontend.js 1.11 kB -1 B (0%)
build/cart-blocks/order-summary-coupon-form-frontend.js 1.73 kB -1.01 kB (-37%) 🎉
build/cart-blocks/order-summary-discount-frontend.js 2.16 kB -2 B (0%)
build/cart-blocks/order-summary-fee-frontend.js 273 B +1 B (0%)
build/cart-blocks/order-summary-heading-frontend.js 455 B -1 B (0%)
build/cart-blocks/order-summary-shipping--checkout-blocks/order-summary-shipping-frontend.js 5.66 kB -943 B (-14%) 👏
build/cart-blocks/proceed-to-checkout-frontend.js 1.19 kB -1 B (0%)
build/cart-frontend.js 54.5 kB +4 B (0%)
build/cart.js 46.3 kB -1.24 kB (-3%)
build/checkout-blocks/actions-frontend.js 1.78 kB -2 B (0%)
build/checkout-blocks/billing-address--checkout-blocks/shipping-address-frontend.js 3.9 kB -1.08 kB (-22%) 🎉
build/checkout-blocks/contact-information-frontend.js 1.77 kB -1.25 kB (-41%) 🎉
build/checkout-blocks/order-note-frontend.js 1.14 kB -1 B (0%)
build/checkout-blocks/order-summary-cart-items-frontend.js 3.67 kB -1 B (0%)
build/checkout-blocks/order-summary-coupon-form-frontend.js 1.89 kB -993 B (-34%) 🎉
build/checkout-blocks/order-summary-discount-frontend.js 2.28 kB -1 B (0%)
build/checkout-blocks/order-summary-frontend.js 1.11 kB -1 B (0%)
build/checkout-blocks/payment-frontend.js 7.7 kB -163 B (-2%)
build/checkout-blocks/shipping-address-frontend.js 1.06 kB +2 B (0%)
build/checkout-blocks/shipping-methods-frontend.js 4.89 kB -2 B (0%)
build/checkout-blocks/terms-frontend.js 1.64 kB -2 B (0%)
build/checkout-frontend.js 56.7 kB -9 B (0%)
build/checkout.js 40.3 kB -929 B (-2%)
build/featured-category.js 13.2 kB -35 B (0%)
build/featured-product.js 13.4 kB -41 B (0%)
build/filter-wrapper.js 2.41 kB +5 B (0%)
build/handpicked-products.js 7.29 kB -35 B (0%)
build/legacy-template.js 2.84 kB +7 B (0%)
build/mini-cart-component-frontend.js 20 kB -2 B (0%)
build/mini-cart-contents-block/empty-cart-frontend.js 366 B -1 B (0%)
build/mini-cart-contents-block/footer-frontend.js 2.97 kB -1 B (0%)
build/mini-cart-contents-block/items-frontend.js 237 B +1 B (0%)
build/mini-cart-contents-block/products-table-frontend.js 591 B +1 B (0%)
build/mini-cart-contents-block/shopping-button-frontend.js 288 B +1 B (0%)
build/mini-cart-contents-block/title-frontend.js 368 B +1 B (0%)
build/mini-cart-contents.js 17.2 kB +5 B (0%)
build/mini-cart.js 4.29 kB +3 B (0%)
build/price-filter.js 8.37 kB +3 B (0%)
build/product-add-to-cart--product-button--product-category-list--product-image--product-price--product-r--a0326d00.js 226 B -2 B (-1%)
build/product-add-to-cart-frontend.js 1.25 kB +1 B (0%)
build/product-add-to-cart.js 8.42 kB -151 B (-2%)
build/product-best-sellers.js 7.62 kB -81 B (-1%)
build/product-button--product-image--product-rating--product-sale-badge--product-title.js 302 B +1 B (0%)
build/product-button-frontend.js 1.89 kB -2 B (0%)
build/product-button.js 3.88 kB +4 B (0%)
build/product-categories.js 2.36 kB +5 B (0%)
build/product-category.js 8.62 kB -68 B (-1%)
build/product-image-frontend.js 1.91 kB -1 B (0%)
build/product-image.js 3.99 kB -1 B (0%)
build/product-new.js 7.63 kB -66 B (-1%)
build/product-on-sale.js 7.95 kB -62 B (-1%)
build/product-price-frontend.js 1.92 kB +1 B (0%)
build/product-price.js 1.53 kB +3 B (0%)
build/product-query.js 2.89 kB +1 B (0%)
build/product-rating-frontend.js 1.2 kB +1 B (0%)
build/product-rating.js 787 B -1 B (0%)
build/product-sale-badge-frontend.js 1.15 kB +1 B (0%)
build/product-sale-badge.js 812 B -1 B (0%)
build/product-search.js 2.62 kB +5 B (0%)
build/product-sku-frontend.js 377 B -1 B (0%)
build/product-sku.js 376 B -1 B (0%)
build/product-stock-indicator-frontend.js 999 B -1 B (0%)
build/product-summary.js 921 B +1 B (0%)
build/product-tag-list-frontend.js 878 B +1 B (0%)
build/product-tag-list.js 498 B +1 B (0%)
build/product-tag.js 8 kB -50 B (-1%)
build/product-title-frontend.js 1.33 kB -1 B (0%)
build/product-title.js 3.36 kB -4 B (0%)
build/product-top-rated.js 7.86 kB -68 B (-1%)
build/products-by-attribute.js 8.54 kB -79 B (-1%)
build/rating-filter-frontend.js 7.15 kB +22 B (0%)
build/rating-filter-wrapper-frontend.js 5.41 kB +18 B (0%)
build/rating-filter.js 5.79 kB +19 B (0%)
build/reviews-by-category.js 11.2 kB -91 B (-1%)
build/reviews-by-product.js 12.3 kB -113 B (-1%)
build/single-product-frontend.js 32.3 kB +1 B (0%)
build/single-product.js 10 kB -26 B (0%)
build/stock-filter-wrapper-frontend.js 6.03 kB +2 B (0%)
build/stock-filter.js 6.7 kB -2 B (0%)
build/vendors--cart-blocks/cart-cross-sells-products--cart-blocks/order-summary-shipping--checkout-blocks--18f9376a-frontend.js 19.1 kB +1 B (0%)
build/vendors--cart-blocks/order-summary-shipping--checkout-blocks/billing-address--checkout-blocks/order--5b8feb0b-frontend.js 4.85 kB -2 B (0%)
build/wc-blocks-data.js 18.3 kB +49 B (0%)
build/wc-blocks-middleware.js 931 B -1 B (0%)
build/wc-blocks-registry.js 2.93 kB -1 B (0%)
build/wc-blocks-shared-context.js 1.51 kB -2 B (0%)
build/wc-blocks-shared-hocs.js 1.72 kB +5 B (0%)
build/wc-blocks-style-rtl.css 24.3 kB +37 B (0%)
build/wc-blocks-style.css 24.2 kB +42 B (0%)
build/wc-blocks-vendors.js 62.4 kB +3 B (0%)
build/wc-blocks.js 2.63 kB +3 B (0%)
ℹ️ View Unchanged
Filename Size
build/active-filters-frontend.js 7.74 kB
build/attribute-filter-frontend.js 22.6 kB
build/cart-blocks/cart-cross-sells-frontend.js 253 B
build/cart-blocks/cart-totals-frontend.js 320 B
build/cart-blocks/empty-cart-frontend.js 346 B
build/cart-blocks/filled-cart-frontend.js 783 B
build/cart-blocks/order-summary-shipping-frontend.js 428 B
build/cart-blocks/order-summary-subtotal-frontend.js 273 B
build/cart-blocks/order-summary-taxes-frontend.js 433 B
build/checkout-blocks/billing-address-frontend.js 952 B
build/checkout-blocks/express-payment-frontend.js 1.13 kB
build/checkout-blocks/fields-frontend.js 343 B
build/checkout-blocks/order-summary-fee-frontend.js 275 B
build/checkout-blocks/order-summary-shipping-frontend.js 603 B
build/checkout-blocks/order-summary-subtotal-frontend.js 273 B
build/checkout-blocks/order-summary-taxes-frontend.js 433 B
build/checkout-blocks/totals-frontend.js 323 B
build/filter-wrapper-frontend.js 13.8 kB
build/general-style-rtl.css 1.29 kB
build/general-style.css 1.29 kB
build/mini-cart-contents-block/filled-cart-frontend.js 230 B
build/mini-cart-frontend.js 1.82 kB
build/price-filter-frontend.js 13.6 kB
build/price-filter-wrapper-frontend.js 7.01 kB
build/price-format.js 1.19 kB
build/product-add-to-cart--product-button--product-image--product-rating--product-title.js 151 B
build/product-button--product-category-list--product-image--product-price--product-rating--product-sale-b--e17c7c01.js 431 B
build/product-category-list-frontend.js 884 B
build/product-category-list.js 502 B
build/product-stock-indicator.js 624 B
build/product-summary-frontend.js 1.29 kB
build/reviews-frontend.js 7.01 kB
build/stock-filter-frontend.js 7.78 kB
build/vendors--attribute-filter-wrapper--mini-cart-contents-block/footer-frontend.js 6.86 kB
build/vendors--attribute-filter-wrapper-frontend.js 8.22 kB
build/vendors--cart-blocks/cart-cross-sells-products--cart-blocks/cart-line-items--cart-blocks/cart-order--671ca56f-frontend.js 5.26 kB
build/vendors--cart-blocks/cart-cross-sells-products--product-add-to-cart-frontend.js 7.53 kB
build/vendors--cart-blocks/cart-line-items--checkout-blocks/order-summary-cart-items--mini-cart-contents---233ab542-frontend.js 3.14 kB
build/wc-blocks-editor-style-rtl.css 5.24 kB
build/wc-blocks-editor-style.css 5.24 kB
build/wc-blocks-google-analytics.js 1.56 kB
build/wc-blocks-vendors-style-rtl.css 1.95 kB
build/wc-blocks-vendors-style.css 1.95 kB
build/wc-payment-method-bacs.js 816 B
build/wc-payment-method-cheque.js 811 B
build/wc-payment-method-cod.js 909 B
build/wc-payment-method-paypal.js 837 B
build/wc-settings.js 2.6 kB

compressed-size-action

@github-actions
Copy link
Contributor

github-actions bot commented Nov 4, 2022

TypeScript Errors Report

Files with errors: 440
Total errors: 2097

⚠️ ⚠️ This PR introduces new TS errors on 4 files:

packages/checkout/blocks-registry/test/index.js

packages/checkout/components/text-input/test/validated-text-input.tsx

packages/checkout/components/totals/item/index.tsx

packages/checkout/filter-registry/test/index.js

Copy link
Member

@senadir senadir left a comment

Choose a reason for hiding this comment

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

Thank you for the detailed commit by commit PR Thomas, it was really helpful to understand the refactor.

@github-actions
Copy link
Contributor

TypeScript Errors Report

Files with errors: 440
Total errors: 2097

⚠️ ⚠️ This PR introduces new TS errors on 7 files:

assets/js/atomic/blocks/product-elements/summary/edit.js

assets/js/atomic/blocks/product-elements/summary/index.js

assets/js/blocks/cart/cart-line-items-table/cart-line-item-row.tsx

packages/checkout/blocks-registry/test/index.js

packages/checkout/components/text-input/test/validated-text-input.tsx

packages/checkout/components/totals/item/index.tsx

packages/checkout/filter-registry/test/index.js

@opr opr merged commit d8ff1ce into trunk Nov 10, 2022
@opr opr deleted the update/validation-components branch November 10, 2022 10:05
senadir pushed a commit to senadir/woocommerce-blocks that referenced this pull request Nov 12, 2022
…heckout` (woocommerce#7583)

* Move ValidatedTextInput and ValidationInputError to checkout package

* Include checkout package in tsconfig file

* Remove unnecessary index file

We export these components from packages/checkout/index.js instead

* Import ValidatedTextInput & ValidationInput error from checkout package

* Only add validationError.message when validationError is an object

* Explicitly add undefined to optional props

* Import isObject to test validationError

* Extend the HTML Input element attributes

* Use more performant useDispatch instead of dispatch

* Export component without withInstanceId hoc for testing

* Add tests for ValidatedTextInput

* bot: update checkstyle.xml

* Rename export of unwrapped component to have __

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
focus: blocks Specific work involving or impacting how blocks behave. focus: components Work that introduces new or updates existing components. type: enhancement The issue is a request for an enhancement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Investigate moving components into @woocommerce/blocks-checkout
2 participants