Skip to content

Commit 1d1766e

Browse files
committed
Merge branch 'develop_mainline' into develop
Conflicts: setup/view/magento/setup/add-database.phtml
2 parents 0a8bca9 + 8e8d3ae commit 1d1766e

File tree

350 files changed

+21082
-18574
lines changed

Some content is hidden

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

350 files changed

+21082
-18574
lines changed

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: 31 additions & 1 deletion
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
*

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

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,14 @@
66
*/
77
-->
88
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd">
9-
<head>
10-
<css src="Magento_Theme::prototype/magento.css"/>
11-
</head>
129
<body>
1310
<referenceContainer name="notifications">
1411
<block class="Magento\AdminNotification\Block\System\Messages" name="system_messages" as="system_messages" before="-" template="Magento_AdminNotification::system/messages.phtml"/>
1512
<block class="Magento\AdminNotification\Block\System\Messages\UnreadMessagePopup" name="unread_system_messages" as="unread_system_messages" after="system_messages" template="Magento_AdminNotification::system/messages/popup.phtml"/>
1613
<block class="Magento\AdminNotification\Block\Window" name="notification_window" as="notification_window" acl="Magento_AdminNotification::show_toolbar" template="notification/window.phtml"/>
1714
</referenceContainer>
1815
<referenceContainer name="header">
19-
<block class="Magento\AdminNotification\Block\ToolbarEntry" before="user" template="toolbar_entry.phtml"/>
16+
<block class="Magento\AdminNotification\Block\ToolbarEntry" name="notification.messages" before="user" template="toolbar_entry.phtml"/>
2017
</referenceContainer>
2118
</body>
2219
</page>

app/code/Magento/AdminNotification/view/adminhtml/templates/notification/window.phtml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,19 +12,20 @@
1212
* @see \Magento\AdminNotification\Block\Window
1313
*/
1414
?>
15-
<div data-mage-init='{"modalPopup": {}}' class="fade critical-notification">
15+
<div data-mage-init='{"modalPopup": {}}' class="fade critical-notification admin__scope">
1616
<div class="popup popup-<?php echo preg_replace('#[^a-z0-9]+#', '-', strtolower($block->getSeverityText())) ?>">
1717
<div class="popup-inner">
18-
<header class="popup-header">
19-
<h2 class="popup-title"><?php echo $block->getHeaderText(); ?></h2>
20-
</header>
18+
<div class="popup-header">
19+
<div class="popup-title"><?php echo $block->getHeaderText(); ?></div>
20+
</div>
2121
<div class="popup-content">
2222
<span><?php echo $block->getSeverityText();?></span>
23+
2324
<p class="message-text"><?php echo $block->getNoticeMessageText(); ?></p>
2425

2526
<a href="<?php echo $block->getNoticeMessageUrl(); ?>"><?php echo $block->getReadDetailsText(); ?></a>
2627
</div>
27-
<span class="close" data-dismiss="popup" title="<?php echo __('Close popup'); ?>"><?php echo __('Close'); ?></span>
28+
<span class="action close" data-dismiss="popup" title="<?php echo $block->escapeHtml(__('Close popup'));?>"><?php echo __('Close'); ?></span>
2829
</div>
2930
</div>
3031
</div>

app/code/Magento/AdminNotification/view/adminhtml/templates/system/messages.phtml

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,22 +10,34 @@
1010
<?php /** @var $block \Magento\AdminNotification\Block\System\Messages */ ?>
1111

