Skip to content

Commit 7a947fc

Browse files
committed
Merge remote-tracking branch 'origin/2.3-develop' into GraphQL-458
2 parents f40faed + 9d231d1 commit 7a947fc

File tree

81 files changed

+1286
-306
lines changed

Some content is hidden

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

81 files changed

+1286
-306
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/Api/ProductRenderListInterface.php

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,22 @@
44
* Copyright © Magento, Inc. All rights reserved.
55
* See COPYING.txt for license details.
66
*/
7+
78
namespace Magento\Catalog\Api;
89

910
/**
10-
* Interface which provides product renders information for products
11+
* Interface which provides product renders information for products.
12+
*
1113
* @api
1214
* @since 101.1.0
1315
*/
1416
interface ProductRenderListInterface
1517
{
1618
/**
17-
* Collect and retrieve the list of product render info
18-
* This info contains raw prices and formated prices, product name, stock status, store_id, etc
19+
* Collect and retrieve the list of product render info.
20+
*
21+
* This info contains raw prices and formatted prices, product name, stock status, store_id, etc.
22+
*
1923
* @see \Magento\Catalog\Api\Data\ProductRenderInfoDtoInterface
2024
*
2125
* @param \Magento\Framework\Api\SearchCriteriaInterface $searchCriteria

app/code/Magento/Catalog/Block/Product/View/Options/AbstractOptions.php

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,14 @@
99
*
1010
* @author Magento Core Team <[email protected]>
1111
*/
12+
1213
namespace Magento\Catalog\Block\Product\View\Options;
1314

1415
use Magento\Catalog\Pricing\Price\CustomOptionPriceInterface;
1516

1617
/**
18+
* Product aoptions section abstract block.
19+
*
1720
* @api
1821
* @since 100.0.2
1922
*/
@@ -46,7 +49,7 @@ abstract class AbstractOptions extends \Magento\Framework\View\Element\Template
4649
/**
4750
* @param \Magento\Framework\View\Element\Template\Context $context
4851
* @param \Magento\Framework\Pricing\Helper\Data $pricingHelper
49-
* @param \Magento\Catalog\Helper\Data $catalogData,
52+
* @param \Magento\Catalog\Helper\Data $catalogData
5053
* @param array $data
5154
*/
5255
public function __construct(
@@ -123,6 +126,8 @@ public function getFormattedPrice()
123126
}
124127

125128
/**
129+
* Retrieve formatted price.
130+
*
126131
* @return string
127132
*
128133
* @deprecated
@@ -134,7 +139,7 @@ public function getFormatedPrice()
134139
}
135140

136141
/**
137-
* Return formated price
142+
* Return formatted price
138143
*
139144
* @param array $value
140145
* @param bool $flag

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/Block/Cart/Totals.php

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,15 @@
33
* Copyright © Magento, Inc. All rights reserved.
44
* See COPYING.txt for license details.
55
*/
6+
67
namespace Magento\Checkout\Block\Cart;
78

89
use Magento\Framework\View\Element\BlockInterface;
910
use Magento\Checkout\Block\Checkout\LayoutProcessorInterface;
1011

1112
/**
13+
* Totals cart block.
14+
*
1215
* @api
1316
*/
1417
class Totals extends \Magento\Checkout\Block\Cart\AbstractCart
@@ -62,6 +65,8 @@ public function __construct(
6265
}
6366

6467
/**
68+
* Retrieve encoded js layout.
69+
*
6570
* @return string
6671
*/
6772
public function getJsLayout()
@@ -74,6 +79,8 @@ public function getJsLayout()
7479
}
7580

7681
/**
82+
* Retrieve totals from cache.
83+
*
7784
* @return array
7885
*/
7986
public function getTotals()
@@ -85,6 +92,8 @@ public function getTotals()
8592
}
8693

8794
/**
95+
* Set totals to cache.
96+
*
8897
* @param array $value
8998
* @return $this
9099
* @codeCoverageIgnore
@@ -96,6 +105,8 @@ public function setTotals($value)
96105
}
97106

98107
/**
108+
* Create totals block and set totals.
109+
*
99110
* @param string $code
100111
* @return BlockInterface
101112
*/
@@ -121,6 +132,8 @@ protected function _getTotalRenderer($code)
121132
}
122133

123134
/**
135+
* Get totals html.
136+
*
124137
* @param mixed $total
125138
* @param int|null $area
126139
* @param int $colspan
@@ -177,7 +190,7 @@ public function needDisplayBaseGrandtotal()
177190
}
178191

179192
/**
180-
* Get formated in base currency base grand total value
193+
* Get formatted in base currency base grand total value
181194
*
182195
* @return string
183196
*/

0 commit comments

Comments
 (0)