Skip to content

Commit eb63965

Browse files
committed
Merge remote-tracking branch 'origin/2.3-develop' into RE-develop
2 parents 9ec4258 + d83f3f5 commit eb63965

File tree

141 files changed

+2831
-1357
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

+2831
-1357
lines changed

.github/ISSUE_TEMPLATE.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@
2828

2929
### Expected result
3030
<!--- Tell us what should happen -->
31-
1. [Screenshot, logs]
31+
1. [Screenshots, logs or description]
3232

3333
### Actual result
3434
<!--- Tell us what happens instead -->
35-
1. [Screenshot, logs]
35+
1. [Screenshots, logs or description]

app/code/Magento/Backend/etc/adminhtml/di.xml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -145,9 +145,6 @@
145145
<item name="dev" xsi:type="const">Magento\Config\Model\Config\Structure\ElementVisibilityInterface::HIDDEN</item>
146146
<item name="general/locale/code" xsi:type="const">Magento\Config\Model\Config\Structure\ElementVisibilityInterface::DISABLED</item>
147147
</argument>
148-
<argument name="exemptions" xsi:type="array">
149-
<item name="dev/debug/debug_logging" xsi:type="string"/>
150-
</argument>
151148
</arguments>
152149
</type>
153150
<type name="Magento\Backend\Model\Search\Config\Result\Builder">

app/code/Magento/Braintree/Test/Unit/Gateway/Response/PayPal/VaultDetailsHandlerTest.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ protected function setUp()
8888

8989
$this->paymentInfoMock = $this->getMockBuilder(Payment::class)
9090
->disableOriginalConstructor()
91-
->setMethods(['__wakeup'])
91+
->setMethods(['__wakeup', 'getExtensionAttributes'])
9292
->getMock();
9393

9494
$this->paymentTokenMock = $objectManager->getObject(PaymentToken::class);
@@ -107,6 +107,10 @@ protected function setUp()
107107
->setMethods(['create'])
108108
->getMock();
109109

110+
$this->paymentInfoMock->expects(self::any())
111+
->method('getExtensionAttributes')
112+
->willReturn($this->paymentExtensionMock);
113+
110114
$this->subject = [
111115
'payment' => $this->paymentDataObjectMock,
112116
];
@@ -184,7 +188,7 @@ public function testHandleWithoutToken()
184188
->method('create');
185189

186190
$this->handler->handle($this->subject, $response);
187-
self::assertNull($this->paymentInfoMock->getExtensionAttributes());
191+
self::assertNotNull($this->paymentInfoMock->getExtensionAttributes());
188192
}
189193

190194
/**

app/code/Magento/Braintree/Test/Unit/Gateway/Response/VaultDetailsHandlerTest.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,9 +80,11 @@ protected function setUp()
8080

8181
$this->payment = $this->getMockBuilder(Payment::class)
8282
->disableOriginalConstructor()
83-
->setMethods(['__wakeup'])
83+
->setMethods(['__wakeup', 'getExtensionAttributes'])
8484
->getMock();
8585

86+
$this->payment->expects(self::any())->method('getExtensionAttributes')->willReturn($this->paymentExtension);
87+
8688
$config = $this->getConfigMock();
8789

8890
$this->paymentHandler = new VaultDetailsHandler(

app/code/Magento/Braintree/Test/Unit/Model/Paypal/Helper/QuoteUpdaterTest.php

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
use Magento\Braintree\Observer\DataAssignObserver;
1414
use Magento\Braintree\Gateway\Config\PayPal\Config;
1515
use Magento\Braintree\Model\Paypal\Helper\QuoteUpdater;
16+
use Magento\Quote\Api\Data\CartExtensionInterface;
1617

1718
/**
1819
* Class QuoteUpdaterTest
@@ -281,7 +282,7 @@ private function updateQuoteStep(\PHPUnit_Framework_MockObject_MockObject $quote
281282
*/
282283
private function getQuoteMock()
283284
{
284-
return $this->getMockBuilder(Quote::class)
285+
$quoteMock = $this->getMockBuilder(Quote::class)
285286
->setMethods(
286287
[
287288
'getIsVirtual',
@@ -291,9 +292,21 @@ private function getQuoteMock()
291292
'collectTotals',
292293
'getShippingAddress',
293294
'getBillingAddress',
295+
'getExtensionAttributes'
294296
]
295297
)->disableOriginalConstructor()
296298
->getMock();
299+
300+
$cartExtensionMock = $this->getMockBuilder(CartExtensionInterface::class)
301+
->setMethods(['setShippingAssignments'])
302+
->disableOriginalConstructor()
303+
->getMock();
304+
305+
$quoteMock->expects(self::any())
306+
->method('getExtensionAttributes')
307+
->willReturn($cartExtensionMock);
308+
309+
return $quoteMock;
297310
}
298311