1212
<?php $lastCritical = $block->getLastCritical();?>
13-
<div id="system_messages" class="message-system<?php if ($lastCritical): ?> message-system-unread<?php endif; ?>">
13+
<div id="system_messages" class="message-system<?php if ($lastCritical): ?> message-system-unread<?php endif; ?> admin__scope">
1414
<div class="message-system-inner">
1515
<?php if ($lastCritical): ?>
1616
<ul class="message-system-list">
17-
<li class="error"><!-- warning -->
17+
<li class="message message-warning error">
1818
<?php echo $lastCritical->getText();?>
1919
</li>
2020
</ul>
2121
<?php endif; ?>
2222
<div class="message-system-short">
23-
System Messages:
23+
<span class="message-system-short-label">
24+
<?php echo __('System Messages:')?>
25+
</span>
26+
2427
<?php if ($block->getCriticalCount()): ?>
25-
<span class="error"><a href="#" title="<?php echo $block->escapeHtml(__('Critical System Messages'));?>"><?php echo $block->getCriticalCount();?></a></span>
28+
<div class="message message-warning error">
29+
<a class="message-link" href="#" title="<?php echo $block->escapeHtml(__('Critical System Messages'));?>">
30+
<?php echo $block->getCriticalCount();?>
31+
</a>
32+
</div>
2633
<?php endif;?>
34+
2735
<?php if ($block->getMajorCount()): ?>
28-
<span class="warning"><a href="#" title="<?php echo $block->escapeHtml(__('Major System Messages'));?>"><?php echo $block->getMajorCount();?></a></span>
36+
<div class="message message-warning warning">
37+
<a class="message-link" href="#" title="<?php echo $block->escapeHtml(__('Major System Messages'));?>">
38+
<?php echo $block->getMajorCount();?>
39+
</a>
40+
</div>
2941
<?php endif;?>
3042
</div>
3143
<div id="message-system-all" title="<?php echo $block->escapeHtml(__('System messages'));?>" data-mage-init='<?php echo $block->escapeHtml($block->getSystemMessageDialogJson());?>'></div>

app/code/Magento/AdminNotification/view/adminhtml/templates/system/messages/popup.phtml

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,17 @@
88

99
?>
1010
<?php /** @var $block \Magento\AdminNotification\Block\System\Messages\UnreadMessagePopup */ ?>
11-
<div id="system_messages_list" title="<?php echo $block->escapeHtml($block->getPopupTitle()); ?>">
11+
12+
<div id="system_messages_list" class="admin__scope" title="<?php echo $block->escapeHtml($block->getPopupTitle()); ?>">
1213
<ul class="message-system-list">
1314
<?php foreach ($block->getUnreadMessages() as $message): ?>
14-
<li class="<?php echo $block->getItemClass($message);?>">
15+
<li class="message message-warning <?php echo $block->getItemClass($message);?>">
1516
<?php echo $message->getText();?>
1617
</li>
1718
<?php endforeach;?>
1819
</ul>
1920
</div>
21+
2022
<script>
2123
require([
2224
"jquery",
@@ -27,18 +29,21 @@ require([
2729
$("#system_messages_list").dialog({
2830
autoOpen: true,
2931
resizable: false,
30-
width: 650,
32+
width: '75%',
33+
modal: true,
34+
dialogClass: 'ui-popup-message',
3135
position: {
32-
using: function(pos) {
33-
$(this).css({
34-
"position": "absolute",
35-
"top": Math.ceil($(window).height()/2 - $(this).height()/2),
36-
"left": pos.left
37-
});
38-
}
36+
my: 'left+12.5% top',
37+
at: 'center top',
38+
of: 'body'
39+
},
40+
open: function() {
41+
$(this).closest('.ui-dialog').addClass('ui-dialog-active');
42+
43+
var topMargin = $(this).closest('.ui-dialog').children('.ui-dialog-titlebar').outerHeight() + 10;
44+
$(this).closest('.ui-dialog').css('margin-top', topMargin);
3945
}
4046
});
4147
});
42-
4348
});
4449
</script>

app/code/Magento/AdminNotification/view/adminhtml/templates/toolbar_entry.phtml

Lines changed: 60 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -8,40 +8,77 @@
88

