Skip to content

Commit b5423fa

Browse files
authored
Merge pull request #1103 from magento-east/MAGETWO-69163
MAGETWO-69163: Functional Improvements for Magento 2.0.14
2 parents bc8e521 + 6277f10 commit b5423fa

File tree

141 files changed

+12431
-8957
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

141 files changed

+12431
-8957
lines changed

app/code/Magento/Authorizenet/Controller/Directpost/Payment/BackendResponse.php

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,6 @@
66
*/
77
namespace Magento\Authorizenet\Controller\Directpost\Payment;
88

9-
class BackendResponse extends \Magento\Authorizenet\Controller\Directpost\Payment
9+
class BackendResponse extends \Magento\Authorizenet\Controller\Directpost\Payment\Response
1010
{
11-
/**
12-
* Response action.
13-
* Action for Authorize.net SIM Relay Request.
14-
*
15-
* @return void
16-
*/
17-
public function execute()
18-
{
19-
$this->_responseAction('adminhtml');
20-
}
2111
}

app/code/Magento/Authorizenet/view/frontend/layout/authorizenet_directpost_payment_backendresponse.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@
77
-->
88
<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/layout_generic.xsd">
99
<container name="root">
10-
<block class="Magento\Payment\Block\Transparent\Iframe" name="authorizenet_directpost_iframe" template="Magento_Payment::transparent/iframe.phtml"/>
10+
<block class="Magento\Payment\Block\Transparent\Iframe" name="authorizenet_directpost_iframe" template="Magento_Payment::transparent/backend-iframe.phtml"/>
1111
</container>
1212
</layout>

app/code/Magento/Catalog/Controller/Adminhtml/Product/Initialization/Helper.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ public function initialize(\Magento\Catalog\Model\Product $product)
151151
foreach ($options as &$customOptionData) {
152152
if (isset($customOptionData['values'])) {
153153
$customOptionData['values'] = array_filter($customOptionData['values'], function ($valueData) {
154-
return !($valueData['option_type_id'] == '-1' && !empty($valueData['is_delete']));
154+
return !((!isset($valueData['option_type_id']) || $valueData['option_type_id'] == '-1') && !empty($valueData['is_delete']));
155155
});
156156
}
157157
}

app/code/Magento/Catalog/Model/Product/Pricing/Renderer/SalableResolver.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,6 @@ class SalableResolver implements SalableResolverInterface
1919
*/
2020
public function isSalable(\Magento\Framework\Pricing\SaleableInterface $salableItem)
2121
{
22-
return $salableItem->getCanShowPrice() !== false && $salableItem->isSalable();
22+
return $salableItem->getCanShowPrice() !== false;
2323
}
2424
}

