Skip to content

Commit 7ae8aa0

Browse files
🔃 [EngCom] Public Pull Requests - 2.2-develop
Accepted Public Pull Requests: - magento#15331: set alignment purchase order form and place order button (by @neeta-wagento) - magento#15341: Refactored javascript code of admin notification modal popup (by @rahul-kachhadiya) - magento#15351: Refactor javascript code of button split widget (by @amittiwari024) - magento#15411: [Backport-2.2] Fixed abstract.js typo (by @VitaliyBoyko) - magento#15350: 15319 : misleading data-container in product list (by @sunilit42) - magento#15333: Added language translation for message string (by @yogeshks) - magento#15346: Function is unnecessarily called multiple time (by @saurabh-aureate) - magento#15362: Removed duplicate line and added comment on variable (by @vgelani) - magento#15265: declare var to fix scope error (by @keithbentrup) - magento#15343: Format the javascript code in Tax module (by @vgelani) Fixed GitHub Issues: - magento#15334: Purchased Order Form button should visible properly (reported by @neeta-wagento) has been fixed in magento#15331 by @neeta-wagento in 2.2-develop branch Related commits: 1. 0605a27 2. eae0ac6 - magento#15354: Refactor javascript code of button split widget call js component (reported by @amittiwari024) has been fixed in magento#15351 by @amittiwari024 in 2.2-develop branch Related commits: 1. 37851f4 - magento#15319: misleading data-container in product list (reported by @DanielRuf) has been fixed in magento#15350 by @sunilit42 in 2.2-develop branch Related commits: 1. 8c144a2 2. 9e0db30 3. 03465eb - magento#15355: Function is unnecessarily called multiple time (reported by @saurabh-aureate) has been fixed in magento#15346 by @saurabh-aureate in 2.2-develop branch Related commits: 1. 9339279 - magento#15121: Magento 2.2.4 - Condition Category Chooser Crashes Page if Store has Several Nested Categories (reported by @rjtulloh) has been fixed in magento#15265 by @keithbentrup in 2.2-develop branch Related commits: 1. b7179ad - magento#15352: Reformat the javascript code as per magento standards. (reported by @namratachangani) has been fixed in magento#15343 by @vgelani in 2.2-develop branch Related commits: 1. 00bfbd0 2. cdc5b2f 3. f8d5312 4. 2ecf8c6
2 parents aaf99a9 + d9dc66c commit 7ae8aa0

File tree

13 files changed

+82
-43
lines changed

13 files changed

+82
-43
lines changed

app/code/Magento/AdminNotification/Controller/Adminhtml/System/Message/ListAction.php

+4-2
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,10 @@ public function execute()
5959
if (empty($result)) {
6060
$result[] = [
6161
'severity' => (string)\Magento\Framework\Notification\MessageInterface::SEVERITY_NOTICE,
62-
'text' => 'You have viewed and resolved all recent system notices. '
63-
. 'Please refresh the web page to clear the notice alert.',
62+
'text' => __(
63+
'You have viewed and resolved all recent system notices. '
64+
. 'Please refresh the web page to clear the notice alert.'
65+
)
6466
];
6567
}
6668
$this->getResponse()->representJson($this->jsonHelper->jsonEncode($result));

app/code/Magento/AdminNotification/i18n/en_US.csv

+1
Original file line numberDiff line numberDiff line change
@@ -48,3 +48,4 @@ Severity,Severity
4848
"Date Added","Date Added"
4949
Message,Message
5050
Actions,Actions
51+
"You have viewed and resolved all recent system notices. Please refresh the web page to clear the notice alert.","You have viewed and resolved all recent system notices. Please refresh the web page to clear the notice alert."

app/code/Magento/AdminNotification/view/adminhtml/templates/system/messages/popup.phtml

+8-16
Original file line numberDiff line numberDiff line change
@@ -19,20 +19,12 @@
1919
</ul>
2020
</div>
2121

