Skip to content

Commit

Permalink
Merge pull request #108 from magento/stabilize-builds
Browse files Browse the repository at this point in the history
Tests stabilization.
  • Loading branch information
naydav authored Apr 28, 2020
2 parents b179a93 + dc886c3 commit 7b56529
Show file tree
Hide file tree
Showing 13 changed files with 132 additions and 101 deletions.
3 changes: 1 addition & 2 deletions app/code/Magento/LoginAsCustomer/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@
"php": "~7.1.3||~7.2.0||~7.3.0",
"magento/framework": "*",
"magento/module-customer": "*",
"magento/module-login-as-customer-api": "*",
"magento/module-store": "*"
"magento/module-login-as-customer-api": "*"
},
"type": "magento2-module",
"license": [
Expand Down
2 changes: 1 addition & 1 deletion app/code/Magento/LoginAsCustomer/etc/config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<general>
<enabled>0</enabled>
<store_view_manual_choice_enabled>0</store_view_manual_choice_enabled>
<secrets_expiration_time>60</secrets_expiration_time>
<authentication_data_expiration_time>60</authentication_data_expiration_time>
</general>
</login_as_customer>
</default>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand Down
8 changes: 1 addition & 7 deletions app/code/Magento/LoginAsCustomerLog/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,7 @@
"require": {
"php": "~7.1.3||~7.2.0||~7.3.0",
"magento/framework": "*",
"magento/module-login-as-customer-api": "*",
"magento/module-backend": "*",
"magento/module-customer": "*",
"magento/module-sales": "*",
"magento/module-store": "*",
"magento/module-ui": "*",
"magento/module-user": "*"
"magento/module-backend": "*"
},
"suggest": {
"magento/module-login-as-customer": "*"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion app/code/Magento/LoginAsCustomerSales/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
"magento/module-checkout": "*",
"magento/module-customer": "*",
"magento/module-quote": "*",
"magento/module-login-as-customer": "*",
"magento/module-user": "*"
},
"suggest": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -69,14 +70,20 @@ class Login extends Action implements HttpGetActionInterface, HttpPostActionInte
*/
private $saveAuthenticationData;

/**
* @var Url
*/
private $url;

/**
* @param Context $context
* @param Session $authSession
* @param StoreManagerInterface $storeManager
* @param CustomerRepositoryInterface $customerRepository
* @param ConfigInterface $config
* @param AuthenticationDataInterfaceFactory $authenticationDataFactory
* @param SaveAuthenticationDataInterface $saveAuthenticationData
* @param SaveAuthenticationDataInterface $saveAuthenticationData ,
* @param Url $url
*/
public function __construct(
Context $context,
Expand All @@ -85,7 +92,8 @@ public function __construct(
CustomerRepositoryInterface $customerRepository,
ConfigInterface $config,
AuthenticationDataInterfaceFactory $authenticationDataFactory,
SaveAuthenticationDataInterface $saveAuthenticationData
SaveAuthenticationDataInterface $saveAuthenticationData,
Url $url
) {
parent::__construct($context);

Expand All @@ -95,6 +103,7 @@ public function __construct(
$this->config = $config;
$this->authenticationDataFactory = $authenticationDataFactory;
$this->saveAuthenticationData = $saveAuthenticationData;
$this->url = $url;
}

/**
Expand Down Expand Up @@ -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;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
namespace Magento\LoginAsCustomerUi\ViewModel;

use Magento\Customer\Model\Context;
use Magento\LoginAsCustomer\Model\Config;
use Magento\LoginAsCustomerApi\Api\ConfigInterface;

/**
Expand All @@ -17,7 +16,7 @@
class Configuration implements \Magento\Framework\View\Element\Block\ArgumentInterface
{
/**
* @var Config
* @var ConfigInterface
*/
private $config;

Expand Down
3 changes: 1 addition & 2 deletions app/code/Magento/LoginAsCustomerUi/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@
"magento/module-backend": "*",
"magento/module-customer": "*",
"magento/module-store": "*",
"magento/module-ui": "*",
"magento/module-user": "*"
"magento/module-ui": "*"
},
"suggest": {
"magento/module-login-as-customer": "*"
Expand Down
4 changes: 2 additions & 2 deletions app/code/Magento/LoginAsCustomerUi/etc/adminhtml/system.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
-->
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Config:etc/system_file.xsd">
<system>
<section id="loginascustomer" translate="label" type="text" sortOrder="1" showInDefault="1" showInWebsite="1" showInStore="1">
<section id="login_as_customer" translate="label" type="text" sortOrder="1" showInDefault="1" showInWebsite="1" showInStore="1">
<class>separator-top</class>
<label>Login As Customer</label>
<tab>customer</tab>
Expand All @@ -18,7 +18,7 @@
<label>Enable Extension</label>
<source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
</field>
<field id="enable_store_view_manual_choice" translate="label comment" type="select" sortOrder="40" showInDefault="1" showInWebsite="1" showInStore="1">
<field id="store_view_manual_choice_enabled" translate="label comment" type="select" sortOrder="40" showInDefault="1" showInWebsite="1" showInStore="1">
<label>Store View To Login In</label>
<source_model>Magento\LoginAsCustomerUi\Model\Config\Source\StoreViewLogin</source_model>
<comment><![CDATA[
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
*/
$viewFileUrl = $block->getViewFileUrl('Magento_LoginAsCustomerUi::images/magento-icon.svg');
?>
<?php if ($block->getConfig()->isEnabled()) : ?>
<?php if ($block->getConfig()->isEnabled()): ?>
<div data-bind="scope: 'loginAsCustomer'" >
<div class="lac-notification clearfix" data-bind="visible: isVisible" style="display: none">
<div class="top-container">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,63 +3,75 @@
* See COPYING.txt for license details.
*/

//
// Variables
// ---------------------------------------------

@lac-notification-background-color: #373330;
@lac-notification-color: #fff;
@lac-notification-links-color: #fff;

//
// Common
// ---------------------------------------------

& when (@media-common = true) {
.lac-notification {
background-color: #373330;
color: #fff;
font-size: 16px;
.lac-notification {
background-color: @lac-notification-background-color;
color: @lac-notification-color;
font-size: 16px;

.lac-notification-icon {
float: left;
margin: 10px 25px 10px 10px;
.lac-notification-icon {
float: left;
margin: 10px 25px 10px 10px;

.logo-img {
display: block
}
}
.logo-img {
display: block
}
}

.lac-notification-text {
float: left;
padding: 15px 0;
}
.lac-notification-text {
float: left;
padding: 15px 0;
}

.lac-notification-links {
float: right;
padding: 15px 0;
.lac-notification-links {
float: right;
padding: 15px 0;

a {
color: #fff;
font-size: 14px;
}
a {
color: @lac-notification-links-color;
font-size: 14px;
}

.lac-notification-close-link {
&:after {
content: ' ';
background: url('../Magento_LoginAsCustomerUi/images/close.svg');
display: inline-block;
height: 12px;
margin-left: 5px;
vertical-align: middle;
width: 12px;
.lac-notification-close-link {
&:after {
background: url('../Magento_LoginAsCustomerUi/images/close.svg');
content: ' ';
display: inline-block;
height: 12px;
margin-left: 5px;
vertical-align: middle;
width: 12px;
}
}
}
}
}
}
}

.media-width(@extremum, @break) when (@extremum = 'max') and (@break = @screen__m) {
.lac-notification {
padding: 5px 0;
.lac-notification {
padding: 5px 0;

.lac-notification-icon {
display: none;
}
.lac-notification-icon {
display: none;
}

.lac-notification-text,
.lac-notification-links {
float: none;
padding: 5px 0;
text-align: center;
.lac-notification-text,
.lac-notification-links {
float: none;
padding: 5px 0;
text-align: center;
}
}
}
}
Loading

0 comments on commit 7b56529

Please sign in to comment.