Skip to content

Commit b033dff

Browse files
committed
magento2/issues/29113 Customers should be able to enable/disable Admin "remote shopping assistance"
1 parent 4c31a1b commit b033dff

File tree

7 files changed

+27
-18
lines changed

7 files changed

+27
-18
lines changed

app/code/Magento/LoginAsCustomer/Model/Resolver/IsLoginAsCustomerEnabledResolver.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
namespace Magento\LoginAsCustomer\Model\Resolver;
99

10-
use Magento\LoginAsCustomer\Model\IsLoginAsCustomerEnabledForCustomerResultFactory;
10+
use Magento\LoginAsCustomerApi\Api\Data\IsLoginAsCustomerEnabledForCustomerResultInterfaceFactory;
1111
use Magento\LoginAsCustomerApi\Api\ConfigInterface;
1212
use Magento\LoginAsCustomerApi\Api\Data\IsLoginAsCustomerEnabledForCustomerResultInterface;
1313
use Magento\LoginAsCustomerApi\Api\IsLoginAsCustomerEnabledForCustomerInterface;
@@ -23,17 +23,17 @@ class IsLoginAsCustomerEnabledResolver implements IsLoginAsCustomerEnabledForCus
2323
private $config;
2424

2525
/**
26-
* @var IsLoginAsCustomerEnabledForCustomerResultFactory
26+
* @var IsLoginAsCustomerEnabledForCustomerResultInterfaceFactory
2727
*/
2828
private $resultFactory;
2929

