Skip to content

Commit

Permalink
MAGETWO-87066: [EngCom Team] Batch 1. Forwardports to 2.3-develop #1282
Browse files Browse the repository at this point in the history
  • Loading branch information
ishakhsuvarov authored Jan 25, 2018
2 parents d838579 + 8597a73 commit 4164cb8
Show file tree
Hide file tree
Showing 10 changed files with 72 additions and 49 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public function execute()
{
/** @var \Magento\Backend\Model\View\Result\Page $resultPage */
$resultPage = $this->resultPageFactory->create();
$resultPage->setStatusHeader(404, '1.1', 'Forbidden');
$resultPage->setStatusHeader(404, '1.1', 'Not Found');
$resultPage->setHeader('Status', '404 File not found');
$resultPage->addHandle('adminhtml_noroute');
return $resultPage;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@
<div class="messages">
<div class="message message-notice notice">
<span
translate="'Search strings are either normal strings or regular exceptions (PCRE). They are matched in the same order as entered.'"></span>
translate="'Search strings are either normal strings or regular expressions (PCRE). They are matched in the same order as entered.'"></span>
<br>
<span
translate="'Examples'"></span>:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ define([
regionInput.removeClass('required-entry');
}

regionList.removeClass('required-entry').hide();
regionList.removeClass('required-entry').prop('disabled', 'disabled').hide();
regionInput.show();
label.attr('for', regionInput.attr('id'));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,12 @@
</settings>
<container name="google_experiment_container" sortOrder="250">
<htmlContent name="html_content">
<block name="googleOptimizerBlockAdminhtmlFormCmsPage" class="Magento\GoogleOptimizer\Block\Adminhtml\Form\CmsPage" />
<block name="googleOptimizerBlockAdminhtmlFormCmsPage" class="Magento\GoogleOptimizer\Block\Adminhtml\Form\CmsPage">
<arguments>
<argument name="code-entity" xsi:type="string">Magento\GoogleOptimizer\Block\Adminhtml\Cms\Page\EntityCmsPage</argument>
<argument name="form-name" xsi:type="string">cms_page_form</argument>
</arguments>
</block>
</htmlContent>
</container>
</fieldset>
Expand Down
2 changes: 1 addition & 1 deletion app/code/Magento/Quote/Model/QuoteRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ protected function loadQuote($loadMethod, $loadField, $identifier, array $shared
if ($sharedStoreIds) {
$quote->setSharedStoreIds($sharedStoreIds);
}
$quote->setStoreId($this->storeManager->getStore()->getId())->$loadMethod($identifier);
$quote->$loadMethod($identifier)->setStoreId($this->storeManager->getStore()->getId());
if (!$quote->getId()) {
throw NoSuchEntityException::singleField($loadField, $identifier);
}
Expand Down
2 changes: 2 additions & 0 deletions app/code/Magento/Sales/Model/Order/Shipment/ItemCreation.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ public function getOrderItemId()
public function setOrderItemId($orderItemId)
{
$this->orderItemId = $orderItemId;
return $this;
}

/**
Expand All @@ -59,6 +60,7 @@ public function getQty()
public function setQty($qty)
{
$this->qty = $qty;
return $this;
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,6 @@
</td>
<td class="item-qty"><?= /* @escapeNotVerified */ $_item->getQty() * 1 ?></td>
<td class="item-price">
<?= /* @escapeNotVerified */ $block->getItemPrice($_item) ?>
<?= /* @escapeNotVerified */ $block->getItemPrice($_item->getOrderItem()) ?>
</td>
</tr>
80 changes: 42 additions & 38 deletions app/code/Magento/Search/view/frontend/web/form-mini.js
Original file line number Diff line number Diff line change
Expand Up @@ -286,46 +286,50 @@ define([
$.getJSON(this.options.url, {
q: value
}, $.proxy(function (data) {
$.each(data, function (index, element) {
var html;

element.index = index;
html = template({
data: element
if (data.length) {
$.each(data, function (index, element) {
var html;

element.index = index;
html = template({
data: element
});
dropdown.append(html);
});
dropdown.append(html);
});
this.responseList.indexList = this.autoComplete.html(dropdown)
.css(clonePosition)
.show()
.find(this.options.responseFieldElements + ':visible');

this._resetResponseList(false);
this.element.removeAttr('aria-activedescendant');

if (this.responseList.indexList.length) {
this._updateAriaHasPopup(true);
} else {
this._updateAriaHasPopup(false);
}

this.responseList.indexList
.on('click', function (e) {
this.responseList.selected = $(e.currentTarget);
this.searchForm.trigger('submit');
}.bind(this))
.on('mouseenter mouseleave', function (e) {
this.responseList.indexList.removeClass(this.options.selectClass);
$(e.target).addClass(this.options.selectClass);
this.responseList.selected = $(e.target);
this.element.attr('aria-activedescendant', $(e.target).attr('id'));
}.bind(this))
.on('mouseout', function (e) {
if (!this._getLastElement() && this._getLastElement().hasClass(this.options.selectClass)) {
$(e.target).removeClass(this.options.selectClass);
this._resetResponseList(false);
}
}.bind(this));
this.responseList.indexList = this.autoComplete.html(dropdown)
.css(clonePosition)
.show()
.find(this.options.responseFieldElements + ':visible');

this._resetResponseList(false);
this.element.removeAttr('aria-activedescendant');

if (this.responseList.indexList.length) {
this._updateAriaHasPopup(true);
} else {
this._updateAriaHasPopup(false);
}

this.responseList.indexList
.on('click', function (e) {
this.responseList.selected = $(e.currentTarget);
this.searchForm.trigger('submit');
}.bind(this))
.on('mouseenter mouseleave', function (e) {
this.responseList.indexList.removeClass(this.options.selectClass);
$(e.target).addClass(this.options.selectClass);
this.responseList.selected = $(e.target);
this.element.attr('aria-activedescendant', $(e.target).attr('id'));
}.bind(this))
.on('mouseout', function (e) {
if (!this._getLastElement() &&
this._getLastElement().hasClass(this.options.selectClass)) {
$(e.target).removeClass(this.options.selectClass);
this._resetResponseList(false);
}
}.bind(this));
}
}, this));
} else {
this._resetResponseList(true);
Expand Down
20 changes: 16 additions & 4 deletions app/code/Magento/Store/Model/Address/Renderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@
*/
class Renderer
{
const DEFAULT_TEMPLATE = "{{var name}}\n" .
"{{var street_line1}}\n" .
"{{depend street_line2}}{{var street_line2}}\n{{/depend}}" .
"{{depend city}}{{var city}},{{/depend}} {{var region}} {{depend postcode}}{{var postcode}},{{/depend}}\n" .
"{{var country}}";

/**
* @var EventManager
*/
Expand All @@ -25,18 +31,26 @@ class Renderer
*/
protected $filterManager;

/**
* @var string
*/
private $template;

/**
* Constructor
*
* @param EventManager $eventManager
* @param FilterManager $filterManager
* @param string $template
*/
public function __construct(
EventManager $eventManager,
FilterManager $filterManager
FilterManager $filterManager,
$template = self::DEFAULT_TEMPLATE
) {
$this->eventManager = $eventManager;
$this->filterManager = $filterManager;
$this->template = $template;
}

/**
Expand All @@ -50,9 +64,7 @@ public function format(DataObject $storeInfo, $type = 'html')
{
$this->eventManager->dispatch('store_address_format', ['type' => $type, 'store_info' => $storeInfo]);
$address = $this->filterManager->template(
"{{var name}}\n{{var street_line1}}\n{{depend street_line2}}{{var street_line2}}\n{{/depend}}" .
"{{depend city}}{{var city}},{{/depend}} {{var region}} {{depend postcode}}{{var postcode}},{{/depend}}\n" .
"{{var country}}",
$this->template,
['variables' => $storeInfo->getData()]
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ define([
],
'stripped-min-length': [
function (value, param) {
return $(value).text().length >= param;
return _.isUndefined(value) || value.length === 0 || utils.stripHtml(value).length >= param;
},
$.mage.__('Please enter at least {0} characters')
],
Expand Down

0 comments on commit 4164cb8

Please sign in to comment.