299312
/**

app/code/Magento/Bundle/Ui/DataProvider/Product/Form/Modifier/BundlePanel.php

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,8 @@ protected function getBundleOptions()
314314
'template' => 'ui/dynamic-rows/templates/collapsible',
315315
'additionalClasses' => 'admin__field-wide',
316316
'dataScope' => 'data.bundle_options',
317-
'bundleSelectionsName' => 'product_bundle_container.bundle_selections'
317+
'isDefaultFieldScope' => 'is_default',
318+
'bundleSelectionsName' => 'product_bundle_container.bundle_selections',
318319
],
319320
],
320321
],
@@ -378,7 +379,10 @@ protected function getBundleOptions()
378379
'selection_qty' => '',
379380
],
380381
'links' => ['insertData' => '${ $.provider }:${ $.dataProvider }'],
381-
'source' => 'product'
382+
'imports' => [
383+
'inputType' => '${$.provider}:${$.dataScope}.type',
384+
],
385+
'source' => 'product',
382386
],
383387
],
384388
],
@@ -594,11 +598,14 @@ protected function getBundleSelections()
594598
'config' => [
595599
'componentType' => Container::NAME,
596600
'isTemplate' => true,
597-
'component' => 'Magento_Bundle/js/components/bundle-record',
601+
'component' => 'Magento_Ui/js/dynamic-rows/record',
598602
'is_collection' => true,
599603
'imports' => [
600-
'onTypeChanged' => '${ $.provider }:${ $.bundleOptionsDataScope }.type'
601-
]
604+
'inputType' => '${$.parentName}:inputType',
605+
],
606+
'exports' => [
607+
'isDefaultValue' => '${$.parentName}:isDefaultValue.${$.index}',
608+
],
602609
],
603610
],
604611
],
@@ -691,11 +698,15 @@ protected function getBundleSelections()
691698
'componentType' => Form\Field::NAME,
692699
'formElement' => Form\Element\Checkbox::NAME,
693700
'dataType' => Form\Element\DataType\Price::NAME,
701+
'component' => 'Magento_Bundle/js/components/bundle-user-defined-checkbox',
694702
'label' => __('User Defined'),
695703
'dataScope' => 'selection_can_change_qty',
696704
'value' => '1',
697705
'valueMap' => ['true' => '1', 'false' => '0'],
698706
'sortOrder' => 110,
707+
'imports' => [
708+
'inputType' => '${$.parentName}:inputType',
709+
],
699710
],
700711
],
701712
],

app/code/Magento/Bundle/view/adminhtml/web/js/components/bundle-checkbox.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,10 @@ define([
1414
clearing: false,
1515
parentContainer: '',
1616
parentSelections: '',
17-
changer: ''
17+
changer: '',
18+
exports: {
19+
value: '${$.parentName}:isDefaultValue'
20+
}
1821
},
1922

2023
/**
@@ -58,10 +61,6 @@ define([
5861

5962
this.prefer = typeMap[type];
6063
this.elementTmpl(this.templates[typeMap[type]]);
61-
62-
if (this.prefer === 'radio' && this.checked()) {
63-
this.clearValues();
64-
}
6564
},
6665

6766
/**

app/code/Magento/Bundle/view/adminhtml/web/js/components/bundle-dynamic-rows-grid.js

Lines changed: 51 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,57 @@ define([
1414
label: '',
1515
columnsHeader: false,
1616
columnsHeaderAfterRender: true,
17-
addButton: false
17+
addButton: false,
18+
isDefaultFieldScope: 'is_default',
19+
defaultRecords: {
20+
use: [],
21+
moreThanOne: false,
22+
state: {}
23+
},
24+
listens: {
25+
inputType: 'onInputTypeChange',
26+
isDefaultValue: 'onIsDefaultValue'
27+
}
28+
},
29+
30+
/**
31+
* Handler for type select.
32+
*
33+
* @param {String} inputType - changed.
34+
*/
35+
onInputTypeChange: function (inputType) {
36+
if (this.defaultRecords.moreThanOne && (inputType === 'radio' || inputType === 'select')) {
37+
_.each(this.defaultRecords.use, function (index, counter) {
38+
this.source.set(
39+
this.dataScope + '.bundle_selections.' + index + '.' + this.isDefaultFieldScope,
40+
counter ? '0' : '1'
41+
);
42+
}.bind(this));
43+
}
44+
},
45+
46+
/**
47+
* Handler for is_default field.
48+
*
49+
* @param {Object} data - changed data.
50+
*/
51+
onIsDefaultValue: function (data) {
52+
var cb,
53+
use = 0;
54+
55+
this.defaultRecords.use = [];
56+
57+
cb = function (elem, key) {
58+
59+
if (~~elem) {
60+
this.defaultRecords.use.push(key);
61+
use++;
62+
}
63+
64+
this.defaultRecords.moreThanOne = use > 1;
65+
}.bind(this);
66+
67+
_.each(data, cb);
1868
},
1969

