Skip to content

Commit beb058c

Browse files
🔃 [EngCom] Public Pull Requests - 2.3-develop
Accepted Public Pull Requests: - magento#22643: Fixed typo issue and added missing header in customer sales order grid (by @vishal-7037) - magento#22720: Fixed:magento#22395 (by @satyaprakashpatel) - magento#22656: issues magento#22647 fixed, In customer account create page word not readable, should use '-' after break to new line In mobile view (by @cedarvinda) - magento#21992: magento#21473: Form element validation is not triggered when validation rules� (by @kisroman) - magento#19767: Prevent display of token when save for later is not selected (by @pmclain) - magento#22493: Update credit-card-number-validator.js (by @justin-at-bounteous) - magento#21744: Custom option type select - Allow modify list of single selection option types (by @ihor-sviziev) Fixed GitHub Issues: - magento#22641: Typo Issue and Missing header title at Customer Sales order grid (reported by @vishal-7037) has been fixed in magento#22643 by @vishal-7037 in 2.3-develop branch Related commits: 1. df3047b - magento#22395: config:set -le and -lc short form options don't work (reported by @MichaelThessel) has been fixed in magento#22720 by @satyaprakashpatel in 2.3-develop branch Related commits: 1. fbcfd11 2. 62cbf5b - magento#22647: In customer account create page word not readable, should use '-' after break to new line In mobile view (reported by @cedarvinda) has been fixed in magento#22656 by @cedarvinda in 2.3-develop branch Related commits: 1. 1ae8bf5 - magento#21473: Form element validation is not triggered when validation rules change (reported by @mam08ixo) has been fixed in magento#21992 by @kisroman in 2.3-develop branch Related commits: 1. 48e9760 2. d3e37b8 - magento#19515: Create new order from backend saves the credit card when it is told not to (reported by @justinharris1986) has been fixed in magento#19767 by @pmclain in 2.3-develop branch Related commits: 1. bbb386b 2. d93a9b5 3. 093af61
2 parents c56341c + e6facbf commit beb058c

File tree

10 files changed

+73
-25
lines changed

10 files changed

+73
-25
lines changed

app/code/Magento/Catalog/Model/Product/Option/Type/Select.php

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010

1111
/**
1212
* Catalog product option select type
13+
*
14+
* @SuppressWarnings(PHPMD.CookieAndSessionMisuse)
1315
*/
1416
class Select extends \Magento\Catalog\Model\Product\Option\Type\DefaultType
1517
{
@@ -30,23 +32,35 @@ class Select extends \Magento\Catalog\Model\Product\Option\Type\DefaultType
3032
*/
3133
protected $string;
3234

35+
/**
36+
* @var array
37+
*/
38+
private $singleSelectionTypes;
39+
3340
/**
3441
* @param \Magento\Checkout\Model\Session $checkoutSession
3542
* @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig
3643
* @param \Magento\Framework\Stdlib\StringUtils $string
3744
* @param \Magento\Framework\Escaper $escaper
3845
* @param array $data
46+
* @param array $singleSelectionTypes
3947
*/
4048
public function __construct(
4149
\Magento\Checkout\Model\Session $checkoutSession,
4250
\Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig,
4351
\Magento\Framework\Stdlib\StringUtils $string,
4452
\Magento\Framework\Escaper $escaper,
45-
array $data = []
53+
array $data = [],
54+
array $singleSelectionTypes = []
4655
) {
4756
$this->string = $string;
4857
$this->_escaper = $escaper;
4958
parent::__construct($checkoutSession, $scopeConfig, $data);
59+
60+
$this->singleSelectionTypes = $singleSelectionTypes ?: [
61+
'drop_down' => \Magento\Catalog\Api\Data\ProductCustomOptionInterface::OPTION_TYPE_DROP_DOWN,
62+
'radio' => \Magento\Catalog\Api\Data\ProductCustomOptionInterface::OPTION_TYPE_RADIO,
63+
];
5064
}
5165

5266
/**
@@ -310,10 +324,6 @@ public function getOptionSku($optionValue, $skuDelimiter)
310324
*/
311325
protected function _isSingleSelection()
312326
{
313-
$single = [
314-
\Magento\Catalog\Api\Data\ProductCustomOptionInterface::OPTION_TYPE_DROP_DOWN,
315-
\Magento\Catalog\Api\Data\ProductCustomOptionInterface::OPTION_TYPE_RADIO,
316-
];
317-
return in_array($this->getOption()->getType(), $single);
327+
return in_array($this->getOption()->getType(), $this->singleSelectionTypes, true);
318328
}
319329
}

