feat: add bootstrap entry badges

This commit is contained in:
richjohnrambo
2026-08-20 15:59:16 +08:00
parent d467323ecb
commit 6db2938672
9 changed files with 707 additions and 24 deletions
+18
View File
@@ -227,6 +227,7 @@ type testSecurityStore struct {
attempts int
lockedUntil *time.Time
notifications []types.SystemNotification
unreadNotifications int
readNotificationID string
realNameTenant types.TenantID
realNameUser types.Uid
@@ -235,6 +236,8 @@ type testSecurityStore struct {
listCursor string
listLimit int
nextCursor string
unreadTenant types.TenantID
unreadUser types.Uid
readTenant types.TenantID
readUser types.Uid
}
@@ -368,6 +371,21 @@ func (s *testSecurityStore) ListSystemNotifications(tenantID types.TenantID, uid
return s.notifications, s.nextCursor, s.err
}
func (s *testSecurityStore) CountUnreadSystemNotifications(tenantID types.TenantID, uid types.Uid) (int, error) {
s.unreadTenant = tenantID
s.unreadUser = uid
if s.unreadNotifications != 0 {
return s.unreadNotifications, s.err
}
count := 0
for _, notification := range s.notifications {
if notification.ReadAt == nil {
count++
}
}
return count, s.err
}
func (s *testSecurityStore) MarkSystemNotificationRead(tenantID types.TenantID, uid types.Uid, eventID string, readAt time.Time) error {
s.readTenant = tenantID
s.readUser = uid