Skip to content

Commit

Permalink
🔃 [EngCom] Public Pull Requests - 2.3-develop
Browse files Browse the repository at this point in the history
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
  • Loading branch information
magento-engcom-team authored May 8, 2019
2 parents c56341c + e6facbf commit beb058c
Show file tree
Hide file tree
Showing 10 changed files with 73 additions and 25 deletions.
22 changes: 16 additions & 6 deletions app/code/Magento/Catalog/Model/Product/Option/Type/Select.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@

/**
* Catalog product option select type
*
* @SuppressWarnings(PHPMD.CookieAndSessionMisuse)
*/
class Select extends \Magento\Catalog\Model\Product\Option\Type\DefaultType
{
Expand All @@ -30,23 +32,35 @@ class Select extends \Magento\Catalog\Model\Product\Option\Type\DefaultType
*/
protected $string;

/**
* @var array
*/
private $singleSelectionTypes;

/**
* @param \Magento\Checkout\Model\Session $checkoutSession
* @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig
* @param \Magento\Framework\Stdlib\StringUtils $string
* @param \Magento\Framework\Escaper $escaper
* @param array $data
* @param array $singleSelectionTypes
*/
public function __construct(
\Magento\Checkout\Model\Session $checkoutSession,
\Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig,
\Magento\Framework\Stdlib\StringUtils $string,
\Magento\Framework\Escaper $escaper,
array $data = []
array $data = [],
array $singleSelectionTypes = []
) {
$this->string = $string;
$this->_escaper = $escaper;
parent::__construct($checkoutSession, $scopeConfig, $data);

$this->singleSelectionTypes = $singleSelectionTypes ?: [
'drop_down' => \Magento\Catalog\Api\Data\ProductCustomOptionInterface::OPTION_TYPE_DROP_DOWN,
'radio' => \Magento\Catalog\Api\Data\ProductCustomOptionInterface::OPTION_TYPE_RADIO,
];
}

/**
Expand Down Expand Up @@ -310,10 +324,6 @@ public function getOptionSku($optionValue, $skuDelimiter)
*/
protected function _isSingleSelection()
{
$single = [
\Magento\Catalog\Api\Data\ProductCustomOptionInterface::OPTION_TYPE_DROP_DOWN,
\Magento\Catalog\Api\Data\ProductCustomOptionInterface::OPTION_TYPE_RADIO,
];
return in_array($this->getOption()->getType(), $single);
return in_array($this->getOption()->getType(), $this->singleSelectionTypes, true);
}
}
8 changes: 8 additions & 0 deletions app/code/Magento/Catalog/etc/di.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1165,4 +1165,12 @@
</argument>
</arguments>
</type>
<type name="Magento\Catalog\Model\Product\Option\Type\Select">
<arguments>
<argument name="singleSelectionTypes" xsi:type="array">
<item name="drop_down" xsi:type="const">Magento\Catalog\Api\Data\ProductCustomOptionInterface::OPTION_TYPE_DROP_DOWN</item>
<item name="radio" xsi:type="const">Magento\Catalog\Api\Data\ProductCustomOptionInterface::OPTION_TYPE_RADIO</item>
</argument>
</arguments>
</type>
</config>
8 changes: 5 additions & 3 deletions app/code/Magento/Config/Console/Command/ConfigSetCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -114,13 +114,13 @@ protected function configure()
),
new InputOption(
static::OPTION_LOCK_ENV,
'le',
'e',
InputOption::VALUE_NONE,
'Lock value which prevents modification in the Admin (will be saved in app/etc/env.php)'
),
new InputOption(
static::OPTION_LOCK_CONFIG,
'lc',
'c',
InputOption::VALUE_NONE,
'Lock and share value with other installations, prevents modification in the Admin '
. '(will be saved in app/etc/config.php)'
Expand All @@ -139,8 +139,10 @@ protected function configure()
/**
* Creates and run appropriate processor, depending on input options.
*
* {@inheritdoc}
* @param InputInterface $input
* @param OutputInterface $output
* @since 100.2.0
* @return int|null
*/
protected function execute(InputInterface $input, OutputInterface $output)
{
Expand Down
4 changes: 2 additions & 2 deletions app/code/Magento/Customer/Block/Adminhtml/Edit/Tab/Orders.php
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ protected function _prepareCollection()
*/
protected function _prepareColumns()
{
$this->addColumn('increment_id', ['header' => __('Order'), 'width' => '100', 'index' => 'increment_id']);
$this->addColumn('increment_id', ['header' => __('Order #'), 'width' => '100', 'index' => 'increment_id']);

$this->addColumn(
'created_at',
Expand Down Expand Up @@ -140,7 +140,7 @@ protected function _prepareColumns()
$this->addColumn(
'action',
[
'header' => ' ',
'header' => 'Action',
'filter' => false,
'sortable' => false,
'width' => '100px',
Expand Down
2 changes: 1 addition & 1 deletion app/code/Magento/Customer/i18n/en_US.csv
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ Sending,Sending
Paused,Paused
View,View
Unknown,Unknown
Order,Order
"Order #","Order #"
Purchased,Purchased
"Bill-to Name","Bill-to Name"
"Ship-to Name","Ship-to Name"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ define([
return resultWrapper(null, false, false);
}

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

if (!/^\d*$/.test(value)) {
return resultWrapper(null, false, false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ define([
this.validation[rule] = options;
}

changed = utils.compare(rules, this.validation).equal;
changed = !utils.compare(rules, this.validation).equal;

if (changed) {
this.required(!!rules['required-entry']);
Expand Down
10 changes: 4 additions & 6 deletions app/code/Magento/Vault/Observer/AfterPaymentSaveObserver.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,11 +77,9 @@ public function execute(Observer $observer)
$paymentToken->setPaymentMethodCode($payment->getMethod());

$additionalInformation = $payment->getAdditionalInformation();
if (isset($additionalInformation[VaultConfigProvider::IS_ACTIVE_CODE])) {
$paymentToken->setIsVisible(
(bool) (int) $additionalInformation[VaultConfigProvider::IS_ACTIVE_CODE]
);
}
$paymentToken->setIsVisible(
(bool) (int) ($additionalInformation[VaultConfigProvider::IS_ACTIVE_CODE] ?? 0)
);

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

Expand Down Expand Up @@ -115,7 +113,7 @@ protected function generatePublicHash(PaymentTokenInterface $paymentToken)
/**
* Reads Payment token from Order Payment
*
* @param OrderPaymentExtensionInterface | null $extensionAttributes
* @param OrderPaymentExtensionInterface|null $extensionAttributes
* @return PaymentTokenInterface | null
*/
protected function getPaymentToken(OrderPaymentExtensionInterface $extensionAttributes = null)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/

namespace Magento\Vault\Test\Unit\Observer;

use Magento\Framework\App\DeploymentConfig;
Expand All @@ -15,9 +16,13 @@
use Magento\Sales\Model\Order\Payment;
use Magento\Vault\Model\PaymentToken;
use Magento\Vault\Model\PaymentTokenManagement;
use Magento\Vault\Model\Ui\VaultConfigProvider;
use Magento\Vault\Observer\AfterPaymentSaveObserver;
use PHPUnit_Framework_MockObject_MockObject as MockObject;

/**
* Tests for AfterPaymentSaveObserver.
*/
class AfterPaymentSaveObserverTest extends \PHPUnit\Framework\TestCase
{
/**
Expand Down Expand Up @@ -93,7 +98,7 @@ protected function setUp()

// Sales Order Payment Model
$this->salesOrderPaymentMock = $this->getMockBuilder(Payment::class)
->setMethods(null)
->setMethods(['getAdditionalInformation'])
->disableOriginalConstructor()
->getMock();
$this->salesOrderPaymentMock->setOrder($this->salesOrderMock);
Expand Down Expand Up @@ -122,9 +127,10 @@ protected function setUp()
* @param string $token
* @param bool $isActive
* @param string $method
* @param array $additionalInfo
* @dataProvider positiveCaseDataProvider
*/
public function testPositiveCase($customerId, $createdAt, $token, $isActive, $method)
public function testPositiveCase($customerId, $createdAt, $token, $isActive, $method, $additionalInfo)
{
$this->paymentTokenMock->setGatewayToken($token);
$this->paymentTokenMock->setCustomerId($customerId);
Expand All @@ -136,6 +142,8 @@ public function testPositiveCase($customerId, $createdAt, $token, $isActive, $me
->method('getVaultPaymentToken')
->willReturn($this->paymentTokenMock);

$this->salesOrderPaymentMock->method('getAdditionalInformation')->willReturn($additionalInfo);

if (!empty($token)) {
$this->paymentTokenManagementMock->expects($this->once())
->method('saveTokenWithPaymentLink')
Expand All @@ -158,6 +166,10 @@ public function testPositiveCase($customerId, $createdAt, $token, $isActive, $me
static::assertEquals($token, $paymentToken->getGatewayToken());
static::assertEquals($isActive, $paymentToken->getIsActive());
static::assertEquals($createdAt, $paymentToken->getCreatedAt());
static::assertEquals(
$additionalInfo[VaultConfigProvider::IS_ACTIVE_CODE] ?? false,
$paymentToken->getIsVisible()
);
}

/**
Expand All @@ -171,14 +183,32 @@ public function positiveCaseDataProvider()
'10\20\2015',
'asdfg',
true,
'paypal'
'paypal',
[],
],
[
1,
'10\20\2015',
'asdfg',
true,
'paypal',
[VaultConfigProvider::IS_ACTIVE_CODE => true],
],
[
1,
'10\20\2015',
'asdfg',
true,
'paypal',
[VaultConfigProvider::IS_ACTIVE_CODE => false],
],
[
null,
null,
null,
false,
null
null,
[],
],
];
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@
.page-main {
> .page-title-wrapper {
.page-title {
word-break: break-all;
hyphens: auto;
}
}
}
Expand Down

0 comments on commit beb058c

Please sign in to comment.