Skip to content

Commit 2c2926d

Browse files
Merge branch '2.4-develop' into mftf-use-action-group-click-done-button
2 parents 62bcfd7 + 25772e6 commit 2c2926d

File tree

82 files changed

+3303
-122
lines changed

Some content is hidden

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

82 files changed

+3303
-122
lines changed

app/code/Magento/AsynchronousOperations/Model/MassConsumer.php

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,11 +69,19 @@ public function process($maxNumberOfMessages = null)
6969
$this->registry->register('isSecureArea', true, true);
7070

7171
$queue = $this->configuration->getQueue();
72+
$maxIdleTime = $this->configuration->getMaxIdleTime();
73+
$sleep = $this->configuration->getSleep();
7274

7375
if (!isset($maxNumberOfMessages)) {
7476
$queue->subscribe($this->getTransactionCallback($queue));
7577
} else {
76-
$this->invoker->invoke($queue, $maxNumberOfMessages, $this->getTransactionCallback($queue));
78+
$this->invoker->invoke(
79+
$queue,
80+
$maxNumberOfMessages,
81+
$this->getTransactionCallback($queue),
82+
$maxIdleTime,
83+
$sleep
84+
);
7785
}
7886

7987
$this->registry->unregister('isSecureArea');
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
<?php
2+
/**
3+
* Copyright © Magento, Inc. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
declare(strict_types=1);
7+
8+
namespace Magento\BundleGraphQl\Model\Resolver\Options;
9+
10+
use Magento\Framework\GraphQl\Config\Element\Field;
11+
use Magento\Framework\GraphQl\Exception\GraphQlInputException;
12+
use Magento\Framework\GraphQl\Query\Resolver\ContextInterface;
13+
use Magento\Framework\GraphQl\Query\ResolverInterface;
14+
use Magento\Framework\GraphQl\Schema\Type\ResolveInfo;
15+
16+
/**
17+
* Format new option uid in base64 encode for entered bundle options
18+
*/
19+
class BundleItemOptionUid implements ResolverInterface
20+
{
21+
/**
22+
* Option type name
23+
*/
24+
private const OPTION_TYPE = 'bundle';
25+
26+
/**
27+
* Create a option uid for entered option in "<option-type>/<option-id>/<option-value-id>/<quantity>" format
28+
*
29+
* @param Field $field
30+
* @param ContextInterface $context
31+
* @param ResolveInfo $info
32+
* @param array|null $value
33+
* @param array|null $args
34+
*
35+
* @return string
36+
*
37+
* @throws GraphQlInputException
38+
*
39+
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
40+
*/
41+
public function resolve(
42+
Field $field,
43+
$context,
44+
ResolveInfo $info,
45+
array $value = null,
46+
array $args = null
47+
) {
48+
if (!isset($value['option_id']) || empty($value['option_id'])) {
49+
throw new GraphQlInputException(__('"option_id" value should be specified.'));
50+
}
51+
52+
if (!isset($value['selection_id']) || empty($value['selection_id'])) {
53+
throw new GraphQlInputException(__('"selection_id" value should be specified.'));
54+
}
55+
56+
$optionDetails = [
57+
self::OPTION_TYPE,
58+
$value['option_id'],
59+
$value['selection_id'],
60+
(int) $value['selection_qty']
61+
];
62+
63+
$content = implode('/', $optionDetails);
64+
65+
// phpcs:ignore Magento2.Functions.DiscouragedFunction
66+
return base64_encode($content);
67+
}
68+
}

app/code/Magento/BundleGraphQl/etc/schema.graphqls

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ type BundleItemOption @doc(description: "BundleItemOption defines characteristic
6666
price_type: PriceTypeEnum @doc(description: "One of FIXED, PERCENT, or DYNAMIC.")
6767
can_change_quantity: Boolean @doc(description: "Indicates whether the customer can change the number of items for this option.")
6868
product: ProductInterface @doc(description: "Contains details about this product option.") @resolver(class: "Magento\\CatalogGraphQl\\Model\\Resolver\\Product")
69+
uid: ID! @doc(description: "A string that encodes option details.") @resolver(class: "Magento\\BundleGraphQl\\Model\\Resolver\\Options\\BundleItemOptionUid") # A Base64 string that encodes option details.
6970
}
7071

