Skip to content

Commit 06b13f4

Browse files
author
Yevhen Miroshnychenko
committed
Merge branch '2.3-develop' into MAGETWO-94241
2 parents b39ab7d + f6876dd commit 06b13f4

File tree

96 files changed

+3714
-467
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

96 files changed

+3714
-467
lines changed

app/code/Magento/Catalog/Test/Mftf/Test/AdminProductImageAssignmentForMultipleStoresTest.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@
1818
<testCaseId value="MAGETWO-58718"/>
1919
<group value="product"/>
2020
<group value="WYSIWYGDisabled"/>
21+
<skip>
22+
<issueId value="MC-13841"/>
23+
</skip>
2124
</annotations>
2225
<before>
2326
<!-- Login Admin -->

app/code/Magento/Catalog/view/frontend/web/js/catalog-add-to-cart.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,16 @@ define([
165165
self.enableAddToCartButton(form);
166166
},
167167

168+
/** @inheritdoc */
169+
error: function (res) {
170+
$(document).trigger('ajax:addToCart:error', {
171+
'sku': form.data().productSku,
172+
'productIds': productIds,
173+
'form': form,
174+
'response': res
175+
});
176+
},
177+
168178
/** @inheritdoc */
169179
complete: function (res) {
170180
if (res.state() === 'rejected') {

app/code/Magento/Checkout/Block/QuoteShortcutButtons.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
use Magento\Framework\View\Element\Template;
99

1010
/**
11+
* Displays buttons on shopping cart page
12+
*
1113
* @api
1214
*/
1315
class QuoteShortcutButtons extends \Magento\Catalog\Block\ShortcutButtons
@@ -45,7 +47,8 @@ protected function _beforeToHtml()
4547
'container' => $this,
4648
'is_catalog_product' => $this->_isCatalogProduct,
4749
'or_position' => $this->_orPosition,
48-
'checkout_session' => $this->_checkoutSession
50+
'checkout_session' => $this->_checkoutSession,
51+
'is_shopping_cart' => true
4952
]
5053
);
5154
return $this;

app/code/Magento/Checkout/view/frontend/web/js/model/payment/additional-validators.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,15 +35,17 @@ define([], function () {
3535
*
3636
* @returns {Boolean}
3737
*/
38-
validate: function () {
38+
validate: function (hideError) {
3939
var validationResult = true;
4040

41+
hideError = hideError || false;
42+
4143
if (validators.length <= 0) {
4244
return validationResult;
4345
}
4446

4547
validators.forEach(function (item) {
46-
if (item.validate() == false) { //eslint-disable-line eqeqeq
48+
if (item.validate(hideError) == false) { //eslint-disable-line eqeqeq
4749
validationResult = false;
4850

4951
return false;

app/code/Magento/CheckoutAgreements/view/frontend/web/js/model/agreement-validator.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ define([
1919
*
2020
* @returns {Boolean}
2121
*/
22-
validate: function () {
22+
validate: function (hideError) {
2323
var isValid = true;
2424

2525
if (!agreementsConfig.isEnabled || $(agreementsInputPath).length === 0) {
@@ -28,7 +28,8 @@ define([
2828

2929
$(agreementsInputPath).each(function (index, element) {
3030
if (!$.validator.validateSingleElement(element, {
31-
errorElement: 'div'
31+
errorElement: 'div',
32+
hideError: hideError || false
3233
})) {
3334
isValid = false;
3435
}

app/code/Magento/Cms/Test/Mftf/Test/CheckStaticBlocksTest.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
<group value="Cms"/>
2020
</annotations>
2121
<before>
22+
<magentoCLI command="config:set cms/wysiwyg/enabled disabled" stepKey="disableWYSIWYG"/>
2223
<actionGroup ref="LoginAsAdmin" stepKey="LoginAsAdmin"/>
2324
<actionGroup ref="AdminCreateWebsiteActionGroup" stepKey="AdminCreateWebsite">
2425
<argument name="newWebsiteName" value="secondWebsite"/>
@@ -67,6 +68,7 @@
6768
<argument name="websiteName" value="secondWebsite"/>
6869
</actionGroup>
6970
<actionGroup ref="DeleteCMSBlockActionGroup" stepKey="DeleteCMSBlockActionGroup"/>
71+
<magentoCLI command="config:set cms/wysiwyg/enabled enabled" stepKey="enableWYSIWYG"/>
7072
</after>
7173
</test>
7274
</tests>

app/code/Magento/Config/etc/adminhtml/di.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
*/
77
-->
88
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
9-
<preference for="Magento\Config\Model\Config\Structure\SearchInterface" type="Magento\Config\Model\Config\Structure" />
109
<preference for="Magento\Config\Model\Config\Backend\File\RequestData\RequestDataInterface" type="Magento\Config\Model\Config\Backend\File\RequestData" />
1110
<preference for="Magento\Config\Model\Config\Structure\ElementVisibilityInterface" type="Magento\Config\Model\Config\Structure\ElementVisibilityComposite" />
1211
<type name="Magento\Config\Model\Config\Structure\Element\Iterator\Tab" shared="false" />
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
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\Paypal\Block\Adminhtml\System\Config\Field\Depends;
9+
10+
use Magento\Paypal\Block\Adminhtml\System\Config\Field\Enable\AbstractEnable;
11+
12+
/**
13+
* Class ButtonStylesLabel
14+
*/
15+
class ButtonStylesLabel extends AbstractEnable
16+
{
17+
/**
18+
* Getting the name of a UI attribute
19+
*
20+
* @return string
21+
*/
22+
protected function getDataAttributeName()
23+
{
24+
return 'button-label';
25+
}
26+
}

app/code/Magento/Paypal/Block/Adminhtml/System/Config/Field/Enable/BmlApi.php

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

88
/**
99
* Class Bml
10+
* @deprecated
11+
* "Enable PayPal Credit" setting was removed. Please @see "Disable Funding Options"
1012
*/
1113
class BmlApi extends AbstractEnable
1214
{
Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
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\Paypal\Block\Adminhtml\System\Config\MultiSelect;
9+
10+
use Magento\Paypal\Block\Adminhtml\System\Config\Field\Enable\AbstractEnable;
11+
use Magento\Paypal\Model\Config\StructurePlugin;
12+
use Magento\Backend\Block\Template\Context;
13+
use Magento\Paypal\Model\Config;
14+
use Magento\Framework\Data\Form\Element\AbstractElement;
15+
16+
/**
17+
* Class DisabledFundingOptions
18+
*/
19+
class DisabledFundingOptions extends AbstractEnable
20+
{
21+
/**
22+
* @var Config
23+
*/
24+
private $config;
25+
26+
/**
27+
* DisabledFundingOptions constructor.
28+
* @param Context $context
29+
* @param Config $config
30+
* @param array $data
31+
*/
32+
public function __construct(
33+
Context $context,
34+
Config $config,
35+
$data = []
36+
) {
37+
$this->config = $config;
38+
parent::__construct($context, $data);
39+
}
40+
41+
/**
42+
* Render country field considering request parameter
43+
*
44+
* @param AbstractElement $element
45+
* @return string
46+
*/
47+
public function render(AbstractElement $element)
48+
{
49+
if (!$this->isSelectedMerchantCountry('US')) {
50+
$fundingOptions = $element->getValues();
51+
$element->setValues($this->filterValuesForPaypalCredit($fundingOptions));
52+
}
53+
return parent::render($element);
54+
}
55+
56+
/**
57+
* Getting the name of a UI attribute
58+
*
59+
* @return string
60+
*/
61+
protected function getDataAttributeName(): string
62+
{
63+
return 'disable-funding-options';
64+
}
65+
66+
/**
67+
* Filters array for CREDIT
68+
*
69+
* @param array $options
70+
* @return array
71+
*/
72+
private function filterValuesForPaypalCredit($options): array
73+
{
74+
return array_filter($options, function ($opt) {
75+
return ($opt['value'] !== 'CREDIT');
76+
});
77+
}
78+
79+
/**
80+
* Checks for chosen Merchant country from the config/url
81+
*
82+
* @param string $country
83+
* @return bool
84+
*/
85+
private function isSelectedMerchantCountry(string $country): bool
86+
{
87+
$merchantCountry = $this->getRequest()->getParam(StructurePlugin::REQUEST_PARAM_COUNTRY)
88+
?: $this->config->getMerchantCountry();
89+
return $merchantCountry === $country;
90+
}
91+
}

0 commit comments

Comments
 (0)