Skip to content

Commit cce8e58

Browse files
Merge remote-tracking branch 'origin/2.4-develop' into MC-41575
2 parents c091a25 + be82efb commit cce8e58

File tree

73 files changed

+3831
-419
lines changed

Some content is hidden

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

73 files changed

+3831
-419
lines changed

app/code/Magento/Backend/Test/Mftf/Section/AdminMenuSection.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
<element name="marketing" type="button" selector="#menu-magento-backend-marketing"/>
2323
<element name="system" type="button" selector="#menu-magento-backend-system"/>
2424
<element name="findPartners" type="button" selector="#menu-magento-marketplace-partners"/>
25+
<element name="contentMenuClose" type="button" selector="#menu-magento-backend-content a.action-close" timeout="30"/>
2526

2627
<!-- Navigate menu selectors -->
2728
<element name="menuItem" type="button" selector="li[data-ui-id='menu-{{dataUiId}}']" parameterized="true" timeout="30"/>

app/code/Magento/Bundle/Model/Product/LinksList.php

Lines changed: 29 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,22 @@
44
* Copyright © Magento, Inc. All rights reserved.
55
* See COPYING.txt for license details.
66
*/
7+
declare(strict_types=1);
8+
79
namespace Magento\Bundle\Model\Product;
810

11+
use Magento\Bundle\Api\Data\LinkInterface;
12+
use Magento\Bundle\Api\Data\LinkInterfaceFactory;
13+
use Magento\Catalog\Api\Data\ProductInterface;
14+
use Magento\Framework\Api\DataObjectHelper;
15+
16+
/**
17+
* Retrieve bundle product links service.
18+
*/
919
class LinksList
1020
{
1121
/**
12-
* @var \Magento\Bundle\Api\Data\LinkInterfaceFactory
22+
* @var LinkInterfaceFactory
1323
*/
1424
protected $linkFactory;
1525

@@ -19,52 +29,52 @@ class LinksList
1929
protected $type;
2030

2131
/**
22-
* @var \Magento\Framework\Api\DataObjectHelper
32+
* @var DataObjectHelper
2333
*/
2434
protected $dataObjectHelper;
2535

2636
/**
27-
* @param \Magento\Bundle\Api\Data\LinkInterfaceFactory $linkFactory
37+
* @param LinkInterfaceFactory $linkFactory
2838
* @param Type $type
29-
* @param \Magento\Framework\Api\DataObjectHelper $dataObjectHelper
39+
* @param DataObjectHelper $dataObjectHelper
3040
*/
3141
public function __construct(
32-
\Magento\Bundle\Api\Data\LinkInterfaceFactory $linkFactory,
33-
\Magento\Bundle\Model\Product\Type $type,
34-
\Magento\Framework\Api\DataObjectHelper $dataObjectHelper
42+
LinkInterfaceFactory $linkFactory,
43+
Type $type,
44+
DataObjectHelper $dataObjectHelper
3545
) {
3646
$this->linkFactory = $linkFactory;
3747
$this->type = $type;
3848
$this->dataObjectHelper = $dataObjectHelper;
3949
}
4050

4151
/**
42-
* Bundle Product Items Data
52+
* Get Bundle Product Items Data.
4353
*
44-
* @param \Magento\Catalog\Api\Data\ProductInterface $product
54+
* @param ProductInterface $product
4555
* @param int $optionId
46-
* @return \Magento\Bundle\Api\Data\LinkInterface[]
56+
* @return LinkInterface[]
4757
*/
48-
public function getItems(\Magento\Catalog\Api\Data\ProductInterface $product, $optionId)
58+
public function getItems(ProductInterface $product, $optionId)
4959
{
5060
$selectionCollection = $this->type->getSelectionsCollection([$optionId], $product);
5161

5262
$productLinks = [];
5363
/** @var \Magento\Catalog\Model\Product $selection */
5464
foreach ($selectionCollection as $selection) {
55-
$bundledProductPrice = $selection->getSelectionPriceValue();
56-
if ($bundledProductPrice <= 0) {
57-
$bundledProductPrice = $selection->getPrice();
58-
}
59-
$selectionPriceType = $product->getPriceType() ? $selection->getSelectionPriceType() : null;
60-
$selectionPrice = $bundledProductPrice ? $bundledProductPrice : null;
65+
$priceType = $product->getPriceType();
66+
$selectionPriceType = $priceType ? $selection->getSelectionPriceType() : null;
67+
$selectionPriceValue = $selection->getSelectionPriceValue() < 0
68+
? $selection->getPrice()
69+
: $selection->getSelectionPriceValue();
70+
$selectionPrice = $priceType ? $selectionPriceValue : $selection->getPrice();
6171

62-
/** @var \Magento\Bundle\Api\Data\LinkInterface $productLink */
72+
/** @var LinkInterface $productLink */
6373
$productLink = $this->linkFactory->create();
6474
$this->dataObjectHelper->populateWithArray(
6575
$productLink,
6676
$selection->getData(),
67-
\Magento\Bundle\Api\Data\LinkInterface::class
77+
LinkInterface::class
6878
);
6979
$productLink->setIsDefault($selection->getIsDefault())
7080
->setId($selection->getSelectionId())

app/code/Magento/Bundle/Test/Unit/Model/Product/LinksListTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ public function testLinksList()
9595
$this->selectionMock->expects($this->once())
9696
->method('getSelectionPriceType')
9797
->willReturn('selection_price_type');
98-
$this->selectionMock->expects($this->once())->method('getSelectionPriceValue')->willReturn(12);
98+
$this->selectionMock->expects($this->exactly(2))->method('getSelectionPriceValue')->willReturn(12);
9999
$this->selectionMock->expects($this->once())->method('getData')->willReturn(['some data']);
100100
$this->selectionMock->expects($this->once())->method('getSelectionId')->willReturn($selectionId);
101101
$this->selectionMock->expects($this->once())->method('getIsDefault')->willReturn(true);

app/code/Magento/BundleGraphQl/etc/graphql/di.xml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,4 +107,11 @@
107107
</argument>
108108
</arguments>
109109
</type>
110+
<type name="Magento\UrlRewriteGraphQl\Model\RoutableInterfaceTypeResolver">
111+
<arguments>
112+
<argument name="productTypeNameResolvers" xsi:type="array">
113+
<item name="bundle_product_type_resolver" xsi:type="object">Magento\BundleGraphQl\Model\BundleProductTypeResolver</item>
114+
</argument>
115+
</arguments>
116+
</type>
110117
</config>

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ type BundleItemOption @doc(description: "BundleItemOption defines characteristic
7272
uid: ID! @doc(description: "The unique ID for a `BundleItemOption` object.") @resolver(class: "Magento\\BundleGraphQl\\Model\\Resolver\\Options\\BundleItemOptionUid")
7373
}
7474

75-
type BundleProduct implements ProductInterface, PhysicalProductInterface, CustomizableProductInterface @doc(description: "BundleProduct defines basic features of a bundle product and contains multiple BundleItems.") {
75+
type BundleProduct implements ProductInterface, RoutableInterface, PhysicalProductInterface, CustomizableProductInterface @doc(description: "Defines basic features of a bundle product and contains multiple BundleItems") {
7676
price_view: PriceViewEnum @doc(description: "One of PRICE_RANGE or AS_LOW_AS.") @resolver(class: "Magento\\BundleGraphQl\\Model\\Resolver\\Product\\Fields\\PriceView")
7777
dynamic_price: Boolean @doc(description: "Indicates whether the bundle product has a dynamic price.") @resolver(class: "Magento\\BundleGraphQl\\Model\\Resolver\\Product\\Fields\\DynamicPrice")
7878
dynamic_sku: Boolean @doc(description: "Indicates whether the bundle product has a dynamic SK.") @resolver(class: "Magento\\BundleGraphQl\\Model\\Resolver\\Product\\Fields\\DynamicSku")

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -914,7 +914,8 @@ private function joinPositionField(
914914
foreach ($searchCriteria->getFilterGroups() as $filterGroup) {
915915
foreach ($filterGroup->getFilters() as $filter) {
916916
if ($filter->getField() === 'category_id') {
917-
$categoryIds[] = explode(',', $filter->getValue());
917+
$filterValue = $filter->getValue();
918+
$categoryIds[] = is_array($filterValue) ? $filterValue : explode(',', $filterValue);
918919
}
919920
}
920921
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
9+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="AdminChangeSeoUrlKeyToDefaultValueWithoutRedirectActionGroup">
12+
<annotations>
13+
<description>Requires navigation to category creation/edit page. Selects 'Use Default Value' checkbox for the 'URL Key' with 'Create Permanent Redirect for old URL' unchecked.</description>
14+
</annotations>
15+
16+
<conditionalClick selector="{{AdminCategorySEOSection.SectionHeader}}" dependentSelector="{{AdminCategorySEOSection.UrlKeyInput}}" visible="false" stepKey="clickOnSEOTab"/>
17+
<waitForElementVisible selector="{{AdminCategorySEOSection.UrlKeyInput}}" stepKey="waitForSEOTabOpened"/>
18+
<clearField selector="{{AdminCategorySEOSection.UrlKeyInput}}" stepKey="clearUrlKeyField"/>
19+
<uncheckOption selector="{{AdminCategorySEOSection.UrlKeyRedirectCheckbox}}" stepKey="uncheckRedirectCheckbox"/>
20+
<checkOption selector="{{AdminCategorySEOSection.UrlKeyDefaultValueCheckbox}}" stepKey="checkUseDefaultValueCheckbox"/>
21+
</actionGroup>
22+
</actionGroups>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
9+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="AssertStorefrontAttributeOptionQuantityInLayeredNavigationActionGroup" extends="AssertStorefrontAttributeOptionPresentInLayeredNavigationActionGroup">
12+
<annotations>
13+
<description>Asserts visible attribute option quantity</description>
14+
</annotations>
15+
<arguments>
16+
<argument name="attributeOptionQuantity" type="string" defaultValue="1"/>
17+
</arguments>
18+
<see selector="{{StorefrontCategorySidebarSection.visibleOptionQty(attributeOptionPosition)}}" userInput="{{attributeOptionQuantity}}" after="assertAttributeOptionInLayeredNavigation" stepKey="assertOptionQuantity"/>
19+
</actionGroup>
20+
</actionGroups>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
9+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="StorefrontAssertSubCategoryNameIsNotShownInMenuActionGroup" extends="StorefrontAssertCategoryNameIsNotShownInMenuActionGroup">
12+
<annotations>
13+
<description>Validate that the subcategory is not present in menu on Frontend.</description>
14+
</annotations>
15+
<arguments>
16+
<argument name="parentCategoryName" type="string"/>
17+
</arguments>
18+
<moveMouseOver selector="{{StorefrontHeaderSection.NavigationCategoryByName(parentCategoryName)}}" before="doNotSeeCatergoryInStoreFront" stepKey="showSubCategories"/>
19+
</actionGroup>
20+
</actionGroups>

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,9 @@
1616
<element name="filterOptionByLabel" type="button" selector=" div.filter-options-item div[data-option-label='{{optionLabel}}']" parameterized="true"/>
1717
<element name="removeFilter" type="button" selector="div.filter-current .remove" timeout="30"/>
1818
<element name="activeFilterOptions" type="text" selector=".filter-options-item.active .items"/>
19-
<element name="activeFilterOptionItemByPosition" type="text" selector=".filter-options-item.active .items li:nth-child({{itemPosition}}) a" parameterized="true"/>
19+
<element name="activeFilterOptionItemByPosition" type="text" selector=".filter-options-item.active .items li:nth-child({{itemPosition}}) a" parameterized="true" timeout="30"/>
2020
<element name="enabledFilterOptionItemByLabel" type="text" selector="//div[@class='filter-options']//li[@class='item']//a[contains(text(), '{{optionLabel}}')]" parameterized="true" timeout="30"/>
2121
<element name="disabledFilterOptionItemByLabel" type="text" selector="//div[@class='filter-options']//li[@class='item' and contains(text(), '{{optionLabel}}')]" parameterized="true" timeout="30"/>
22+
<element name="visibleOptionQty" type="text" selector=".filter-options-item.active .items li:nth-child({{itemPosition}}) a .count" parameterized="true" timeout="30"/>
2223
</section>
2324
</sections>

0 commit comments

Comments
 (0)