Skip to content

Commit 5d6896b

Browse files
committed
Merge remote-tracking branch 'origin/2.3-develop' into MAGETWO-88814
2 parents 875b18e + bed17e0 commit 5d6896b

File tree

250 files changed

+5709
-1615
lines changed

Some content is hidden

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

250 files changed

+5709
-1615
lines changed

.github/ISSUE_TEMPLATE.md

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,35 @@
1-
<!--- Provide a general summary of the issue in the Title above -->
2-
<!--- Before adding new issues, please, check this article https://github.com/magento/magento2/wiki/Issue-reporting-guidelines-->
1+
<!---
2+
Thank you for contributing to Magento.
3+
To help us process this issue we recommend that you add the following information:
4+
- Summary of the issue,
5+
- Information on your environment,
6+
- Steps to reproduce,
7+
- Expected and actual results,
8+
9+
Please also have a look at our guidelines article before adding a new issue https://github.com/magento/magento2/wiki/Issue-reporting-guidelines
10+
-->
311

412
### Preconditions
5-
<!--- Provide a more detailed information of environment you use -->
6-
<!--- Magento version, tag, HEAD, etc., PHP & MySQL version, etc.. -->
13+
<!---
14+
Please provide as detailed information about your environment as possible.
15+
For example Magento version, tag, HEAD, PHP & MySQL version, etc..
16+
-->
717
1.
818
2.
919

1020
### Steps to reproduce
11-
<!--- Provide a set of unambiguous steps to reproduce this bug include code, if relevant -->
21+
<!---
22+
It is important to provide a set of clear steps to reproduce this bug.
23+
If relevant please include code samples
24+
-->
1225
1.
1326
2.
1427
3.
1528

1629
### Expected result
1730
<!--- Tell us what should happen -->
18-
1.
31+
1. [Screenshots, logs or description]
1932

2033
### Actual result
2134
<!--- Tell us what happens instead -->
22-
1. [Screenshot, logs]
23-
24-
<!--- (This may be platform independent comment) -->
35+
1. [Screenshots, logs or description]

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,32 @@
1-
<!--- Provide a general summary of the Pull Request in the Title above -->
1+
<!---
2+
Thank you for contributing to Magento.
3+
To help us process this pull request we recommend that you add the following information:
4+
- Summary of the pull request,
5+
- Issue(s) related to the changes made,
6+
- Manual testing scenarios,
7+
-->
8+
9+
<!--- Please provide a general summary of the Pull Request in the Title above -->
210

311
### Description
4-
<!--- Provide a description of the changes proposed in the pull request -->
12+
<!---
13+
Please provide a description of the changes proposed in the pull request.
14+
Letting us know what has changed and why it needed changing will help us validate this pull request.
15+
-->
516

617
### Fixed Issues (if relevant)
7-
<!--- Provide a list of fixed issues in the format magento/magento2#<issue_number>, if relevant -->
18+
<!---
19+
If relevant, please provide a list of fixed issues in the format magento/magento2#<issue_number>.
20+
There could be 1 or more issues linked here and it will help us find some more information about the reasoning behind this change.
21+
-->
822
1. magento/magento2#<issue_number>: Issue title
923
2. ...
1024

1125
### Manual testing scenarios
12-
<!--- Provide a set of unambiguous steps to test the proposed code change -->
26+
<!---
27+
Please provide a set of unambiguous steps to test the proposed code change.
28+
Giving us manual testing scenarios will help with the processing and validation process.
29+
-->
1330
1. ...
1431
2. ...
1532

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/Braintree/etc/di.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -447,7 +447,7 @@
447447
<!-- PayPal value handlers infrastructure -->
448448
<type name="Magento\Braintree\Gateway\Response\PayPal\VaultDetailsHandler">
449449
<arguments>
450-
<argument name="paymentTokenFactory" xsi:type="object">Magento\Vault\Model\AccountPaymentTokenFactory</argument>
450+
<argument name="paymentTokenFactory" xsi:type="object">Magento\Vault\Api\Data\PaymentTokenFactoryInterface</argument>
451451
</arguments>
452452
</type>
453453
<virtualType name="BraintreePayPalValueHandlerPool" type="Magento\Payment\Gateway\Config\ValueHandlerPool">

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) {

0 commit comments

Comments
 (0)