Skip to content

Commit 57b2f85

Browse files
🔃 [Magento Community Engineering] Community Contributions - 2.3-develop
Accepted Community Pull Requests: - #25582: Covering the AllowedQuantity by Unit Test (by @eduard13) - #25590: Add Poland regions (by @Bartlomiejsz) - #25584: [Signifyd] Making system configs dependent by Active field (by @eduard13) - #25556: WYSIWYG-Editor Insert Image-Popup is not working correctly with multiple WYSIWYG-Editors on page (by @engcom-Golf) - #25380: MAGETWO-98251 Position remove icon in sidebar (by @ptylek) Fixed GitHub Issues: - #622: FIX Magento Search Please! (reported by @gfxguru) has been fixed in #25556 by @engcom-Golf in 2.3-develop branch Related commits: 1. f229056 2. a07627c 3. 8e39f49 4. 3be5ac8 5. 76a866e 6. 26dca10 - #18548: WYSIWYG-Editor Insert Image-Popup is not working correctly with multiple WYSIWYG-Editors on page (reported by @4ctobias) has been fixed in #25556 by @engcom-Golf in 2.3-develop branch Related commits: 1. f229056 2. a07627c 3. 8e39f49 4. 3be5ac8 5. 76a866e 6. 26dca10 - #23966: WYSIWYG image upload dialog hangs up (reported by @sshymko) has been fixed in #25556 by @engcom-Golf in 2.3-develop branch Related commits: 1. f229056 2. a07627c 3. 8e39f49 4. 3be5ac8 5. 76a866e 6. 26dca10 - #21190: The Wishlist removing icon isn't correctly positioned on category pages (reported by @eduard13) has been fixed in #25380 by @ptylek in 2.3-develop branch Related commits: 1. dd33d87 2. a26ca31 3. 1ccd6a2 4. d9e0cfd 5. 4381ce2 6. e619c26 7. 3267575 8. 39988a1
2 parents 3397b2b + 8c9008e commit 57b2f85

File tree

11 files changed

+300
-15
lines changed

11 files changed

+300
-15
lines changed

app/code/Magento/Customer/Test/Mftf/Data/AddressData.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,7 @@
292292
<item>Piwowarska 6</item>
293293
</array>
294294
<data key="city">Bielsko-Biała</data>
295-
<data key="state"> Bielsko</data>
295+
<data key="state">śląskie</data>
296296
<data key="country_id">PL</data>
297297
<data key="country">Poland</data>
298298
<data key="postcode">43-310</data>

app/code/Magento/Customer/Test/Mftf/Test/AdminCreateCustomerWithCountryPolandTest.xml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
<click selector="{{AdminCustomerGridSection.firstRowEditLink}}" stepKey="clickOnEditButton"/>
3535
<waitForPageLoad stepKey="waitForCustomerEditPageToLoad"/>
3636

37-
<!--Add the Address -->
37+
<!-- Add the Address -->
3838
<click selector="{{AdminEditCustomerAddressesSection.addresses}}" stepKey="selectAddress"/>
3939
<waitForPageLoad stepKey="waitForAddressPageToLoad"/>
4040
<click selector="{{AdminEditCustomerAddressesSection.addNewAddress}}" stepKey="ClickOnAddNewAddressButton"/>
@@ -44,6 +44,7 @@
4444
<fillField selector="{{AdminEditCustomerAddressesSection.city}}" userInput="{{PolandAddress.city}}" stepKey="fillCity"/>
4545
<scrollTo selector="{{AdminEditCustomerAddressesSection.phone}}" x="0" y="-80" stepKey="scrollToPhone"/>
4646
<selectOption selector="{{AdminEditCustomerAddressesSection.country}}" userInput="{{PolandAddress.country}}" stepKey="fillCountry"/>
47+
<selectOption selector="{{AdminEditCustomerAddressesSection.state}}" userInput="{{PolandAddress.state}}" stepKey="fillState"/>
4748
<fillField selector="{{AdminEditCustomerAddressesSection.zipCode}}" userInput="{{PolandAddress.postcode}}" stepKey="fillPostCode"/>
4849
<fillField selector="{{AdminEditCustomerAddressesSection.phone}}" userInput="{{PolandAddress.telephone}}" stepKey="fillPhoneNumber"/>
4950
<scrollToTopOfPage stepKey="scrollToTopOfPage"/>
@@ -60,6 +61,7 @@
6061
<see userInput="$$createCustomer.firstname$$" selector="{{AdminCustomerGridSection.customerGrid}}" stepKey="assertFirstName"/>
6162
<see userInput="$$createCustomer.lastname$$" selector="{{AdminCustomerGridSection.customerGrid}}" stepKey="assertLastName"/>
6263
<see userInput="$$createCustomer.email$$" selector="{{AdminCustomerGridSection.customerGrid}}" stepKey="assertEmail"/>
64+
<see userInput="{{PolandAddress.state}}" selector="{{AdminCustomerGridSection.customerGrid}}" stepKey="assertState"/>
6365
<see userInput="{{PolandAddress.country}}" selector="{{AdminCustomerGridSection.customerGrid}}" stepKey="assertCountry"/>
6466
<see userInput="{{PolandAddress.postcode}}" selector="{{AdminCustomerGridSection.customerGrid}}" stepKey="assertPostCode"/>
6567
<see userInput="{{PolandAddress.telephone}}" selector="{{AdminCustomerGridSection.customerGrid}}" stepKey="assertPhoneNumber"/>
@@ -86,6 +88,7 @@
8688
<see selector="{{AdminCustomerAddressesGridSection.customerAddressGrid}}" userInput="{{PolandAddress.street}}" stepKey="seeStreetAddress"/>
8789
<see selector="{{AdminCustomerAddressesGridSection.customerAddressGrid}}" userInput="{{PolandAddress.city}}" stepKey="seeCity"/>
8890
<see selector="{{AdminCustomerAddressesGridSection.customerAddressGrid}}" userInput="{{PolandAddress.country}}" stepKey="seeCountry"/>
91+
<see selector="{{AdminCustomerAddressesGridSection.customerAddressGrid}}" userInput="{{PolandAddress.state}}" stepKey="seeState"/>
8992
<see selector="{{AdminCustomerAddressesGridSection.customerAddressGrid}}" userInput="{{PolandAddress.postcode}}" stepKey="seePostCode"/>
9093
<see selector="{{AdminCustomerAddressesGridSection.customerAddressGrid}}" userInput="{{PolandAddress.telephone}}" stepKey="seePhoneNumber"/>
9194
</test>
Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
<?php
2+
/**
3+
* Copyright © Magento, Inc. All rights reserved.
4+
* See PLPYING.txt for license details.
5+
*/
6+
7+
declare(strict_types=1);
8+
9+
namespace Magento\Directory\Setup\Patch\Data;
10+
11+
use Magento\Directory\Setup\DataInstaller;
12+
use Magento\Directory\Setup\DataInstallerFactory;
13+
use Magento\Framework\Setup\ModuleDataSetupInterface;
14+
use Magento\Framework\Setup\Patch\DataPatchInterface;
15+
16+
/**
17+
* Add Poland States
18+
*/
19+
class AddDataForPoland implements DataPatchInterface
20+
{
21+
/**
22+
* @var ModuleDataSetupInterface
23+
*/
24+
private $moduleDataSetup;
25+
26+
/**
27+
* @var DataInstallerFactory
28+
*/
29+
private $dataInstallerFactory;
30+
31+
/**
32+
* @param ModuleDataSetupInterface $moduleDataSetup
33+
* @param DataInstallerFactory $dataInstallerFactory
34+
*/
35+
public function __construct(
36+
ModuleDataSetupInterface $moduleDataSetup,
37+
DataInstallerFactory $dataInstallerFactory
38+
) {
39+
$this->moduleDataSetup = $moduleDataSetup;
40+
$this->dataInstallerFactory = $dataInstallerFactory;
41+
}
42+
43+
/**
44+
* @inheritdoc
45+
*/
46+
public function apply()
47+
{
48+
/** @var DataInstaller $dataInstaller */
49+
$dataInstaller = $this->dataInstallerFactory->create();
50+
$dataInstaller->addCountryRegions(
51+
$this->moduleDataSetup->getConnection(),
52+
$this->getDataForPoland()
53+
);
54+
}
55+
56+
/**
57+
* Poland states data.
58+
*
59+
* @return array
60+
*/
61+
private function getDataForPoland()
62+
{
63+
return [
64+
['PL', 'PL-02', 'dolnośląskie'],
65+
['PL', 'PL-04', 'kujawsko-pomorskie'],
66+
['PL', 'PL-06', 'lubelskie'],
67+
['PL', 'PL-08', 'lubuskie'],
68+
['PL', 'PL-10', 'łódzkie'],
69+
['PL', 'PL-12', 'małopolskie'],
70+
['PL', 'PL-14', 'mazowieckie'],
71+
['PL', 'PL-16', 'opolskie'],
72+
['PL', 'PL-18', 'podkarpackie'],
73+
['PL', 'PL-20', 'podlaskie'],
74+
['PL', 'PL-22', 'pomorskie'],
75+
['PL', 'PL-24', 'śląskie'],
76+
['PL', 'PL-26', 'świętokrzyskie'],
77+
['PL', 'PL-28', 'warmińsko-mazurskie'],
78+
['PL', 'PL-30', 'wielkopolskie'],
79+
['PL', 'PL-32', 'zachodniopomorskie'],
80+
];
81+
}
82+
83+
/**
84+
* @inheritdoc
85+
*/
86+
public static function getDependencies()
87+
{
88+
return [
89+
InitializeDirectoryData::class,
90+
];
91+
}
92+
93+
/**
94+
* @inheritdoc
95+
*/
96+
public function getAliases()
97+
{
98+
return [];
99+
}
100+
}

