Skip to content

Commit 3b0d7b7

Browse files
committed
MC-15298: Allow admin to opt out of admin analytics tracking - Updated files based on review
1 parent ba2390f commit 3b0d7b7

File tree

8 files changed

+19
-23
lines changed

8 files changed

+19
-23
lines changed

app/code/Magento/AdminAnalytics/Block/Metadata.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
*/
66
namespace Magento\AdminAnalytics\Block;
77

8-
use Magento\Framework\View\Element\Template;
9-
use Magento\Framework\View\Element\Template\Context;
8+
use Magento\Backend\Block\Template;
9+
use Magento\Backend\Block\Template\Context;
1010
use Magento\Framework\App\ProductMetadataInterface;
1111
use Magento\Backend\Model\Auth\Session;
1212
use Magento\Framework\App\State;

app/code/Magento/AdminAnalytics/Block/Notification.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ class Notification implements ArgumentInterface
2727
private $canViewNotificationRelease;
2828

2929
/**
30-
* Notification constructor.
3130
* @param AdminAnalyticsNotification $canViewNotificationAnalytics
3231
* @param ReleaseNotification $canViewNotificationRelease
3332
*/

app/code/Magento/AdminAnalytics/Controller/Adminhtml/Config/DisableAdminUsage.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,10 @@ class DisableAdminUsage extends Action implements HttpPostActionInterface
3838
/**
3939
* DisableAdminUsage constructor.
4040
*
41-
* @param Action\Context $context
41+
* @param Action\Context $context
4242
* @param ProductMetadataInterface $productMetadata
43-
* @param NotificationLogger $notificationLogger
44-
* @param Factory $configFactory
43+
* @param NotificationLogger $notificationLogger
44+
* @param Factory $configFactory
4545
*/
4646
public function __construct(
4747
Action\Context $context,
@@ -56,7 +56,7 @@ public function __construct(
5656
}
5757

5858
/**
59-
* Changes the value of config/admin/usage/enabled
59+
* Change the value of config/admin/usage/enabled
6060
*/
6161
private function disableAdminUsage()
6262
{
@@ -70,7 +70,7 @@ private function disableAdminUsage()
7070
*
7171
* @return ResultInterface
7272
*/
73-
private function markUserNotified() : ResultInterface
73+
private function markUserNotified(): ResultInterface
7474
{
7575
$responseContent = [
7676
'success' => $this->notificationLogger->log(

app/code/Magento/AdminAnalytics/Controller/Adminhtml/Config/EnableAdminUsage.php

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,10 @@ class EnableAdminUsage extends Action implements HttpPostActionInterface
3636
private $notificationLogger;
3737

3838
/**
39-
* MarkUserNotified constructor.
40-
*
41-
* @param Action\Context $context
39+
* @param Action\Context $context
4240
* @param ProductMetadataInterface $productMetadata
43-
* @param NotificationLogger $notificationLogger
44-
* @param Factory $configFactory
41+
* @param NotificationLogger $notificationLogger
42+
* @param Factory $configFactory
4543
*/
4644
public function __construct(
4745
Action\Context $context,
@@ -56,7 +54,7 @@ public function __construct(
5654
}
5755

5856
/**
59-
* Changes the value of config/admin/usage/enabled
57+
* Change the value of config/admin/usage/enabled
6058
*/
6159
private function enableAdminUsage()
6260
{
@@ -70,7 +68,7 @@ private function enableAdminUsage()
7068
*
7169
* @return ResultInterface
7270
*/
73-
private function markUserNotified() : ResultInterface
71+
private function markUserNotified(): ResultInterface
7472
{
7573
$responseContent = [
7674
'success' => $this->notificationLogger->log(

app/code/Magento/AdminAnalytics/Model/Condition/CanViewNotification.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
use Magento\Framework\App\CacheInterface;
1313

1414
/**
15-
* Dynamic validator for UI admin analytics notification, manage UI component visibility.
15+
* Dynamic validator for UI admin analytics notification, control UI component visibility.
1616
*/
1717
class CanViewNotification implements VisibilityConditionInterface
1818
{
@@ -41,7 +41,7 @@ class CanViewNotification implements VisibilityConditionInterface
4141
private $cacheStorage;
4242

4343
/**
44-
* @param Logger $viewerLogger
44+
* @param Logger $viewerLogger
4545
* @param CacheInterface $cacheStorage
4646
*/
4747
public function __construct(

app/code/Magento/AdminAnalytics/Model/ResourceModel/Viewer/Logger.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public function __construct(
5151
* @param string $lastViewVersion
5252
* @return bool
5353
*/
54-
public function log(string $lastViewVersion) : bool
54+
public function log(string $lastViewVersion): bool
5555
{
5656
/** @var \Magento\Framework\DB\Adapter\AdapterInterface $connection */
5757
$connection = $this->resource->getConnection(ResourceConnection::DEFAULT_CONNECTION);
@@ -72,7 +72,7 @@ public function log(string $lastViewVersion) : bool
7272
*
7373
* @return Log
7474
*/
75-
public function get() : Log
75+
public function get(): Log
7676
{
7777
return $this->logFactory->create(['data' => $this->loadLatestLogData()]);
7878
}
@@ -82,7 +82,7 @@ public function get() : Log
8282
*
8383
* @return boolean
8484
*/
85-
public function checkLogExists() : bool
85+
public function checkLogExists(): bool
8686
{
8787
$data = $this->logFactory->create(['data' => $this->loadLatestLogData()]);
8888
$lastViewedVersion = $data->getLastViewVersion();
@@ -94,7 +94,7 @@ public function checkLogExists() : bool
9494
*
9595
* @return array
9696
*/
97-
private function loadLatestLogData() : array
97+
private function loadLatestLogData(): array
9898
{
9999
$connection = $this->resource->getConnection();
100100
$select = $connection->select()
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
The purpose of Magento\AdminAnalytics module is gather information on which features the users uses and sends it to adobe analytics
1+
The purpose of Magento\AdminAnalytics module is to gather information on which features the admins use, to help improve Magento admin experience.

app/code/Magento/AdminAnalytics/Test/Mftf/Section/AdminUsageConfigSection.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
1010
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
1111
<section name="AdminUsageConfigSection">
12-
1312
<element name="adminUsageHeader" type="text" selector="#admin_usage-head"/>
1413
<element name="adminUsageOptions" type="select" selector="#admin_usage_enabled"/>
1514
</section>

0 commit comments

Comments
 (0)