app/code/Magento/Catalog/Test/Unit/Model/Product/Pricing/Renderer/SalableResolverTest.php

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ protected function setUp()
2222
{
2323
$this->product = $this->getMock(
2424
'Magento\Catalog\Model\Product',
25-
['__wakeup', 'getCanShowPrice', 'isSalable'],
25+
['__wakeup', 'getCanShowPrice'],
2626
[],
2727
'',
2828
false
@@ -40,8 +40,6 @@ public function testSalableItem()
4040
->method('getCanShowPrice')
4141
->willReturn(true);
4242

43-
$this->product->expects($this->any())->method('isSalable')->willReturn(true);
44-
4543
$result = $this->object->isSalable($this->product);
4644
$this->assertTrue($result);
4745
}
@@ -50,9 +48,7 @@ public function testNotSalableItem()
5048
{
5149
$this->product->expects($this->any())
5250
->method('getCanShowPrice')
53-
->willReturn(true);
54-
55-
$this->product->expects($this->any())->method('isSalable')->willReturn(false);
51+
->willReturn(false);
5652

5753
$result = $this->object->isSalable($this->product);
5854
$this->assertFalse($result);

app/code/Magento/Catalog/view/adminhtml/ui_component/product_listing.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
<item name="deps" xsi:type="string">product_listing.product_listing_data_source</item>
1313
</item>
1414
<item name="spinner" xsi:type="string">product_columns</item>
15+
<item name="acl" xsi:type="string">Magento_Catalog::products</item>
1516
</argument>
1617
<dataSource name="product_listing_data_source">
1718
<argument name="dataProvider" xsi:type="configurableObject">

app/code/Magento/Catalog/view/adminhtml/web/catalog/apply-to-type-switcher.js

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,22 @@
44
*/
55
define([
66
'jquery',
7+
'uiRegistry',
78
'Magento_Catalog/js/product/weight-handler',
89
'Magento_Catalog/catalog/type-events'
9-
], function ($, weight, productType) {
10+
], function ($, registry, weight, productType) {
1011
'use strict';
1112

1213
return {
1314

15+
/**
16+
* Init
17+
*/
18+
init: function () {
19+
this.bindAll();
20+
this._switchToTypeByApplyAttr();
21+
},
22+
1423
/**
1524
* Bind event
1625
*/
@@ -32,8 +41,7 @@ define([
3241
* Constructor component
3342
*/
3443
'Magento_Catalog/catalog/apply-to-type-switcher': function () {
35-
this.bindAll();
36-
this._switchToTypeByApplyAttr();
44+
registry.get('typeSwitcher', this.init.bind(this));
3745
},
3846

3947
/**

app/code/Magento/Catalog/view/adminhtml/web/catalog/type-events.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@
44
*/
55
define([
66
'jquery',
7+
'uiRegistry',
78
'Magento_Catalog/js/product/weight-handler'
8-
], function ($, weight) {
9+
], function ($, registry, weight) {
910
'use strict';
1011

1112
return {
@@ -30,6 +31,7 @@ define([
3031
this.type.current = this.$type.val();
3132

3233
this.bindAll();
34+
registry.set('typeSwitcher', this);
3335
},
3436

3537
/**

app/code/Magento/Catalog/view/adminhtml/web/js/custom-options.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,7 @@ define([
308308
*/
309309
_bindReadOnlyMode: function () {
310310
if (this.options.isReadonly) {
311-
$('div.product-custom-options').find('button,input,select,textarea,').each(function () {
311+
$('div.product-custom-options').find('button,input,select,textarea').each(function () {
312312
$(this).prop('disabled', true);
313313

314314
if ($(this).is('button')) {
@@ -339,7 +339,7 @@ define([
339339
checkbox: 'input[id$=_price_use_default]',
340340
label: 'span'
341341
});
342-
//@TODO not work set default value for second field
342+
// not work set default value for second field
343343
priceType.useDefault({
344344
field: '.field',
345345
useDefault: 'label[for$=_price]',

app/code/Magento/Checkout/view/frontend/web/js/model/shipping-rates-validator.js

Lines changed: 48 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ define(
1212
'../action/select-shipping-address',
1313
'./postcode-validator',
1414
'mage/translate',
15+
'uiRegistry',
1516
'Magento_Checkout/js/model/quote'
1617
],
1718
function (
@@ -22,14 +23,16 @@ define(
2223
selectShippingAddress,
2324
postcodeValidator,
2425
$t,
26+
uiRegistry,
2527
quote
2628
) {
2729
'use strict';
2830

2931
var checkoutConfig = window.checkoutConfig,
3032
validators = [],
3133
observedElements = [],
32-
postcodeElement = null;
34+
postcodeElement = null,
35+
postcodeElementName = 'postcode';
3336

3437
return {
3538
validateAddressTimeout: 0,
@@ -55,26 +58,57 @@ define(
5558
});
5659
},
5760

61+
/**
62+
* Perform postponed binding for fieldset elements
63+
*
64+
* @param {String} formPath
65+
*/
66+
initFields: function (formPath) {
67+
var self = this,
68+
elements = shippingRatesValidationRules.getObservableFields();
69+
70+
if ($.inArray(postcodeElementName, elements) === -1) {
71+
// Add postcode field to observables if not exist for zip code validation support
72+
elements.push(postcodeElementName);
73+
}
74+
75+
$.each(elements, function (index, field) {
76+
uiRegistry.async(formPath + '.' + field)(self.doElementBinding.bind(self));
77+
});
78+
},
79+
80+
/**
81+
* Bind shipping rates request to form element
82+
*
83+
* @param {Object} element
84+
* @param {Boolean} force
85+
* @param {Number} delay
86+
*/
87+
doElementBinding: function (element, force, delay) {
88+
var observableFields = shippingRatesValidationRules.getObservableFields();
89+
90+
if (element && (observableFields.indexOf(element.index) !== -1 || force)) {
91+
if (element.index !== postcodeElementName) {
92+
this.bindHandler(element, delay);
93+
}
94+
}
95+
96+
if (element.index === postcodeElementName) {
97+
this.bindHandler(element, delay);
98+
postcodeElement = element;
99+
}
100+
},
101+
58102
/**
59103
* @param {*} elements
60104
* @param {Boolean} force
61105
* @param {Number} delay
62106
*/
63107
bindChangeHandlers: function (elements, force, delay) {
64-
var self = this,
65-
observableFields = shippingRatesValidationRules.getObservableFields();
108+
var self = this;
66109

67110
$.each(elements, function (index, elem) {
68-
if (elem && (observableFields.indexOf(elem.index) != -1 || force)) {
69-
if (elem.index !== 'postcode') {
70-
self.bindHandler(elem, delay);
71-
}
72-
}
73-
74-
if (elem.index === 'postcode') {
75-
self.bindHandler(elem, delay);
76-
postcodeElement = elem;
77-
}
111+
self.doElementBinding(elem, force, delay);
78112
});
79113
},
80114

@@ -87,7 +121,7 @@ define(
87121

88122
delay = typeof delay === "undefined" ? self.validateDelay : delay;
89123

90-
if (element.component.indexOf('/group') != -1) {
124+
if (element.component.indexOf('/group') !== -1) {
91125
$.each(element.elems(), function (index, elem) {
92126
self.bindHandler(elem);
93127
});

app/code/Magento/Checkout/view/frontend/web/js/view/shipping.js

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,13 @@ define(
6969
quoteIsVirtual: quote.isVirtual(),
7070

7171
initialize: function () {
72-
var self = this;
72+
var self = this,
73+
hasNewAddress,
74+
fieldsetName = 'checkout.steps.shipping-step.shippingAddress.shipping-address-fieldset';
75+
7376
this._super();
77+
shippingRatesValidator.initFields(fieldsetName);
78+
7479
if (!quote.isVirtual()) {
7580
stepNavigator.registerStep(
7681
'shipping',
@@ -82,7 +87,7 @@ define(
8287
}
8388
checkoutDataResolver.resolveShippingAddress();
8489

85-
var hasNewAddress = addressList.some(function (address) {
90+
hasNewAddress = addressList.some(function (address) {
8691
return address.getType() == 'new-customer-address';
8792
});
8893

@@ -94,7 +99,7 @@ define(
9499
}
95100
});
96101

97-
quote.shippingMethod.subscribe(function (value) {
102+
quote.shippingMethod.subscribe(function () {
98103
self.errorValidationMessage(false);
99104
});
100105

@@ -118,13 +123,7 @@ define(
118123
//load data from server for shipping step
119124
},
120125

121-
initElement: function(element) {
122-
if (element.index === 'shipping-address-fieldset') {
123-
shippingRatesValidator.bindChangeHandlers(element.elems(), false);
124-
}
125-
},
126-
127-
getPopUp: function() {
126+
getPopUp: function () {
128127
var self = this;
129128
if (!popUp) {
130129
var buttons = this.popUpForm.options.buttons;

app/code/Magento/Cms/view/adminhtml/ui_component/cms_block_listing.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
<item name="url" xsi:type="string">*/*/new</item>
2121
</item>
2222
</item>
23+
<item name="acl" xsi:type="string">Magento_Cms::block</item>
2324
</argument>
2425
<dataSource name="cms_block_listing_data_source">
2526
<argument name="dataProvider" xsi:type="configurableObject">

app/code/Magento/Cms/view/adminhtml/ui_component/cms_page_listing.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
<item name="url" xsi:type="string">*/*/new</item>
2121
</item>
2222
</item>
23+
<item name="acl" xsi:type="string">Magento_Cms::page</item>
2324
</argument>
2425
<dataSource name="cms_page_listing_data_source">
2526
<argument name="dataProvider" xsi:type="configurableObject">

app/code/Magento/ConfigurableProduct/view/adminhtml/ui_component/configurable_associated_product_listing.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
<item name="deps" xsi:type="string">configurable_associated_product_listing.data_source</item>
1313
</item>
1414
<item name="spinner" xsi:type="string">product_columns</item>
15+
<item name="acl" xsi:type="string">Magento_Catalog::products</item>
1516
</argument>
1617
<dataSource name="data_source">
1718
<argument name="dataProvider" xsi:type="configurableObject">

app/code/Magento/ConfigurableProduct/view/adminhtml/ui_component/product_attributes_listing.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
<item name="deps" xsi:type="string">product_attributes_listing.product_attributes_listing_data_source</item>
1313
</item>
1414
<item name="spinner" xsi:type="string">product_attributes_columns</item>
15+
<item name="acl" xsi:type="string">Magento_Catalog::products</item>
1516
</argument>
1617
<dataSource name="product_attributes_listing_data_source">
1718
<argument name="dataProvider" xsi:type="configurableObject">

app/code/Magento/ConfigurableProduct/view/adminhtml/web/js/configurable-type-handler.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,6 @@ define([
9393
suggestContainer.removeClass('disabled').removeProp('disabled');
9494
$('#inventory_qty').removeProp('disabled');
9595
$('#inventory_stock_availability').prop('disabled', true);
96-
this._setElementDisabled($('#quantity_and_stock_status'), true, false);
9796
this._setElementDisabled($('#qty'), false, true);
9897
}
9998

app/code/Magento/ConfigurableProduct/view/adminhtml/web/js/variations/variations.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ define([
6767
*/
6868
initObservable: function () {
6969
var $form = $('[data-form="edit-product"]'),
70-
formSubmitHandlers = $form.data('events').submit,
70+
formSubmitHandlers,
7171
pagingObservables = {
7272
current: ko.getObservable(this.paging, 'current'),
7373
pageSize: ko.getObservable(this.paging, 'pageSize')
@@ -101,7 +101,12 @@ define([
101101
$form.validation('isValid');
102102
}
103103
}.bind(this));
104-
formSubmitHandlers.splice(0, 0, formSubmitHandlers.pop());
104+
105+
formSubmitHandlers = $form.data('events').submit || [];
106+
107+
if (formSubmitHandlers.length > 1) {
108+
formSubmitHandlers.unshift(formSubmitHandlers.pop());
109+
}
105110

106111
return this;
107112
},

0 commit comments

Comments
 (0)