app/code/Magento/Catalog/etc/di.xml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1165,4 +1165,12 @@
11651165
</argument>
11661166
</arguments>
11671167
</type>
1168+
<type name="Magento\Catalog\Model\Product\Option\Type\Select">
1169+
<arguments>
1170+
<argument name="singleSelectionTypes" xsi:type="array">
1171+
<item name="drop_down" xsi:type="const">Magento\Catalog\Api\Data\ProductCustomOptionInterface::OPTION_TYPE_DROP_DOWN</item>
1172+
<item name="radio" xsi:type="const">Magento\Catalog\Api\Data\ProductCustomOptionInterface::OPTION_TYPE_RADIO</item>
1173+
</argument>
1174+
</arguments>
1175+
</type>
11681176
</config>

app/code/Magento/Config/Console/Command/ConfigSetCommand.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -114,13 +114,13 @@ protected function configure()
114114
),
115115
new InputOption(
116116
static::OPTION_LOCK_ENV,
117-
'le',
117+
'e',
118118
InputOption::VALUE_NONE,
119119
'Lock value which prevents modification in the Admin (will be saved in app/etc/env.php)'
120120
),
121121
new InputOption(
122122
static::OPTION_LOCK_CONFIG,
123-
'lc',
123+
'c',
124124
InputOption::VALUE_NONE,
125125
'Lock and share value with other installations, prevents modification in the Admin '
126126
. '(will be saved in app/etc/config.php)'
@@ -139,8 +139,10 @@ protected function configure()
139139
/**
140140
* Creates and run appropriate processor, depending on input options.
141141
*
142-
* {@inheritdoc}
142+
* @param InputInterface $input
143+
* @param OutputInterface $output
143144
* @since 100.2.0
145+
* @return int|null
144146
*/
145147
protected function execute(InputInterface $input, OutputInterface $output)
146148
{

app/code/Magento/Customer/Block/Adminhtml/Edit/Tab/Orders.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ protected function _prepareCollection()
107107
*/
108108
protected function _prepareColumns()
109109
{
110-
$this->addColumn('increment_id', ['header' => __('Order'), 'width' => '100', 'index' => 'increment_id']);
110+
$this->addColumn('increment_id', ['header' => __('Order #'), 'width' => '100', 'index' => 'increment_id']);
111111

112112
$this->addColumn(
113113
'created_at',
@@ -140,7 +140,7 @@ protected function _prepareColumns()
140140
$this->addColumn(
141141
'action',
142142
[
143-
'header' => ' ',
143+
'header' => 'Action',
144144
'filter' => false,
145145
'sortable' => false,
146146
'width' => '100px',

app/code/Magento/Customer/i18n/en_US.csv

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ Sending,Sending
4747
Paused,Paused
4848
View,View
4949
Unknown,Unknown
50-
Order,Order
50+
"Order #","Order #"
5151
Purchased,Purchased
5252
"Bill-to Name","Bill-to Name"
5353
"Ship-to Name","Ship-to Name"

app/code/Magento/Payment/view/base/web/js/model/credit-card-validation/credit-card-number-validator.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ define([
3636
return resultWrapper(null, false, false);
3737
}
3838

39-
value = value.replace(/|\s/g, '');
39+
value = value.replace(/\s+/g, '');
4040

4141
if (!/^\d*$/.test(value)) {
4242
return resultWrapper(null, false, false);

app/code/Magento/Ui/view/base/web/js/form/element/abstract.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,7 @@ define([
296296
this.validation[rule] = options;
297297
}
298298

299-
changed = utils.compare(rules, this.validation).equal;
299+
changed = !utils.compare(rules, this.validation).equal;
300300

301301
if (changed) {
302302
this.required(!!rules['required-entry']);

app/code/Magento/Vault/Observer/AfterPaymentSaveObserver.php

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -77,11 +77,9 @@ public function execute(Observer $observer)
7777
$paymentToken->setPaymentMethodCode($payment->getMethod());
7878

7979
$additionalInformation = $payment->getAdditionalInformation();
80-
if (isset($additionalInformation[VaultConfigProvider::IS_ACTIVE_CODE])) {
81-
$paymentToken->setIsVisible(
82-
(bool) (int) $additionalInformation[VaultConfigProvider::IS_ACTIVE_CODE]
83-
);
84-
}
80+
$paymentToken->setIsVisible(
81+
(bool) (int) ($additionalInformation[VaultConfigProvider::IS_ACTIVE_CODE] ?? 0)
82+
);
8583

8684
$paymentToken->setPublicHash($this->generatePublicHash($paymentToken));
8785

@@ -115,7 +113,7 @@ protected function generatePublicHash(PaymentTokenInterface $paymentToken)
115113
/**
116114
* Reads Payment token from Order Payment
117115
*
118-
* @param OrderPaymentExtensionInterface | null $extensionAttributes
116+
* @param OrderPaymentExtensionInterface|null $extensionAttributes
119117
* @return PaymentTokenInterface | null
120118
*/
121119
protected function getPaymentToken(OrderPaymentExtensionInterface $extensionAttributes = null)

app/code/Magento/Vault/Test/Unit/Observer/AfterPaymentSaveObserverTest.php

Lines changed: 34 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
* Copyright © Magento, Inc. All rights reserved.
44
* See COPYING.txt for license details.
55
*/
6+
67
namespace Magento\Vault\Test\Unit\Observer;
78

89
use Magento\Framework\App\DeploymentConfig;
@@ -15,9 +16,13 @@
1516
use Magento\Sales\Model\Order\Payment;
1617
use Magento\Vault\Model\PaymentToken;
1718
use Magento\Vault\Model\PaymentTokenManagement;
19+
use Magento\Vault\Model\Ui\VaultConfigProvider;
1820
use Magento\Vault\Observer\AfterPaymentSaveObserver;
1921
use PHPUnit_Framework_MockObject_MockObject as MockObject;
2022

23+
/**
24+
* Tests for AfterPaymentSaveObserver.
25+
*/
2126
class AfterPaymentSaveObserverTest extends \PHPUnit\Framework\TestCase
2227
{
2328
/**
@@ -93,7 +98,7 @@ protected function setUp()
9398

9499
// Sales Order Payment Model
95100
$this->salesOrderPaymentMock = $this->getMockBuilder(Payment::class)
96-
->setMethods(null)
101+
->setMethods(['getAdditionalInformation'])
97102
->disableOriginalConstructor()
98103
->getMock();
99104
$this->salesOrderPaymentMock->setOrder($this->salesOrderMock);
@@ -122,9 +127,10 @@ protected function setUp()
122127
* @param string $token
123128
* @param bool $isActive
124129
* @param string $method
130+
* @param array $additionalInfo
125131
* @dataProvider positiveCaseDataProvider
126132
*/
127-
public function testPositiveCase($customerId, $createdAt, $token, $isActive, $method)
133+
public function testPositiveCase($customerId, $createdAt, $token, $isActive, $method, $additionalInfo)
128134
{
129135
$this->paymentTokenMock->setGatewayToken($token);
130136
$this->paymentTokenMock->setCustomerId($customerId);
@@ -136,6 +142,8 @@ public function testPositiveCase($customerId, $createdAt, $token, $isActive, $me
136142
->method('getVaultPaymentToken')
137143
->willReturn($this->paymentTokenMock);
138144

145+
$this->salesOrderPaymentMock->method('getAdditionalInformation')->willReturn($additionalInfo);
146+
139147
if (!empty($token)) {
140148
$this->paymentTokenManagementMock->expects($this->once())
141149
->method('saveTokenWithPaymentLink')
@@ -158,6 +166,10 @@ public function testPositiveCase($customerId, $createdAt, $token, $isActive, $me
158166
static::assertEquals($token, $paymentToken->getGatewayToken());
159167
static::assertEquals($isActive, $paymentToken->getIsActive());
160168
static::assertEquals($createdAt, $paymentToken->getCreatedAt());
169+
static::assertEquals(
170+
$additionalInfo[VaultConfigProvider::IS_ACTIVE_CODE] ?? false,
171+
$paymentToken->getIsVisible()
172+
);
161173
}
162174

163175
/**
@@ -171,14 +183,32 @@ public function positiveCaseDataProvider()
171183
'10\20\2015',
172184
'asdfg',
173185
true,
174-
'paypal'
186+
'paypal',
187+
[],
188+
],
189+
[
190+
1,
191+
'10\20\2015',
192+
'asdfg',
193+
true,
194+
'paypal',
195+
[VaultConfigProvider::IS_ACTIVE_CODE => true],
196+
],
197+
[
198+
1,
199+
'10\20\2015',
200+
'asdfg',
201+
true,
202+
'paypal',
203+
[VaultConfigProvider::IS_ACTIVE_CODE => false],
175204
],
176205
[
177206
null,
178207
null,
179208
null,
180209
false,
181-
null
210+
null,
211+
[],
182212
],
183213
];
184214
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@
8080
.page-main {
8181
> .page-title-wrapper {
8282
.page-title {
83-
word-break: break-all;
83+
hyphens: auto;
8484
}
8585
}
8686
}

0 commit comments

Comments
 (0)