Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

Turn any count larger 99 to 99+

Oliver Güntherf581ef8eb5b8
diff --git a/frontend/src/app/features/in-app-notifications/bell/in-app-notification-bell.component.html b/frontend/src/app/features/in-app-notifications/bell/in-app-notification-bell.component.html
index 5886cc576d2..bb71c9208f2 100644
--- a/frontend/src/app/features/in-app-notifications/bell/in-app-notification-bell.component.html
+++ b/frontend/src/app/features/in-app-notifications/bell/in-app-notification-bell.component.html
@@ -9,7 +9,7 @@
*ngIf="unreadCount !== 0"
class="op-ian-bell--indicator"
data-qa-selector="op-ian-notifications-count"
- [textContent]="(unreadCount === -1 || unreadCount > 99) ? '' : unreadCount"
+ [textContent]="unreadCountText$ | async"
></span>
</ng-container>
</a>
diff --git a/frontend/src/app/features/in-app-notifications/bell/in-app-notification-bell.component.ts b/frontend/src/app/features/in-app-notifications/bell/in-app-notification-bell.component.ts
index 8aac0518fd8..4320fd95c2c 100644
--- a/frontend/src/app/features/in-app-notifications/bell/in-app-notification-bell.component.ts
+++ b/frontend/src/app/features/in-app-notifications/bell/in-app-notification-bell.component.ts
@@ -43,6 +43,22 @@ export class InAppNotificationBellComponent {
this.polling$,
]).pipe(map(([count]) => count));
+ unreadCountText$ = this
+ .unreadCount$
+ .pipe(
+ map((count) => {
+ if (count > 99) {
+ return '99+';
+ }
+
+ if (count <= 0) {
+ return '';
+ }
+
+ return count;
+ }),
+ );
+
constructor(
readonly storeService:IanBellService,
readonly apiV3Service:ApiV3Service,