Skip to content

Commit 9d231d1

Browse files
authored
Merge pull request #3861 from magento-arcticfoxes/2.3-develop-pr
[2.3-develop] Sync with 2.3.1-release
2 parents 8f737c0 + ba96c2b commit 9d231d1

File tree

58 files changed

+1174
-249
lines changed

Some content is hidden

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

58 files changed

+1174
-249
lines changed

app/code/Magento/AuthorizenetAcceptjs/etc/config.xml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,13 @@
77
-->
88
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Store:etc/config.xsd">
99
<default>
10+
<dev>
11+
<js>
12+
<minify_exclude>
13+
<authorizenet_acceptjs>\.authorize\.net/v1/Accept</authorizenet_acceptjs>
14+
</minify_exclude>
15+
</js>
16+
</dev>
1017
<payment>
1118
<authorizenet_acceptjs>
1219
<active>0</active>

app/code/Magento/AuthorizenetAcceptjs/view/base/requirejs-config.js

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,16 @@
44
*/
55

66
var config = {
7-
map: {
8-
'*': {
9-
acceptjssandbox: 'https://jstest.authorize.net/v1/Accept.js',
10-
acceptjs: 'https://js.authorize.net/v1/Accept.js'
7+
shim: {
8+
acceptjs: {
9+
exports: 'Accept'
10+
},
11+
acceptjssandbox: {
12+
exports: 'Accept'
1113
}
14+
},
15+
paths: {
16+
acceptjssandbox: 'https://jstest.authorize.net/v1/Accept',
17+
acceptjs: 'https://js.authorize.net/v1/Accept'
1218
}
1319
};

app/code/Magento/AuthorizenetAcceptjs/view/base/web/js/view/payment/acceptjs-factory.js

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ define([
1616
dependency = 'acceptjssandbox';
1717
}
1818

19-
require([dependency], function () {
19+
require([dependency], function (accept) {
2020
var $body = $('body');
2121

2222
/*
@@ -26,16 +26,7 @@ define([
2626
* Dynamically-loading-Accept-js-E-WC-03-Accept-js-is-not-loaded/td-p/63283
2727
*/
2828
$body.on('handshake.acceptjs', function () {
29-
/*
30-
* Accept.js doesn't return the library when loading
31-
* and requirejs "shim" can't be used because it only works with the "paths" config option
32-
* and we can't use "paths" because require will try to load ".min.js" in production
33-
* and that doesn't work because it doesn't exist
34-
* and we can't add a query string to force a URL because accept.js will reject it
35-
* and we can't include it locally because they check in the script before loading more scripts
36-
* So, we use the global version as "shim" would
37-
*/
38-
deferred.resolve(window.Accept);
29+
deferred.resolve(accept);
3930
$body.off('handshake.acceptjs');
4031
});
4132
},

app/code/Magento/Catalog/Model/CategoryList.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,11 +76,10 @@ public function getList(SearchCriteriaInterface $searchCriteria)
7676
$this->extensionAttributesJoinProcessor->process($collection);
7777

7878
$this->collectionProcessor->process($searchCriteria, $collection);
79-
$collection->load();
8079

8180
$items = [];
82-
foreach ($collection->getItems() as $category) {
83-
$items[] = $this->categoryRepository->get($category->getId());
81+
foreach ($collection->getAllIds() as $id) {
82+
$items[] = $this->categoryRepository->get($id);
8483
}
8584

8685
/** @var CategorySearchResultsInterface $searchResult */

app/code/Magento/Catalog/Test/Mftf/Section/AdminProductFormSection.xml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,24 +13,31 @@
1313
<element name="attributeSetFilterResult" type="input" selector="div[data-index='attribute_set_id'] .action-menu-item._last" timeout="30"/>
1414
<element name="attributeSetFilterResultByName" type="text" selector="//label/span[text() = '{{var}}']" timeout="30" parameterized="true"/>
1515
<element name="productName" type="input" selector=".admin__field[data-index=name] input"/>
16+
<element name="productNameDisabled" type="input" selector=".admin__field[data-index=name] input[disabled=true]"/>
1617
<element name="RequiredNameIndicator" type="text" selector=" return window.getComputedStyle(document.querySelector('._required[data-index=name]&gt;.admin__field-label span'), ':after').getPropertyValue('content');"/>
1718
<element name="RequiredSkuIndicator" type="text" selector=" return window.getComputedStyle(document.querySelector('._required[data-index=sku]&gt;.admin__field-label span'), ':after').getPropertyValue('content');"/>
1819
<element name="productSku" type="input" selector=".admin__field[data-index=sku] input"/>
20+
<element name="productSkuDisabled" type="input" selector=".admin__field[data-index=sku] input[disabled=true]"/>
1921
<element name="enableProductAttributeLabel" type="text" selector="//span[text()='Enable Product']/parent::label"/>
2022
<element name="enableProductAttributeLabelWrapper" type="text" selector="//span[text()='Enable Product']/parent::label/parent::div"/>
2123
<element name="productStatus" type="checkbox" selector="input[name='product[status]']"/>
24+
<element name="productStatusDisabled" type="checkbox" selector="input[name='product[status]'][disabled]"/>
2225
<element name="enableProductLabel" type="checkbox" selector="input[name='product[status]']+label"/>
2326
<element name="productStatusUseDefault" type="checkbox" selector="input[name='use_default[status]']"/>
2427
<element name="productNameUseDefault" type="checkbox" selector="input[name='use_default[name]']"/>
2528
<element name="productPrice" type="input" selector=".admin__field[data-index=price] input"/>
29+
<element name="productPriceDisabled" type="input" selector=".admin__field[data-index=price] input[disabled=true]"/>
30+
<element name="productPriceUseDefault" type="checkbox" selector=".admin__field[data-index=price] [name='use_default[price]']"/>
2631
<element name="productTaxClass" type="select" selector="//*[@name='product[tax_class_id]']"/>
32+
<element name="productTaxClassDisabled" type="select" selector="select[name='product[tax_class_id]'][disabled=true]"/>
2733
<element name="productTaxClassUseDefault" type="checkbox" selector="input[name='use_default[tax_class_id]']"/>
2834
<element name="advancedPricingLink" type="button" selector="button[data-index='advanced_pricing_button']" timeout="30"/>
2935
<element name="categoriesDropdown" type="multiselect" selector="div[data-index='category_ids']"/>
3036
<element name="unselectCategories" type="button" selector="//span[@class='admin__action-multiselect-crumb']/span[contains(.,'{{category}}')]/../button[@data-action='remove-selected-item']" parameterized="true" timeout="30"/>
3137
<element name="productQuantity" type="input" selector=".admin__field[data-index=qty] input"/>
3238
<element name="advancedInventoryLink" type="button" selector="//button[contains(@data-index, 'advanced_inventory_button')]" timeout="30"/>
3339
<element name="productStockStatus" type="select" selector="select[name='product[quantity_and_stock_status][is_in_stock]']"/>
40+
<element name="productStockStatusDisabled" type="select" selector="select[name='product[quantity_and_stock_status][is_in_stock]'][disabled=true]"/>
3441
<element name="stockStatus" type="select" selector="[data-index='product-details'] select[name='product[quantity_and_stock_status][is_in_stock]']"/>
3542
<element name="productWeight" type="input" selector=".admin__field[data-index=weight] input"/>
3643
<element name="productWeightSelect" type="select" selector="select[name='product[product_has_weight]']"/>
@@ -48,6 +55,7 @@
4855
<element name="productFormTab" type="button" selector="//strong[@class='admin__collapsible-title']/span[contains(text(), '{{tabName}}')]" parameterized="true"/>
4956
<element name="productFormTabState" type="text" selector="//strong[@class='admin__collapsible-title']/span[contains(text(), '{{tabName}}')]/parent::*/parent::*[@data-state-collapsible='{{state}}']" parameterized="true"/>
5057
<element name="visibility" type="select" selector="//select[@name='product[visibility]']"/>
58+
<element name="visibilityDisabled" type="select" selector="select[name='product[visibility]'][disabled=true]"/>
5159
<element name="visibilityUseDefault" type="checkbox" selector="//input[@name='use_default[visibility]']"/>
5260
<element name="divByDataIndex" type="input" selector="div[data-index='{{var}}']" parameterized="true"/>
5361
<element name="setProductAsNewFrom" type="input" selector="input[name='product[news_from_date]']"/>

app/code/Magento/Catalog/Test/Unit/Model/CategoryListTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ public function testGetList()
9393

9494
$collection = $this->getMockBuilder(Collection::class)->disableOriginalConstructor()->getMock();
9595
$collection->expects($this->once())->method('getSize')->willReturn($totalCount);
96-
$collection->expects($this->once())->method('getItems')->willReturn([$categoryFirst, $categorySecond]);
96+
$collection->expects($this->once())->method('getAllIds')->willReturn([$categoryIdFirst, $categoryIdSecond]);
9797

9898
$this->collectionProcessorMock->expects($this->once())
9999
->method('process')

app/code/Magento/CatalogGraphQl/Model/Resolver/Products.php

Lines changed: 2 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77

88
namespace Magento\CatalogGraphQl\Model\Resolver;
99

10-
use Magento\Framework\Exception\InputException;
1110
use Magento\Framework\GraphQl\Schema\Type\ResolveInfo;
1211
use Magento\CatalogGraphQl\Model\Resolver\Products\Query\Filter;
1312
use Magento\CatalogGraphQl\Model\Resolver\Products\Query\Search;
@@ -17,7 +16,6 @@
1716
use Magento\Framework\GraphQl\Query\Resolver\Argument\SearchCriteria\SearchFilter;
1817
use Magento\Framework\GraphQl\Query\ResolverInterface;
1918
use Magento\Catalog\Model\Layer\Resolver;
20-
use Magento\Framework\Api\Search\SearchCriteriaInterface;
2119

2220
/**
2321
* Products field resolver, used for GraphQL request processing.
@@ -82,10 +80,10 @@ public function resolve(
8280
} elseif (isset($args['search'])) {
8381
$layerType = Resolver::CATALOG_LAYER_SEARCH;
8482
$this->searchFilter->add($args['search'], $searchCriteria);
85-
$searchResult = $this->getSearchResult($this->searchQuery, $searchCriteria, $info);
83+
$searchResult = $this->searchQuery->getResult($searchCriteria, $info);
8684
} else {
8785
$layerType = Resolver::CATALOG_LAYER_CATEGORY;
88-
$searchResult = $this->getSearchResult($this->filterQuery, $searchCriteria, $info);
86+
$searchResult = $this->filterQuery->getResult($searchCriteria, $info);
8987
}
9088
//possible division by 0
9189
if ($searchCriteria->getPageSize()) {
@@ -117,25 +115,4 @@ public function resolve(
117115

118116
return $data;
119117
}
120-
121-
/**
122-
* Get search result.
123-
*
124-
* @param Filter|Search $query
125-
* @param SearchCriteriaInterface $searchCriteria
126-
* @param ResolveInfo $info
127-
*
128-
* @return \Magento\CatalogGraphQl\Model\Resolver\Products\SearchResult
129-
* @throws GraphQlInputException
130-
*/
131-
private function getSearchResult($query, SearchCriteriaInterface $searchCriteria, ResolveInfo $info)
132-
{
133-
try {
134-
$searchResult = $query->getResult($searchCriteria, $info);
135-
} catch (InputException $e) {
136-
throw new GraphQlInputException(__($e->getMessage()));
137-
}
138-
139-
return $searchResult;
140-
}
141118
}

app/code/Magento/Checkout/Test/Mftf/ActionGroup/StorefrontMiniCartActionGroup.xml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,4 +35,11 @@
3535
<click selector="{{StoreFrontRemoveItemModalSection.ok}}" stepKey="confirmDelete"/>
3636
<waitForPageLoad stepKey="waitForDeleteToFinish"/>
3737
</actionGroup>
38+
39+
<!--Check that the minicart is empty-->
40+
<actionGroup name="assertMiniCartEmpty">
41+
<dontSeeElement selector="{{StorefrontMinicartSection.productCount}}" stepKey="dontSeeMinicartProductCount"/>
42+
<click selector="{{StorefrontMinicartSection.showCart}}" stepKey="expandMinicart"/>
43+
<see selector="{{StorefrontMinicartSection.minicartContent}}" userInput="You have no items in your shopping cart." stepKey="seeEmptyCartMessage"/>
44+
</actionGroup>
3845
</actionGroups>

app/code/Magento/Config/Model/Config.php

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -525,24 +525,29 @@ public function setDataByPath($path, $value)
525525
if ($path === '') {
526526
throw new \UnexpectedValueException('Path must not be empty');
527527
}
528+
528529
$pathParts = explode('/', $path);
529530
$keyDepth = count($pathParts);
530-
if ($keyDepth !== 3) {
531+
if ($keyDepth < 3) {
531532
throw new \UnexpectedValueException(
532-
"Allowed depth of configuration is 3 (<section>/<group>/<field>). Your configuration depth is "
533-
. $keyDepth . " for path '$path'"
533+
'Minimal depth of configuration is 3. Your configuration depth is ' . $keyDepth
534534
);
535535
}
536+
537+
$section = array_shift($pathParts);
536538
$data = [
537-
'section' => $pathParts[0],
538-
'groups' => [
539-
$pathParts[1] => [
540-
'fields' => [
541-
$pathParts[2] => ['value' => $value],
542-
],
543-
],
539+
'fields' => [
540+
array_pop($pathParts) => ['value' => $value],
544541
],
545542
];
543+
while ($pathParts) {
544+
$data = [
545+
'groups' => [
546+
array_pop($pathParts) => $data,
547+
],
548+
];
549+
}
550+
$data['section'] = $section;
546551
$this->addData($data);
547552
}
548553

app/code/Magento/Config/Test/Unit/Model/ConfigTest.php

Lines changed: 54 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -330,22 +330,59 @@ public function testSaveToCheckScopeDataSet()
330330
$this->model->save();
331331
}
332332

333-
public function testSetDataByPath()
333+
/**
334+
* @param string $path
335+
* @param string $value
336+
* @param string $section
337+
* @param array $groups
338+
* @dataProvider setDataByPathDataProvider
339+
*/
340+
public function testSetDataByPath(string $path, string $value, string $section, array $groups)
334341
{
335-
$value = 'value';
336-
$path = '<section>/<group>/<field>';
337342
$this->model->setDataByPath($path, $value);
338-
$expected = [
339-
'section' => '<section>',
340-
'groups' => [
341-
'<group>' => [
342-
'fields' => [
343-
'<field>' => ['value' => $value],
343+
$this->assertEquals($section, $this->model->getData('section'));
344+
$this->assertEquals($groups, $this->model->getData('groups'));
345+
}
346+
347+
/**
348+
* @return array
349+
*/
350+
public function setDataByPathDataProvider(): array
351+
{
352+
return [
353+
'depth 3' => [
354+
'a/b/c',
355+
'value1',
356+
'a',
357+
[
358+
'b' => [
359+
'fields' => [
360+
'c' => ['value' => 'value1'],
361+
],
362+
],
363+
],
364+
],
365+
'depth 5' => [
366+
'a/b/c/d/e',
367+
'value1',
368+
'a',
369+
[
370+
'b' => [
371+
'groups' => [
372+
'c' => [
373+
'groups' => [
374+
'd' => [
375+
'fields' => [
376+
'e' => ['value' => 'value1'],
377+
],
378+
],
379+
],
380+
],
381+
],
344382
],
345383
],
346384
],
347385
];
348-
$this->assertSame($expected, $this->model->getData());
349386
}
350387

351388
/**
@@ -359,14 +396,13 @@ public function testSetDataByPathEmpty()
359396

360397
/**
361398
* @param string $path
362-
* @param string $expectedException
363-
*
364399
* @dataProvider setDataByPathWrongDepthDataProvider
365400
*/
366-
public function testSetDataByPathWrongDepth($path, $expectedException)
401+
public function testSetDataByPathWrongDepth(string $path)
367402
{
368-
$expectedException = 'Allowed depth of configuration is 3 (<section>/<group>/<field>). ' . $expectedException;
369-
$this->expectException('\UnexpectedValueException');
403+
$currentDepth = count(explode('/', $path));
404+
$expectedException = 'Minimal depth of configuration is 3. Your configuration depth is ' . $currentDepth;
405+
$this->expectException(\UnexpectedValueException::class);
370406
$this->expectExceptionMessage($expectedException);
371407
$value = 'value';
372408
$this->model->setDataByPath($path, $value);
@@ -375,13 +411,11 @@ public function testSetDataByPathWrongDepth($path, $expectedException)
375411
/**
376412
* @return array
377413
*/
378-
public function setDataByPathWrongDepthDataProvider()
414+
public function setDataByPathWrongDepthDataProvider(): array
379415
{
380416
return [
381-
'depth 2' => ['section/group', "Your configuration depth is 2 for path 'section/group'"],
382-
'depth 1' => ['section', "Your configuration depth is 1 for path 'section'"],
383-
'depth 4' => ['section/group/field/sub-field', "Your configuration depth is 4 for path"
384-
. " 'section/group/field/sub-field'", ],
417+
'depth 2' => ['section/group'],
418+
'depth 1' => ['section'],
385419
];
386420
}
387421
}

app/code/Magento/ConfigurableImportExport/etc/module.xml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@
66
*/
77
-->
88
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
9-
<module name="Magento_ConfigurableImportExport" >
9+
<module name="Magento_ConfigurableImportExport">
10+
<sequence>
11+
<module name="Magento_ConfigurableProduct"/>
12+
</sequence>
1013
</module>
1114
</config>

app/code/Magento/ConfigurableProduct/view/adminhtml/web/js/components/price-configurable.js

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,6 @@ define([
1111

1212
return Abstract.extend({
1313
defaults: {
14-
listens: {
15-
isConfigurable: 'handlePriceValue'
16-
},
1714
imports: {
1815
isConfigurable: '!ns = ${ $.ns }, index = configurable-matrix:isEmpty'
1916
},
@@ -22,12 +19,15 @@ define([
2219
}
2320
},
2421

25-
/**
26-
* Invokes initialize method of parent class,
27-
* contains initialization logic
28-
*/
22+
/** @inheritdoc */
2923
initialize: function () {
3024
this._super();
25+
// resolve initial disable state
26+
this.handlePriceValue(this.isConfigurable);
27+
// add listener to track "configurable" type
28+
this.setListeners({
29+
isConfigurable: 'handlePriceValue'
30+
});
3131

3232
return this;
3333
},
@@ -50,11 +50,10 @@ define([
5050
* @param {String} isConfigurable
5151
*/
5252
handlePriceValue: function (isConfigurable) {
53+
this.disabled(!!this.isUseDefault() || isConfigurable);
54+
5355
if (isConfigurable) {
54-
this.disable();
5556
this.clear();
56-
} else {
57-
this.enable();
5857
}
5958
}
6059
});

0 commit comments

Comments
 (0)