Skip to content

Commit be7125c

Browse files
merge magento/2.3-develop into magento-arcticfoxes/MC-22958
2 parents abfe4b0 + 8f73566 commit be7125c

File tree

16 files changed

+225
-36
lines changed

16 files changed

+225
-36
lines changed

app/code/Magento/Catalog/Model/Product/Image/ParamsBuilder.php

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -130,10 +130,12 @@ private function getWatermark(string $type, int $scopeId = null): array
130130
);
131131

132132
if ($file) {
133-
$size = $this->scopeConfig->getValue(
134-
"design/watermark/{$type}_size",
135-
ScopeInterface::SCOPE_STORE,
136-
$scopeId
133+
$size = explode(
134+
'x',
135+
$this->scopeConfig->getValue(
136+
"design/watermark/{$type}_size",
137+
ScopeInterface::SCOPE_STORE
138+
)
137139
);
138140
$opacity = $this->scopeConfig->getValue(
139141
"design/watermark/{$type}_imageOpacity",
@@ -145,8 +147,8 @@ private function getWatermark(string $type, int $scopeId = null): array
145147
ScopeInterface::SCOPE_STORE,
146148
$scopeId
147149
);
148-
$width = !empty($size['width']) ? $size['width'] : null;
149-
$height = !empty($size['height']) ? $size['height'] : null;
150+
$width = !empty($size['0']) ? $size['0'] : null;
151+
$height = !empty($size['1']) ? $size['1'] : null;
150152

151153
return [
152154
'watermark_file' => $file,

app/code/Magento/MediaStorage/Service/ImageResize.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -311,6 +311,10 @@ private function resize(array $imageParams, string $originalImagePath, string $o
311311
]
312312
);
313313

314+
if ($imageParams['image_width'] !== null && $imageParams['image_height'] !== null) {
315+
$image->resize($imageParams['image_width'], $imageParams['image_height']);
316+
}
317+
314318
if (isset($imageParams['watermark_file'])) {
315319
if ($imageParams['watermark_height'] !== null) {
316320
$image->setWatermarkHeight($imageParams['watermark_height']);
@@ -331,9 +335,6 @@ private function resize(array $imageParams, string $originalImagePath, string $o
331335
$image->watermark($this->getWatermarkFilePath($imageParams['watermark_file']));
332336
}
333337

334-
if ($imageParams['image_width'] !== null && $imageParams['image_height'] !== null) {
335-
$image->resize($imageParams['image_width'], $imageParams['image_height']);
336-
}
337338
$image->save($imageAsset->getPath());
338339

339340
if ($this->fileStorageDatabase->checkDbUsage()) {

app/code/Magento/Sales/Block/Order/Item/Renderer/DefaultRenderer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ public function getFormatedOptionValue($optionValue)
182182

183183
if ($this->string->strlen($optionValue) > 55) {
184184
$result['value'] = $result['value']
185-
. ' <a href="#" class="dots tooltip toggle" onclick="return false">...</a>';
185+
. ' ...';
186186
$optionValue = nl2br($optionValue);
187187
$result = array_merge($result, ['full_view' => $optionValue]);
188188
}

app/code/Magento/Sales/view/frontend/templates/order/creditmemo/items/renderer/default.phtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
<?php if (!$block->getPrintStatus()) : ?>
1818
<?php $_formatedOptionValue = $block->getFormatedOptionValue($_option) ?>
1919
<dd<?= (isset($_formatedOptionValue['full_view']) ? ' class="tooltip wrapper"' : '') ?>>
20-
<?= $block->escapeHtml($_formatedOptionValue['value']) ?>
20+
<?= $block->escapeHtml($_formatedOptionValue['value'], ['a', 'img']) ?>
2121
<?php if (isset($_formatedOptionValue['full_view'])) : ?>
2222
<div class="tooltip content">
2323
<dl class="item options">

app/code/Magento/Sales/view/frontend/templates/order/invoice/items/renderer/default.phtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
<?php if (!$block->getPrintStatus()) : ?>
1818
<?php $_formatedOptionValue = $block->getFormatedOptionValue($_option) ?>
1919
<dd<?= (isset($_formatedOptionValue['full_view']) ? ' class="tooltip wrapper"' : '') ?>>
20-
<?= $block->escapeHtml($_formatedOptionValue['value']) ?>
20+
<?= $block->escapeHtml($_formatedOptionValue['value'], ['a', 'img']) ?>
2121
<?php if (isset($_formatedOptionValue['full_view'])) : ?>
2222
<div class="tooltip content">
2323
<dl class="item options">

app/code/Magento/Sales/view/frontend/templates/order/items/renderer/default.phtml

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,19 @@ $_item = $block->getItem();
1616
<dt><?= $block->escapeHtml($_option['label']) ?></dt>
1717
<?php if (!$block->getPrintStatus()) : ?>
1818
<?php $_formatedOptionValue = $block->getFormatedOptionValue($_option) ?>
19-
<dd>
19+
<dd<?= (isset($_formatedOptionValue['full_view']) ? ' class="tooltip wrapper"' : '') ?>>
20+
<?= $block->escapeHtml($_formatedOptionValue['value'], ['a', 'img']) ?>
2021
<?php if (isset($_formatedOptionValue['full_view'])) : ?>
21-
<?= $block->escapeHtml($_formatedOptionValue['full_view'], ['a']) ?>
22-
<?php else : ?>
23-
<?=$block->escapeHtml($_formatedOptionValue['value'], ['a']) ?>
22+
<div class="tooltip content">
23+
<dl class="item options">
24+
<dt><?= $block->escapeHtml($_option['label']) ?></dt>
25+
<dd><?= $block->escapeHtml($_formatedOptionValue['full_view']) ?></dd>
26+
</dl>
27+
</div>
2428
<?php endif; ?>
2529
</dd>
2630
<?php else : ?>
27-
<dd>
28-
<?= /* @noEscape */ nl2br($block->escapeHtml($_option['print_value'] ?? $_option['value'])) ?>
29-
</dd>
31+
<dd><?= $block->escapeHtml((isset($_option['print_value']) ? $_option['print_value'] : $_option['value'])) ?></dd>
3032
<?php endif; ?>
3133
<?php endforeach; ?>
3234
</dl>

app/code/Magento/Sales/view/frontend/templates/order/shipment/items/renderer/default.phtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
<?php if (!$block->getPrintStatus()) : ?>
1717
<?php $_formatedOptionValue = $block->getFormatedOptionValue($_option) ?>
1818
<dd<?= (isset($_formatedOptionValue['full_view']) ? ' class="tooltip wrapper"' : '') ?>>
19-
<?= $block->escapeHtml($_formatedOptionValue['value']) ?>
19+
<?= $block->escapeHtml($_formatedOptionValue['value'], ['a', 'img']) ?>
2020
<?php if (isset($_formatedOptionValue['full_view'])) : ?>
2121
<div class="tooltip content">
2222
<dl class="item options">

app/code/Magento/Ui/view/base/web/js/grid/columns/image-preview.js

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,16 @@ define([
1010

1111
return Column.extend({
1212
defaults: {
13+
bodyTmpl: 'ui/grid/columns/image-preview',
1314
previewImageSelector: '[data-image-preview]',
1415
visibleRecord: null,
1516
height: 0,
1617
displayedRecord: {},
1718
lastOpenedImage: null,
19+
fields: {
20+
previewUrl: 'preview_url',
21+
title: 'title'
22+
},
1823
modules: {
1924
masonry: '${ $.parentName }',
2025
thumbnailComponent: '${ $.parentName }.thumbnail_url'
@@ -154,6 +159,26 @@ define([
154159
return this.visibleRecord() === record._rowIndex || false;
155160
},
156161

162+
/**
163+
* Returns preview image url for a given record.
164+
*
165+
* @param {Object} record
166+
* @return {String}
167+
*/
168+
getUrl: function (record) {
169+
return record[this.fields.previewUrl];
170+
},
171+
172+
/**
173+
* Returns image title for a given record.
174+
*
175+
* @param {Object} record
176+
* @return {String}
177+
*/
178+
getTitle: function (record) {
179+
return record[this.fields.title];
180+
},
181+
157182
/**
158183
* Get styles for preview
159184
*

app/code/Magento/Ui/view/base/web/js/grid/columns/image.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ define([
99

1010
return Column.extend({
1111
defaults: {
12+
bodyTmpl: 'ui/grid/columns/image',
1213
modules: {
1314
previewComponent: '${ $.parentName }.preview'
1415
},

app/code/Magento/Ui/view/base/web/js/grid/columns/overlay.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ define([
88
'use strict';
99

1010
return Column.extend({
11+
defaults: {
12+
bodyTmpl: 'ui/grid/columns/overlay'
13+
},
14+
1115
/**
1216
* If overlay should be visible
1317
*

0 commit comments

Comments
 (0)