Skip to content

Commit 4f7e598

Browse files
authored
Merge pull request #7869 from magento-gl/Hammer_Community_Backlog_06092022
[2.4.6]_Hammer_community_Backlog_06092022
2 parents 3a25a26 + da7bdd1 commit 4f7e598

File tree

17 files changed

+255
-14
lines changed

17 files changed

+255
-14
lines changed

app/code/Magento/CatalogGraphQl/DataProvider/Product/LayeredNavigation/Builder/Category.php

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
use Magento\Framework\Api\Search\AggregationValueInterface;
1818
use Magento\Framework\Api\Search\BucketInterface;
1919
use Magento\Framework\App\ResourceConnection;
20+
use Magento\Framework\GraphQl\Query\Uid;
2021

2122
/**
2223
* Category layer builder
@@ -75,6 +76,9 @@ class Category implements LayerBuilderInterface
7576
*/
7677
private Aggregations\Category\IncludeDirectChildrenOnly $includeDirectChildrenOnly;
7778

79+
/** @var Uid */
80+
private Uid $uidEncoder;
81+
7882
/**
7983
* @param CategoryAttributeQuery $categoryAttributeQuery
8084
* @param CategoryAttributesMapper $attributesMapper
@@ -83,6 +87,7 @@ class Category implements LayerBuilderInterface
8387
* @param LayerFormatter $layerFormatter
8488
* @param Aggregations\Category\IncludeDirectChildrenOnly $includeDirectChildrenOnly
8589
* @param CollectionFactory $categoryCollectionFactory
90+
* @param Uid $uidEncoder
8691
*/
8792
public function __construct(
8893
CategoryAttributeQuery $categoryAttributeQuery,
@@ -91,7 +96,8 @@ public function __construct(
9196
ResourceConnection $resourceConnection,
9297
LayerFormatter $layerFormatter,
9398
Aggregations\Category\IncludeDirectChildrenOnly $includeDirectChildrenOnly,
94-
CollectionFactory $categoryCollectionFactory
99+
CollectionFactory $categoryCollectionFactory,
100+
Uid $uidEncoder
95101
) {
96102
$this->categoryAttributeQuery = $categoryAttributeQuery;
97103
$this->attributesMapper = $attributesMapper;
@@ -100,6 +106,7 @@ public function __construct(
100106
$this->layerFormatter = $layerFormatter;
101107
$this->includeDirectChildrenOnly = $includeDirectChildrenOnly;
102108
$this->categoryCollectionFactory = $categoryCollectionFactory;
109+
$this->uidEncoder = $uidEncoder;
103110
}
104111

105112
/**
@@ -155,7 +162,7 @@ function (AggregationValueInterface $value) {
155162
}
156163
$result['options'][] = $this->layerFormatter->buildItem(
157164
$categoryLabels[$categoryId] ?? $categoryId,
158-
$categoryId,
165+
$this->uidEncoder->encode((string) $categoryId),
159166
$value->getMetrics()['count']
160167
);
161168
}

app/code/Magento/Config/Controller/Adminhtml/System/Config/Save.php

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
use Magento\Framework\App\Action\HttpPostActionInterface as HttpPostActionInterface;
1010
use Magento\Config\Controller\Adminhtml\System\AbstractConfig;
11+
use Magento\Framework\Exception\LocalizedException;
1112

1213
/**
1314
* System Configuration Save Controller
@@ -221,6 +222,20 @@ public function execute()
221222
];
222223
$configData = $this->filterNodes($configData);
223224

225+
$groups = $this->getRequest()->getParam('groups');
226+
227+
if (isset($groups['country']['fields'])) {
228+
if (isset($groups['country']['fields']['eu_countries'])) {
229+
$countries = $groups['country']['fields']['eu_countries'];
230+
if (empty($countries['value']) &&
231+
!isset($countries['inherit'])) {
232+
throw new LocalizedException(
233+
__('Something went wrong while saving this configuration.')
234+
);
235+
}
236+
}
237+
}
238+
224239
/** @var \Magento\Config\Model\Config $configModel */
225240
$configModel = $this->_configFactory->create(['data' => $configData]);
226241
$configModel->save();
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
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="EuropeanCountriesOptionActionGroup">
12+
<annotations>
13+
<description>Validate european country option value</description>
14+
</annotations>
15+
16+
<amOnPage url="{{AdminConfigGeneralPage.url}}" stepKey="navigateToAdminStoreConfiguration"/>
17+
<conditionalClick selector="{{CountriesFormSection.block}}" dependentSelector="{{CountriesFormSection.label}}" visible="false" stepKey="expand_panel"/>
18+
<scrollTo selector="{{CountriesFormSection.label}}" stepKey="scrolltolabel" />
19+
<wait time="2" stepKey="waitForLoad"/>
20+
<uncheckOption selector="{{CountriesFormSection.useConfigSettings}}" stepKey="uncheckConfigSetting"/>
21+
<wait time="2" stepKey="waitForLoad1"/>
22+
<click selector="{{CountriesFormSection.saveConfig}}" stepKey="clickSave"/>
23+
</actionGroup>
24+
</actionGroups>
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
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+
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
11+
<section name="CountriesFormSection">
12+
<element name="optionvalue" type="select" selector='//*[@id="general_country_eu_countries"]'/>
13+
<element name="saveConfig" type="button" selector="#save" timeout="30"/>
14+
<element name="label" type="input" selector="#row_general_country_optional_zip_countries"/>
15+
<element name="useConfigSettings" type="checkbox" selector="//input[@name='groups[country][fields][eu_countries][inherit]']"/>
16+
<element name="block" type="button" selector='a#general_country-head'/>
17+
</section>
18+
</sections>
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
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+
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
10+
<test name="ValidateEuropeanCountriesOptionValue">
11+
<annotations>
12+
<features value="Backend"/>
13+
<stories value="Check european countries option value"/>
14+
<title value="There must be atleast one european country selected"/>
15+
<description value="There must be atleast one european country selected"/>
16+
<severity value="CRITICAL"/>
17+
<group value="config"/>
18+
<testCaseId value="AC-6385"/>
19+
</annotations>
20+
<before>
21+
<actionGroup ref="AdminLoginActionGroup" stepKey="login"/>
22+
<actionGroup ref="EuropeanCountriesOptionActionGroup" stepKey="validate"/>
23+
</before>
24+
<after>
25+
<actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/>
26+
</after>
27+
</test>
28+
</tests>

app/code/Magento/Customer/Test/Mftf/ActionGroup/StorefrontFillBillingAddressActionGroup.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* See COPYING.txt for license details.
66
*/
77
-->
8-
8+
99
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
1010
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
1111
<actionGroup name="StorefrontFillBillingAddressActionGroup">
@@ -21,4 +21,4 @@
2121
<fillField selector="{{CheckoutPaymentSection.guestTelephone}}" userInput="{{address.telephone}}" stepKey="enterTelephone"/>
2222
<waitForLoadingMaskToDisappear stepKey="waitForLoadingMask"/>
2323
</actionGroup>
24-
</actionGroups>
24+
</actionGroups>
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
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="ZeroTaxSubtotalActionGroup">
12+
<annotations>
13+
<description>Zero tax subtotal should not be displayed on frontend after admin config setting</description>
14+
</annotations>
15+
<arguments>
16+
<argument name="optionValue" type="string" defaultValue="{{DefaultTotalFlagZero.value}}"/>
17+
</arguments>
18+
<amOnPage url="{{AdminTaxConfigurationPage.url}}" stepKey="navigateToAdminStoreTaxConfiguration"/>
19+
<scrollTo selector="{{AdminZeroTaxFormSection.label}}" stepKey="scrollToDropdownSelection" />
20+
<selectOption selector="{{AdminZeroTaxFormSection.optionvalue}}" userInput="{{optionValue}}" stepKey="setSelectorValue"/>
21+
<click selector="{{AdminZeroTaxFormSection.saveConfig}}" stepKey="clickSave"/>
22+
</actionGroup>
23+
</actionGroups>
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
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+
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
11+
<section name="AdminZeroTaxFormSection">
12+
<element name="optionvalue" type="select" selector="select#tax_cart_display_zero_tax"/>
13+
<element name="saveConfig" type="button" selector="#save" timeout="30"/>
14+
<element name="label" type="input" selector="#row_tax_cart_display_zero_tax"/>
15+
</section>
16+
</sections>
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
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+
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
11+
<test name="StoreFrontZeroTaxSettingCheckOnCartPage">
12+
<annotations>
13+
<stories value="Storefront cart page"/>
14+
<title value="Zero tax configuration for multiple shipping methods on Cart page"/>
15+
<description value="Zero tax configuration for multiple shipping methods on Cart page"/>
16+
<severity value="MINOR"/>
17+
<testCaseId value="AC-3201"/>
18+
<group value="Tax"/>
19+
</annotations>
20+
<before>
21+
<actionGroup ref="AdminLoginActionGroup" stepKey="login"/>
22+
<actionGroup ref="ZeroTaxSubtotalActionGroup" stepKey="zerosubtotal"/>
23+
<createData entity="_defaultCategory" stepKey="createCategory"/>
24+
<createData entity="SimpleProduct" stepKey="createProduct01">
25+
<requiredEntity createDataKey="createCategory"/>
26+
</createData>
27+
</before>
28+
<after>
29+
<actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/>
30+
<deleteData createDataKey="createCategory" stepKey="deleteCategory"/>
31+
<deleteData createDataKey="createProduct01" stepKey="deleteProduct1"/>
32+
</after>
33+
34+
<amOnPage url="$$createProduct01.custom_attributes[url_key]$$.html" stepKey="goToSimpleProductPage"/>
35+
<waitForPageLoad stepKey="waitForSimpleProductPage"/>
36+
<waitForElementClickable selector="{{StorefrontProductActionSection.addToCart}}" stepKey="waitForAddToCartButton"/>
37+
<click stepKey="addSimpleProductToCart" selector="{{StorefrontProductActionSection.addToCart}}"/>
38+
<waitForPageLoad stepKey="waitForProductAdded"/>
39+
<see stepKey="seeSuccess" selector="{{StorefrontMessagesSection.success}}" userInput="You added"/>
40+
<actionGroup ref="StorefrontCartPageOpenActionGroup" stepKey="goToCartPage" />
41+
<dontSeeElement selector="//*[@id='cart-totals']/div/table/tbody/tr[2]/th[contains(text(),'Tax')]" stepKey="checkZerotaxVisible"/>
42+
</test>
43+
</tests>

app/code/Magento/Tax/view/frontend/web/js/view/checkout/cart/totals/tax.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ define([
2121
* @override
2222
*/
2323
ifShowValue: function () {
24-
if (this.getPureValue() === 0) {
24+
if (parseInt(this.getPureValue()) === 0) { //eslint-disable-line radix
2525
return isZeroTaxDisplayed;
2626
}
2727

0 commit comments

Comments
 (0)