File tree 20 files changed +80
-79
lines changed
LoginAsCustomerPageCache/Plugin/PageCache/Model/Config
Controller/Adminhtml/Login
dev/tests/static/testsuite/Magento/Test/Integrity/Magento/Framework/Api/_files/ExtensibleInterfacesTest 20 files changed +80
-79
lines changed Original file line number Diff line number Diff line change 11
11
use Magento \LoginAsCustomerApi \Api \DeleteExpiredAuthenticationDataInterface ;
12
12
13
13
/**
14
- * elete expired authentication data cron task
14
+ * Delete expired authentication data cron task
15
15
*/
16
16
class DeleteExpiredAuthenticationData
17
17
{
@@ -38,7 +38,7 @@ public function __construct(
38
38
}
39
39
40
40
/**
41
- * elete expired authentication data
41
+ * Delete expired authentication data
42
42
*/
43
43
public function execute (): void
44
44
{
Original file line number Diff line number Diff line change 14
14
15
15
/**
16
16
* @inheritdoc
17
+ *
18
+ * @SuppressWarnings(PHPMD.CookieAndSessionMisuse)
17
19
*/
18
20
class AuthenticateCustomer implements AuthenticateCustomerInterface
19
21
{
Original file line number Diff line number Diff line change @@ -46,15 +46,15 @@ public function __construct(
46
46
}
47
47
48
48
/**
49
- * @return int
49
+ * @inheritdoc
50
50
*/
51
51
public function getCustomerId (): int
52
52
{
53
53
return $ this ->customerId ;
54
54
}
55
55
56
56
/**
57
- * @return int
57
+ * @inheritdoc
58
58
*/
59
59
public function getAdminId (): int
60
60
{
Original file line number Diff line number Diff line change 13
13
class Login extends \Magento \Framework \Model \AbstractModel
14
14
{
15
15
/**
16
- * Initialize resource model
17
- *
18
- * @return void
16
+ * @inheritdoc
19
17
*/
20
18
protected function _construct ()
21
19
{
Original file line number Diff line number Diff line change 13
13
class Login extends \Magento \Framework \Model \ResourceModel \Db \AbstractDb
14
14
{
15
15
/**
16
- * Initialize resource model
17
- * Get tablename from config
18
- *
19
- * @return void
16
+ * @inheritdoc
20
17
*/
21
18
protected function _construct ()
22
19
{
Original file line number Diff line number Diff line change 13
13
class Collection extends \Magento \Framework \Model \ResourceModel \Db \Collection \AbstractCollection
14
14
{
15
15
/**
16
- * Constructor
17
- * Configures collection
18
- *
19
- * @return void
16
+ * @inheritdoc
20
17
*/
21
18
protected function _construct ()
22
19
{
Original file line number Diff line number Diff line change 13
13
class Collection extends \Magento \LoginAsCustomerLog \Model \ResourceModel \Login \Collection
14
14
{
15
15
/**
16
- * Constructor
17
- * Configures collection
18
- *
19
- * @return void
16
+ * @inheritdoc
20
17
*/
21
18
protected function _construct ()
22
19
{
Original file line number Diff line number Diff line change 14
14
15
15
/**
16
16
* Disable PageCache if enabled corresponding option in configuration
17
+ *
18
+ * @SuppressWarnings(PHPMD.CookieAndSessionMisuse)
17
19
*/
18
20
class DisablePageCacheIfNeededPlugin
19
21
{
Original file line number Diff line number Diff line change 12
12
13
13
/**
14
14
* Add comment after order placed by admin using admin panel.
15
+ *
16
+ * @SuppressWarnings(PHPMD.CookieAndSessionMisuse)
15
17
*/
16
18
class AdminAddCommentOnOrderPlacementPlugin
17
19
{
Original file line number Diff line number Diff line change 15
15
use Magento \LoginAsCustomerApi \Api \Data \AuthenticationDataInterface ;
16
16
17
17
/**
18
- * Class AuthenticateCustomer Plugin
18
+ * \Magento\LoginAsCustomerApi\Api\AuthenticateCustomerInterface Plugin
19
+ *
20
+ * Remove all items from guest shopping cart before execute. Mark customer cart as not-guest after execute
21
+ *
22
+ * @SuppressWarnings(PHPMD.CookieAndSessionMisuse)
19
23
*/
20
24
class AuthenticateCustomerPlugin
21
25
{
Original file line number Diff line number Diff line change 13
13
14
14
/**
15
15
* Add comment after order placed by admin using login-as-customer.
16
+ *
17
+ * @SuppressWarnings(PHPMD.CookieAndSessionMisuse)
16
18
*/
17
19
class FrontAddCommentOnOrderPlacementPlugin
18
20
{
Original file line number Diff line number Diff line change 12
12
"magento/module-user" : " *"
13
13
},
14
14
"suggest" : {
15
- "magento/sales" : " *" ,
15
+ "magento/module- sales" : " *" ,
16
16
"magento/module-login-as-customer-api" : " *"
17
17
},
18
18
"type" : " magento2-module" ,
Original file line number Diff line number Diff line change @@ -150,6 +150,8 @@ public function execute(): ResultInterface
150
150
}
151
151
152
152
/**
153
+ * Get login proceed redirect url
154
+ *
153
155
* @param string $secret
154
156
* @param int|null $storeId
155
157
* @return string
Original file line number Diff line number Diff line change 8
8
namespace Magento \LoginAsCustomerUi \Model \Config \Source ;
9
9
10
10
/**
11
- * Class StoreViewLogin
11
+ * @inheritdoc
12
12
*/
13
13
class StoreViewLogin implements \Magento \Framework \Data \OptionSourceInterface
14
14
{
@@ -23,9 +23,7 @@ class StoreViewLogin implements \Magento\Framework\Data\OptionSourceInterface
23
23
private const MANUAL = 1 ;
24
24
25
25
/**
26
- * Options int
27
- *
28
- * @return array
26
+ * @inheritdoc
29
27
*/
30
28
public function toOptionArray (): array
31
29
{
Original file line number Diff line number Diff line change 8
8
namespace Magento \LoginAsCustomerUi \ViewModel ;
9
9
10
10
use Magento \Customer \Model \Context ;
11
+ use Magento \LoginAsCustomer \Model \Config ;
11
12
use Magento \LoginAsCustomerApi \Api \ConfigInterface ;
12
13
13
14
/**
14
15
* View model to get extension configuration in the template
15
16
*/
16
17
class Configuration implements \Magento \Framework \View \Element \Block \ArgumentInterface
17
18
{
18
-
19
19
/**
20
- * @var \Magento\LoginAsCustomer\Model\ Config
20
+ * @var Config
21
21
*/
22
22
private $ config ;
23
23
24
24
/**
25
- * Customer session
26
- *
27
25
* @var \Magento\Framework\App\Http\Context
28
26
*/
29
27
private $ httpContext ;
@@ -42,6 +40,7 @@ public function __construct(
42
40
43
41
/**
44
42
* Retrieve true if login as a customer is enabled
43
+ *
45
44
* @return bool
46
45
*/
47
46
public function isEnabled (): bool
Original file line number Diff line number Diff line change 8
8
* @var \Magento\Framework\View\Element\Template $block
9
9
* @var \Magento\Framework\Escaper $escaper
10
10
*/
11
+ $ viewFileUrl = $ block ->getViewFileUrl ('Magento_LoginAsCustomerUi::images/magento-icon.svg ' );
11
12
?>
12
13
<?php if ($ block ->getConfig ()->isEnabled ()) : ?>
13
14
<div data-bind="scope: 'loginAsCustomer'" >
14
15
<div class="lac-notification clearfix" data-bind="visible: isVisible" style="display: none">
15
16
<div class="top-container">
16
17
<div class="lac-notification-icon wrapper">
17
- <img class="logo-img" src="<?= $ escaper ->escapeUrl ($ block -> getViewFileUrl ( ' Magento_LoginAsCustomerUi::images/magento-icon.svg ' ) ) ?> " alt="Magento" />
18
+ <img class="logo-img" src="<?= $ escaper ->escapeUrl ($ viewFileUrl ) ?> " alt="Magento" />
18
19
</div>
19
20
<div class="lac-notification-text wrapper">
20
21
<span data-bind="html: notificationText"></span>
Original file line number Diff line number Diff line change @@ -14,7 +14,8 @@ if ($block->isLoggedIn()) {
14
14
}
15
15
?>
16
16
17
- <a class="lac-notification-close-link" <?= /* @noEscape */ $ block ->getLinkAttributes () ?> <?= /* @noEscape */ $ dataPostParam ?> >
17
+ <a class="lac-notification-close-link" <?= /* @noEscape */ $ block ->getLinkAttributes ()
18
+ ?> <?= /* @noEscape */ $ dataPostParam ?> >
18
19
<?= $ escaper ->escapeHtml (__ ('Close Session ' )) ?>
19
20
</a>
20
21
Original file line number Diff line number Diff line change 10
10
{
11
11
"*": {
12
12
"Magento_LoginAsCustomerUi/js/login": {
13
- "redirectUrl": "<?= $ block ->getUrl ('customer/account/index ' ) ?> "
13
+ "redirectUrl": "<?= /* @noEscape */ $ block ->getUrl ('customer/account/index ' ) ?> "
14
14
}
15
15
}
16
16
}
Original file line number Diff line number Diff line change 4
4
*/
5
5
6
6
& when (@media-common = true ) {
7
+ .lac-notification {
8
+ background-color : #373330 ;
9
+ color : #fff ;
10
+ font-size : 16px ;
7
11
8
- .lac-notification {
9
- background-color : #373330 ;
10
- color : #fff ;
11
- font-size : 16px ;
12
+ .lac-notification-icon {
13
+ float : left ;
14
+ margin : 10px 25px 10px 10px ;
12
15
13
- .lac-notification-icon {
14
- float :left ;
15
- margin : 10px 25px 10px 10px ;
16
+ .logo-img {
17
+ display : block
18
+ }
19
+ }
16
20
17
- .logo-img {
18
- display : block
19
- }
20
- }
21
+ .lac-notification-text {
22
+ float : left ;
23
+ padding : 15 px 0 ;
24
+ }
21
25
22
- .lac-notification-text {
23
- float :left ;
24
- padding : 15px 0 ;
25
- }
26
+ .lac-notification-links {
27
+ float : right ;
28
+ padding : 15px 0 ;
26
29
27
- .lac-notification-links {
28
- float : right ;
29
- padding : 15px 0 ;
30
- a {
31
- color :#fff ;
32
- font-size : 14px ;
33
- }
30
+ a {
31
+ color : #fff ;
32
+ font-size : 14px ;
33
+ }
34
34
35
- .lac-notification-close-link {
36
- & :after {
37
- content : ' ' ;
38
- vertical-align : middle ;
39
- display : inline-block ;
40
- background : url(' ../Magento_LoginAsCustomerUi/images/close.svg' ) ;
41
- height : 12px ;
42
- width : 12px ;
43
- margin-left : 5px ;
44
- }
45
- }
35
+ .lac-notification-close-link {
36
+ & :after {
37
+ content : ' ' ;
38
+ background : url(' ../Magento_LoginAsCustomerUi/images/close.svg' ) ;
39
+ display : inline-block ;
40
+ height : 12px ;
41
+ margin-left : 5px ;
42
+ vertical-align : middle ;
43
+ width : 12px ;
46
44
}
45
+ }
47
46
}
47
+ }
48
48
}
49
49
50
-
51
50
.media-width (@extremum , @break ) when (@extremum = ' max' ) and (@break = @screen__m ) {
52
- .lac-notification {
53
- padding : 5px 0 ;
54
-
55
- .lac-notification-icon {
56
- display : none ;
57
- }
51
+ .lac-notification {
52
+ padding : 5px 0 ;
58
53
59
- .lac-notification-text ,
60
- .lac-notification-links {
61
- float : none ;
62
- text-align : center ;
63
- padding : 5px 0 ;
64
- }
54
+ .lac-notification-icon {
55
+ display : none ;
56
+ }
65
57
58
+ .lac-notification-text ,
59
+ .lac-notification-links {
60
+ float : none ;
61
+ padding : 5px 0 ;
62
+ text-align : center ;
66
63
}
64
+ }
67
65
}
Original file line number Diff line number Diff line change 1
1
module Magento_Payment Model/Info.php
2
2
module Magento_Customer Model/Address/AbstractAddress.php
3
3
library magento/framework MessageQueue/Rpc/Publisher.php
4
- module Magento_GraphQl Model/Query/ContextInterface.php
4
+ module Magento_GraphQl Model/Query/ContextInterface.php
5
+ module Magento_LoginAsCustomerApi Api/Data/AuthenticationDataInterface.php
You can’t perform that action at this time.
0 commit comments