Skip to content

Commit 69e8af8

Browse files
committed
Merge remote-tracking branch 'mainline/develop' into MAGETWO-23407-memory-usage
2 parents e038c3c + 44e90c4 commit 69e8af8

File tree

6,800 files changed

+275064
-262937
lines changed

Some content is hidden

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

6,800 files changed

+275064
-262937
lines changed

.php_cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ $finder = Symfony\CS\Finder\DefaultFinder::create()
1515
->exclude('dev/tests/functional/vendor')
1616
->exclude('dev/tests/integration/tmp')
1717
->exclude('dev/tests/integration/var')
18-
->exclude('lib/internal/Apache')
1918
->exclude('lib/internal/CardinalCommerce')
2019
->exclude('lib/internal/Cm')
2120
->exclude('lib/internal/Credis')

CHANGELOG.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,36 @@
1+
0.42.0-beta11
2+
=============
3+
* Various improvements:
4+
* Added LICENSE to Developer module
5+
* Refactored Catalog and related module to use mutable data object interface
6+
* Refactored Sales and related modules to use mutable data interfaces
7+
* Setup:
8+
* Added styles for new module enabling / disabling section in Installation wizard
9+
* Modules Install and upgrade capabilities are refactored to implement interfaces used by Setup application
10+
* Framework:
11+
* Moved/refactored Magento\IO\Sftp adapter into Filesystem library
12+
* Removed Magento IO library
13+
* Implemented Dynamic Types Binding in SOAP
14+
* Implemented Extensible Attributes generation
15+
* Improved Web API Related Code Quality
16+
* Moved Specific Helper Components From the Magento/Core Module to Magento/Framework
17+
* Performance:
18+
* Inline JS code is eliminated
19+
* Created fixture for changing Magento config update via Performance Toolkit Generator
20+
* Fixed bugs:
21+
* Issue with multiple addresses checkout
22+
* Issue with catalog page update after a product status changes
23+
* Issue with distance between "Log in" & "or" & "Register" in Frontend header
24+
* Issue with tax details and amounts in frontend and backend order
25+
* JavaScript error when clicking on toggle arrow to show FPT in shopping cart
26+
* PHP Warning when trying to checkout with Multiple Addresses on review order page
27+
* Functional tests:
28+
* Refactored end-to-end test for order placement from backend and for OnePageCheckout
29+
* GitHub requests:
30+
* [#1035] (https://github.com/magento/magento2/issues/1035) -- Bug in Magento\Framework\Simplexml\Element::appendChild
31+
* [#1053] (https://github.com/magento/magento2/issues/1053) -- #865: add getParams/setParam to RequestInterface
32+
* [#1066] (https://github.com/magento/magento2/issues/1066) -- PHP 5.5.16-1+deb.sury.org~precise+1
33+
134
0.42.0-beta10
235
=============
336
* Framework

app/bootstrap.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,5 +35,5 @@
3535
\Magento\Framework\Profiler::applyConfig($_SERVER['MAGE_PROFILER'], BP, !empty($_REQUEST['isAjax']));
3636
}
3737
if (ini_get('date.timezone') == '') {
38-
date_default_timezone_set(\Magento\Framework\Stdlib\DateTime\TimezoneInterface::DEFAULT_TIMEZONE);
38+
date_default_timezone_set('UTC');
3939
}

app/code/Magento/AdminNotification/Block/System/Messages.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,8 +121,10 @@ public function getSystemMessageDialogJson()
121121
[
122122
'systemMessageDialog' => [
123123
'autoOpen' => false,
124-
'width' => 600,
125-
'ajaxUrl' => $this->_getMessagesUrl(),
124+
'width' => '75%',
125+
'modal' => true,
126+
'dialogClass' => 'ui-dialog-active ui-popup-message',
127+
'ajaxUrl' => $this->_getMessagesUrl()
126128
],
127129
]
128130
);

app/code/Magento/AdminNotification/Block/ToolbarEntry.php

Lines changed: 42 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,17 @@ class ToolbarEntry extends \Magento\Backend\Block\Template
1818
/**
1919
* Number of notifications showed on expandable window
2020
*/
21-
const NOTIFICATIONS_NUMBER = 4;
21+
const NOTIFICATIONS_NUMBER = 3;
22+
23+
/**
24+
* Number of notifications showed on icon
25+
*/
26+
const NOTIFICATIONS_COUNTER_MAX = 99;
27+
28+
/**
29+
* Length of notification description showed by default
30+
*/
31+
const NOTIFICATION_DESCRIPTION_LENGTH = 150;
2232

2333
/**
2434
* Collection of latest unread notifications
@@ -41,6 +51,26 @@ public function __construct(
4151
$this->_notificationList = $notificationList;
4252
}
4353

54+
/**
55+
* Retrieve notification description start length
56+
*
57+
* @return int
58+
*/
59+
public function getNotificationDescriptionLength()
60+
{
61+
return self::NOTIFICATION_DESCRIPTION_LENGTH;
62+
}
63+
64+
/**
65+
* Retrieve notification counter max value
66+
*
67+
* @return int
68+
*/
69+
public function getNotificationCounterMax()
70+
{
71+
return self::NOTIFICATIONS_COUNTER_MAX;
72+
}
73+
4474
/**
4575
* Retrieve number of unread notifications
4676
*
@@ -69,13 +99,18 @@ public function getLatestUnreadNotifications()
6999
*/
70100
public function formatNotificationDate($dateString)
71101
{
72-
if (date('Ymd') == date('Ymd', strtotime($dateString))) {
73-
return $this->formatTime(
74-
$dateString,
75-
\Magento\Framework\Stdlib\DateTime\TimezoneInterface::FORMAT_TYPE_SHORT,
76-
false
102+
$date = new \DateTime($dateString);
103+
if ($date == new \DateTime('today')) {
104+
return $this->_localeDate->formatDateTime(
105+
$date,
106+
\IntlDateFormatter::NONE,
107+
\IntlDateFormatter::SHORT
77108
);
78109
}
79-
return $this->formatDate($dateString, \Magento\Framework\Stdlib\DateTime\TimezoneInterface::FORMAT_TYPE_MEDIUM, true);
110+
return $this->_localeDate->formatDateTime(
111+
$date,
112+
\IntlDateFormatter::MEDIUM,
113+
\IntlDateFormatter::MEDIUM
114+
);
80115
}
81116
}

app/code/Magento/AdminNotification/Controller/Adminhtml/System/Message/ListAction.php

Lines changed: 41 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,24 +8,56 @@
88

99
class ListAction extends \Magento\Backend\App\AbstractAction
1010
{
11+
/**
12+
* @var \Magento\Framework\Json\Helper\Data
13+
*/
14+
protected $jsonHelper;
15+
16+
/**
17+
* @var \Magento\AdminNotification\Model\Resource\System\Message\Collection
18+
*/
19+
protected $messageCollection;
20+
21+
/**
22+
* Initialize ListAction
23+
*
24+
* @param \Magento\Backend\App\Action\Context $context
25+
* @param \Magento\Framework\Json\Helper\Data $jsonHelper
26+
* @param \Magento\AdminNotification\Model\Resource\System\Message\Collection $messageCollection
27+
*/
28+
public function __construct(
29+
\Magento\Backend\App\Action\Context $context,
30+
\Magento\Framework\Json\Helper\Data $jsonHelper,
31+
\Magento\AdminNotification\Model\Resource\System\Message\Collection $messageCollection
32+
) {
33+
$this->jsonHelper = $jsonHelper;
34+
$this->messageCollection = $messageCollection;
35+
parent::__construct($context);
36+
}
37+
1138
/**
1239
* @return void
1340
*/
1441
public function execute()
1542
{
1643
$severity = $this->getRequest()->getParam('severity');
17-
$messageCollection = $this->_objectManager->get(
18-
'Magento\AdminNotification\Model\Resource\System\Message\Collection'
19-
);
2044
if ($severity) {
21-
$messageCollection->setSeverity($severity);
45+
$this->messageCollection->setSeverity($severity);
2246
}
2347
$result = [];
24-
foreach ($messageCollection->getItems() as $item) {
25-
$result[] = ['severity' => $item->getSeverity(), 'text' => $item->getText()];
48+
foreach ($this->messageCollection->getItems() as $item) {
49+
$result[] = [
50+
'severity' => $item->getSeverity(),
51+
'text' => $item->getText(),
52+
];
53+
}
54+
if (empty($result)) {
55+
$result[] = [
56+
'severity' => (string)\Magento\Framework\Notification\MessageInterface::SEVERITY_NOTICE,
57+
'text' => 'You have viewed and resolved all recent system notices. '
58+
. 'Please refresh the web page to clear the notice alert.',
59+
];
2660
}
27-
$this->getResponse()->representJson(
28-
$this->_objectManager->get('Magento\Framework\Json\Helper\Data')->jsonEncode($result)
29-
);
61+
$this->getResponse()->representJson($this->jsonHelper->jsonEncode($result));
3062
}
3163
}

dev/tests/unit/testsuite/Magento/AdminNotification/Block/ToolbarEntryTest.php renamed to app/code/Magento/AdminNotification/Test/Unit/Block/ToolbarEntryTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
/**
1010
* Test class for \Magento\AdminNotification\Block\ToolbarEntry
1111
*/
12-
namespace Magento\AdminNotification\Block;
12+
namespace Magento\AdminNotification\Test\Unit\Block;
1313

1414
class ToolbarEntryTest extends \PHPUnit_Framework_TestCase
1515
{
@@ -21,7 +21,7 @@ class ToolbarEntryTest extends \PHPUnit_Framework_TestCase
2121
*/
2222
protected function _getBlockInstance($unreadNotifications)
2323
{
24-
$objectManagerHelper = new \Magento\TestFramework\Helper\ObjectManager($this);
24+
$objectManagerHelper = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this);
2525
// mock collection of unread notifications
2626
$notificationList = $this->getMock(
2727
'Magento\AdminNotification\Model\Resource\Inbox\Collection\Unread',
@@ -49,7 +49,7 @@ public function testGetUnreadNotificationCount()
4949

5050
public function testGetLatestUnreadNotifications()
5151
{
52-
$helper = new \Magento\TestFramework\Helper\ObjectManager($this);
52+
$helper = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this);
5353

5454
// 1. Create mocks
5555
$notificationList = $this->getMockBuilder('Magento\AdminNotification\Model\Resource\Inbox\Collection\Unread')

dev/tests/unit/testsuite/Magento/AdminNotification/Model/FeedTest.php renamed to app/code/Magento/AdminNotification/Test/Unit/Model/FeedTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
* See COPYING.txt for license details.
55
*/
66

7-
namespace Magento\AdminNotification\Model;
7+
namespace Magento\AdminNotification\Test\Unit\Model;
88

9-
use Magento\TestFramework\Helper\ObjectManager as ObjectManagerHelper;
9+
use Magento\Framework\TestFramework\Unit\Helper\ObjectManager as ObjectManagerHelper;
1010

1111
/**
1212
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)

dev/tests/unit/testsuite/Magento/AdminNotification/Model/NotificationServiceTest.php renamed to app/code/Magento/AdminNotification/Test/Unit/Model/NotificationServiceTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
/**
88
* Test class for \Magento\AdminNotification\Model\NotificationService
99
*/
10-
namespace Magento\AdminNotification\Model;
10+
namespace Magento\AdminNotification\Test\Unit\Model;
1111

1212
class NotificationServiceTest extends \PHPUnit_Framework_TestCase
1313
{

0 commit comments

Comments
 (0)