Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge upstream #93

Merged
merged 168 commits into from
Sep 19, 2022
Merged

Merge upstream #93

merged 168 commits into from
Sep 19, 2022

Conversation

luisherranz
Copy link
Collaborator

Trying to merge upstream changes.

albarin and others added 30 commits July 28, 2022 12:49
Bumps [mockery/mockery](https://github.com/mockery/mockery) from 1.4.4 to 1.5.0.
- [Release notes](https://github.com/mockery/mockery/releases)
- [Changelog](https://github.com/mockery/mockery/blob/master/CHANGELOG.md)
- [Commits](mockery/mockery@1.4.4...1.5.0)

---
updated-dependencies:
- dependency-name: mockery/mockery
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Alba Rincón <[email protected]>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
… (#6718)

* refactor coupon functions outside of useSelect

* fix test
* Add new icon for mini cart block (inserter).

See woocommerce/woocommerce-blocks#6617.

* Adjust size of SVG

The new SVG was rendering a little bit smaller than the original icon.
Potentially because of the mask and the artboard size.

This commit adjusts the size to render at the same size as the original
version of the icon in the inserter.
* Try registering the "cart taxes" inner block

Registering server side. This example isn't working, but I'm pushing to
share it and see what's wrong with this implementation.

* Fix registering the cart taxes inner block issue

* Update translation script loading

* Remove unnecessary JS translation

The translation should work fine by getting the title & description from
the `block.json` file

* Put back the initial code in the 'Cart Taxes' inner block

We didn't provide the correct `block.json` file path server side,
that's why the `metadata` wasn't correctly registered

* Generate `block.json`files for inner blocks

This is the first step on fixing the missing translations of `metadata`
in `block.json` files

* Set the folder name exactly the same as the inner block name

We are doing this first test for the `Cart taxes` inner block.

The `Block` & its containing folder need to have the same name for:
- Consistency
- We use the `Block` name to get the file Path

* Update imports after folder renaming

* Get block name directly from the JSON metadata

Getting the block name from the JSON metadata is less error prone than
extracting it from the file path.

And no need to rename all our `inner-blocks` to get the correct
`block.json` path

* Revert folder naming change of `Cart taxes` inner block

Since we are getting the `block` name directly from the `block.json`
metadata instead of extracting it from the file path, there is no need
to keep their names in sync anymore

* Fix missing translations for the `Cart Subtotal` Block

* Register only the client-side settings on the client

When the block is registered on the server, you only need to register
the client-side settings on the client using the same block’s name.
See [docs](https://github.com/WordPress/gutenberg/blob/trunk/docs/reference-guides/block-api/block-metadata.md#javascript-client-side).

* Add schema validation to `block.json`

Development is improved by using a defined schema definition file.
Supported editors can provide help like tooltips, autocomplete, and
schema validation.

* Use the same `editor_script` as the parent block

This prevents WordPress from generating script tags to inexistant
inner blocks JS files

* Add C&C inner blocks in Cart.php & Checkout.php

This is a refactoring to keep the block types controller file less
overloaded

* Fix all Cart inner blocks missing translations

* Create the "AbstractInnerBlock" class

The "Inner Blocks" will use their parent's script, so no need to create
new scripts for each one of them

And, our "Inner Blocks" should always be registered using the metadata file

* Update the "Inner Blocks" PHP classes

* Fix PHP lint erros & update function description

* Fix missing translations bug for all Checkout Inner Blocks

* Update src/BlockTypes/Checkout.php

Co-authored-by: Seghir Nadir <[email protected]>

* skip lazy loaded scripts

Co-authored-by: Seghir Nadir <[email protected]>
… (#6815)

* Check package length >= 1 to show package name

* Check shipping rates length in order shipping packages slot

* Fix TS error where boolean value could be undefined

* Show items if there is more than one shipping rate
… (#6815)

* Check package length >= 1 to show package name

* Check shipping rates length in order shipping packages slot

* Fix TS error where boolean value could be undefined

* Show items if there is more than one shipping rate
* Add toggle control to sidebar in editor.

Adds a visibility toggle in the Mini Cart block's sidebar editor
settings for the block price.

* Update name of hasVisiblePrice attrubite.

Adjusts the name of the hasVisiblePrice attribute to hasHiddenPrice.
This seems a bit easier to reason about, where we can set the default
state of the visibility toggle to 'off'.

* Add conditional price rendering to server side.

Since this is a dynamic block, need to add the condidional attribute
state to the server-side render callback.

* Add price visibility setting to block frontend.

We need to prevent pricec from rendering when hidden setting is active
after the JS kicks in on the frontend (i.e., when the Mini Cart is
interacted with by the user).

* Fix logic error in frontend rendering conditional.

* Add unit tests for both show/hide price states.
* Empty commit for release pull request

* Update 8.2.0 changelog

* Add 8.2.0 testing steps

* Fix typo in 8.2.0 testing steps

* Ensure package names display correctly if only one item is in package (#6815)

* Check package length >= 1 to show package name

* Check shipping rates length in order shipping packages slot

* Fix TS error where boolean value could be undefined

* Show items if there is more than one shipping rate

* Update 8.2.0 testing zip

* Bumping version strings to new version.

* Remove empty element from changelog

Co-authored-by: github-actions <[email protected]>
Co-authored-by: Albert Juhé Lluveras <[email protected]>
Co-authored-by: Thomas Roberts <[email protected]>
Bumps [@wordpress/is-shallow-equal](https://github.com/WordPress/gutenberg/tree/HEAD/packages/is-shallow-equal) from 4.12.0 to 4.13.0.
- [Release notes](https://github.com/WordPress/gutenberg/releases)
- [Changelog](https://github.com/WordPress/gutenberg/blob/trunk/packages/is-shallow-equal/CHANGELOG.md)
- [Commits](https://github.com/WordPress/gutenberg/commits/@wordpress/[email protected]/packages/is-shallow-equal)

---
updated-dependencies:
- dependency-name: "@wordpress/is-shallow-equal"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Luigi Teschio <[email protected]>
Bumps [AbleLincoln/push-to-sftp](https://github.com/AbleLincoln/push-to-sftp) from 1.0 to 1.2.
- [Release notes](https://github.com/AbleLincoln/push-to-sftp/releases)
- [Commits](AbleLincoln/push-to-sftp@v1.0...v1.2)

---
updated-dependencies:
- dependency-name: AbleLincoln/push-to-sftp
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Luigi Teschio <[email protected]>
Aljullu and others added 16 commits September 13, 2022 09:32
* Empty commit for release pull request

* add changelog - 8.5.0 version

* Add testing instructions

* add missing screenshot

* Fix pills in the Filter by Attribute block dropdown overlapping with the chevron (second attempt) (#7112)

* Fix invisible Reset filter button in some themes (#7111)

* update link zip file

* Bumping version strings to new version.

Co-authored-by: github-actions <[email protected]>
Co-authored-by: Luigi <[email protected]>
Co-authored-by: Albert Juhé Lluveras <[email protected]>
* Make chevron clickable in Filter by Product block

* Make sure the chevron is vertically centered
* Add Dependabot documentation

* fix typos

* Update docs/internal-developers/automations/dependabot.md

Co-authored-by: Lucio Giannotta <[email protected]>

Co-authored-by: Lucio Giannotta <[email protected]>
@github-actions
Copy link
Contributor

Remove this logic when WordPress 6.1 is released.

Remove this logic when WordPress 6.1 is released.


* @todo Remove this logic when WordPress 6.1 is released.
*/
if ( GUTENBERG_EDITOR_CONTEXT !== 'core' ) {
unlinkSync(
path.join(
__dirname,
'../specs/backend/__snapshots__/site-editing-templates.test.js.snap'
)
);
}
// we need to load puppeteer global setup here.
await setupPuppeteer( globalConfig );

🚀 This comment was generated by the automations bot based on a todo comment in 0518c51 in #93. cc @luisherranz

@github-actions
Copy link
Contributor

Remove runOnlyWhenGutenbergIsDisabled function and relati...

Remove runOnlyWhenGutenbergIsDisabled function and relative workarounds when WordPress 6.1 is released.


* @todo Remove runOnlyWhenGutenbergIsDisabled function and relative workarounds when WordPress 6.1 is released.
*/
const runOnlyWhenGutenbergIsDisabled = ( fn ) => {
if ( GUTENBERG_EDITOR_CONTEXT === 'core' ) {
fn();
}
};
describe( 'Store Editing Templates', () => {
useTheme( 'emptytheme' );

🚀 This comment was generated by the automations bot based on a todo comment in 0518c51 in #93. cc @luisherranz

@luisherranz
Copy link
Collaborator Author

@c4rl0sbr4v0 I'm having problems running the linters in my machine. As you've done this in the past, would you mind helping me out? Thanks!! 🙏

@github-actions
Copy link
Contributor

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
product-categories.js wc-settings 🎉
product-search.js wp-data ⚠️
attribute-filter.js wc-blocks-checkout ⚠️
stock-filter.js wc-blocks-checkout ⚠️
cart.js wp-core-data, wp-editor ⚠️
checkout.js wp-core-data, wp-editor ⚠️
product-query.js wp-hooks, wp-polyfill ⚠️

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

@github-actions
Copy link
Contributor

Size Change: +2.22 kB (0%)

Total Size: 875 kB

Filename Size Change
build/active-filters-frontend.js 7.62 kB +287 B (+4%)
build/active-filters.js 8.27 kB +283 B (+4%)
build/all-products-frontend.js 18.6 kB -3 B (0%)
build/all-products.js 33.9 kB +123 B (0%)
build/all-reviews.js 7.79 kB -1 B (0%)
build/attribute-filter-frontend.js 22.3 kB +413 B (+2%)
build/attribute-filter.js 13.3 kB +367 B (+3%)
build/blocks-checkout.js 17.4 kB +11 B (0%)
build/cart-blocks/cart-accepted-payment-methods-frontend.js 1.17 kB +2 B (0%)
build/cart-blocks/cart-express-payment-frontend.js 4.51 kB -8 B (0%)
build/cart-blocks/cart-items-frontend.js 299 B +1 B (0%)
build/cart-blocks/cart-line-items--mini-cart-contents-block/products-table-frontend.js 5.24 kB -21 B (0%)
build/cart-blocks/filled-cart-frontend.js 782 B +1 B (0%)
build/cart-blocks/order-summary-discount-frontend.js 1.69 kB +8 B (0%)
build/cart-blocks/order-summary-shipping--checkout-blocks/order-summary-shipping-frontend.js 5.25 kB -26 B (0%)
build/cart-blocks/order-summary-shipping-frontend.js 426 B -2 B (0%)
build/cart-blocks/order-summary-taxes-frontend.js 432 B -1 B (0%)
build/cart-blocks/proceed-to-checkout-frontend.js 987 B -1 B (0%)
build/cart-frontend.js 50.7 kB +23 B (0%)
build/cart.js 42 kB -1.39 kB (-3%)
build/checkout-blocks/actions-frontend.js 1.42 kB +12 B (+1%)
build/checkout-blocks/billing-address--checkout-blocks/shipping-address-frontend.js 4.13 kB +2 B (0%)
build/checkout-blocks/billing-address-frontend.js 888 B -4 B (0%)
build/checkout-blocks/express-payment-frontend.js 5.38 kB -8 B (0%)
build/checkout-blocks/order-note-frontend.js 1.07 kB -2 B (0%)
build/checkout-blocks/order-summary-cart-items-frontend.js 3.64 kB -24 B (-1%)
build/checkout-blocks/order-summary-coupon-form-frontend.js 2.79 kB +1 B (0%)
build/checkout-blocks/order-summary-discount-frontend.js 2.28 kB +8 B (0%)
build/checkout-blocks/order-summary-fee-frontend.js 277 B +1 B (0%)
build/checkout-blocks/order-summary-shipping-frontend.js 1.97 kB -1 B (0%)
build/checkout-blocks/order-summary-taxes-frontend.js 431 B -2 B (0%)
build/checkout-blocks/payment-frontend.js 7.7 kB -11 B (0%)
build/checkout-blocks/shipping-address-frontend.js 1.03 kB -1 B (0%)
build/checkout-blocks/shipping-methods-frontend.js 4.75 kB -32 B (-1%)
build/checkout-blocks/terms-frontend.js 1.23 kB +12 B (+1%)
build/checkout-blocks/totals-frontend.js 324 B -2 B (-1%)
build/checkout-frontend.js 49.4 kB +25 B (0%)
build/checkout.js 43.1 kB -1.51 kB (-3%)
build/featured-category.js 13.2 kB -45 B (0%)
build/featured-product.js 13.4 kB -86 B (-1%)
build/handpicked-products.js 7.29 kB -84 B (-1%)
build/legacy-template.js 2.84 kB +42 B (+2%)
build/mini-cart-component-frontend.js 16.9 kB +7 B (0%)
build/mini-cart-contents-block/footer--mini-cart-contents-block/products-table-frontend.js 4.69 kB +3 B (0%)
build/mini-cart-contents-block/footer-frontend.js 6.99 kB +4 B (0%)
build/mini-cart-contents-block/products-table-frontend.js 290 B -1 B (0%)
build/mini-cart-contents-block/title-frontend.js 368 B +1 B (0%)
build/mini-cart-contents.js 22.9 kB -56 B (0%)
build/mini-cart.js 4.56 kB -26 B (-1%)
build/price-filter-frontend.js 13.4 kB +357 B (+3%)
build/price-filter.js 9.34 kB +313 B (+3%)
build/product-add-to-cart-frontend.js 6.96 kB +11 B (0%)
build/product-add-to-cart.js 6.88 kB -5 B (0%)
build/product-best-sellers.js 7.62 kB -90 B (-1%)
build/product-button--product-category-list--product-image--product-price--product-rating--product-sale-b--e17c7c01.js 435 B -2 B (0%)
build/product-button--product-image--product-rating--product-sale-badge--product-title.js 300 B -2 B (-1%)
build/product-button-frontend.js 1.88 kB +5 B (0%)
build/product-button.js 1.57 kB -4 B (0%)
build/product-categories.js 2.36 kB -418 B (-15%) 👏
build/product-category-list-frontend.js 880 B -2 B (0%)
build/product-category-list.js 501 B -2 B (0%)
build/product-category.js 8.61 kB -72 B (-1%)
build/product-image-frontend.js 1.89 kB +6 B (0%)
build/product-image.js 1.59 kB -1 B (0%)
build/product-new.js 7.62 kB -95 B (-1%)
build/product-on-sale.js 7.94 kB -80 B (-1%)
build/product-price-frontend.js 1.9 kB +1 B (0%)
build/product-price.js 1.51 kB +5 B (0%)
build/product-sale-badge-frontend.js 1.14 kB +6 B (+1%)
build/product-sale-badge.js 803 B +2 B (0%)
build/product-search.js 2.62 kB +438 B (+20%) 🚨
build/product-sku-frontend.js 382 B +2 B (+1%)
build/product-sku.js 379 B -1 B (0%)
build/product-stock-indicator.js 623 B -1 B (0%)
build/product-summary-frontend.js 1.29 kB +5 B (0%)
build/product-tag-list-frontend.js 878 B +6 B (+1%)
build/product-tag-list.js 497 B -2 B (0%)
build/product-tag.js 8 kB -85 B (-1%)
build/product-title-frontend.js 1.31 kB -2 B (0%)
build/product-title.js 921 B +2 B (0%)
build/product-top-rated.js 7.86 kB -90 B (-1%)
build/products-by-attribute.js 8.53 kB -98 B (-1%)
build/reviews-by-category.js 11.2 kB +22 B (0%)
build/reviews-by-product.js 12.3 kB +2 B (0%)
build/reviews-frontend.js 7.01 kB -1 B (0%)
build/single-product-frontend.js 21.5 kB -2 B (0%)
build/single-product.js 10 kB -24 B (0%)
build/stock-filter-frontend.js 7.63 kB +244 B (+3%)
build/stock-filter.js 7.52 kB +233 B (+3%)
build/vendors--cart-blocks/order-summary-shipping--checkout-blocks/billing-address--checkout-blocks/order--5b8feb0b-frontend.js 4.85 kB +1 B (0%)
build/vendors--cart-blocks/order-summary-shipping--checkout-blocks/billing-address--checkout-blocks/order--decc3dc6-frontend.js 19.1 kB +2 B (0%)
build/vendors--product-add-to-cart-frontend.js 7.53 kB -1 B (0%)
build/wc-blocks-data.js 9.87 kB +5 B (0%)
build/wc-blocks-editor-style-rtl.css 5.1 kB +61 B (+1%)
build/wc-blocks-editor-style.css 5.1 kB +56 B (+1%)
build/wc-blocks-middleware.js 931 B +1 B (0%)
build/wc-blocks-shared-context.js 1.53 kB +3 B (0%)
build/wc-blocks-shared-hocs.js 1.71 kB +572 B (+50%) 🆘
build/wc-blocks-style-rtl.css 23.8 kB +996 B (+4%)
build/wc-blocks-style.css 23.7 kB +996 B (+4%)
build/wc-blocks-vendors.js 54.5 kB +8 B (0%)
build/wc-blocks.js 2.63 kB +1 B (0%)
build/product-query.js 648 B +648 B (new file) 🆕
ℹ️ View Unchanged
Filename Size
build/cart-blocks/cart-line-items-frontend.js 431 B
build/cart-blocks/cart-order-summary-frontend.js 1.1 kB
build/cart-blocks/cart-totals-frontend.js 322 B
build/cart-blocks/empty-cart-frontend.js 346 B
build/cart-blocks/order-summary-fee-frontend.js 273 B
build/cart-blocks/order-summary-heading-frontend.js 453 B
build/cart-blocks/order-summary-subtotal-frontend.js 274 B
build/checkout-blocks/contact-information-frontend.js 2.84 kB
build/checkout-blocks/fields-frontend.js 345 B
build/checkout-blocks/order-summary-frontend.js 1.1 kB
build/checkout-blocks/order-summary-subtotal-frontend.js 274 B
build/general-style-rtl.css 1.29 kB
build/general-style.css 1.29 kB
build/mini-cart-contents-block/empty-cart-frontend.js 366 B
build/mini-cart-contents-block/filled-cart-frontend.js 230 B
build/mini-cart-contents-block/items-frontend.js 237 B
build/mini-cart-contents-block/shopping-button-frontend.js 287 B
build/mini-cart-frontend.js 1.72 kB
build/price-format.js 1.19 kB
build/product-add-to-cart--product-button--product-category-list--product-image--product-price--product-r--a0326d00.js 223 B
build/product-add-to-cart--product-button--product-image--product-title.js 2.66 kB
build/product-rating-frontend.js 1.17 kB
build/product-rating.js 740 B
build/product-stock-indicator-frontend.js 996 B
build/product-summary.js 921 B
build/vendors--cart-blocks/cart-line-items--cart-blocks/cart-order-summary--cart-blocks/order-summary-shi--c02aad66-frontend.js 5.26 kB
build/vendors--cart-blocks/cart-line-items--checkout-blocks/order-summary-cart-items--mini-cart-contents---233ab542-frontend.js 3.14 kB
build/vendors--mini-cart-contents-block/footer-frontend.js 6.86 kB
build/wc-blocks-google-analytics.js 1.56 kB
build/wc-blocks-registry.js 2.7 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

@luisherranz
Copy link
Collaborator Author

@c4rl0sbr4v0 wait, all the lint-related tasks passed. Then, I don't know why they were failing in my machine 🤷‍♂️

Anyway, no need to help then! Thanks anyway 😄

@luisherranz luisherranz marked this pull request as ready for review September 19, 2022 08:35
Copy link
Collaborator

@cbravobernal cbravobernal left a comment

Choose a reason for hiding this comment

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

Blind approval 😆

@luisherranz
Copy link
Collaborator Author

I may have broken something in the Cart Order Summary Coupon Form block. I'll check it out later.

@luisherranz luisherranz merged commit acf16e7 into trunk Sep 19, 2022
@luisherranz luisherranz deleted the merge-upstream branch September 19, 2022 12:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.