Skip to content

Commit a94be9d

Browse files
author
Joan He
committed
Merge remote-tracking branch 'upstream/2.3-develop' into MAGETWO-85113-analytics-mftf
2 parents 4db925b + e150a7e commit a94be9d

File tree

1,075 files changed

+43944
-28241
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,075 files changed

+43944
-28241
lines changed

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ atlassian*
3434
/.php_cs.cache
3535
/grunt-config.json
3636
/dev/tools/grunt/configs/local-themes.js
37-
3837
/pub/media/*.*
3938
!/pub/media/.htaccess
4039
/pub/media/attribute/*

app/code/Magento/Analytics/Api/Data/LinkInterface.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@
66
namespace Magento\Analytics\Api\Data;
77

88
/**
9-
* Interface LinkInterface
10-
*
119
* Represents link with collected data and initialized vector for decryption.
1210
*/
1311
interface LinkInterface

app/code/Magento/Analytics/Block/Adminhtml/System/Config/SubscriptionStatusLabel.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@
99
use Magento\Backend\Block\Template\Context;
1010

1111
/**
12-
* Class SubscriptionStatusLabel.
13-
*
1412
* Provides labels for subscription status
1513
* Status can be reviewed in System Configuration
1614
*/
@@ -22,8 +20,6 @@ class SubscriptionStatusLabel extends \Magento\Config\Block\System\Config\Form\F
2220
private $subscriptionStatusProvider;
2321

2422
/**
25-
* SubscriptionStatusLabel constructor.
26-
*
2723
* @param Context $context
2824
* @param SubscriptionStatusProvider $labelStatusProvider
2925
* @param array $data
@@ -59,6 +55,6 @@ public function render(\Magento\Framework\Data\Form\Element\AbstractElement $ele
5955
*/
6056
private function prepareLabelValue()
6157
{
62-
return __('Subscription status') . ': ' . __($this->subscriptionStatusProvider->getStatus());
58+
return __('Subscription status') . ': ' . $this->subscriptionStatusProvider->getStatus();
6359
}
6460
}

app/code/Magento/Analytics/Controller/Adminhtml/BIEssentials/SignUp.php

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@
1010
use Magento\Framework\App\Config\ScopeConfigInterface;
1111

1212
/**
13-
* Class SignUp
14-
*
1513
* Provides link to BI Essentials signup
1614
*/
1715
class SignUp extends Action
@@ -28,6 +26,11 @@ class SignUp extends Action
2826
*/
2927
private $config;
3028

29+
/**
30+
* @inheritdoc
31+
*/
32+
const ADMIN_RESOURCE = 'Magento_Analytics::bi_essentials';
33+
3134
/**
3235
* @param Context $context
3336
* @param ScopeConfigInterface $config
@@ -40,16 +43,6 @@ public function __construct(
4043
parent::__construct($context);
4144
}
4245

43-
/**
44-
* Check admin permissions for this controller
45-
*
46-
* @return boolean
47-
*/
48-
protected function _isAllowed()
49-
{
50-
return $this->_authorization->isAllowed('Magento_Analytics::bi_essentials');
51-
}
52-
5346
/**
5447
* Provides link to BI Essentials signup
5548
*

app/code/Magento/Analytics/Controller/Adminhtml/Reports/Show.php

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,11 @@ class Show extends Action
2323
*/
2424
private $reportUrlProvider;
2525

26+
/**
27+
* @inheritdoc
28+
*/
29+
const ADMIN_RESOURCE = 'Magento_Analytics::analytics_settings';
30+
2631
/**
2732
* @param Context $context
2833
* @param ReportUrlProvider $reportUrlProvider
@@ -35,16 +40,6 @@ public function __construct(
3540
parent::__construct($context);
3641
}
3742

38-
/**
39-
* Check admin permissions for this controller.
40-
*
41-
* @return boolean
42-
*/
43-
protected function _isAllowed()
44-
{
45-
return $this->_authorization->isAllowed('Magento_Analytics::analytics_settings');
46-
}
47-
4843
/**
4944
* Redirect to resource with reports.
5045
*

app/code/Magento/Analytics/Controller/Adminhtml/Subscription/Retry.php

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,11 @@ class Retry extends Action
2525
*/
2626
private $subscriptionHandler;
2727

28+
/**
29+
* @inheritdoc
30+
*/
31+
const ADMIN_RESOURCE = 'Magento_Analytics::analytics_settings';
32+
2833
/**
2934
* @param Context $context
3035
* @param SubscriptionHandler $subscriptionHandler
@@ -37,16 +42,6 @@ public function __construct(
3742
parent::__construct($context);
3843
}
3944

40-
/**
41-
* Check admin permissions for this controller
42-
*
43-
* @return boolean
44-
*/
45-
protected function _isAllowed()
46-
{
47-
return $this->_authorization->isAllowed('Magento_Analytics::analytics_settings');
48-
}
49-
5045
/**
5146
* Retry process of subscription.
5247
*

app/code/Magento/Analytics/Cron/SignUp.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
use Magento\Framework\App\Config\Storage\WriterInterface;
1313

1414
/**
15-
* Class SignUp
15+
* Cron class for the Advanced Reporting signup process
1616
*/
1717
class SignUp
1818
{

app/code/Magento/Analytics/Model/Connector/Http/Client/Curl.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
use Magento\Analytics\Model\Connector\Http\ConverterInterface;
99
use Psr\Log\LoggerInterface;
1010
use Magento\Framework\HTTP\Adapter\CurlFactory;
11-
use Magento\Analytics\Model\Connector\Http\ResponseFactory;
11+
use Magento\Framework\HTTP\ResponseFactory;
1212

1313
/**
1414
* A CURL HTTP client.

app/code/Magento/Analytics/Model/Connector/Http/ConverterInterface.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77

88
/**
99
* Represents converter interface for http request and response body.
10+
*
11+
* @api
1012
*/
1113
interface ConverterInterface
1214
{

app/code/Magento/Analytics/Model/Connector/Http/JsonConverter.php

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
*/
66
namespace Magento\Analytics\Model\Connector\Http;
77

8+
use Magento\Framework\Serialize\Serializer\Json;
9+
810
/**
911
* Represents JSON converter for http request and response body.
1012
*/
@@ -15,25 +17,35 @@ class JsonConverter implements ConverterInterface
1517
*/
1618
const CONTENT_TYPE_HEADER = 'Content-Type: application/json';
1719

20+
/**
21+
* @var Json
22+
*/
23+
private $serializer;
24+
25+
public function __construct(Json $serializer)
26+
{
27+
$this->serializer = $serializer;
28+
}
29+
1830
/**
1931
* @param string $body
2032
*
2133
* @return array
2234
*/
2335
public function fromBody($body)
2436
{
25-
$decodedBody = json_decode($body, 1);
37+
$decodedBody = $this->serializer->unserialize($body);
2638
return $decodedBody === null ? [$body] : $decodedBody;
2739
}
2840

29-
/**
41+
/**c
3042
* @param array $data
3143
*
3244
* @return string
3345
*/
3446
public function toBody(array $data)
3547
{
36-
return json_encode($data);
48+
return $this->serializer->serialize($data);
3749
}
3850

3951
/**

0 commit comments

Comments
 (0)