2070
/**
@@ -29,7 +79,6 @@ define([
2979
recordIndex;
3080

3181
this.parsePagesData(data);
32-
this.templates.record.bundleOptionsDataScope = this.dataScope;
3382

3483
if (newData.length) {
3584
if (this.insertData().length) {
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
/**
2+
* Copyright © Magento, Inc. All rights reserved.
3+
* See COPYING.txt for license details.
4+
*/
5+
6+
define([
7+
'Magento_Ui/js/form/element/single-checkbox'
8+
], function (Checkbox) {
9+
'use strict';
10+
11+
return Checkbox.extend({
12+
defaults: {
13+
listens: {
14+
inputType: 'onInputTypeChange'
15+
}
16+
},
17+
18+
/**
19+
* Handler for "inputType" property
20+
*
21+
* @param {String} data
22+
*/
23+
onInputTypeChange: function (data) {
24+
data === 'checkbox' || data === 'multi' ?
25+
this.clear()
26+
.visible(false) :
27+
this.visible(true);
28+
}
29+
});
30+
});

app/code/Magento/Catalog/Block/Product/Compare/ListCompare.php

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,22 @@ public function getProductAttributeValue($product, $attribute)
213213
return (string)$value == '' ? __('No') : $value;
214214
}
215215

216+
/**
217+
* Check if any of the products has a value set for the attribute
218+
*
219+
* @param \Magento\Catalog\Model\ResourceModel\Eav\Attribute $attribute
220+
* @return bool
221+
*/
222+
public function hasAttributeValueForProducts($attribute)
223+
{
224+
foreach ($this->getItems() as $item) {
225+
if ($item->hasData($attribute->getAttributeCode())) {
226+
return true;
227+
}
228+
}
229+
return false;
230+
}
231+
216232
/**
217233
* Retrieve Print URL
218234
*

0 commit comments

Comments
 (0)