Skip to content

Commit 70a3d3b

Browse files
committed
magento2-login-as-customer/issues/90: Tests stabilization
1 parent 29b5920 commit 70a3d3b

File tree

2 files changed

+82
-82
lines changed

2 files changed

+82
-82
lines changed

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

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77
// Variables
88
// ---------------------------------------------
99

10-
@lac-confirm-background-color: #ccc;
10+
@lac-confirm-popup-title-background-color: #ccc;
11+
@lac-confirm-popup-content-color: #514943;
1112

1213
//
1314
// Common
@@ -19,7 +20,7 @@
1920
max-width: 55rem;
2021
}
2122
.modal-title {
22-
border-bottom: 1px solid @lac-confirm-background-color;
23+
border-bottom: 1px solid @lac-confirm-popup-title-background-color;
2324
padding-bottom: 15px;
2425
width: 100%;
2526
}
@@ -32,7 +33,7 @@
3233
.message-warning {
3334
padding-left: 4.5rem;
3435
&:before {
35-
color: #514943;
36+
color: @lac-confirm-popup-content-color;
3637
left: 5px;
3738
}
3839
}

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

Lines changed: 78 additions & 79 deletions
Original file line numberDiff line numberDiff line change
@@ -3,91 +3,90 @@
33
* See COPYING.txt for license details.
44
*/
55

6-
'use strict';
6+
define([
7+
'uiComponent',
8+
'Magento_Ui/js/modal/confirm',
9+
'jquery',
10+
'ko',
11+
'mage/translate',
12+
'mage/template',
13+
'text!Magento_LoginAsCustomerUi/template/confirmation-popup/store-view-ptions.html'
14+
], function (Component, confirm, $, ko, $t, template, selectTpl) {
715

8-
define(
9-
[
10-
'uiComponent',
11-
'Magento_Ui/js/modal/confirm',
12-
'jquery',
13-
'ko',
14-
'mage/translate',
15-
'mage/template',
16-
'text!Magento_LoginAsCustomerUi/template/confirmation-popup/store-view-ptions.html'
17-
],
18-
function (Component, confirm, $, ko, $t, template, selectTpl, undefined) {
16+
'use strict';
1917

20-
return Component.extend({
21-
/**
22-
* Initialize Component
23-
*/
24-
initialize: function () {
25-
this._super();
26-
var self = this,
27-
content = '<div class="message message-warning">' + self.content + '</div>';
18+
return Component.extend({
19+
/**
20+
* Initialize Component
21+
*/
22+
initialize: function () {
23+
var self = this,
24+
content = '<div class="message message-warning">' + self.content + '</div>';
2825

29-
if (self.showStoreViewOptions) {
30-
content = template(
31-
selectTpl,
32-
{
33-
data: {
34-
showStoreViewOptions: self.showStoreViewOptions,
35-
storeViewOptions: self.storeViewOptions,
36-
label: $t('Store View')
37-
}
38-
}) + content;
39-
}
26+
this._super();
4027

41-
/**
42-
* Confirmation popup
43-
*
44-
* @param {String} url
45-
* @returns {Boolean}
46-
*/
47-
window.lacConfirmationPopup = function (url) {
48-
confirm({
49-
title: self.title,
50-
content: content,
51-
modalClass: 'confirm lac-confirm',
52-
actions: {
53-
/**
54-
* Confirm action.
55-
*/
56-
confirm: function () {
57-
var storeId = $('#lac-confirmation-popup-store-id').val();
28+
if (self.showStoreViewOptions) {
29+
content = template(
30+
selectTpl,
31+
{
32+
data: {
33+
showStoreViewOptions: self.showStoreViewOptions,
34+
storeViewOptions: self.storeViewOptions,
35+
label: $t('Store View')
36+
}
37+
}) + content;
38+
}
5839

59-
if (storeId) {
60-
url += ((url.indexOf('?') == -1) ? '?' : '&') + 'store_id=' + storeId;
61-
}
62-
window.open(url);
63-
}
64-
},
65-
buttons: [{
66-
text: $t('Cancel'),
67-
class: 'action-secondary action-dismiss',
40+
/**
41+
* Confirmation popup
42+
*
43+
* @param {String} url
44+
* @returns {Boolean}
45+
*/
46+
window.lacConfirmationPopup = function (url) {
47+
confirm({
48+
title: self.title,
49+
content: content,
50+
modalClass: 'confirm lac-confirm',
51+
actions: {
52+
/**
53+
* Confirm action.
54+
*/
55+
confirm: function () {
56+
var storeId = $('#lac-confirmation-popup-store-id').val();
6857

69-
/**
70-
* Click handler.
71-
*/
72-
click: function (event) {
73-
this.closeModal(event);
58+
if (storeId) {
59+
url += url.indexOf('?') === -1 ? '?' : '&';
60+
url += 'store_id=' + storeId;
7461
}
75-
}, {
76-
text: $t('Login as Customer'),
77-
class: 'action-primary action-accept',
62+
window.open(url);
63+
}
64+
},
65+
buttons: [{
66+
text: $t('Cancel'),
67+
class: 'action-secondary action-dismiss',
7868

79-
/**
80-
* Click handler.
81-
*/
82-
click: function (event) {
83-
this.closeModal(event, true);
84-
}
85-
}]
86-
});
69+
/**
70+
* Click handler.
71+
*/
72+
click: function (event) {
73+
this.closeModal(event);
74+
}
75+
}, {
76+
text: $t('Login as Customer'),
77+
class: 'action-primary action-accept',
8778

88-
return false;
89-
};
90-
}
91-
});
92-
}
93-
);
79+
/**
80+
* Click handler.
81+
*/
82+
click: function (event) {
83+
this.closeModal(event, true);
84+
}
85+
}]
86+
});
87+
88+
return false;
89+
};
90+
}
91+
});
92+
});

0 commit comments

Comments
 (0)