Skip to content

Commit 29133fb

Browse files
committed
Merge branch 'develop' of github.com:magento/magento2ce into troll_bugfix_kanban
2 parents 5101dcc + bbe3ee0 commit 29133fb

File tree

561 files changed

+3028
-1818
lines changed

Some content is hidden

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

561 files changed

+3028
-1818
lines changed

app/code/Magento/AdminNotification/view/adminhtml/layout/default.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
<block class="Magento\AdminNotification\Block\Window"
1717
name="notification_window"
1818
as="notification_window"
19-
acl="Magento_AdminNotification::show_toolbar"
19+
aclResource="Magento_AdminNotification::show_toolbar"
2020
template="Magento_AdminNotification::notification/window.phtml"/>
2121
</referenceContainer>
2222
<referenceContainer name="header">

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

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,9 @@
33
* Copyright © Magento, Inc. All rights reserved.
44
* See COPYING.txt for license details.
55
*/
6-
76
namespace Magento\Analytics\Model\Condition;
87

9-
use Magento\Backend\Model\View\Layout\ConditionInterface;
8+
use Magento\Framework\View\Layout\Condition\VisibilityConditionInterface;
109
use Magento\Analytics\Model\NotificationTime;
1110
use Magento\Framework\Intl\DateTimeFactory;
1211

@@ -16,8 +15,13 @@
1615
* Dynamic validator for UI signUp notification form, manage Ui component visibility.
1716
* Return true if last notification was shipped seven days ago.
1817
*/
19-
class CanViewNotification implements ConditionInterface
18+
class CanViewNotification implements VisibilityConditionInterface
2019
{
20+
/**
21+
* Unique condition name.
22+
*/
23+
const NAME = 'can_view_notification';
24+
2125
/**
2226
* Time interval in seconds
2327
*
@@ -52,9 +56,9 @@ public function __construct(
5256
/**
5357
* Validate is notification popup can be shown
5458
*
55-
* @return bool
59+
* @inheritdoc
5660
*/
57-
public function validate()
61+
public function isVisible(array $arguments)
5862
{
5963
$lastNotificationTime = $this->notificationTime->getLastTimeNotification();
6064
if (!$lastNotificationTime) {
@@ -65,4 +69,12 @@ public function validate()
6569
$datetime->getTimestamp() >= $lastNotificationTime + $this->notificationInterval
6670
);
6771
}
72+
73+
/**
74+
* @return string
75+
*/
76+
public function getName()
77+
{
78+
return self::NAME;
79+
}
6880
}

app/code/Magento/Analytics/Test/Unit/Model/Condition/CanViewNotificationTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ public function testValidate()
6666
$this->dateTimeMock->expects($this->once())
6767
->method('getTimestamp')
6868
->willReturn(10005000);
69-
$this->assertTrue($this->canViewNotification->validate());
69+
$this->assertTrue($this->canViewNotification->isVisible([]));
7070
}
7171

7272
public function testValidateFlagRemoved()
@@ -76,6 +76,6 @@ public function testValidateFlagRemoved()
7676
->willReturn(null);
7777
$this->dateTimeFactoryMock->expects($this->never())
7878
->method('create');
79-
$this->assertFalse($this->canViewNotification->validate());
79+
$this->assertFalse($this->canViewNotification->isVisible([]));
8080
}
8181
}

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

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,6 @@
2323
</argument>
2424
</arguments>
2525
</type>
26-
<type name="Magento\Backend\Model\View\Layout\ConditionPool">
27-
<arguments>
28-
<argument name="conditions" xsi:type="array">
29-
<item name="analytics::can-view-notification" xsi:type="string">Magento\Analytics\Model\Condition\CanViewNotification</item>
30-
</argument>
31-
</arguments>
32-
</type>
3326
<type name="Magento\Analytics\Controller\Adminhtml\Subscription\Activate">
3427
<arguments>
3528
<argument name="configValueResource" xsi:type="object">Magento\Config\Model\ResourceModel\Config\Data</argument>

app/code/Magento/Analytics/view/adminhtml/layout/adminhtml_dashboard_index.xml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,9 @@
99
xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
1010
<body>
1111
<referenceContainer name="content">
12-
<uiComponent name="analytics_subscription_form" acl="Magento_Analytics::analytics_settings"
13-
condition="analytics::can-view-notification"/>
12+
<uiComponent name="analytics_subscription_form" aclResource="Magento_Analytics::analytics_settings">
13+
<visibilityCondition name="can_view_notification" className="Magento\Analytics\Model\Condition\CanViewNotification"/>
14+
</uiComponent>
1415
<block template="Magento_Analytics::dashboard/section.phtml"
1516
class="Magento\Backend\Block\Template"
1617
name="analytics_service_external_link"

app/code/Magento/Authorization/Model/CompositeUserContext.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,12 @@
99
use Magento\Framework\ObjectManager\Helper\Composite as CompositeHelper;
1010

1111
/**
12-
* Composite user context (implements composite pattern).
12+
* User context.
13+
*
14+
* This class is not implementing standard composite pattern and will not invoke all of its children.
15+
* Instead, it will try to find the first suitable child and return its result.
16+
*
17+
* @api
1318
*/
1419
class CompositeUserContext implements \Magento\Authorization\Model\UserContextInterface
1520
{

app/code/Magento/Authorization/Model/ResourceModel/Permissions/Collection.php

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -8,20 +8,9 @@
88
/**
99
* Admin permissions collection
1010
*
11-
* @author Magento Core Team <core@magentocommerce.com>
11+
* @deprecated
12+
* @see \Magento\Authorization\Model\ResourceModel\Rules\Collection
1213
*/
13-
class Collection extends \Magento\Framework\Model\ResourceModel\Db\Collection\AbstractCollection
14+
class Collection extends \Magento\Authorization\Model\ResourceModel\Rules\Collection
1415
{
15-
/**
16-
* Initialize resource
17-
*
18-
* @return void
19-
*/
20-
protected function _construct()
21-
{
22-
$this->_init(
23-
\Magento\Authorization\Model\Rules::class,
24-
\Magento\Authorization\Model\ResourceModel\Rules::class
25-
);
26-
}
2716
}

app/code/Magento/Authorization/Model/ResourceModel/Role/Collection.php

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

1010
/**
1111
* Admin role collection
12+
*
13+
* @api
1214
*/
1315
class Collection extends \Magento\Framework\Model\ResourceModel\Db\Collection\AbstractCollection
1416
{

app/code/Magento/Authorization/Model/ResourceModel/Rules/Collection.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
/**
99
* Rules collection
1010
*
11-
* @author Magento Core Team <core@magentocommerce.com>
11+
* @api
1212
*/
1313
class Collection extends \Magento\Framework\Model\ResourceModel\Db\Collection\AbstractCollection
1414
{

app/code/Magento/Authorization/Model/Role.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
* @method \Magento\Authorization\Model\Role setUserType(string $value)
2525
* @method string getRoleName()
2626
* @method \Magento\Authorization\Model\Role setRoleName(string $value)
27+
* @api
2728
*/
2829
class Role extends \Magento\Framework\Model\AbstractModel
2930
{

0 commit comments

Comments
 (0)