99
?>
1010
<?php /** @var $this \Magento\AdminNotification\Block\ToolbarEntry */ ?>
11-
<?php $notificationCount = $block->getUnreadNotificationCount(); ?>
12-
<div data-mage-init='{"toolbarEntry": {}}' class="notifications-summary" data-notification-count="<?php echo $block->escapeHtml($notificationCount); ?>">
11+
<?php
12+
$notificationCount = $block->getUnreadNotificationCount();
13+
$notificationCounterMax = $block->getNotificationCounterMax();
14+
?>
15+
<div
16+
data-mage-init='{"toolbarEntry": {}}'
17+
class="notifications-wrapper"
18+
data-notification-count="<?php echo $notificationCount; ?>">
1319
<?php if ($notificationCount > 0) : ?>
14-
<a href="<?php echo $block->getUrl('adminhtml/notification/index'); ?>" class="action notifications-action" data-mage-init='{"dropdown":{}}' title="<?php echo __('Notifications'); ?>" data-toggle="dropdown">
15-
<span class="text"><?php echo __('Notifications'); ?></span>
16-
<span class="counter qty"><?php echo $block->escapeHtml($notificationCount); ?></span>
20+
<a
21+
href="<?php echo $block->getUrl('adminhtml/notification/index'); ?>"
22+
class="notifications-action"
23+
data-mage-init='{"dropdown":{}}'
24+
title="<?php echo __('Notifications'); ?>"
25+
data-toggle="dropdown">
26+
<span class="notifications-counter">
27+
<?php echo ($notificationCount > $notificationCounterMax) ? $notificationCounterMax . '+' : $notificationCount; ?>
28+
</span>
1729
</a>
18-
<ul class="dropdown-menu notifications-list" data-mark-as-read-url="<?php echo $block->getUrl('adminhtml/notification/ajaxMarkAsRead'); ?>">
30+
<ul
31+
class="notifications-list"
32+
data-mark-as-read-url="<?php echo $block->getUrl('adminhtml/notification/ajaxMarkAsRead'); ?>">
1933
<?php foreach ($block->getLatestUnreadNotifications() as $notification) : ?>
2034
<?php /** @var $notification \Magento\AdminNotification\Model\Inbox*/ ?>
2135
<li class="notifications-entry<?php if ($notification->getSeverity() == 1): ?> notifications-critical<?php endif; ?>"
22-
data-notification-id="<?php echo $block->escapeHtml($notification->getId()); ?>"
36+
data-notification-id="<?php echo $notification->getId(); ?>"
2337
data-notification-severity="<?php if ($notification->getSeverity() == 1): ?>1<?php endif; ?>">
24-
<strong class="notifications-entry-title"><?php echo $block->escapeHtml($notification->getTitle()); ?></strong>
25-
<span class="notifications-entry-description"><?php echo $block->escapeHtml($notification->getDescription()); ?></span>
26-
<time class="notifications-entry-time"><?php echo $block->escapeHtml($block->formatNotificationDate($notification->getDateAdded())); ?></time>
27-
<button type="button" class="action close notifications-close"><span><?php echo __('Close'); ?></span></button>
28-
<div class="notifications-dialog-content" data-title="<?php echo __('Notification'); ?>" data-cancel-caption="<?php echo __('Cancel'); ?>" data-acknowledge-caption="<?php echo __('Acknowledge'); ?>">
29-
<strong class="notifications-entry-title"><?php echo $block->escapeHtml($notification->getTitle()); ?></strong>
30-
<span class="notifications-entry-description"><?php echo $block->escapeHtml($notification->getDescription()); ?></span>
31-
<div class="actions notifications-entry-actions">
32-
<a class="notifications-url" href="<?php echo $block->escapeUrl($notification->getUrl()); ?>" target="_blank"><?php echo __('Read Details'); ?></a>
33-
</div>
34-
<time class="notifications-entry-time"><?php echo $block->escapeHtml($block->formatNotificationDate($notification->getDateAdded())); ?></time>
35-
</div>
38+
<?php
39+
$notificationDescription = $block->escapeHtml($notification->getDescription());
40+
$notificationDescriptionLength = $block->getNotificationDescriptionLength();
41+
?>
42+
<strong class="notifications-entry-title">
43+
<?php echo $block->escapeHtml($notification->getTitle()); ?>
44+
</strong>
45+
<?php if (strlen($notificationDescription) > $notificationDescriptionLength) : ?>
46+
<p class="notifications-entry-description _cutted">
47+
<span class="notifications-entry-description-start">
48+
<?php echo substr($notificationDescription, 0, $notificationDescriptionLength); ?>
49+
</span>
50+
<span class="notifications-entry-description-end">
51+
<?php echo substr($notificationDescription, $notificationDescriptionLength); ?>
52+
</span>
53+
</p>
54+
<?php else : ?>
55+
<p class="notifications-entry-description">
56+
<?php echo $notificationDescription; ?>
57+
</p>
58+
<?php endif; ?>
59+
<time class="notifications-entry-time">
60+
<?php echo $block->formatNotificationDate($notification->getDateAdded()); ?>
61+
</time>
62+
<button
63+
type="button"
64+
class="notifications-close"
65+
title="<?php echo __('Close'); ?>"
66+
></button>
3667
</li>
3768
<?php endforeach; ?>
38-
<li class="last">
39-
<a href="<?php echo $block->getUrl('adminhtml/notification/index'); ?>" class="action more notification-more"><?php echo __('See All (%1 unread)', $notificationCount); ?></a>
69+
<li class="notifications-entry notifications-entry-last">
70+
<a
71+
href="<?php echo $block->getUrl('adminhtml/notification/index'); ?>"
72+
class="action-tertiary action-more">
73+
<?php echo __('See All (') ?><span class="notifications-counter"><?php echo $notificationCount ?></span><?php echo __(' unread)'); ?>
74+
</a>
4075
</li>
4176
</ul>
4277
<?php else : ?>
43-
<a href="<?php echo $block->getUrl('adminhtml/notification/index'); ?>" class="action notifications-action empty" title="<?php echo __('Notifications'); ?>">
44-
<span class="text"><?php echo __('Notifications'); ?></span>
78+
<a
79+
class="notifications-action"
80+
href="<?php echo $block->getUrl('adminhtml/notification/index'); ?>"
81+
title="<?php echo __('Notifications'); ?>">
4582
</a>
4683
<?php endif; ?>
4784
</div>