7172
type BundleProduct implements ProductInterface, PhysicalProductInterface, CustomizableProductInterface @doc(description: "BundleProduct defines basic features of a bundle product and contains multiple BundleItems.") {

app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateAndSwitchProductType/AdminCreateSimpleProductSwitchToVirtualTest.xml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,11 @@
5454
<actionGroup ref="FilterProductGridByNameActionGroup" stepKey="searchForProduct">
5555
<argument name="product" value="_defaultProduct"/>
5656
</actionGroup>
57-
<see selector="{{AdminProductGridSection.productGridCell('1', 'Type')}}" userInput="Virtual Product" stepKey="seeProductTypeInGrid"/>
57+
<actionGroup ref="AssertAdminProductGridCellActionGroup" stepKey="seeProductTypeInGrid">
58+
<argument name="row" value="1"/>
59+
<argument name="column" value="Type"/>
60+
<argument name="value" value="Virtual Product"/>
61+
</actionGroup>
5862
<actionGroup ref="AssertProductInStorefrontProductPageActionGroup" stepKey="AssertProductInStorefrontProductPage">
5963
<argument name="product" value="_defaultProduct"/>
6064
</actionGroup>

app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateAndSwitchProductType/AdminCreateVirtualProductSwitchToSimpleTest.xml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,10 @@
2525
<actionGroup ref="FillMainProductFormActionGroup" stepKey="fillProductForm">
2626
<argument name="product" value="_defaultProduct"/>
2727
</actionGroup>
28-
<see selector="{{AdminProductGridSection.productGridCell('1', 'Type')}}" userInput="Simple Product" stepKey="seeProductTypeInGrid"/>
28+
<actionGroup ref="AssertAdminProductGridCellActionGroup" stepKey="seeProductTypeInGrid">
29+
<argument name="row" value="1"/>
30+
<argument name="column" value="Type"/>
31+
<argument name="value" value="Simple Product"/>
32+
</actionGroup>
2933
</test>
3034
</tests>

app/code/Magento/Catalog/Test/Mftf/Test/AdminProductTypeSwitchingOnEditingTest/AdminDownloadableProductTypeSwitchingToSimpleProductTest.xml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,16 @@
3333
<actionGroup ref="FilterProductGridBySku2ActionGroup" stepKey="filterSimpleProductGridBySku">
3434
<argument name="sku" value="$$createProduct.sku$$"/>
3535
</actionGroup>
36-
<see selector="{{AdminProductGridSection.productGridCell('1', 'Name')}}" userInput="$$createProduct.name$$" stepKey="seeSimpleProductNameInGrid"/>
37-
<see selector="{{AdminProductGridSection.productGridCell('1', 'Type')}}" userInput="Simple Product" stepKey="seeSimpleProductTypeInGrid"/>
36+
<actionGroup ref="AssertAdminProductGridCellActionGroup" stepKey="seeSimpleProductNameInGrid">
37+
<argument name="row" value="1"/>
38+
<argument name="column" value="Name"/>
39+
<argument name="value" value="$$createProduct.name$$"/>
40+
</actionGroup>
41+
<actionGroup ref="AssertAdminProductGridCellActionGroup" stepKey="seeSimpleProductTypeInGrid">
42+
<argument name="row" value="1"/>
43+
<argument name="column" value="Type"/>
44+
<argument name="value" value="Simple Product"/>
45+
</actionGroup>
3846
<actionGroup ref="AdminClearFiltersActionGroup" stepKey="clearSimpleProductFilters"/>
3947
<!--Assert simple product on storefront-->
4048
<comment userInput="Assert simple product on storefront" stepKey="commentAssertSimpleProductOnStorefront"/>

app/code/Magento/Catalog/Test/Mftf/Test/AdminProductTypeSwitchingOnEditingTest/AdminVirtualProductTypeSwitchingToDownloadableProductTest.xml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,16 @@
5353
<actionGroup ref="FilterProductGridBySku2ActionGroup" stepKey="filterProductGridBySku">
5454
<argument name="sku" value="$$createProduct.sku$$"/>
5555
</actionGroup>
56-
<see selector="{{AdminProductGridSection.productGridCell('1', 'Name')}}" userInput="$$createProduct.name$$" stepKey="seeDownloadableProductNameInGrid"/>
57-
<see selector="{{AdminProductGridSection.productGridCell('1', 'Type')}}" userInput="Downloadable Product" stepKey="seeDownloadableProductTypeInGrid"/>
56+
<actionGroup ref="AssertAdminProductGridCellActionGroup" stepKey="seeDownloadableProductNameInGrid">
57+
<argument name="row" value="1"/>
58+
<argument name="column" value="Name"/>
59+
<argument name="value" value="$$createProduct.name$$"/>
60+
</actionGroup>
61+
<actionGroup ref="AssertAdminProductGridCellActionGroup" stepKey="seeDownloadableProductTypeInGrid">
62+
<argument name="row" value="1"/>
63+
<argument name="column" value="Type"/>
64+
<argument name="value" value="Downloadable Product"/>
65+
</actionGroup>
5866
<actionGroup ref="AdminClearFiltersActionGroup" stepKey="clearDownloadableProductFilters"/>
5967
<!--Assert downloadable product on storefront-->
6068
<comment userInput="Assert downloadable product on storefront" stepKey="commentAssertDownloadableProductOnStorefront"/>

app/code/Magento/Catalog/Test/Mftf/Test/EndToEndB2CAdminTest.xml

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,11 @@
7979
<argument name="keyword" value="SimpleProduct.name"/>
8080
</actionGroup>
8181
<seeNumberOfElements selector="{{AdminProductGridSection.productGridRows}}" userInput="1" stepKey="seeOnlyOneProductInGrid"/>
82-
<see selector="{{AdminProductGridSection.productGridCell('1', 'Name')}}" userInput="{{SimpleProduct.name}}" stepKey="seeOnlySimpleProductInGrid"/>
82+
<actionGroup ref="AssertAdminProductGridCellActionGroup" stepKey="seeOnlySimpleProductInGrid">
83+
<argument name="row" value="1"/>
84+
<argument name="column" value="Name"/>
85+
<argument name="value" value="{{SimpleProduct.name}}"/>
86+
</actionGroup>
8387

8488
<!--Paging works-->
8589
<actionGroup ref="ResetProductGridToDefaultViewActionGroup" stepKey="setProductGridToDefaultPagination"/>
@@ -105,7 +109,11 @@
105109
<argument name="product" value="GroupedProduct"/>
106110
</actionGroup>
107111
<seeNumberOfElements selector="{{AdminProductGridSection.productGridRows}}" userInput="1" stepKey="seeOneMatchingSkuInProductGrid"/>
108-
<see selector="{{AdminProductGridSection.productGridCell('1','SKU')}}" userInput="{{GroupedProduct.sku}}" stepKey="seeProductInFilteredGridSku"/>
112+
<actionGroup ref="AssertAdminProductGridCellActionGroup" stepKey="seeProductInFilteredGridSku">
113+
<argument name="row" value="1"/>
114+
<argument name="column" value="SKU"/>
115+
<argument name="value" value="{{GroupedProduct.sku}}"/>
116+
</actionGroup>
109117
<!--Filter by price-->
110118
<actionGroup ref="FilterProductGridByPriceRangeActionGroup" stepKey="filterProductGridByPrice">
111119
<argument name="filter" value="PriceFilterRange"/>
@@ -194,7 +202,11 @@
194202
<actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterProductGridToCheckWeightColumn">
195203
<argument name="product" value="SimpleProduct"/>
196204
</actionGroup>
197-
<see selector="{{AdminProductGridSection.productGridCell('1','Weight')}}" userInput="{{SimpleProduct.weight}}" stepKey="seeCorrectProductWeightInGrid"/>
205+
<actionGroup ref="AssertAdminProductGridCellActionGroup" stepKey="seeCorrectProductWeightInGrid">
206+
<argument name="row" value="1"/>
207+
<argument name="column" value="Weight"/>
208+
<argument name="value" value="{{SimpleProduct.weight}}"/>
209+
</actionGroup>
198210
<!--END Admin uses product grid-->
199211

200212
<!--Admin creates category-->

app/code/Magento/Catalog/view/frontend/web/js/product/list/toolbar.js

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,26 @@ define([
3535

3636
/** @inheritdoc */
3737
_create: function () {
38-
this._bind($(this.options.modeControl), this.options.mode, this.options.modeDefault);
39-
this._bind($(this.options.directionControl), this.options.direction, this.options.directionDefault);
40-
this._bind($(this.options.orderControl), this.options.order, this.options.orderDefault);
41-
this._bind($(this.options.limitControl), this.options.limit, this.options.limitDefault);
38+
this._bind(
39+
$(this.options.modeControl, this.element),
40+
this.options.mode,
41+
this.options.modeDefault
42+
);
43+
this._bind(
44+
$(this.options.directionControl, this.element),
45+
this.options.direction,
46+
this.options.directionDefault
47+
);
48+
this._bind(
49+
$(this.options.orderControl, this.element),
50+
this.options.order,
51+
this.options.orderDefault
52+
);
53+
this._bind(
54+
$(this.options.limitControl, this.element),
55+
this.options.limit,
56+
this.options.limitDefault
57+
);
4258
},
4359

4460
/** @inheritdoc */

app/code/Magento/CatalogCustomerGraphQl/Model/Resolver/PriceTiers.php

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
use Magento\Framework\GraphQl\Schema\Type\ResolveInfo;
1313
use Magento\Framework\Exception\LocalizedException;
1414
use Magento\Framework\GraphQl\Query\Resolver\ValueFactory;
15+
use Magento\Framework\Pricing\PriceCurrencyInterface;
1516
use Magento\CatalogCustomerGraphQl\Model\Resolver\Product\Price\Tiers;
1617
use Magento\CatalogCustomerGraphQl\Model\Resolver\Product\Price\TiersFactory;
1718
use Magento\CatalogCustomerGraphQl\Model\Resolver\Customer\GetCustomerGroup;
@@ -60,25 +61,33 @@ class PriceTiers implements ResolverInterface
6061
*/
6162
private $priceProviderPool;
6263

64+
/**
65+
* @var PriceCurrencyInterface
66+
*/
67+
private $priceCurrency;
68+
6369
/**
6470
* @param ValueFactory $valueFactory
6571
* @param TiersFactory $tiersFactory
6672
* @param GetCustomerGroup $getCustomerGroup
6773
* @param Discount $discount
6874
* @param PriceProviderPool $priceProviderPool
75+
* @param PriceCurrencyInterface $priceCurrency
6976
*/
7077
public function __construct(
7178
ValueFactory $valueFactory,
7279
TiersFactory $tiersFactory,
7380
GetCustomerGroup $getCustomerGroup,
7481
Discount $discount,
75-
PriceProviderPool $priceProviderPool
82+
PriceProviderPool $priceProviderPool,
83+
PriceCurrencyInterface $priceCurrency
7684
) {
7785
$this->valueFactory = $valueFactory;
7886
$this->tiersFactory = $tiersFactory;
7987
$this->getCustomerGroup = $getCustomerGroup;
8088
$this->discount = $discount;
8189
$this->priceProviderPool = $priceProviderPool;
90+
$this->priceCurrency = $priceCurrency;
8291
}
8392

8493
/**
@@ -130,6 +139,7 @@ private function formatProductTierPrices(array $tierPrices, float $productPrice,
130139
$tiers = [];
131140

132141
foreach ($tierPrices as $tierPrice) {
142+
$tierPrice->setValue($this->priceCurrency->convertAndRound($tierPrice->getValue()));
133143
$percentValue = $tierPrice->getExtensionAttributes()->getPercentageValue();
134144
if ($percentValue && is_numeric($percentValue)) {
135145
$discount = $this->discount->getDiscountByPercent($productPrice, (float)$percentValue);

0 commit comments

Comments
 (0)