-
Notifications
You must be signed in to change notification settings - Fork 9.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6622 from magento-tsg/2.4-develop-pr123
[Arrows] Fixes for 2.4 (pr123) (2.4-develop)
- Loading branch information
Showing
25 changed files
with
755 additions
and
107 deletions.
There are no files selected for viewing
57 changes: 57 additions & 0 deletions
57
...og/Plugin/Api/ProductLinkRepositoryInterface/ReindexAfterDeleteByIdProductLinksPlugin.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
<?php | ||
/** | ||
* Copyright © Magento, Inc. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
declare(strict_types=1); | ||
|
||
namespace Magento\Catalog\Plugin\Api\ProductLinkRepositoryInterface; | ||
|
||
use Magento\Catalog\Api\ProductRepositoryInterface; | ||
use Magento\Catalog\Api\ProductLinkRepositoryInterface; | ||
use Magento\Catalog\Model\Indexer\Product\Full as FullProductIndexer; | ||
|
||
/** | ||
* Product reindexing after delete by id links plugin. | ||
*/ | ||
class ReindexAfterDeleteByIdProductLinksPlugin | ||
{ | ||
/** | ||
* @var FullProductIndexer | ||
*/ | ||
private $fullProductIndexer; | ||
|
||
/** | ||
* @var ProductRepositoryInterface | ||
*/ | ||
private $productRepository; | ||
|
||
/** | ||
* @param FullProductIndexer $fullProductIndexer | ||
* @param ProductRepositoryInterface $productRepository | ||
*/ | ||
public function __construct(FullProductIndexer $fullProductIndexer, ProductRepositoryInterface $productRepository) | ||
{ | ||
$this->fullProductIndexer = $fullProductIndexer; | ||
$this->productRepository = $productRepository; | ||
} | ||
|
||
/** | ||
* Complex reindex after product links has been deleted. | ||
* | ||
* @param ProductLinkRepositoryInterface $subject | ||
* @param bool $result | ||
* @param string $sku | ||
* @param string $type | ||
* @param string $linkedProductSku | ||
* @return bool | ||
* @SuppressWarnings(PHPMD.UnusedFormalParameter) | ||
*/ | ||
public function afterDeleteById(ProductLinkRepositoryInterface $subject, bool $result, $sku): bool | ||
{ | ||
$product = $this->productRepository->get($sku); | ||
$this->fullProductIndexer->executeRow($product->getId()); | ||
|
||
return $result; | ||
} | ||
} |
56 changes: 56 additions & 0 deletions
56
.../Catalog/Plugin/Api/ProductLinkRepositoryInterface/ReindexAfterSaveProductLinksPlugin.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
<?php | ||
/** | ||
* Copyright © Magento, Inc. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
declare(strict_types=1); | ||
|
||
namespace Magento\Catalog\Plugin\Api\ProductLinkRepositoryInterface; | ||
|
||
use Magento\Catalog\Api\ProductRepositoryInterface; | ||
use Magento\Catalog\Api\ProductLinkRepositoryInterface; | ||
use Magento\Catalog\Api\Data\ProductLinkInterface; | ||
use Magento\Catalog\Model\Indexer\Product\Full as FullProductIndexer; | ||
|
||
/** | ||
* Product reindexing after save links plugin. | ||
*/ | ||
class ReindexAfterSaveProductLinksPlugin | ||
{ | ||
/** | ||
* @var FullProductIndexer | ||
*/ | ||
private $fullProductIndexer; | ||
|
||
/** | ||
* @var ProductRepositoryInterface | ||
*/ | ||
private $productRepository; | ||
|
||
/** | ||
* @param FullProductIndexer $fullProductIndexer | ||
* @param ProductRepositoryInterface $productRepository | ||
*/ | ||
public function __construct(FullProductIndexer $fullProductIndexer, ProductRepositoryInterface $productRepository) | ||
{ | ||
$this->fullProductIndexer = $fullProductIndexer; | ||
$this->productRepository = $productRepository; | ||
} | ||
|
||
/** | ||
* Complex reindex after product links has been saved. | ||
* | ||
* @param ProductLinkRepositoryInterface $subject | ||
* @param bool $result | ||
* @param ProductLinkInterface $entity | ||
* @return bool | ||
* @SuppressWarnings(PHPMD.UnusedFormalParameter) | ||
*/ | ||
public function afterSave(ProductLinkRepositoryInterface $subject, bool $result, ProductLinkInterface $entity): bool | ||
{ | ||
$product = $this->productRepository->get($entity->getSku()); | ||
$this->fullProductIndexer->executeRow($product->getId()); | ||
|
||
return $result; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
.../Magento/Customer/Test/Mftf/ActionGroup/AdminCustomerWishlistConfigureItemActionGroup.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- | ||
/** | ||
* Copyright © Magento, Inc. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
--> | ||
|
||
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> | ||
<actionGroup name="AdminCustomerWishlistConfigureItemActionGroup"> | ||
<arguments> | ||
<argument name="title" type="string" defaultValue="{{Attribute.label}}"/> | ||
<argument name="option" type="string" defaultValue="option1"/> | ||
<argument name="quantity" type="string" defaultValue="2"/> | ||
<argument name="productName" type="string" defaultValue="{{ApiConfigurableProductWithOutCategory.name}}"/> | ||
</arguments> | ||
<click selector="{{AdminCustomerWishlistSection.configureButton(productName)}}" stepKey="clickConfigureButton"/> | ||
<waitForElementVisible selector="{{AdminCustomerWishlistSection.productAttributeOptionsDropDown(title)}}" stepKey="waitForConfigurableOption"/> | ||
<selectOption selector="{{AdminCustomerWishlistSection.productAttributeOptionsDropDown(title)}}" userInput="{{option}}" stepKey="selectConfigurableOption"/> | ||
<fillField selector="{{AdminOrderFormConfigureProductSection.quantity}}" userInput="{{quantity}}" stepKey="fillQty"/> | ||
<click selector="{{AdminOrderFormConfigureProductSection.ok}}" stepKey="confirmSave"/> | ||
</actionGroup> | ||
</actionGroups> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
...adable/Test/Mftf/ActionGroup/AssertStorefrontLinkOnDownloadableProductPageActionGroup.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- | ||
/** | ||
* Copyright © Magento, Inc. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
--> | ||
|
||
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> | ||
<actionGroup name="AssertStorefrontLinkOnDownloadableProductPageActionGroup"> | ||
<annotations> | ||
<description>Validates that the provided Link Title is present on Downloadable Product details page.</description> | ||
</annotations> | ||
<arguments> | ||
<argument name="linkTitle" type="string" defaultValue="{{downloadableLink.title}}"/> | ||
</arguments> | ||
|
||
<waitForElementVisible selector="{{StorefrontDownloadableProductSection.downloadableLinksListSection}}" stepKey="waitForDownloadableLinksList"/> | ||
<see selector="{{StorefrontDownloadableProductSection.downloadableLinksListSection}}" userInput="{{linkTitle}}" stepKey="seeDownloadableLink"/> | ||
</actionGroup> | ||
</actionGroups> |
22 changes: 22 additions & 0 deletions
22
...able/Test/Mftf/ActionGroup/AssertStorefrontNoLinkOnDownloadableProductPageActionGroup.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- | ||
/** | ||
* Copyright © Magento, Inc. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
--> | ||
|
||
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> | ||
<actionGroup name="AssertStorefrontNoLinkOnDownloadableProductPageActionGroup"> | ||
<annotations> | ||
<description>Validates that the provided Link Title is NOT present on Downloadable Product details page.</description> | ||
</annotations> | ||
<arguments> | ||
<argument name="linkTitle" type="string" defaultValue="{{downloadableLink.title}}"/> | ||
</arguments> | ||
|
||
<waitForElementVisible selector="{{StorefrontDownloadableProductSection.downloadableLinksListSection}}" stepKey="waitForDownloadableLinksList"/> | ||
<dontSee selector="{{StorefrontDownloadableProductSection.downloadableLinksListSection}}" userInput="{{linkTitle}}" stepKey="dontSeeDownloadableLink"/> | ||
</actionGroup> | ||
</actionGroups> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.