app/code/Magento/AdminNotification/view/adminhtml/web/system/notification.js

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,16 @@ define([
1313
options: {
1414
systemMessageTemplate:
1515
'<% _.each(data.items, function(item) { %>' +
16-
'<li class="<% if (item.severity == 1) { %>error<% } else { %>warning<% } %>">' +
16+
'<li class="message message-warning <% if (item.severity == 1) { %>error<% } else { %>warning<% } %>">' +
1717
'<%= item.text %>' +
1818
'</li>' +
1919
'<% }); %>'
2020
},
2121

2222
open: function (severity) {
23-
var superMethod = $.proxy(this._super, this);
23+
var superMethod = $.proxy(this._super, this),
24+
listTemplate,
25+
fullTemplate;
2426

2527
$.ajax({
2628
url: this.options.ajaxUrl,
@@ -36,12 +38,12 @@ define([
3638
});
3739

3840
tmpl = $(tmpl);
41+
listTemplate = $('<ul class="message-system-list"></ul>').append(tmpl);
42+
fullTemplate = $('<div class="admin__scope"></div>').append(listTemplate);
3943

40-
this.element.html(
41-
$('<ul />', {
42-
'class': 'message-system-list'
43-
}).append(tmpl)
44-
).trigger('contentUpdated');
44+
this.element
45+
.html(fullTemplate)
46+
.trigger('contentUpdated');
4547

4648
superMethod();
4749
}, this));

0 commit comments

Comments
 (0)