3030
/**
3131
* @param ConfigInterface $config
32-
* @param IsLoginAsCustomerEnabledForCustomerResultFactory $resultFactory
32+
* @param IsLoginAsCustomerEnabledForCustomerResultInterfaceFactory $resultFactory
3333
*/
3434
public function __construct(
3535
ConfigInterface $config,
36-
IsLoginAsCustomerEnabledForCustomerResultFactory $resultFactory
36+
IsLoginAsCustomerEnabledForCustomerResultInterfaceFactory $resultFactory
3737
) {
3838
$this->config = $config;
3939
$this->resultFactory = $resultFactory;

app/code/Magento/LoginAsCustomer/etc/di.xml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,7 @@
2323
<preference for="Magento\LoginAsCustomerApi\Api\GetLoggedAsCustomerCustomerIdInterface" type="Magento\LoginAsCustomer\Model\GetLoggedAsCustomerCustomerId"/>
2424
<preference for="Magento\LoginAsCustomerApi\Api\SetLoggedAsCustomerAdminIdInterface" type="Magento\LoginAsCustomer\Model\SetLoggedAsCustomerAdminId"/>
2525
<preference for="Magento\LoginAsCustomerApi\Api\SetLoggedAsCustomerCustomerIdInterface" type="Magento\LoginAsCustomer\Model\SetLoggedAsCustomerCustomerId"/>
26-
<preference for="Magento\LoginAsCustomerApi\Api\IsLoginAsCustomerEnabledForCustomerInterface"
27-
type="Magento\LoginAsCustomer\Model\IsLoginAsCustomerEnabledForCustomerChain"/>
28-
<type name="Magento\LoginAsCustomer\Model\IsLoginAsCustomerEnabledForCustomerChain">
26+
<type name="Magento\LoginAsCustomerApi\Model\IsLoginAsCustomerEnabledForCustomerChain">
2927
<arguments>
3028
<argument name="resolvers" xsi:type="array">
3129
<item name="is_enabled" xsi:type="object">

app/code/Magento/LoginAsCustomer/Model/IsLoginAsCustomerEnabledForCustomerChain.php renamed to app/code/Magento/LoginAsCustomerApi/Model/IsLoginAsCustomerEnabledForCustomerChain.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
*/
66
declare(strict_types=1);
77

8-
namespace Magento\LoginAsCustomer\Model;
8+
namespace Magento\LoginAsCustomerApi\Model;
99

1010
use Magento\LoginAsCustomerApi\Api\ConfigInterface;
1111
use Magento\LoginAsCustomerApi\Api\Data\IsLoginAsCustomerEnabledForCustomerResultInterface;
@@ -22,7 +22,7 @@ class IsLoginAsCustomerEnabledForCustomerChain implements IsLoginAsCustomerEnabl
2222
private $config;
2323

2424
/**
25-
* @var IsLoginAsCustomerEnabledForCustomerResultFactory
25+
* @var IsLoginAsCustomerEnabledForCustomerResultInterfaceFactory
2626
*/
2727
private $resultFactory;
2828

@@ -33,12 +33,12 @@ class IsLoginAsCustomerEnabledForCustomerChain implements IsLoginAsCustomerEnabl
3333

3434
/**
3535
* @param ConfigInterface $config
36-
* @param IsLoginAsCustomerEnabledForCustomerResultFactory $resultFactory
36+
* @param IsLoginAsCustomerEnabledForCustomerResultInterfaceFactory $resultFactory
3737
* @param array $resolvers
3838
*/
3939
public function __construct(
4040
ConfigInterface $config,
41-
IsLoginAsCustomerEnabledForCustomerResultFactory $resultFactory,
41+
IsLoginAsCustomerEnabledForCustomerResultInterfaceFactory $resultFactory,
4242
array $resolvers = []
4343
) {
4444
$this->config = $config;
@@ -52,7 +52,7 @@ public function __construct(
5252
public function execute(int $customerId): IsLoginAsCustomerEnabledForCustomerResultInterface
5353
{
5454
$messages = [[]];
55-
/** @var IsLoginAsCustomerEnabledForCustomerResultInterface $resolver */
55+
/** @var IsLoginAsCustomerEnabledForCustomerInterface $resolver */
5656
foreach ($this->resolvers as $resolver) {
5757
$resolverResult = $resolver->execute($customerId);
5858
if (!$resolverResult->isEnabled()) {
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<?xml version="1.0"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
9+
xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
10+
<preference for="Magento\LoginAsCustomerApi\Api\IsLoginAsCustomerEnabledForCustomerInterface"
11+
type="Magento\LoginAsCustomerApi\Model\IsLoginAsCustomerEnabledForCustomerChain"/>
12+
</config>

app/code/Magento/LoginAsCustomerAssistance/Model/Processor/IsLoginAsCustomerAllowedResolver.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
namespace Magento\LoginAsCustomerAssistance\Model\Processor;
99

10-
use Magento\LoginAsCustomer\Model\IsLoginAsCustomerEnabledForCustomerResultFactory;
10+
use Magento\LoginAsCustomerApi\Api\Data\IsLoginAsCustomerEnabledForCustomerResultInterfaceFactory;
1111
use Magento\LoginAsCustomerApi\Api\Data\IsLoginAsCustomerEnabledForCustomerResultInterface;
1212
use Magento\LoginAsCustomerApi\Api\IsLoginAsCustomerEnabledForCustomerInterface;
1313
use Magento\LoginAsCustomerAssistance\Api\IsAssistanceEnabledInterface;
@@ -23,17 +23,17 @@ class IsLoginAsCustomerAllowedResolver implements IsLoginAsCustomerEnabledForCus
2323
private $isAssistanceEnabled;
2424

2525
/**
26-
* @var IsLoginAsCustomerEnabledForCustomerResultFactory
26+
* @var IsLoginAsCustomerEnabledForCustomerResultInterfaceFactory
2727
*/
2828
private $resultFactory;
2929

3030
/**
3131
* @param IsAssistanceEnabledInterface $isAssistanceEnabled
32-
* @param IsLoginAsCustomerEnabledForCustomerResultFactory $resultFactory
32+
* @param IsLoginAsCustomerEnabledForCustomerResultInterfaceFactory $resultFactory
3333
*/
3434
public function __construct(
3535
IsAssistanceEnabledInterface $isAssistanceEnabled,
36-
IsLoginAsCustomerEnabledForCustomerResultFactory $resultFactory
36+
IsLoginAsCustomerEnabledForCustomerResultInterfaceFactory $resultFactory
3737
) {
3838
$this->isAssistanceEnabled = $isAssistanceEnabled;
3939
$this->resultFactory = $resultFactory;

app/code/Magento/LoginAsCustomerAssistance/composer.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
"magento/framework": "*",
77
"magento/module-backend": "*",
88
"magento/module-customer": "*",
9-
"magento/module-login-as-customer": "*",
109
"magento/module-login-as-customer-api": "*"
1110
},
1211
"suggest": {

app/code/Magento/LoginAsCustomerAssistance/etc/di.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
type="Magento\LoginAsCustomerAssistance\Model\IsAssistanceEnabled"/>
1414
<preference for="Magento\LoginAsCustomerAssistance\Api\SetAssistanceInterface"
1515
type="Magento\LoginAsCustomerAssistance\Model\SetAssistance"/>
16-
<type name="Magento\LoginAsCustomer\Model\IsLoginAsCustomerEnabledForCustomerChain">
16+
<type name="Magento\LoginAsCustomerApi\Model\IsLoginAsCustomerEnabledForCustomerChain">
1717
<arguments>
1818
<argument name="resolvers" xsi:type="array">
1919
<item name="is_allowed" xsi:type="object">

0 commit comments

Comments
 (0)