feat: add bootstrap entry badges
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user