Skip to content

Commit 1dc62a7

Browse files
🔃 [Magento Community Engineering] Community Contributions - 2.4-develop
Accepted Community Pull Requests: - #27896: ui select list visible even though it is disabled (by @Mohamed-Asar) - #28689: #28431 issue fixed (by @syed-ziffity) - #29771: Remove space between textarea field in contact form (by @mrtuvn) - #29278: Resolve Can not export Coupon Code to CSV,XML issue29277 (by @edenduong) - #29861: Fix issue with saving filters from url-applier to default view of bookmark (by @Nazar65) - #29913: Removed redundant less styles navigation in blank theme (by @mrtuvn) - #29856: removed redundant and clean code less (by @mrtuvn) - #29276: Redirect to "Options" config path more accurate (in Currency Rate form) (by @edenduong) Fixed GitHub Issues: - #29098: [Issue] ui select list visible even though it is disabled (reported by @m2-assistant[bot]) has been fixed in #27896 by @Mohamed-Asar in 2.4-develop branch Related commits: 1. 6ba9fff 2. 2e75bae 3. 66ee024 - #28431: REST API Bundle Product Details Price Issue (reported by @mack4hack) has been fixed in #28689 by @syed-ziffity in 2.4-develop branch Related commits: 1. 8974e16 2. e962d7c 3. 2178617 4. 7f4eccb 5. 34a6433 6. 1d82b50 - #29779: [Issue] Remove space between textarea field in contact form (reported by @m2-assistant[bot]) has been fixed in #29771 by @mrtuvn in 2.4-develop branch Related commits: 1. 16f97b0 - #29277: Can not export Coupon Code to CSV,XML (reported by @edenduong) has been fixed in #29278 by @edenduong in 2.4-develop branch Related commits: 1. ca09097 2. c82e68f 3. e04514e 4. af02e48 5. c379cea - #1789: Merchant beta release date? (reported by @CRYX2) has been fixed in #29861 by @Nazar65 in 2.4-develop branch Related commits: 1. 04a9f44 2. 47b5eea - #29914: [Issue] Removed redundant less styles navigation in blank theme (reported by @m2-assistant[bot]) has been fixed in #29913 by @mrtuvn in 2.4-develop branch Related commits: 1. 1b76317 - #29857: [Issue] removed redundant and clean code less (reported by @m2-assistant[bot]) has been fixed in #29856 by @mrtuvn in 2.4-develop branch Related commits: 1. c1cac89 - #29336: [Issue] Redirect to "Options" config path more accurate (in Currency Rate form) (reported by @m2-assistant[bot]) has been fixed in #29276 by @edenduong in 2.4-develop branch Related commits: 1. 37e5e15 2. dc8a387 3. 2ffc03f 4. 1e8f523
2 parents d4d757b + 58e9748 commit 1dc62a7

File tree

18 files changed

+359
-44
lines changed

18 files changed

+359
-44
lines changed

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

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ public function __construct(
3939
}
4040

4141
/**
42+
* Bundle Product Items Data
43+
*
4244
* @param \Magento\Catalog\Api\Data\ProductInterface $product
4345
* @param int $optionId
4446
* @return \Magento\Bundle\Api\Data\LinkInterface[]
@@ -50,8 +52,12 @@ public function getItems(\Magento\Catalog\Api\Data\ProductInterface $product, $o
5052
$productLinks = [];
5153
/** @var \Magento\Catalog\Model\Product $selection */
5254
foreach ($selectionCollection as $selection) {
55+
$bundledProductPrice = $selection->getSelectionPriceValue();
56+
if ($bundledProductPrice <= 0) {
57+
$bundledProductPrice = $selection->getPrice();
58+
}
5359
$selectionPriceType = $product->getPriceType() ? $selection->getSelectionPriceType() : null;
54-
$selectionPrice = $product->getPriceType() ? $selection->getSelectionPriceValue() : null;
60+
$selectionPrice = $bundledProductPrice ? $bundledProductPrice : null;
5561

5662
/** @var \Magento\Bundle\Api\Data\LinkInterface $productLink */
5763
$productLink = $this->linkFactory->create();

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ public function testLinksList()
9191
->method('getSelectionsCollection')
9292
->with([$optionId], $this->productMock)
9393
->willReturn([$this->selectionMock]);
94-
$this->productMock->expects($this->exactly(2))->method('getPriceType')->willReturn('price_type');
94+
$this->productMock->expects($this->once())->method('getPriceType')->willReturn('price_type');
9595
$this->selectionMock->expects($this->once())
9696
->method('getSelectionPriceType')
9797
->willReturn('selection_price_type');

app/code/Magento/Contact/view/frontend/templates/form.phtml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,8 @@ $viewModel = $block->getViewModel();
6969
class="input-text"
7070
cols="5"
7171
rows="3"
72-
data-validate="{required:true}"><?= $block->escapeHtml($viewModel->getUserComment()) ?>
73-
</textarea>
72+
data-validate="{required:true}"
73+
><?= $block->escapeHtml($viewModel->getUserComment()) ?></textarea>
7474
</div>
7575
</div>
7676
<?= $block->getChildHtml('form.additional.info') ?>

app/code/Magento/CurrencySymbol/Block/Adminhtml/System/Currency.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,14 @@ protected function _prepareLayout()
4141
]
4242
);
4343

44-
$onClick = "setLocation('" . $this->getUrl('adminhtml/system_config/edit/section/currency') . "')";
44+
$currencyOptionPath = $this->getUrl(
45+
'adminhtml/system_config/edit',
46+
[
47+
'section' => 'currency',
48+
'_fragment' => 'currency_options-link'
49+
]
50+
);
51+
$onClick = "setLocation('$currencyOptionPath')";
4552

4653
$this->getToolbar()->addChild(
4754
'options_button',
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
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="AdminNavigateToCurrencyRatesOptionActionGroup">
12+
<click selector="{{AdminCurrencyRatesSection.options}}" stepKey="clickOptionsButton"/>
13+
<waitForPageLoad stepKey="waitForPageLoad"/>
14+
</actionGroup>
15+
</actionGroups>

app/code/Magento/CurrencySymbol/Test/Mftf/Section/AdminCurrencyRatesSection.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
<section name="AdminCurrencyRatesSection">
1212
<element name="import" type="button" selector="//button[@title='Import']"/>
1313
<element name="saveCurrencyRates" type="button" selector="//button[@title='Save Currency Rates']"/>
14+
<element name="options" type="button" selector="//button[@title='Options']"/>
1415
<element name="oldRate" type="text" selector="//div[contains(@class, 'admin__field-note') and contains(text(), 'Old rate:')]/strong"/>
1516
<element name="rateService" type="select" selector="#rate_services"/>
1617
<element name="currencyRate" type="input" selector="input[name='rate[{{fistCurrency}}][{{secondCurrency}}]']" parameterized="true"/>
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
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="AdminCurrencyOptionsSystemConfigExpandedTabTest">
12+
<annotations>
13+
<features value="Expanded tab on Currency Option page"/>
14+
<stories value="Expanded tab"/>
15+
<title value=" Verify the Currency Option tab expands automatically."/>
16+
<description value="Check auto open the collapse on Currency Option page."/>
17+
<severity value="MINOR"/>
18+
<testCaseId value="MC-37425"/>
19+
</annotations>
20+
<before>
21+
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>
22+
</before>
23+
<after>
24+
<actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/>
25+
</after>
26+
<actionGroup ref="AdminNavigateMenuActionGroup" stepKey="navigateToStoresCurrencyRatesPage">
27+
<argument name="menuUiId" value="{{AdminMenuStores.dataUiId}}"/>
28+
<argument name="submenuUiId" value="{{AdminMenuStoresCurrencyCurrencyRates.dataUiId}}"/>
29+
</actionGroup>
30+
<actionGroup ref="AdminNavigateToCurrencyRatesOptionActionGroup" stepKey="navigateToOptions" />
31+
<grabAttributeFrom selector="{{CurrencySetupSection.currencyOptions}}" userInput="class" stepKey="grabClass"/>
32+
<assertStringContainsString stepKey="assertClass">
33+
<actualResult type="string">{$grabClass}</actualResult>
34+
<expectedResult type="string">open</expectedResult>
35+
</assertStringContainsString>
36+
</test>
37+
</tests>

app/code/Magento/CurrencySymbol/Test/Unit/Block/Adminhtml/System/CurrencyTest.php

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,22 @@
77

88
namespace Magento\CurrencySymbol\Test\Unit\Block\Adminhtml\System;
99

10+
use Magento\Backend\Block\Template\Context;
1011
use Magento\Backend\Block\Widget\Button;
1112
use Magento\CurrencySymbol\Block\Adminhtml\System\Currency;
1213
use Magento\Framework\TestFramework\Unit\Helper\ObjectManager;
1314
use Magento\Framework\View\Element\BlockInterface;
1415
use Magento\Framework\View\LayoutInterface;
1516
use PHPUnit\Framework\TestCase;
17+
use Magento\Framework\UrlInterface;
1618

1719
class CurrencyTest extends TestCase
1820
{
21+
/**
22+
* Stub currency option link url
23+
*/
24+
const STUB_OPTION_LINK_URL = 'https://localhost/admin/system_config/edit/section/currency#currency_options-link';
25+
1926
/**
2027
* Object manager helper
2128
*
@@ -70,12 +77,25 @@ public function testPrepareLayout()
7077
]
7178
);
7279

80+
$contextMock = $this->createMock(Context::class);
81+
$urlBuilderMock = $this->createMock(UrlInterface::class);
82+
83+
$contextMock->expects($this->once())->method('getUrlBuilder')->willReturn($urlBuilderMock);
84+
85+
$urlBuilderMock->expects($this->once())->method('getUrl')->with(
86+
'adminhtml/system_config/edit',
87+
[
88+
'section' => 'currency',
89+
'_fragment' => 'currency_options-link'
90+
]
91+
)->willReturn(self::STUB_OPTION_LINK_URL);
92+
7393
$childBlockMock->expects($this->at(1))
7494
->method('addChild')
7595
->with(
7696
'options_button',
7797
Button::class,
78-
['label' => __('Options'), 'onclick' => 'setLocation(\'\')']
98+
['label' => __('Options'), 'onclick' => 'setLocation(\''.self::STUB_OPTION_LINK_URL.'\')']
7999
);
80100

81101
$childBlockMock->expects($this->at(2))
@@ -90,7 +110,8 @@ public function testPrepareLayout()
90110
$block = $this->objectManagerHelper->getObject(
91111
Currency::class,
92112
[
93-
'layout' => $layoutMock
113+
'layout' => $layoutMock,
114+
'context' => $contextMock
94115
]
95116
);
96117
$block->setLayout($layoutMock);

app/code/Magento/SalesRule/Controller/Adminhtml/Promo/Quote/ExportCouponsCsv.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,14 @@
1515
use Magento\Framework\View\Result\Layout;
1616
use Magento\Framework\App\ResponseInterface;
1717
use Magento\Framework\App\Action\HttpGetActionInterface;
18+
use Magento\Framework\App\Action\HttpPostActionInterface;
1819

1920
/**
2021
* Export Coupons to csv file
2122
*
2223
* Class \Magento\SalesRule\Controller\Adminhtml\Promo\Quote\ExportCouponsCsv
2324
*/
24-
class ExportCouponsCsv extends Quote implements HttpGetActionInterface
25+
class ExportCouponsCsv extends Quote implements HttpGetActionInterface, HttpPostActionInterface
2526
{
2627
/**
2728
* Export coupon codes as CSV file

app/code/Magento/SalesRule/Controller/Adminhtml/Promo/Quote/ExportCouponsXml.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,14 @@
1515
use Magento\Framework\View\Result\Layout;
1616
use Magento\Framework\App\ResponseInterface;
1717
use Magento\Framework\App\Action\HttpGetActionInterface;
18+
use Magento\Framework\App\Action\HttpPostActionInterface;
1819

1920
/**
2021
* Export coupons to xml file
2122
*
2223
* Class \Magento\SalesRule\Controller\Adminhtml\Promo\Quote\ExportCouponsXml
2324
*/
24-
class ExportCouponsXml extends Quote implements HttpGetActionInterface
25+
class ExportCouponsXml extends Quote implements HttpGetActionInterface, HttpPostActionInterface
2526
{
2627
/**
2728
* Export coupon codes as excel xml file

app/code/Magento/Ui/view/base/web/js/form/element/ui-select.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -668,7 +668,7 @@ define([
668668
* @returns {Object} Chainable
669669
*/
670670
toggleListVisible: function () {
671-
this.listVisible(!this.listVisible());
671+
this.listVisible(!this.disabled() && !this.listVisible());
672672

673673
return this;
674674
},

app/code/Magento/Ui/view/base/web/js/grid/url-filter-applier.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,12 @@ define([
1313
return Component.extend({
1414
defaults: {
1515
listingNamespace: null,
16+
bookmarkProvider: 'componentType = bookmark, ns = ${ $.listingNamespace }',
1617
filterProvider: 'componentType = filters, ns = ${ $.listingNamespace }',
1718
filterKey: 'filters',
1819
searchString: location.search,
1920
modules: {
21+
bookmarks: '${ $.bookmarkProvider }',
2022
filterComponent: '${ $.filterProvider }'
2123
}
2224
},
@@ -49,6 +51,16 @@ define([
4951
return;
5052
}
5153

54+
if (!_.isUndefined(this.bookmarks())) {
55+
if (!_.size(this.bookmarks().getViewData(this.bookmarks().defaultIndex))) {
56+
setTimeout(function () {
57+
this.apply();
58+
}.bind(this), 500);
59+
60+
return;
61+
}
62+
}
63+
5264
if (Object.keys(urlFilter).length) {
5365
applied = this.filterComponent().get('applied');
5466
filters = $.extend({}, applied, urlFilter);

app/design/adminhtml/Magento/backend/Magento_ConfigurableProduct/web/css/source/module/components/_currency-addon.less

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,10 @@
1818
// _____________________________________________
1919

2020
.currency-addon {
21+
.lib-vendor-prefix-display(inline-flex);
2122
border: 1px solid rgb(173,173,173);
22-
position: relative;
23-
display: -webkit-inline-flex;
24-
display: -ms-inline-flexbox;
25-
display: inline-flex;
26-
-webkit-flex-direction: row;
27-
-ms-flex-direction: row;
28-
flex-direction: row;
2923
flex-flow: row nowrap;
24+
position: relative;
3025
width: 100%;
3126

3227
.admin__control-text {

0 commit comments

Comments
 (0)