diff --git a/src/app/features/preservation-space/notification/helper/notification.helper.ts b/src/app/features/preservation-space/notification/helper/notification.helper.ts index c475390ecf8b91725b2abccbf09127e1389f61a6..92d976e9442e6fe6134e2d7543e08df93229bf4b 100644 --- a/src/app/features/preservation-space/notification/helper/notification.helper.ts +++ b/src/app/features/preservation-space/notification/helper/notification.helper.ts @@ -47,6 +47,8 @@ import { NotificationService, SolidifyObject, } from "solidify-frontend"; +import {NotificationType} from "@app/generated-api/model/notification-type.partial.model"; +import NotificationCategoryEnum = NotificationType.NotificationCategoryEnum; export class NotificationHelper { static readonly KEY_ORGUNIT_ID: keyof NotificationDlcm = "notifiedOrgUnit"; @@ -122,11 +124,15 @@ export class NotificationHelper { } private static _processJoinOrgUnitRequest(notification: NotificationDlcm, store: Store): void { - store.dispatch(this._getNavigateToOrgUnitToAddMember(store, notification.notifiedOrgUnit.resId, notification.emitter.person.resId, notification.objectId /* contain roleId */)); + store.dispatch([this._getNavigateToOrgUnitToAddMember(store, notification.notifiedOrgUnit.resId, notification.emitter.person.resId, notification.objectId /* contain roleId */), + new SharedNotificationAction.SetApproved(notification.resId, notification.notificationType.notificationCategory, ViewModeEnum.list)]); } private static _processDepositRequest(notification: NotificationDlcm, store: Store): void { store.dispatch(new Navigate([RoutesEnum.deposit, notification.notifiedOrgUnit.resId, DepositRoutesEnum.detail, notification.objectId])); // contain deposit id + if (notification.notificationType.notificationCategory === NotificationCategoryEnum.REQUEST) { + store.dispatch(new SharedNotificationAction.SetApproved(notification.resId, notification.notificationType.notificationCategory, ViewModeEnum.list)); + } } private static _processArchiveRequest(notification: NotificationDlcm, store: Store): void { @@ -150,13 +156,16 @@ export class NotificationHelper { } private static _processCreateOrgUnitRequest(notification: NotificationDlcm, store: Store): void { - store.dispatch(new Navigate([RoutesEnum.adminOrganizationalUnitCreate], { - [NotificationHelper.KEY_ROLE_ID]: Enums.Role.RoleEnum.MANAGER, - [NotificationHelper.KEY_PERSON_ID]: notification.emitter.person.resId, - [NotificationHelper.KEY_ORGUNIT_NAME]: notification.objectId, // contain org unit name - }, { - skipLocationChange: false, - })); + store.dispatch([ + new Navigate([RoutesEnum.adminOrganizationalUnitCreate], { + [NotificationHelper.KEY_ROLE_ID]: Enums.Role.RoleEnum.MANAGER, + [NotificationHelper.KEY_PERSON_ID]: notification.emitter.person.resId, + [NotificationHelper.KEY_ORGUNIT_NAME]: notification.objectId, // contain org unit name + }, { + skipLocationChange: false, + }), + new SharedNotificationAction.SetApproved(notification.resId, notification.notificationType.notificationCategory, ViewModeEnum.list), + ]); } private static _processAccessDataSetRequest(notification: NotificationDlcm, store: Store, actions: Actions): void {