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

Release: 11.5.4 #11715

Merged
merged 27 commits into from
Nov 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
dbe1881
Empty commit for release pull request
invalid-email-address Nov 9, 2023
4a7c231
Update check for different template names
opr Nov 9, 2023
c8cce86
Return early if content retrieval fails
opr Nov 9, 2023
8537bf6
Version bump
mikejolley Nov 9, 2023
f3361c0
Add testing instructions
mikejolley Nov 9, 2023
9feaf5f
Skip template related E2E tests
tarhi-saad Nov 8, 2023
2559bf2
Test skip for confirmation page
mikejolley Nov 9, 2023
61cd319
Add checks to see if getCartData finished before rendering address
opr Nov 8, 2023
6648af5
Prevent block error due to excessive updates of customValidation
mikejolley Nov 9, 2023
a6e37d6
Do not condense address in admin and handle phone field
mikejolley Nov 9, 2023
836b17a
Add missing showPhoneField for billing
mikejolley Nov 9, 2023
367170b
Readme and testing for 11714
mikejolley Nov 9, 2023
a220263
Update zip and testing version
mikejolley Nov 9, 2023
0ac1d0f
Adjust test to use legacy selector if block is not found
mikejolley Nov 10, 2023
7faa4e0
Select block before transform
mikejolley Nov 10, 2023
f767ba5
Improve frame selector
mikejolley Nov 10, 2023
5be673f
woocommerce_is_checkout/woocommerce_is_cart for classic shortcode block
mikejolley Nov 8, 2023
45c5c3e
Add return to has_block_variation
mikejolley Nov 9, 2023
daa1ae1
Add box-sizing to textarea
mikejolley Nov 10, 2023
470dd4a
Fix cart mobile border
mikejolley Nov 10, 2023
a1a09cf
Ensure that incompatible notices are displayed in Safari.
nielslange Nov 10, 2023
9f5fb8c
Updated testing notes
mikejolley Nov 13, 2023
0b542e7
Updated zip
mikejolley Nov 13, 2023
058f5b8
Use new blockified Order Confirmation on blocks themes
wavvves Nov 6, 2023
7569435
Handle translations on the new blockified Order Confirmation
wavvves Nov 6, 2023
c8af744
Testing notes
mikejolley Nov 13, 2023
4d7f569
zip
mikejolley Nov 13, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import {
ShippingStateInput,
} from '@woocommerce/base-components/state-input';
import { useEffect, useMemo, useRef } from '@wordpress/element';
import { withInstanceId } from '@wordpress/compose';
import { useInstanceId } from '@wordpress/compose';
import { useShallowEqual } from '@woocommerce/base-hooks';
import { defaultAddressFields } from '@woocommerce/settings';
import isShallowEqual from '@wordpress/is-shallow-equal';
Expand Down Expand Up @@ -44,11 +44,12 @@ const AddressForm = ( {
id = '',
fields = defaultFields,
fieldConfig = {} as FieldConfig,
instanceId,
onChange,
type = 'shipping',
values,
}: AddressFormProps ): JSX.Element => {
const instanceId = useInstanceId( AddressForm );

// Track incoming props.
const currentFields = useShallowEqual( fields );
const currentFieldConfig = useShallowEqual( fieldConfig );
Expand Down Expand Up @@ -99,7 +100,7 @@ const AddressForm = ( {
fieldsRef.current?.postcode?.revalidate();
}, [ currentCountry ] );

id = id || instanceId;
id = id || `${ instanceId }`;

return (
<div id={ id } className="wc-block-components-address-form">
Expand Down Expand Up @@ -206,4 +207,4 @@ const AddressForm = ( {
);
};

export default withInstanceId( AddressForm );
export default AddressForm;
2 changes: 0 additions & 2 deletions assets/js/base/components/cart-checkout/address-form/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@ export type AddressFormFields = {
export interface AddressFormProps {
// Id for component.
id?: string;
// Unique id for form.
instanceId: string;
// Type of form (billing or shipping).
type?: AddressType;
// Array of fields in form.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ table.wc-block-cart-items {
.wc-block-cart-item__remove-link {
display: none;
}
&:not(.wc-block-mini-cart-items) {
&:not(.wc-block-mini-cart-items):not(:last-child) {
.wc-block-cart-items__row {
@include with-translucent-border( 0 0 1px );
}
Expand Down
3 changes: 3 additions & 0 deletions assets/js/blocks/cart/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,9 @@
display: none;
}
}
table.wc-block-cart-items {
margin: 0;
}
}

.is-medium,
Expand Down
4 changes: 3 additions & 1 deletion assets/js/blocks/checkout/address-card/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,12 @@ const AddressCard = ( {
address,
onEdit,
target,
showPhoneField,
}: {
address: CartShippingAddress | CartBillingAddress;
onEdit: () => void;
target: string;
showPhoneField: boolean;
} ): JSX.Element | null => {
return (
<div className="wc-block-components-address-card">
Expand All @@ -44,7 +46,7 @@ const AddressCard = ( {
<span key={ `address-` + index }>{ field }</span>
) ) }
</div>
{ address.phone ? (
{ address.phone && showPhoneField ? (
<div
key={ `address-phone` }
className="wc-block-components-address-card__address-section"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ import type {
AddressFields,
} from '@woocommerce/settings';
import { StoreNoticesContainer } from '@woocommerce/blocks-checkout';
import { useSelect } from '@wordpress/data';
import { CART_STORE_KEY } from '@woocommerce/block-data';

/**
* Internal dependencies
Expand Down Expand Up @@ -81,16 +83,24 @@ const Block = ( {
? [ noticeContexts.BILLING_ADDRESS, noticeContexts.SHIPPING_ADDRESS ]
: [ noticeContexts.BILLING_ADDRESS ];

const { cartDataLoaded } = useSelect( ( select ) => {
const store = select( CART_STORE_KEY );
return {
cartDataLoaded: store.hasFinishedResolution( 'getCartData' ),
};
} );
return (
<>
<StoreNoticesContainer context={ noticeContext } />
<WrapperComponent>
<CustomerAddress
addressFieldsConfig={ addressFieldsConfig }
showPhoneField={ showPhoneField }
requirePhoneField={ requirePhoneField }
forceEditing={ forceEditing }
/>
{ cartDataLoaded ? (
<CustomerAddress
addressFieldsConfig={ addressFieldsConfig }
showPhoneField={ showPhoneField }
requirePhoneField={ requirePhoneField }
forceEditing={ forceEditing }
/>
) : null }
</WrapperComponent>
</>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,10 @@ const CustomerAddress = ( {
onEdit={ () => {
setEditing( true );
} }
showPhoneField={ showPhoneField }
/>
),
[ billingAddress ]
[ billingAddress, showPhoneField ]
);

const renderAddressFormComponent = useCallback(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ import type {
AddressField,
AddressFields,
} from '@woocommerce/settings';
import { useSelect } from '@wordpress/data';
import { CART_STORE_KEY } from '@woocommerce/block-data';

/**
* Internal dependencies
Expand Down Expand Up @@ -96,15 +98,24 @@ const Block = ( {
( shippingAddress.first_name || shippingAddress.last_name )
);

const { cartDataLoaded } = useSelect( ( select ) => {
const store = select( CART_STORE_KEY );
return {
cartDataLoaded: store.hasFinishedResolution( 'getCartData' ),
};
} );

return (
<>
<StoreNoticesContainer context={ noticeContext } />
<WrapperComponent>
<CustomerAddress
addressFieldsConfig={ addressFieldsConfig }
showPhoneField={ showPhoneField }
requirePhoneField={ requirePhoneField }
/>
{ cartDataLoaded ? (
<CustomerAddress
addressFieldsConfig={ addressFieldsConfig }
showPhoneField={ showPhoneField }
requirePhoneField={ requirePhoneField }
/>
) : null }
</WrapperComponent>
{ hasAddress && (
<CheckboxControl
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@
*/
import { useState, useCallback, useEffect } from '@wordpress/element';
import { AddressForm } from '@woocommerce/base-components/cart-checkout';
import { useCheckoutAddress, useStoreEvents } from '@woocommerce/base-context';
import {
useCheckoutAddress,
useStoreEvents,
useEditorContext,
} from '@woocommerce/base-context';
import type {
ShippingAddress,
AddressField,
Expand Down Expand Up @@ -38,11 +42,12 @@ const CustomerAddress = ( {
useShippingAsBilling,
} = useCheckoutAddress();
const { dispatchCheckoutEvent } = useStoreEvents();
const { isEditor } = useEditorContext();
const hasAddress = !! (
shippingAddress.address_1 &&
( shippingAddress.first_name || shippingAddress.last_name )
);
const [ editing, setEditing ] = useState( ! hasAddress );
const [ editing, setEditing ] = useState( ! hasAddress || isEditor );

// Forces editing state if store has errors.
const { hasValidationErrors, invalidProps } = useSelect( ( select ) => {
Expand Down Expand Up @@ -103,9 +108,10 @@ const CustomerAddress = ( {
onEdit={ () => {
setEditing( true );
} }
showPhoneField={ showPhoneField }
/>
),
[ shippingAddress ]
[ shippingAddress, showPhoneField ]
);

const renderAddressFormComponent = useCallback(
Expand Down Expand Up @@ -147,9 +153,11 @@ const CustomerAddress = ( {
dispatchCheckoutEvent,
onChangeAddress,
requirePhoneField,
setBillingPhone,
setShippingPhone,
shippingAddress,
showPhoneField,
useShippingAsBilling,
]
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@
width: 24px;
height: 24px;
margin-right: 6px;
min-width: max-content;
min-width: 24px; // Ensure that notice is visible in Safari. See https://github.com/woocommerce/woocommerce-blocks/issues/11734
}
}
ul {
margin: 0 0 1em 1.5em;
margin: 0 0 1em 1.2em;
padding: 0;
list-style: disc outside;
}
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"description": "WooCommerce blocks for the Gutenberg editor.",
"homepage": "https://woocommerce.com/",
"type": "wordpress-plugin",
"version": "11.5.3",
"version": "11.5.4",
"keywords": [
"gutenberg",
"woocommerce",
Expand Down
72 changes: 72 additions & 0 deletions docs/internal-developers/testing/releases/1154.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
# Testing notes and ZIP for release 11.5.4

Zip file for testing: [woocommerce-gutenberg-products-block.zip](https://github.com/woocommerce/woocommerce-blocks/files/13335241/woocommerce-gutenberg-products-block.zip)

## WooCommerce Core

### Bug Fixes

#### Update Jetpack WooCommerce Analytics module integration to check for changed template names ([#11707](https://github.com/woocommerce/woocommerce-blocks/pull/11707))

1. Enable Jetpack and ensure the WooCommerce Analytics module is set up and enabled.
2. Install [Query Monitor](https://wordpress.org/plugins/query-monitor/).
3. Go to the Cart and Checkout blocks and ensure no PHP warnings are logged.

#### Fix address block invalidations in the editor and address card display in Firefox [#11714](https://github.com/woocommerce/woocommerce-blocks/pull/11714)

1. Edit the checkout page
2. Address form should not be condensed
3. Toggle company/phone. Leave phone on. There should be no block errors.
4. Save changes and visit the checkout on the frontend (add something to cart if needed)
5. As a logged in user the address form should be condensed and phone should be visible. If no, fill out the form and place an order.
6. After placing the order go back to checkout and repeat the previous step. Phone should be visible in the condensed address component.
7. Go back to the editor and turn off the phone field. Save and go back to the frontend checkout. Ensure phone is hidden from the condensed address component.
8. Add an item to the cart and go to checkout using Firefox browser.
9. Fill out the form, then refresh the page.
10. The condensed address component is shown.
11. Edit the address. Ensure fields are populated with correct values.

#### Fix styling of Classic Cart and Checkout Blocks on regular pages ([#11694](https://github.com/woocommerce/woocommerce-blocks/pull/11694))

1. Create a new page
2. Insert the classic checkout block
3. Add something to your cart and visit the new page
4. Confirm it looks correct and you can place an order
5. Repeat for the classic cart block on another new page

#### Fix double border in cart and notes field width on mobile. ([11742](https://github.com/woocommerce/woocommerce-blocks/pull/11742))

1. Enable TT4 theme and go to cart
2. Shrink window to mobile size and ensure there is no double border between the cart items table and cart totals table
3. Go to checkout
4. Open the order notes field. Check the textarea is as wide as the checkout, not wider.

#### Ensure that incompatible notices are displayed in Safari. ([#11736](https://github.com/woocommerce/woocommerce-blocks/pull/11736))

1. Install and activate [helper-plugin-1.zip](https://github.com/woocommerce/woocommerce-blocks/files/12701036/helper-plugin-1.zip)
2. Create a test page and add the Cart block.
3. Create a test page and add the Checkout block.
4. Open both test pages using Safari.
5. Click on the Cart block resp. the Checkout block and verify that the incompatible extension notice is visible.
6. Repeat the previous step using Chrome, Firefox and Opera.

<table>
<tr>
<td valign="top">Before:
<br><br>
<img width="1281" alt="Screenshot 2023-11-10 at 21 43 01" src="https://github.com/woocommerce/woocommerce-blocks/assets/3323310/5a68914b-5306-40fd-8270-af880120aa72">
</td>
<td valign="top">After:
<br><br>
<img width="1282" alt="Screenshot 2023-11-10 at 21 42 18" src="https://github.com/woocommerce/woocommerce-blocks/assets/3323310/8718c04b-fb9e-4db7-af71-c84d8e304fc1">
</td>
</tr>
</table>

#### Enabled the new blockified Order Confirmation by default for block-based themes. ([#11615](https://github.com/woocommerce/woocommerce-blocks/pull/11615))

1. On a brand new WC installation enable a block based theme (eg TT3)
2. Place a test order
3. Verify the Thank you page displayed after placing an order renders the new blockified Order Confirmation (see attached printscreen)
4. Change the website language. Repeat steps 2 & 3 and verify that the headings get properly translated.
5. Go to Appearance > Site Editor > Templates > Manage all templates. Verify that the blockified Order Confirmation displays properly, saving changes work and they get reflected on a new order.
2 changes: 1 addition & 1 deletion docs/internal-developers/testing/releases/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -189,4 +189,4 @@ Every release includes specific testing instructions for new features and bug fi
- [11.5.1](./1151.md)
- [11.5.2](./1152.md)
- [11.5.3](./1153.md)

- [11.5.4](./1154.md)
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "@woocommerce/block-library",
"title": "WooCommerce Blocks",
"author": "Automattic",
"version": "11.5.3",
"version": "11.5.4",
"description": "WooCommerce blocks for the Gutenberg editor.",
"homepage": "https://github.com/woocommerce/woocommerce-gutenberg-products-block/",
"keywords": [
Expand Down
2 changes: 2 additions & 0 deletions packages/checkout/components/text-input/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ export interface ValidatedTextInputProps
label?: string | undefined;
// Field value.
value: string;
// Other sibling fields that should be validated together.
values: string[];
// If true, validation errors will be shown.
showError?: boolean;
// Error message to display alongside the field regardless of validation.
Expand Down
Loading
Loading