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

add width and height in <img> #1105

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 3 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
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,14 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.

## [Unreleased]

### Added

- add width and height in the images editable via site-editor

### Fixed

- Arabic, Bulgarian, German, English, Spanish, French, Indonesian, Italian, Japanese, Korean, Dutch, Norwegian, Portuguese, Romanian and Thai translations

## [3.172.2] - 2024-03-06

### Fixed
Expand Down
346 changes: 176 additions & 170 deletions messages/ar.json

Large diffs are not rendered by default.

346 changes: 176 additions & 170 deletions messages/bg.json

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions messages/context.json
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,10 @@
"admin/editor.notification-bar.content.description": "Text of the bar",
"admin/editor.blockClass.title": "CSS Block Class",
"admin/editor.blockClass.description": "Adds an extra class name to ease styling",
"admin/editor.imageWidth.title": "Image Width",
"admin/editor.imageWidth.description": "Adds width in the tag <img>",
"admin/editor.imageHeight.title": "Image Height",
"admin/editor.imageHeight.description": "Adds height in the tag <img>",
"admin/editor.image.title": "Image",
"admin/editor.image.description": "Show any image",
"admin/editor.image.src.title": "Image",
Expand Down
346 changes: 176 additions & 170 deletions messages/de.json

Large diffs are not rendered by default.

348 changes: 176 additions & 172 deletions messages/en.json

Large diffs are not rendered by default.

348 changes: 176 additions & 172 deletions messages/es.json

Large diffs are not rendered by default.

346 changes: 176 additions & 170 deletions messages/fr.json

Large diffs are not rendered by default.

346 changes: 176 additions & 170 deletions messages/id.json

Large diffs are not rendered by default.

346 changes: 176 additions & 170 deletions messages/it.json

Large diffs are not rendered by default.

346 changes: 176 additions & 170 deletions messages/ja.json

Large diffs are not rendered by default.

346 changes: 176 additions & 170 deletions messages/ko.json

Large diffs are not rendered by default.

346 changes: 176 additions & 170 deletions messages/nl.json

Large diffs are not rendered by default.

346 changes: 176 additions & 170 deletions messages/nn.json

Large diffs are not rendered by default.

346 changes: 176 additions & 170 deletions messages/no.json

Large diffs are not rendered by default.

348 changes: 176 additions & 172 deletions messages/pt.json

Large diffs are not rendered by default.

346 changes: 176 additions & 170 deletions messages/ro.json

Large diffs are not rendered by default.

346 changes: 176 additions & 170 deletions messages/th.json

Large diffs are not rendered by default.

20 changes: 20 additions & 0 deletions react/components/InfoCard/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,8 @@ const InfoCard = ({
textPosition,
textAlignment,
imageUrl,
imageWidth,
imageHeight,
mobileImageUrl,
imageActionUrl,
intl,
Expand Down Expand Up @@ -226,6 +228,8 @@ const InfoCard = ({
style={{ objectFit: 'cover' }}
alt={formatIOMessage({ id: callToActionText, intl })}
data-testid="half-image"
width={imageWidth}
height={imageHeight}
/>
</LinkWrapper>
</div>
Expand All @@ -247,6 +251,8 @@ MemoizedInfoCard.propTypes = {
callToActionText: string,
callToActionUrl: string,
imageUrl: string,
imageWidth: string,
imageHeight: string,
mobileImageUrl: string,
textAlignment: oneOf(getEnumValues(textAlignmentTypes)),
imageActionUrl: string,
Expand All @@ -268,6 +274,8 @@ MemoizedInfoCard.defaultProps = {
callToActionUrl: '',
imageUrl: '',
mobileImageUrl: '',
imageWidth: '',
imageHeight: '',
textAlignment: textAlignmentTypes.TEXT_ALIGNMENT_LEFT.value,
textMode: textModeTypes.TEXT_MODE_HTML.value,
linkTarget: '_self',
Expand Down Expand Up @@ -328,6 +336,18 @@ MemoizedInfoCard.schema = {
type: 'string',
isLayout: true,
},
imageWidth: {
title: 'admin/editor.imageWidth.title',
description: 'admin/editor.imageWidth.description',
type: 'string',
isLayout: true,
},
imageHeight: {
title: 'admin/editor.imageHeight.title',
description: 'admin/editor.imageHeight.description',
type: 'string',
isLayout: true,
},
},
}

Expand Down
12 changes: 12 additions & 0 deletions store/contentSchemas.json
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,18 @@
"title": "admin/editor.blockClass.title",
"description": "admin/editor.blockClass.description",
"type": "string"
},
"imageWidth": {
"title": "admin/editor.imageWidth.title",
"description": "admin/editor.imageWidth.description",
"$ref": "app:vtex.native-types#/definitions/text",
"default": ""
},
"imageHeight": {
"title": "admin/editor.imageHeight.title",
"description": "admin/editor.info-card.imageHeight.description",
lucvysk marked this conversation as resolved.
Show resolved Hide resolved
"$ref": "app:vtex.native-types#/definitions/text",
"default": ""
}
}
},
Expand Down
Loading