Skip to content

Commit 7b27b95

Browse files
committed
magento2-login-as-customer/issues/154: LoginAsCustomer API/extension points refactoring
1 parent 9681a37 commit 7b27b95

File tree

5 files changed

+11
-9
lines changed

5 files changed

+11
-9
lines changed

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

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

88
namespace Magento\LoginAsCustomerAdminUi\Block\Adminhtml;
99

10-
use Magento\Framework\Serialize\Serializer\Json;
11-
use Magento\Store\Ui\Component\Listing\Column\Store\Options as StoreOptions;
1210
use Magento\Backend\Block\Template;
11+
use Magento\Framework\Serialize\Serializer\Json;
1312
use Magento\LoginAsCustomerApi\Api\ConfigInterface;
13+
use Magento\Store\Ui\Component\Listing\Column\Store\Options as StoreOptions;
1414

1515
/**
1616
* Login confirmation pop-up
@@ -77,15 +77,13 @@ public function getJsLayout()
7777
}
7878

7979
/**
80-
* Render block HTML
81-
*
82-
* @return string
80+
* @inheritdoc
8381
*/
84-
protected function _toHtml()
82+
public function toHtml()
8583
{
8684
if (!$this->config->isEnabled()) {
8785
return '';
8886
}
89-
return parent::_toHtml();
87+
return parent::toHtml();
9088
}
9189
}

app/code/Magento/LoginAsCustomerAdminUi/composer.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,14 @@
55
"php": "~7.3.0||~7.4.0",
66
"magento/framework": "*",
77
"magento/module-login-as-customer-api": "*",
8+
"magento/module-login-as-customer-frontend-ui": "*",
89
"magento/module-backend": "*",
910
"magento/module-customer": "*",
1011
"magento/module-store": "*"
1112
},
13+
"suggest": {
14+
"magento/module-login-as-customer": "*"
15+
},
1216
"type": "magento2-module",
1317
"license": [
1418
"OSL-3.0",

app/code/Magento/LoginAsCustomerFrontendUi/CustomerData/LoginAsCustomerUi.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
*
1818
* @SuppressWarnings(PHPMD.CookieAndSessionMisuse)
1919
*/
20-
class LoginAsCustomerFrontendUi implements SectionSourceInterface
20+
class LoginAsCustomerUi implements SectionSourceInterface
2121
{
2222
/**
2323
* @var Session

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<type name="Magento\Customer\CustomerData\SectionPoolInterface">
1010
<arguments>
1111
<argument name="sectionSourceMap" xsi:type="array">
12-
<item name="loggedAsCustomer" xsi:type="string">Magento\LoginAsCustomerFrontendUi\CustomerData\LoginAsCustomerFrontendUi</item>
12+
<item name="loggedAsCustomer" xsi:type="string">Magento\LoginAsCustomerFrontendUi\CustomerData\LoginAsCustomerUi</item>
1313
</argument>
1414
</arguments>
1515
</type>

0 commit comments

Comments
 (0)