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

Replace "Image size" with "Resolution" in image size controls #49112

Merged
merged 6 commits into from
Mar 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 2 additions & 0 deletions packages/block-editor/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

## Unreleased

- `ImageSizeControl`: Update image size label ([#49112](https://github.com/WordPress/gutenberg/pull/49112)).

## 11.6.0 (2023-03-15)

## 11.5.0 (2023-03-01)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export default function ImageSizeControl( {
{ imageSizeOptions && imageSizeOptions.length > 0 && (
<SelectControl
__nextHasNoMarginBottom
label={ __( 'Image size' ) }
label={ __( 'Resolution' ) }
value={ slug }
options={ imageSizeOptions }
onChange={ onChangeImage }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ describe( 'ImageSizeControl', () => {
);

expect(
screen.getByRole( 'combobox', { name: 'Image size' } )
screen.getByRole( 'combobox', { name: 'Resolution' } )
).toHaveValue( 'medium' );
} );

Expand All @@ -351,7 +351,7 @@ describe( 'ImageSizeControl', () => {
);

await user.selectOptions(
screen.getByRole( 'combobox', { name: 'Image size' } ),
screen.getByRole( 'combobox', { name: 'Resolution' } ),
'thumbnail'
);

Expand Down
4 changes: 2 additions & 2 deletions packages/block-library/src/gallery/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -592,7 +592,7 @@ function GalleryEdit( props ) {
{ imageSizeOptions?.length > 0 && (
<SelectControl
__nextHasNoMarginBottom
label={ __( 'Image size' ) }
label={ __( 'Resolution' ) }
help={ __(
'Select the size of the source images.'
) }
Expand All @@ -606,7 +606,7 @@ function GalleryEdit( props ) {
{ Platform.isWeb && ! imageSizeOptions && hasImageIds && (
<BaseControl className={ 'gallery-image-sizes' }>
<BaseControl.VisualLabel>
{ __( 'Image size' ) }
{ __( 'Resolution' ) }
</BaseControl.VisualLabel>
<View className={ 'gallery-image-sizes__loading' }>
<Spinner />
Expand Down
2 changes: 1 addition & 1 deletion packages/block-library/src/gallery/use-image-sizes.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { useMemo } from '@wordpress/element';

/**
* Calculates the image sizes that are avaible for the current gallery images in order to
* populate the 'Image size' selector.
* populate the 'Resolution' selector.
*
* @param {Array} images Basic image block data taken from current gallery innerBlock
* @param {boolean} isSelected Is the block currently selected in the editor.
Expand Down
2 changes: 1 addition & 1 deletion packages/block-library/src/image/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ export function ImageEdit( {
: 'full',
};
} else {
// Keep the same url when selecting the same file, so "Image Size"
// Keep the same url when selecting the same file, so "Resolution"
// option is not changed.
additionalAttributes = { url };
}
Expand Down
3 changes: 3 additions & 0 deletions packages/block-library/src/latest-posts/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,9 @@ export default function LatestPostsEdit( { attributes, setAttributes } ) {
imageWidth={ defaultImageWidth }
imageHeight={ defaultImageHeight }
imageSizeOptions={ imageSizeOptions }
imageSizeHelp={ __(
'Select the size of the source image.'
) }
onChangeImage={ ( value ) =>
setAttributes( {
featuredImageSizeSlug: value,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ const DimensionControls = ( {
{ !! imageSizeOptions.length && (
<ToolsPanelItem
hasValue={ () => !! sizeSlug }
label={ __( 'Image size' ) }
label={ __( 'Resolution' ) }
onDeselect={ () =>
setAttributes( { sizeSlug: undefined } )
}
Expand All @@ -216,7 +216,7 @@ const DimensionControls = ( {
>
<SelectControl
__nextHasNoMarginBottom
label={ __( 'Image size' ) }
label={ __( 'Resolution' ) }
value={ sizeSlug || DEFAULT_SIZE }
options={ imageSizeOptions }
onChange={ ( nextSizeSlug ) =>
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/specs/editor/plugins/image-size.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ test.describe( 'changing image size', () => {

// Select the new size updated with the plugin.
await editor.openDocumentSettingsSidebar();
await page.selectOption( 'role=combobox[name="Image size"i]', {
await page.selectOption( 'role=combobox[name="Resolution"i]', {
label: 'Custom Size One',
} );

Expand Down