Skip to content

Commit a11bab5

Browse files
committed
magento2-login-as-customer/issues/90: Tests stabilization
1 parent 02ac58b commit a11bab5

File tree

10 files changed

+101
-96
lines changed

10 files changed

+101
-96
lines changed

app/code/Magento/LoginAsCustomerLog/Model/GetLogList.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ public function __construct(
6161
/**
6262
* @inheritDoc
6363
*/
64-
public function execute(SearchCriteriaInterface $searchCriteria = null): LogSearchResultsInterface
64+
public function execute(SearchCriteriaInterface $searchCriteria): LogSearchResultsInterface
6565
{
6666
$collection = $this->logCollectionFactory->create();
6767
$searchCriteria = $searchCriteria ?: $this->searchCriteriaBuilder->create();

app/code/Magento/LoginAsCustomerLog/Model/Log.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
*/
1717
class Log extends AbstractExtensibleModel implements LogInterface
1818
{
19-
2019
/**
2120
* @inheritDoc
2221
*/

app/code/Magento/LoginAsCustomerLog/etc/frontend/di.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
-->
88
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
99
<type name="Magento\LoginAsCustomerApi\Api\AuthenticateCustomerInterface">
10-
<plugin name="log_authentication_plugin" type="Magento\LoginAsCustomerLog\Plugin\LoginAsCustomerApi\Api\AuthenticateCustomerInterface\LogAuthenticationPlugin"/>
10+
<plugin name="log_authentication_plugin"
11+
type="Magento\LoginAsCustomerLog\Plugin\LoginAsCustomerApi\Api\AuthenticateCustomerInterface\LogAuthenticationPlugin"/>
1112
</type>
1213
</config>

app/code/Magento/LoginAsCustomerSales/Plugin/AuthenticateCustomerPlugin.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ public function beforeExecute(
7171
$quote = $this->checkoutSession->getQuote();
7272
/* Remove items from guest cart */
7373
$quote->removeAllItems();
74+
$this->quoteRepository->save($quote);
7475
}
7576
return null;
7677
}

app/code/Magento/LoginAsCustomerUi/Block/Adminhtml/ConfirmationPopup.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414

1515
/**
1616
* Admin blog post
17+
*
18+
* @api
1719
*/
1820
class ConfirmationPopup extends Template
1921
{
@@ -39,7 +41,6 @@ class ConfirmationPopup extends Template
3941
private $json;
4042

4143
/**
42-
* ConfirmationPopup constructor.
4344
* @param Template\Context $context
4445
* @param StoreOptions $storeOptions
4546
* @param ConfigInterface $config
@@ -60,7 +61,7 @@ public function __construct(
6061
}
6162

6263
/**
63-
* @return string
64+
* @inheritdoc
6465
*/
6566
public function getJsLayout()
6667
{
@@ -70,7 +71,8 @@ public function getJsLayout()
7071
$layout['components']['lac-confirmation-popup']['title'] = $showStoreViewOptions
7172
? __('Login as Customer: Select Store View')
7273
: __('You are about to Login as Customer');
73-
$layout['components']['lac-confirmation-popup']['content'] = __('Actions taken while in "Login as Customer" will affect actual customer data.');
74+
$layout['components']['lac-confirmation-popup']['content'] =
75+
__('Actions taken while in "Login as Customer" will affect actual customer data.');
7476

7577
$layout['components']['lac-confirmation-popup']['showStoreViewOptions'] = $showStoreViewOptions;
7678
$layout['components']['lac-confirmation-popup']['storeViewOptions'] = $showStoreViewOptions

app/code/Magento/LoginAsCustomerUi/composer.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@
77
"magento/module-login-as-customer-api": "*",
88
"magento/module-backend": "*",
99
"magento/module-customer": "*",
10-
"magento/module-store": "*",
11-
"magento/module-ui": "*"
10+
"magento/module-store": "*"
1211
},
1312
"suggest": {
1413
"magento/module-login-as-customer": "*"

app/code/Magento/LoginAsCustomerUi/view/adminhtml/templates/confirmation-popup.phtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<script type="text/x-magento-init">
1010
{
1111
"*": {
12-
"Magento_Ui/js/core/app": <?php /* @escapeNotVerified */ echo $block->getJsLayout();?>
12+
"Magento_Ui/js/core/app": <?= /* @escapeNotVerified */ $block->getJsLayout();?>
1313
}
1414
}
1515
</script>

app/code/Magento/LoginAsCustomerUi/view/adminhtml/web/css/source/_module.less

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,25 @@
33
* See COPYING.txt for license details.
44
*/
55

6+
//
7+
// Variables
8+
// ---------------------------------------------
9+
10+
@lac-confirm-background-color: #ccc;
11+
12+
//
13+
// Common
14+
// ---------------------------------------------
15+
616
& when (@media-common = true) {
717
.modal-popup.confirm.lac-confirm {
818
.modal-inner-wrap {
919
max-width: 55rem;
1020
}
1121
.modal-title {
12-
border-bottom: 1px solid rgb(204, 204, 204);
13-
width: 100%;
22+
border-bottom: 1px solid @lac-confirm-background-color;
1423
padding-bottom: 15px;
24+
width: 100%;
1525
}
1626

1727
.store-view-ptions {

app/code/Magento/LoginAsCustomerUi/view/adminhtml/web/js/confirmation-popup.js

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,14 @@ define(
1818
function (Component, confirm, $, ko, $t, template, selectTpl, undefined) {
1919

2020
return Component.extend({
21+
/**
22+
* Initialize Component
23+
*/
2124
initialize: function () {
2225
this._super();
23-
var self = this;
26+
var self = this,
27+
content = '<div class="message message-warning">' + self.content + '</div>';
2428

25-
var content = '<div class="message message-warning">' + self.content + '</div>';
2629
if (self.showStoreViewOptions) {
2730
content = template(
2831
selectTpl,
@@ -35,6 +38,12 @@ define(
3538
}) + content;
3639
}
3740

41+
/**
42+
* Confirmation popup
43+
*
44+
* @param {String} url
45+
* @returns {Boolean}
46+
*/
3847
window.lacConfirmationPopup = function (url) {
3948
confirm({
4049
title: self.title,
@@ -46,6 +55,7 @@ define(
4655
*/
4756
confirm: function () {
4857
var storeId = $('#lac-confirmation-popup-store-id').val();
58+
4959
if (storeId) {
5060
url += ((url.indexOf('?') == -1) ? '?' : '&') + 'store_id=' + storeId;
5161
}

0 commit comments

Comments
 (0)