From e84147afb583738618109904b362cd56f436819f Mon Sep 17 00:00:00 2001 From: Pavel Bystritsky Date: Tue, 28 Apr 2020 15:33:24 +0300 Subject: [PATCH 1/3] Stabilize builds. --- .../Magento/LoginAsCustomer/etc/config.xml | 2 +- .../Api/ConfigInterface.php | 2 +- .../Plugin/AuthenticateCustomerPlugin.php | 2 +- .../Controller/Adminhtml/Login/Login.php | 22 ++-- .../ViewModel/Configuration.php | 3 +- .../etc/adminhtml/system.xml | 2 +- .../frontend/templates/html/notices.phtml | 2 +- .../view/frontend/web/css/source/_module.less | 100 ++++++++++-------- composer.lock | 81 ++++++++------ 9 files changed, 128 insertions(+), 88 deletions(-) diff --git a/app/code/Magento/LoginAsCustomer/etc/config.xml b/app/code/Magento/LoginAsCustomer/etc/config.xml index 375404dc766ae..936ae1ff2f05d 100644 --- a/app/code/Magento/LoginAsCustomer/etc/config.xml +++ b/app/code/Magento/LoginAsCustomer/etc/config.xml @@ -12,7 +12,7 @@ 0 0 - 60 + 60 diff --git a/app/code/Magento/LoginAsCustomerApi/Api/ConfigInterface.php b/app/code/Magento/LoginAsCustomerApi/Api/ConfigInterface.php index b06051d952196..b3aafa6c8a51b 100644 --- a/app/code/Magento/LoginAsCustomerApi/Api/ConfigInterface.php +++ b/app/code/Magento/LoginAsCustomerApi/Api/ConfigInterface.php @@ -29,7 +29,7 @@ public function isEnabled(): bool; public function isStoreManualChoiceEnabled(): bool; /** - * Gte authentication data expiration time (in seconds) + * Get authentication data expiration time (in seconds) * * @return int */ diff --git a/app/code/Magento/LoginAsCustomerSales/Plugin/AuthenticateCustomerPlugin.php b/app/code/Magento/LoginAsCustomerSales/Plugin/AuthenticateCustomerPlugin.php index 8d3f244994f59..8299f224042fc 100644 --- a/app/code/Magento/LoginAsCustomerSales/Plugin/AuthenticateCustomerPlugin.php +++ b/app/code/Magento/LoginAsCustomerSales/Plugin/AuthenticateCustomerPlugin.php @@ -79,7 +79,7 @@ public function beforeExecute( * Mark customer cart as not-guest * * @param AuthenticateCustomerInterface $subject - * @param null $result + * @param void $result * @param AuthenticationDataInterface $authenticationData * @return void * @throws LocalizedException diff --git a/app/code/Magento/LoginAsCustomerUi/Controller/Adminhtml/Login/Login.php b/app/code/Magento/LoginAsCustomerUi/Controller/Adminhtml/Login/Login.php index 503267d00e7cb..1496f6e4cd3c6 100755 --- a/app/code/Magento/LoginAsCustomerUi/Controller/Adminhtml/Login/Login.php +++ b/app/code/Magento/LoginAsCustomerUi/Controller/Adminhtml/Login/Login.php @@ -10,14 +10,15 @@ use Magento\Backend\App\Action; use Magento\Backend\App\Action\Context; use Magento\Backend\Model\Auth\Session; +use Magento\Customer\Api\CustomerRepositoryInterface; +use Magento\Framework\App\Action\HttpGetActionInterface; +use Magento\Framework\App\Action\HttpPostActionInterface; use Magento\Framework\Controller\Result\Redirect; use Magento\Framework\Controller\ResultFactory; use Magento\Framework\Controller\ResultInterface; -use Magento\Framework\App\Action\HttpGetActionInterface; -use Magento\Framework\App\Action\HttpPostActionInterface; -use Magento\Customer\Api\CustomerRepositoryInterface; use Magento\Framework\Exception\LocalizedException; use Magento\Framework\Exception\NoSuchEntityException; +use Magento\Framework\Url; use Magento\LoginAsCustomerApi\Api\ConfigInterface; use Magento\LoginAsCustomerApi\Api\Data\AuthenticationDataInterface; use Magento\LoginAsCustomerApi\Api\Data\AuthenticationDataInterfaceFactory; @@ -69,6 +70,11 @@ class Login extends Action implements HttpGetActionInterface, HttpPostActionInte */ private $saveAuthenticationData; + /** + * @var Url + */ + private $url; + /** * @param Context $context * @param Session $authSession @@ -76,7 +82,8 @@ class Login extends Action implements HttpGetActionInterface, HttpPostActionInte * @param CustomerRepositoryInterface $customerRepository * @param ConfigInterface $config * @param AuthenticationDataInterfaceFactory $authenticationDataFactory - * @param SaveAuthenticationDataInterface $saveAuthenticationData + * @param SaveAuthenticationDataInterface $saveAuthenticationData , + * @param Url $url */ public function __construct( Context $context, @@ -85,7 +92,8 @@ public function __construct( CustomerRepositoryInterface $customerRepository, ConfigInterface $config, AuthenticationDataInterfaceFactory $authenticationDataFactory, - SaveAuthenticationDataInterface $saveAuthenticationData + SaveAuthenticationDataInterface $saveAuthenticationData, + Url $url ) { parent::__construct($context); @@ -95,6 +103,7 @@ public function __construct( $this->config = $config; $this->authenticationDataFactory = $authenticationDataFactory; $this->saveAuthenticationData = $saveAuthenticationData; + $this->url = $url; } /** @@ -165,9 +174,8 @@ private function getLoginProceedRedirectUrl(string $secret, ?int $storeId): stri $store = $this->storeManager->getStore($storeId); } - $redirectUrl = $this->_url + return $this->url ->setScope($store) ->getUrl('loginascustomer/login/index', ['secret' => $secret, '_nosid' => true]); - return $redirectUrl; } } diff --git a/app/code/Magento/LoginAsCustomerUi/ViewModel/Configuration.php b/app/code/Magento/LoginAsCustomerUi/ViewModel/Configuration.php index d0bfc2ecb724d..7cbe30b116194 100644 --- a/app/code/Magento/LoginAsCustomerUi/ViewModel/Configuration.php +++ b/app/code/Magento/LoginAsCustomerUi/ViewModel/Configuration.php @@ -8,7 +8,6 @@ namespace Magento\LoginAsCustomerUi\ViewModel; use Magento\Customer\Model\Context; -use Magento\LoginAsCustomer\Model\Config; use Magento\LoginAsCustomerApi\Api\ConfigInterface; /** @@ -17,7 +16,7 @@ class Configuration implements \Magento\Framework\View\Element\Block\ArgumentInterface { /** - * @var Config + * @var ConfigInterface */ private $config; diff --git a/app/code/Magento/LoginAsCustomerUi/etc/adminhtml/system.xml b/app/code/Magento/LoginAsCustomerUi/etc/adminhtml/system.xml index 8590b734f6aaa..f84c4dafaad92 100755 --- a/app/code/Magento/LoginAsCustomerUi/etc/adminhtml/system.xml +++ b/app/code/Magento/LoginAsCustomerUi/etc/adminhtml/system.xml @@ -7,7 +7,7 @@ --> -
+
separator-top customer diff --git a/app/code/Magento/LoginAsCustomerUi/view/frontend/templates/html/notices.phtml b/app/code/Magento/LoginAsCustomerUi/view/frontend/templates/html/notices.phtml index 6bc828a112692..a2358cdb2f18b 100644 --- a/app/code/Magento/LoginAsCustomerUi/view/frontend/templates/html/notices.phtml +++ b/app/code/Magento/LoginAsCustomerUi/view/frontend/templates/html/notices.phtml @@ -10,7 +10,7 @@ */ $viewFileUrl = $block->getViewFileUrl('Magento_LoginAsCustomerUi::images/magento-icon.svg'); ?> -getConfig()->isEnabled()) : ?> +getConfig()->isEnabled()): ?>