app/code/Magento/Signifyd/etc/adminhtml/system.xml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,22 +41,34 @@
4141
<comment><![CDATA[Your API key can be found on the <a href="http://signifyd.com/settings" target="_blank">settings page</a> in the Signifyd console.]]></comment>
4242
<config_path>fraud_protection/signifyd/api_key</config_path>
4343
<backend_model>Magento\Config\Model\Config\Backend\Encrypted</backend_model>
44+
<depends>
45+
<field id="active">1</field>
46+
</depends>
4447
</field>
4548
<field id="api_url" translate="label" type="text" sortOrder="30" showInDefault="1" showInWebsite="1" showInStore="0">
4649
<label>API URL</label>
4750
<config_path>fraud_protection/signifyd/api_url</config_path>
4851
<comment>Don’t change unless asked to do so.</comment>
52+
<depends>
53+
<field id="active">1</field>
54+
</depends>
4955
</field>
5056
<field id="debug" translate="label" type="select" sortOrder="40" showInDefault="1" showInWebsite="1" showInStore="0">
5157
<label>Debug</label>
5258
<source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
5359
<config_path>fraud_protection/signifyd/debug</config_path>
60+
<depends>
61+
<field id="active">1</field>
62+
</depends>
5463
</field>
5564
<field id="webhook_url" translate="label comment" type="text" sortOrder="50" showInDefault="1" showInWebsite="1" showInStore="0">
5665
<label>Webhook URL</label>
5766
<comment><![CDATA[Your webhook URL will be used to <a href="https://app.signifyd.com/settings/notifications" target="_blank">configure</a> a guarantee completed webhook in Signifyd. Webhooks are used to sync Signifyd`s guarantee decisions back to Magento.]]></comment>
5867
<attribute type="handler_url">signifyd/webhooks/handler</attribute>
5968
<frontend_model>Magento\Signifyd\Block\Adminhtml\System\Config\Field\WebhookUrl</frontend_model>
69+
<depends>
70+
<field id="active">1</field>
71+
</depends>
6072
</field>
6173
</group>
6274
</group>
Lines changed: 139 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,139 @@
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\Wishlist\Test\Unit\ViewModel;
9+
10+
use Magento\Catalog\Model\Product;
11+
use Magento\Catalog\Model\Product\Configuration\Item\ItemInterface;
12+
use Magento\CatalogInventory\Model\StockRegistry;
13+
use Magento\Store\Model\Store;
14+
use Magento\Wishlist\ViewModel\AllowedQuantity;
15+
use PHPUnit\Framework\MockObject\MockObject;
16+
use PHPUnit\Framework\TestCase;
17+
18+
/**
19+
* Class AllowedQuantityTest
20+
*/
21+
class AllowedQuantityTest extends TestCase
22+
{
23+
/**
24+
* @var AllowedQuantity
25+
*/
26+
private $sut;
27+
28+
/**
29+
* @var StockRegistry|MockObject
30+
*/
31+
private $stockRegistryMock;
32+
33+
/**
34+
* @var ItemInterface|MockObject
35+
*/
36+
private $itemMock;
37+
38+
/**
39+
* @var Product|MockObject
40+
*/
41+
private $productMock;
42+
43+
/**
44+
* @var Store|MockObject
45+
*/
46+
private $storeMock;
47+
48+
/**
49+
* Set Up
50+
*/
51+
protected function setUp()
52+
{
53+
$this->stockRegistryMock = $this->createMock(StockRegistry::class);
54+
$this->itemMock = $this->getMockForAbstractClass(
55+
ItemInterface::class,
56+
[],
57+
'',
58+
false,
59+
true,
60+
true,
61+
['getMinSaleQty', 'getMaxSaleQty']
62+
);
63+
$this->productMock = $this->getMockBuilder(Product::class)
64+
->disableOriginalConstructor()
65+
->getMock();
66+
$this->storeMock = $this->getMockBuilder(Store::class)
67+
->disableOriginalConstructor()
68+
->getMock();
69+
70+
$this->sut = new AllowedQuantity(
71+
$this->stockRegistryMock
72+
);
73+
$this->sut->setItem($this->itemMock);
74+
}
75+
76+
/**
77+
* Getting min and max qty test.
78+
*
79+
* @dataProvider saleQuantityDataProvider
80+
*
81+
* @param int $minSaleQty
82+
* @param int $maxSaleQty
83+
* @param array $expectedResult
84+
*/
85+
public function testGettingMinMaxQty(int $minSaleQty, int $maxSaleQty, array $expectedResult)
86+
{
87+
$this->storeMock->expects($this->atLeastOnce())
88+
->method('getWebsiteId')
89+
->willReturn(1);
90+
$this->productMock->expects($this->atLeastOnce())
91+
->method('getId')
92+
->willReturn(1);
93+
$this->productMock->expects($this->atLeastOnce())
94+
->method('getStore')
95+
->willReturn($this->storeMock);
96+
$this->itemMock->expects($this->any())
97+
->method('getProduct')
98+
->willReturn($this->productMock);
99+
$this->itemMock->expects($this->any())
100+
->method('getMinSaleQty')
101+
->willReturn($minSaleQty);
102+
$this->itemMock->expects($this->any())
103+
->method('getMaxSaleQty')
104+
->willReturn($maxSaleQty);
105+
$this->stockRegistryMock->expects($this->any())
106+
->method('getStockItem')
107+
->will($this->returnValue($this->itemMock));
108+
109+
$result = $this->sut->getMinMaxQty();
110+
111+
$this->assertEquals($result, $expectedResult);
112+
}
113+
114+
/**
115+
* Sales quantity provider
116+
*
117+
* @return array
118+
*/
119+
public function saleQuantityDataProvider(): array
120+
{
121+
return [
122+
[
123+
1,
124+
10,
125+
[
126+
'minAllowed' => 1,
127+
'maxAllowed' => 10
128+
]
129+
], [
130+
1,
131+
0,
132+
[
133+
'minAllowed' => 1,
134+
'maxAllowed' => 99999999
135+
]
136+
]
137+
];
138+
}
139+
}

app/design/frontend/Magento/blank/Magento_Catalog/web/css/source/_module.less

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -457,9 +457,11 @@
457457
.action {
458458
&.delete {
459459
&:extend(.abs-remove-button-for-blocks all);
460+
line-height: unset;
460461
position: absolute;
461462
right: 0;
462-
top: 0;
463+
top: -1px;
464+
width: auto;
463465
}
464466
}
465467

app/design/frontend/Magento/blank/web/css/source/_layout.less

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,11 +125,14 @@
125125
}
126126

127127
.page-layout-2columns-left {
128+
.main {
129+
padding-left: @layout-column__additional-sidebar-offset
130+
}
131+
128132
.sidebar-additional {
129133
clear: left;
130134
float: left;
131135
padding-left: 0;
132-
padding-right: @layout-column__additional-sidebar-offset;
133136
}
134137
}
135138

app/design/frontend/Magento/luma/Magento_Catalog/web/css/source/_module.less

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -397,7 +397,7 @@
397397

398398
.box-tocart {
399399
&:extend(.abs-box-tocart all);
400-
400+
401401
.field.qty {
402402
}
403403

@@ -987,6 +987,24 @@
987987
}
988988
}
989989
}
990+
991+
.media-width(@extremum, @break) when (@extremum = 'min') and (@break = @screen__s) {
992+
.sidebar {
993+
.product-items {
994+
.action {
995+
&.delete {
996+
&:extend(.abs-remove-button-for-blocks all);
997+
line-height: unset;
998+
position: absolute;
999+
right: 0;
1000+
top: -1px;
1001+
width: auto;
1002+
}
1003+
}
1004+
}
1005+
}
1006+
}
1007+
9901008
.media-width(@extremum, @break) when (@extremum = 'max') and (@break = @screen__m) {
9911009
.compare.wrapper,
9921010
[class*='block-compare'] {

app/design/frontend/Magento/luma/Magento_Catalog/web/css/source/module/_listings.less

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -360,13 +360,12 @@
360360
position: absolute;
361361
top: -2px;
362362
width: 100%;
363-
z-index: 1;
363+
z-index: -1;
364364
}
365365
}
366366
}
367367

368368
.product-item-actions {
369-
position: relative;
370369
z-index: 1;
371370
}
372371
}

0 commit comments

Comments
 (0)