22-
<script>
23-
require([
24-
"jquery",
25-
"Magento_Ui/js/modal/modal"
26-
], function($){
27-
if (this.modal) {
28-
this.modal.html($('[data-role="system_messages_list"]').html());
29-
} else {
30-
this.modal = $('[data-role="system_messages_list"]').modal({
31-
modalClass: 'modal-system-messages ui-popup-message',
32-
type: 'popup',
33-
buttons: []
34-
});
22+
<script type="text/x-magento-init">
23+
{
24+
"[data-role=system_messages_list]": {
25+
"Magento_AdminNotification/js/system/messages/popup": {
26+
class: 'modal-system-messages ui-popup-message'
27+
}
28+
}
3529
}
36-
this.modal.modal('openModal');
37-
});
38-
</script>
30+
</script>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
/**
2+
* Copyright © Magento, Inc. All rights reserved.
3+
* See COPYING.txt for license details.
4+
*/
5+
6+
define([
7+
'jquery',
8+
'Magento_Ui/js/modal/modal'
9+
], function ($) {
10+
'use strict';
11+
12+
return function (data, element) {
13+
if (this.modal) {
14+
this.modal.html($(element).html());
15+
} else {
16+
this.modal = $(element).modal({
17+
modalClass: data.class,
18+
type: 'popup',
19+
buttons: []
20+
});
21+
}
22+
this.modal.modal('openModal');
23+
};
24+
});

app/code/Magento/Backend/view/adminhtml/templates/widget/button/split.phtml

+7-7
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,11 @@
4141
<?php endif; ?>
4242
</div>
4343

44-
<script>
45-
require(['jquery'], function($){
46-
$('.actions-split')
47-
.on('click.splitDefault', '.action-default', function() {
48-
$(this).siblings('.dropdown-menu').find('.item-default').trigger('click');
49-
});
50-
});
44+
<script type="text/x-magento-init">
45+
{
46+
".actions-split": {
47+
"Magento_Ui/js/grid/controls/button/split": {}
48+
}
49+
}
5150
</script>
51+

app/code/Magento/Catalog/view/adminhtml/web/js/category-checkbox-tree.js

+7-5
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,7 @@ define([
3232
data = {},
3333
parameters = {},
3434
root = {},
35-
len = 0,
36-
key = '',
37-
i = 0;
35+
key = '';
3836

3937
/* eslint-disable */
4038
/**
@@ -162,13 +160,14 @@ define([
162160
* @returns {void}
163161
*/
164162
categoryLoader.buildCategoryTree = function (parent, config) {// eslint-disable-line no-shadow
163+
var i = 0;
165164

166165
if (!config) {
167166
return null;
168167
}
169168

170169
if (parent && config && config.length) {
171-
for (i = 0; i < config.length; i++) {
170+
for (i; i < config.length; i++) {
172171
categoryLoader.processCategoryTree(parent, config, i);
173172
}
174173
}
@@ -181,11 +180,14 @@ define([
181180
* @returns {Object}
182181
*/
183182
categoryLoader.buildHashChildren = function (hash, node) {// eslint-disable-line no-shadow
183+
var i = 0,
184+
len;
185+
184186
// eslint-disable-next-line no-extra-parens
185187
if ((node.childNodes.length > 0) || (node.loaded === false && node.loading === false)) {
186188
hash.children = [];
187189

188-
for (i = 0, len = node.childNodes.length; i < len; i++) {
190+
for (i, len = node.childNodes.length; i < len; i++) {
189191
/* eslint-disable */
190192
if (!hash.children) {
191193
hash.children = [];

app/code/Magento/Catalog/view/frontend/templates/product/list.phtml

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ $_helper = $this->helper('Magento\Catalog\Helper\Output');
4747
<?php /** @var $_product \Magento\Catalog\Model\Product */ ?>
4848
<?php foreach ($_productCollection as $_product): ?>
4949
<?= /* @escapeNotVerified */ ($iterator++ == 1) ? '<li class="item product product-item">' : '</li><li class="item product product-item">' ?>
50-
<div class="product-item-info" data-container="product-grid">
50+
<div class="product-item-info" data-container="product-<?= /* @escapeNotVerified */ $viewMode ?>">
5151
<?php
5252
$productImage = $block->getImage($_product, $image);
5353
if ($pos != null) {

app/code/Magento/CurrencySymbol/view/adminhtml/templates/grid.phtml

-2
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@
1313
*/
1414
?>
1515

16-
<?php $block->getCurrencySymbolsData();?>
17-
1816
<form id="currency-symbols-form" action="<?= /* @escapeNotVerified */ $block->getFormActionUrl() ?>" method="post">
1917
<input name="form_key" type="hidden" value="<?= /* @escapeNotVerified */ $block->getFormKey() ?>" />
2018
<fieldset class="admin__fieldset">

app/code/Magento/Sales/Block/Adminhtml/Order/Create/Totals/Discount.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@
1515
*/
1616
class Discount extends \Magento\Sales\Block\Adminhtml\Order\Create\Totals\DefaultTotals
1717
{
18-
//protected $_template = 'tax/checkout/subtotal.phtml';
19-
20-
//protected $_template = 'tax/checkout/subtotal.phtml';
18+
/**
19+
* @var \Magento\Tax\Model\Config
20+
*/
2121
protected $_taxConfig;
2222

2323
/**

app/code/Magento/Tax/view/adminhtml/templates/class/page/edit.phtml

+6-6
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@
1111
<?= $block->getSaveButtonHtml() ?>
1212
</div>
1313
<?= $block->getRenameFormHtml() ?>
14-
<script>
15-
require(['jquery', "mage/mage"], function(jQuery){
16-
17-
jQuery('#<?= /* @escapeNotVerified */ $block->getRenameFormId() ?>').mage('form').mage('validation');
18-
19-
});
14+
<script type="text/x-magento-init">
15+
{
16+
"#<?= /* @escapeNotVerified */ $block->getRenameFormId() ?>": {
17+
"Magento_Tax/js/page/validate": {}
18+
}
19+
}
2020
</script>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
/**
2+
* Copyright © Magento, Inc. All rights reserved.
3+
* See COPYING.txt for license details.
4+
*/
5+
6+
define([
7+
'jquery',
8+
'mage/mage'
9+
], function (jQuery) {
10+
'use strict';
11+
12+
return function (data, element) {
13+
jQuery(element).mage('form').mage('validation');
14+
};
15+
});

app/code/Magento/Ui/view/base/web/js/form/element/abstract.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ define([
220220
},
221221

222222
/**
223-
* Sets 'value' as 'hidden' propertie's value, triggers 'toggle' event,
223+
* Sets 'value' as 'hidden' property's value, triggers 'toggle' event,
224224
* sets instance's hidden identifier in params storage based on
225225
* 'value'.
226226
*

app/design/frontend/Magento/luma/Magento_Checkout/web/css/source/module/checkout/_payments.less

+5
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,11 @@
4646
.lib-css(border-top, @checkout-payment-method-title__border);
4747
}
4848
}
49+
form {
50+
&.form-purchase-order {
51+
margin-bottom: 15px;
52+
}
53+
}
4954
}
5055

5156
.payment-method-content {

0 commit comments

Comments
 (0)