-
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.
🔃 [Magento Community Engineering] Community Contributions - 2.4-devel…
…op daily delivery Accepted Community Pull Requests: - #26784: [Forward Port PR-14344] Fix generating product URL rewrites for anchor categories (by @hostep) - #27261: 20472 added product list price modifier (by @sergiy-v) - #27284: Fix static test failures for class annotaions (by @ihor-sviziev) - #27274: MFTF: Create Account tests (Success & Failure) with `extend` (by @lbajsarowicz) - #27281: TYPO: Fix annoying typo in Quantity word (by @lbajsarowicz) - #27277: MFTF: Rename and rewrite Test that fake expired session (by @lbajsarowicz) - #26348: Fixed #26345 Reorder in Admin panel leads to report page in case of changed product custom option max characters (by @cedmudit) - #26746: In System/Export controlers use MessageManager instead of throwing exceptions (by @pmarki) - #27249: Update Frontend Development Workflow type's comment to be clearer (by @navarr) Fixed GitHub Issues: - #4112: Wrong parent category url_key in URL (reported by @bh-ref) has been fixed in #26784 by @hostep in 2.4-develop branch Related commits: 1. cb685d1 2. acb8642 3. 97258e1 4. 6cf26dc 5. 0b94121 6. b0c0c59 7. 28fa345 8. bf514b0 - #11615: URL Rewrites vs multiple storeviews - a never ending battle (reported by @hostep) has been fixed in #26784 by @hostep in 2.4-develop branch Related commits: 1. cb685d1 2. acb8642 3. 97258e1 4. 6cf26dc 5. 0b94121 6. b0c0c59 7. 28fa345 8. bf514b0 - #11616: URL Rewrites vs multiple storeviews - too many rewrites are being generated (reported by @hostep) has been fixed in #26784 by @hostep in 2.4-develop branch Related commits: 1. cb685d1 2. acb8642 3. 97258e1 4. 6cf26dc 5. 0b94121 6. b0c0c59 7. 28fa345 8. bf514b0 - #25124: Magento 2.3 Wrong product url for anchor categories for multiple storeviews (reported by @juharintanen) has been fixed in #26784 by @hostep in 2.4-develop branch Related commits: 1. cb685d1 2. acb8642 3. 97258e1 4. 6cf26dc 5. 0b94121 6. b0c0c59 7. 28fa345 8. bf514b0 - #26393: Product category url rewrite missing storeview specific url_key (reported by @juhanihaapala) has been fixed in #26784 by @hostep in 2.4-develop branch Related commits: 1. cb685d1 2. acb8642 3. 97258e1 4. 6cf26dc 5. 0b94121 6. b0c0c59 7. 28fa345 8. bf514b0 - #20472: Special Price shown without currency symbol in magento backoffice (reported by @XxXgeoXxX) has been fixed in #27261 by @sergiy-v in 2.4-develop branch Related commits: 1. d81d1d4 - #20906: Magento backend catalog "Cost" without currency symbol (reported by @mage2pratik) has been fixed in #27261 by @sergiy-v in 2.4-develop branch Related commits: 1. d81d1d4 - #21910: Magento backend catalog "MSRP" without currency symbol (reported by @mage2pratik) has been fixed in #27261 by @sergiy-v in 2.4-develop branch Related commits: 1. d81d1d4 - #26345: Reorder in Admin panel leads to report page in case of changed product custom option max characters (reported by @oleksii-lisovyi) has been fixed in #26348 by @cedmudit in 2.4-develop branch Related commits: 1. 16079d9 2. 86dc12d 3. a21b246 4. 43f9e2b 5. 7ba11b8 6. 6c5fbcb 7. f7819a6
- Loading branch information
Showing
59 changed files
with
1,584 additions
and
469 deletions.
There are no files selected for viewing
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
21 changes: 21 additions & 0 deletions
21
...og/Test/Mftf/ActionGroup/AdminChangeSeoUrlKeyForSubCategoryWithoutRedirectActionGroup.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,21 @@ | ||
<?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="AdminChangeSeoUrlKeyForSubCategoryWithoutRedirectActionGroup" extends="ChangeSeoUrlKeyForSubCategoryActionGroup"> | ||
<annotations> | ||
<description>Requires navigation to subcategory creation/edit. Updates the Search Engine Optimization with uncheck Redirect Checkbox .</description> | ||
</annotations> | ||
<arguments> | ||
<argument name="value" type="string"/> | ||
</arguments> | ||
|
||
<uncheckOption selector="{{AdminCategorySEOSection.UrlKeyRedirectCheckbox}}" stepKey="uncheckRedirectCheckbox" after="enterURLKey"/> | ||
</actionGroup> | ||
</actionGroups> |
23 changes: 23 additions & 0 deletions
23
app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertAdminProductGridCellActionGroup.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,23 @@ | ||
<?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="AssertAdminProductGridCellActionGroup"> | ||
<annotations> | ||
<description>Checks value for Admin Product Grid cell by provided row and column.</description> | ||
</annotations> | ||
<arguments> | ||
<argument name="row" type="string" defaultValue="1"/> | ||
<argument name="column" type="string" defaultValue="Name"/> | ||
<argument name="value" type="string" defaultValue="1"/> | ||
</arguments> | ||
|
||
<see selector="{{AdminProductGridSection.productGridCell(row,column)}}" userInput="{{value}}" stepKey="seeProductGridCellWithProvidedValue"/> | ||
</actionGroup> | ||
</actionGroups> |
21 changes: 21 additions & 0 deletions
21
...de/Magento/Catalog/Test/Mftf/ActionGroup/CheckAdminProductGridColumnOptionActionGroup.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,21 @@ | ||
<?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="CheckAdminProductGridColumnOptionActionGroup"> | ||
<annotations> | ||
<description>Checks Admin Product Grid 'Columns' option.</description> | ||
</annotations> | ||
<arguments> | ||
<argument name="optionName" type="string" defaultValue="Name"/> | ||
</arguments> | ||
|
||
<checkOption selector="{{AdminProductGridFilterSection.viewColumnOption(optionName)}}" stepKey="checkColumn"/> | ||
</actionGroup> | ||
</actionGroups> |
19 changes: 19 additions & 0 deletions
19
app/code/Magento/Catalog/Test/Mftf/ActionGroup/ClearFiltersAdminProductGridActionGroup.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,19 @@ | ||
<?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="ClearFiltersAdminProductGridActionGroup"> | ||
<annotations> | ||
<description>Clicks on 'Clear Filters'.</description> | ||
</annotations> | ||
|
||
<conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFilters"/> | ||
<waitForPageLoad stepKey="waitForGridLoad"/> | ||
</actionGroup> | ||
</actionGroups> |
18 changes: 18 additions & 0 deletions
18
app/code/Magento/Catalog/Test/Mftf/ActionGroup/ResetAdminProductGridColumnsActionGroup.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,18 @@ | ||
<?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="ResetAdminProductGridColumnsActionGroup"> | ||
<annotations> | ||
<description>Clicks 'reset' for Admin Product Grid 'Columns' dropdown.</description> | ||
</annotations> | ||
|
||
<click selector="{{AdminProductGridFilterSection.resetGridColumns}}" stepKey="resetProductGridColumns"/> | ||
</actionGroup> | ||
</actionGroups> |
21 changes: 21 additions & 0 deletions
21
...code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontOpenProductEntityPageActionGroup.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,21 @@ | ||
<?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="StorefrontOpenProductEntityPageActionGroup"> | ||
<annotations> | ||
<description>Opens Storefront Product page for the provided Product Entity</description> | ||
</annotations> | ||
<arguments> | ||
<argument name="product" type="entity"/> | ||
</arguments> | ||
|
||
<amOnPage url="{{StorefrontProductPage.url(product.custom_attributes[url_key])}}" stepKey="goToProductPage"/> | ||
<waitForPageLoad stepKey="waitForProductPageLoaded"/> | ||
</actionGroup> | ||
</actionGroups> |
18 changes: 18 additions & 0 deletions
18
...agento/Catalog/Test/Mftf/ActionGroup/ToggleAdminProductGridColumnsDropdownActionGroup.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,18 @@ | ||
<?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="ToggleAdminProductGridColumnsDropdownActionGroup"> | ||
<annotations> | ||
<description>Toggles Admin Product Grid 'Columns' dropdown.</description> | ||
</annotations> | ||
|
||
<click selector="{{AdminProductGridFilterSection.columnsDropdown}}" stepKey="toggleColumnsDropdown"/> | ||
</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
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
64 changes: 64 additions & 0 deletions
64
app/code/Magento/Catalog/Test/Mftf/Test/AdminCheckProductListPriceAttributesTest.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,64 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- | ||
/** | ||
* Copyright © Magento, Inc. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
--> | ||
|
||
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> | ||
<test name="AdminCheckProductListPriceAttributesTest"> | ||
<annotations> | ||
<stories value="Check price attributes values on Admin Product List"/> | ||
<title value="Check price attributes values on Admin Product List."/> | ||
<description value="Login as admin, create simple product, add cost, special price. Go to Admin | ||
Product List page filter grid by created product, add mentioned columns to grid, check values."/> | ||
<group value="catalog"/> | ||
</annotations> | ||
<before> | ||
<actionGroup ref="AdminLoginActionGroup" stepKey="loginToAdminPanel"/> | ||
<createData entity="SimpleOutOfStockProductWithSpecialPriceAndCost" stepKey="createSimpleProduct"/> | ||
|
||
<actionGroup ref="AdminOpenProductIndexPageActionGroup" stepKey="adminOpenProductIndexPage"/> | ||
<actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterProductGridByCreatedSimpleProductSku"> | ||
<argument name="product" value="$$createSimpleProduct$$"/> | ||
</actionGroup> | ||
</before> | ||
<after> | ||
<actionGroup ref="ClearFiltersAdminProductGridActionGroup" stepKey="clearFiltersAdminProductGrid"/> | ||
<actionGroup ref="ToggleAdminProductGridColumnsDropdownActionGroup" stepKey="openToResetColumnsDropdown"/> | ||
<actionGroup ref="ResetAdminProductGridColumnsActionGroup" stepKey="resetAdminProductGridColumns"/> | ||
|
||
<deleteData createDataKey="createSimpleProduct" stepKey="deleteSimpleProduct"/> | ||
<actionGroup ref="logout" stepKey="logout"/> | ||
<!-- Reindex invalidated indices after product attribute has been created/deleted --> | ||
<actionGroup ref="CliRunReindexUsingCronJobsActionGroup" stepKey="reindexInvalidatedIndices"/> | ||
</after> | ||
|
||
<actionGroup ref="ToggleAdminProductGridColumnsDropdownActionGroup" stepKey="openColumnsDropdown"/> | ||
<actionGroup ref="CheckAdminProductGridColumnOptionActionGroup" stepKey="checkSpecialPriceOption"> | ||
<argument name="optionName" value="Special Price"/> | ||
</actionGroup> | ||
<actionGroup ref="CheckAdminProductGridColumnOptionActionGroup" stepKey="checkCostOption"> | ||
<argument name="optionName" value="Cost"/> | ||
</actionGroup> | ||
<actionGroup ref="ToggleAdminProductGridColumnsDropdownActionGroup" stepKey="closeColumnsDropdown"/> | ||
|
||
<actionGroup ref="AssertAdminProductGridCellActionGroup" stepKey="seePrice"> | ||
<argument name="row" value="1"/> | ||
<argument name="column" value="Price"/> | ||
<argument name="value" value="${{SimpleOutOfStockProduct.price}}"/> | ||
</actionGroup> | ||
<actionGroup ref="AssertAdminProductGridCellActionGroup" stepKey="seeCorrectSpecialPrice"> | ||
<argument name="row" value="1"/> | ||
<argument name="column" value="Special Price"/> | ||
<argument name="value" value="${{ApiProductSpecialPrice.value}}"/> | ||
</actionGroup> | ||
<actionGroup ref="AssertAdminProductGridCellActionGroup" stepKey="seeCorrectCost"> | ||
<argument name="row" value="1"/> | ||
<argument name="column" value="Cost"/> | ||
<argument name="value" value="${{ApiProductCost.value}}"/> | ||
</actionGroup> | ||
</test> | ||
</tests> |
105 changes: 105 additions & 0 deletions
105
app/code/Magento/Catalog/Ui/DataProvider/Product/Modifier/PriceAttributes.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,105 @@ | ||
<?php | ||
/** | ||
* Copyright © Magento, Inc. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
declare(strict_types=1); | ||
|
||
namespace Magento\Catalog\Ui\DataProvider\Product\Modifier; | ||
|
||
use Magento\Framework\Currency; | ||
use Magento\Framework\Exception\NoSuchEntityException; | ||
use Magento\Framework\Locale\CurrencyInterface; | ||
use Magento\Store\Api\Data\StoreInterface; | ||
use Magento\Store\Model\StoreManagerInterface; | ||
use Magento\Ui\DataProvider\Modifier\ModifierInterface; | ||
|
||
/** | ||
* Modify product listing price attributes | ||
*/ | ||
class PriceAttributes implements ModifierInterface | ||
{ | ||
/** | ||
* @var array | ||
*/ | ||
private $priceAttributeList; | ||
|
||
/** | ||
* @var StoreManagerInterface | ||
*/ | ||
private $storeManager; | ||
|
||
/** | ||
* @var CurrencyInterface | ||
*/ | ||
private $localeCurrency; | ||
|
||
/** | ||
* PriceAttributes constructor. | ||
* | ||
* @param StoreManagerInterface $storeManager | ||
* @param CurrencyInterface $localeCurrency | ||
* @param array $priceAttributeList | ||
*/ | ||
public function __construct( | ||
StoreManagerInterface $storeManager, | ||
CurrencyInterface $localeCurrency, | ||
array $priceAttributeList = [] | ||
) { | ||
$this->storeManager = $storeManager; | ||
$this->localeCurrency = $localeCurrency; | ||
$this->priceAttributeList = $priceAttributeList; | ||
} | ||
|
||
/** | ||
* @inheritdoc | ||
*/ | ||
public function modifyData(array $data): array | ||
{ | ||
if (empty($data) || empty($this->priceAttributeList)) { | ||
return $data; | ||
} | ||
|
||
foreach ($data['items'] as &$item) { | ||
foreach ($this->priceAttributeList as $priceAttribute) { | ||
if (isset($item[$priceAttribute])) { | ||
$item[$priceAttribute] = $this->getCurrency()->toCurrency(sprintf("%f", $item[$priceAttribute])); | ||
} | ||
} | ||
} | ||
|
||
return $data; | ||
} | ||
|
||
/** | ||
* @inheritdoc | ||
*/ | ||
public function modifyMeta(array $meta): array | ||
{ | ||
return $meta; | ||
} | ||
|
||
/** | ||
* Retrieve store | ||
* | ||
* @return StoreInterface | ||
* @throws NoSuchEntityException | ||
*/ | ||
private function getStore(): StoreInterface | ||
{ | ||
return $this->storeManager->getStore(); | ||
} | ||
|
||
/** | ||
* Retrieve currency | ||
* | ||
* @return Currency | ||
* @throws NoSuchEntityException | ||
*/ | ||
private function getCurrency(): Currency | ||
{ | ||
$baseCurrencyCode = $this->getStore()->getBaseCurrencyCode(); | ||
|
||
return $this->localeCurrency->getCurrency($baseCurrencyCode); | ||
} | ||
} |
Oops, something went wrong.