Commit 00510d1d authored by Andreas Fernandez's avatar Andreas Fernandez Committed by Markus Klein
Browse files

[TASK] Cap counter of "Application Overview"

The issue counter of the "Application Overview" menu gets capped if
there are more than 99 issues by appending a "+" sign. This solves a
overflow issue if there are too many "unread" issues, that may occur
e.g. after creating a new admin user.

Change-Id: I285f930c79b1d56384affbbae77a196aaaa5b65e
Resolves: #73084
Releases: master, 7.6
Reviewed-on: https://review.typo3.org/46451

Reviewed-by: Wouter Wolters's avatarWouter Wolters <typo3@wouterwolters.nl>
Tested-by: Wouter Wolters's avatarWouter Wolters <typo3@wouterwolters.nl>
Reviewed-by: default avatarDaniel Goerz <ervaude@gmail.com>
Tested-by: default avatarDaniel Goerz <ervaude@gmail.com>
Reviewed-by: Markus Klein's avatarMarkus Klein <markus.klein@typo3.org>
Tested-by: Markus Klein's avatarMarkus Klein <markus.klein@typo3.org>
parent 29c8716d
......@@ -85,6 +85,11 @@ class SystemInformationToolbarItem implements ToolbarItemInterface
*/
protected $iconFactory;
/**
* @var int
*/
protected $maximumCountInBadge = 99;
/**
* Constructor
*/
......@@ -294,7 +299,7 @@ class SystemInformationToolbarItem implements ToolbarItemInterface
}
// increase counter
if (isset($message['count'])) {
if (isset($message['count']) && $this->totalCount < $this->maximumCountInBadge) {
$this->totalCount += (int)$message['count'];
}
......@@ -346,7 +351,7 @@ class SystemInformationToolbarItem implements ToolbarItemInterface
$this->standaloneView->assignMultiple(array(
'installToolUrl' => BackendUtility::getModuleUrl('system_InstallInstall'),
'messages' => $this->systemMessages,
'count' => $this->totalCount,
'count' => $this->totalCount > $this->maximumCountInBadge ? $this->maximumCountInBadge . '+' : $this->totalCount,
'severityBadgeClass' => $this->severityBadgeClass,
'systemInformation' => $this->systemInformation
));
......
......@@ -81,7 +81,7 @@ define(['jquery', 'TYPO3/CMS/Backend/Icons', 'TYPO3/CMS/Backend/Storage'], funct
count = $ul.data('count'),
badgeClass = $ul.data('severityclass');
SystemInformationMenu.elements.$counter.text(count).toggle(count > 0);
SystemInformationMenu.elements.$counter.text(count).toggle(parseInt(count) > 0);
SystemInformationMenu.elements.$counter.removeClass();
if (badgeClass !== '') {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment