Skip to content

Commit

Permalink
Merge remote-tracking branch 'mainline/2.4-develop' into PR_20210525
Browse files Browse the repository at this point in the history
  • Loading branch information
o-dubovyk committed Jun 7, 2021
2 parents 97ec834 + ed2ffad commit 80cc4e6
Show file tree
Hide file tree
Showing 318 changed files with 6,028 additions and 3,050 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,16 @@ define([
return record[this.messageIndex];
},

/**
* Proxy to getLabel function with UnsanitizedHtml suffix
*
* @param {Object} record
* @returns {String}
*/
getLabelUnsanitizedHtml: function (record) {
return this.getLabel(record);
},

/** @inheritdoc */
getFieldClass: function ($row) {
var status = this.statusMap[$row.status] || 'warning',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
*/
-->
<div css="$col.getFieldClass($row())"
html="$col.getLabel($row())"/>
html="$col.getLabelUnsanitizedHtml($row())"></div>
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,6 @@ public function isAllowed($bulkUuid)
$this->bulkSummaryFactory->create(),
$bulkUuid
);
return $bulkSummary->getUserId() === $this->userContext->getUserId();
return ((int) $bulkSummary->getUserId()) === ((int) $this->userContext->getUserId());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@
-->
<div css="$data.additionalClasses"
if="error"
text="error"/>
text="error"></div>
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@
attr="{
title: $action().label
}"
/>
></button>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,12 @@
<a class="action__message-log"
href="#"
click="dismissAll"
text="dismissAllText"/>
text="dismissAllText"></a>
<a class="action__message-log"
attr="{
href: link
}"
text="linkText"/>
text="linkText"></a>
</div>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ protected function add(UserContextInterface $userContext)
*/
public function getUserId()
{
return $this->getUserContext() ? $this->getUserContext()->getUserId() : null;
return $this->getUserContext() ? ((int) $this->getUserContext()->getUserId()) : null;
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
class="action-secondary"
type="button"
click="processingAddChild.bind($data, false, false, false)">
<span translate="addButtonLabel"/>
<span translate="addButtonLabel"></span>
</button>
</div>

Expand All @@ -30,7 +30,7 @@
css="$data.setClasses($data)"
attr="'data-index': index">
<label if="$data.label" class="admin__field-label" attr="for: $data.uid">
<span translate="$data.label"/>
<span translate="$data.label"></span>
</label>

<div class="admin__field-control" data-role="grid-wrapper">
Expand All @@ -47,14 +47,14 @@
<thead if="element.columnsHeader">
<tr>
<th if="$data.dndConfig.enabled"
class="data-grid-draggable-row-cell"/>
class="data-grid-draggable-row-cell"></th>

<th repeat="foreach: labels, item: '$label'"
class="data-grid-th"
visible="$label().visible"
disable="$label().disabled"
css="setClasses($label())">
<span translate="$label().label"/>
<span translate="$label().label"></span>
</th>
</tr>
</thead>
Expand All @@ -65,15 +65,15 @@
css="'_odd-row': $index % 2">
<td if="dndConfig.enabled"
class="data-grid-draggable-row-cell"
template="name: dndConfig.template, data: dnd"/>
template="name: dndConfig.template, data: dnd"></td>

<!-- ko foreach: { data: $record().elems(), as: 'elem'} -->
<td if="elem.template"
visible="elem.visible() && elem.formElement !== 'hidden'"
disable="elem.disabled"
css="$parent.setClasses(elem)"
template="elem.template"
attr="'data-index': index"/>
attr="'data-index': index"></td>
<!-- /ko -->
</tr>
</tbody>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
class="input-text admin__control-text qty validate-greater-than-zero<?php if (!$_canChangeQty) { echo ' qty-disabled'; } ?>"
type="text"
name="bundle_option_qty[<?= $block->escapeHtmlAttr($_option->getId()) ?>]"
value="<?= $block->escapeHtmlAttr($_defaultQty) ?>" />
value="<?= $block->escapeHtmlAttr($_defaultQty) ?>"></div>
</div>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@
css="getAdjustmentCssClasses($row())">
<span if="label"
class="price-label"
text="label"/>
text="label"></span>

<span class="price-wrapper"
css="priceWrapperCssClasses"
attr="priceWrapperAttr"
data-price-amount=""
data-price-type=""
html="getMinimalPrice($row())"/>
html="getMinimalPriceUnsanitizedHtml($row())"></span>

<each args="data: getAdjustments(), as: '$adj'">
<render args="$adj.getBody()"/>
Expand Down
2 changes: 1 addition & 1 deletion app/code/Magento/Bundle/view/frontend/web/js/slide.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ define([
$('html, body').animate({
scrollTop: $(this.options.bundleOptionsContainer).offset().top
}, 600);
$('#product-options-wrapper > fieldset').focus();
$('#product-options-wrapper > fieldset').trigger('focus');
},

/**
Expand Down
2 changes: 1 addition & 1 deletion app/code/Magento/Catalog/Block/Product/ImageFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ public function create(Product $product, string $imageId, array $attributes = nu
'image_url' => $imageAsset->getUrl(),
'width' => $imageMiscParams['image_width'],
'height' => $imageMiscParams['image_height'],
'label' => $this->getLabel($product, $imageMiscParams['image_type']),
'label' => $this->getLabel($product, $imageMiscParams['image_type'] ?? ''),
'ratio' => $this->getRatio($imageMiscParams['image_width'] ?? 0, $imageMiscParams['image_height'] ?? 0),
'custom_attributes' => $this->filterCustomAttributes($attributes),
'class' => $this->getClass($attributes),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,10 @@ define([
content: data.message
});
} else {
$(this.options.categoryIdSelector).val(data.id).change();
$(this.options.categoryPathSelector).val(data.path).change();
$(this.options.categoryParentSelector).val(data.parentId).change();
$(this.options.categoryLevelSelector).val(data.level).change();
$(this.options.categoryIdSelector).val(data.id).trigger('change');
$(this.options.categoryPathSelector).val(data.path).trigger('change');
$(this.options.categoryParentSelector).val(data.parentId).trigger('change');
$(this.options.categoryLevelSelector).val(data.level).trigger('change');
}
}
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ define([
closed: function () {
var doc = self.iframe.get(0).document;

if (doc && $.isFunction(doc.execCommand)) {
if (doc && typeof doc.execCommand === 'function') {
//IE9 break script loading but not execution on iframe removing
doc.execCommand('stop');
self.iframe.remove();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,7 @@ define([
this.refreshSortableElements();
this.options.selectionItemCount[data.id] = parseInt(this.options.selectionItemCount[data.id], 10) + 1;

$('#' + this.options.fieldId + '_' + data.id + '_select_' + data['select_id'] + '_title').focus();
$('#' + this.options.fieldId + '_' + data.id + '_select_' + data['select_id'] + '_title').trigger('focus');
},

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ define([
$('#new_category_name').val(enteredName);

if (enteredName === '') {
$('#new_category_name').focus();
$('#new_category_name').trigger('focus');
}
$('#new_category_messages').html('');
},
Expand All @@ -88,7 +88,7 @@ define([
validationOptions.unhighlight($('#new_category_parent-suggest').get(0),
validationOptions.errorClass, validationOptions.validClass || '');
newCategoryForm.validation('clearError');
$('#category_ids-suggest').focus();
$('#category_ids-suggest').trigger('focus');
},
buttons: [{
text: $.mage.__('Create Category'),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
-->
<ul class="admin__control-support-text attributes-summary">
<li class="attributes-selected">
<span translate="'Selected Attributes\:'"/>
<span text="label"/>
<span translate="'Selected Attributes\:'"></span>
<span text="label"></span>
</li>
<li class="attributes-found">
<text args="totalRecords"/> records found
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
optionsCaption: caption,
optionsValue: 'value',
optionsText: 'label'"
/>
></select>
<div class="admin__field-note" if="$data.hints">
<span translate="$data.hints[$data.value()]"/>
<span translate="$data.hints[$data.value()]"></span>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@
id: uid,
disabled: disabled
}"/>
<label class="admin__field-error" if="error" attr="for: uid" text="error"/>
<label class="admin__field-error" if="error" attr="for: uid" text="error"></label>
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
css="$data.additionalClasses"
attr="'data-index': index">
<label class="admin__field-label" if="$data.label" visible="$data.labelVisible" attr="for: uid">
<span translate="label" attr="'data-config-scope': $data.scopeLabel"/>
<span translate="label" attr="'data-config-scope': $data.scopeLabel"></span>
</label>
<div class="admin__field-control"
css="'_with-tooltip': $data.tooltip, '_with-reset': $data.showFallbackReset && $data.isDifferedFromDefault">
Expand All @@ -19,24 +19,28 @@
<render args="elementTmpl"/>

<label class="admin__addon-prefix" if="addBefore()" attr="for: uid">
<span text="addBefore()"/>
<span text="addBefore()"></span>
</label>
<label class="admin__addon-suffix" if="$data.addafter" attr="for: uid">
<span text="addafter"/>
<span text="addafter"></span>
</label>
</div>

<render args="tooltipTpl" if="$data.tooltip"/>

<render args="fallbackResetTpl" if="$data.showFallbackReset && $data.isDifferedFromDefault"/>

<label class="admin__field-error" if="error" attr="for: uid" text="error"/>
<label class="admin__field-error" if="error" attr="for: uid" text="error"></label>

<div class="admin__field-note" if="$data.notice" attr="id: noticeId">
<span translate="notice"/>
<span translate="notice"></span>
</div>

<div class="admin__additional-info" if="$data.additionalInfo" html="$data.additionalInfo"></div>
<!-- ko if: $data.additionalInfo -->
<!-- ko with: {additionalInfoUnsanitizedHtml: $data.additionalInfo} -->
<div class="admin__additional-info" html="additionalInfoUnsanitizedHtml"></div>
<!-- /ko -->
<!-- /ko -->

<render args="$data.service.template" if="$data.hasService()"/>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
* See COPYING.txt for license details.
*/
-->
<div class="data-grid-cell-content white-space-preserved" html="$col.getLabel($row())"/>
<div class="data-grid-cell-content white-space-preserved" html="$col.getLabelUnsanitizedHtml($row())"></div>
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<div class="file-uploader-summary">
<div class="file-uploader-preview image-uploader-preview">
<a class="image-uploader-preview-link" attr="href: $parent.getFilePreview($file)" target="_blank">
<div class="file-uploader-spinner image-uploader-spinner" />
<div class="file-uploader-spinner image-uploader-spinner"></div>
<img
class="preview-image"
tabindex="0"
Expand All @@ -26,12 +26,12 @@
attr="title: $t('Delete image')"
disable="$parent.disabled"
click="$parent.removeFile.bind($parent, $file)">
<span translate="'Delete image'"/>
<span translate="'Delete image'"></span>
</button>
</div>
</div>

<div class="file-uploader-filename" text="$file.name"/>
<div class="file-uploader-filename" text="$file.name"></div>
<div class="file-uploader-meta">
<text args="$file.previewWidth"/>x<text args="$file.previewHeight"/>,
<text args="$parent.formatSize($file.size)"/>
Expand Down
Loading

0 comments on commit 80cc4e6

Please sign in to comment.