Merge branch 'DM-370' into 'master'

DM-370: Filtered out ASSIGN_REVIEWER notification.

See merge request redactmanager/red-ui!40
This commit is contained in:
Dan Percic 2023-08-30 09:00:24 +02:00
commit 5a3ec3c636

View File

@ -25,6 +25,7 @@ const NOTIFICATIONS_THRESHOLD = 1000;
export class NotificationsService extends EntitiesService<INotification, Notification> implements OnDestroy {
readonly #config = getConfig<AppConfig>();
readonly #subscription = new Subscription();
readonly #filterDocumineNotifications: string[] = [NotificationTypes.ASSIGN_REVIEWER];
protected readonly _defaultModelPath = 'notification';
protected readonly _entityClass = Notification;
@ -118,6 +119,10 @@ export class NotificationsService extends EntitiesService<INotification, Notific
const todayDate = dayjs(new Date());
notifications = notifications.filter(n => {
if (this.#config.IS_DOCUMINE && this.#filterDocumineNotifications.includes(n.notificationType)) {
return false;
}
if (!(n.notificationType in NotificationTypes)) {
return false;
}