Skip to content
Snippets Groups Projects
Commit a8cb4130 authored by Florent POITTEVIN's avatar Florent POITTEVIN
Browse files

fix: display action button only on inbox notification list

parent c1e1add8
No related branches found
No related tags found
No related merge requests found
......@@ -73,7 +73,7 @@ export class PreservationSpaceNotificationListRoutable extends SharedAbstractLis
orgUnitIdObs: Observable<string> = MemoizedUtil.select(this._store, PreservationSpaceNotificationState, state => state.orgUnitId);
modeObs: Observable<NotificationModeEnum> = MemoizedUtil.select(this._store, PreservationSpaceNotificationState, state => state.mode);
mode: NotificationModeEnum;
sharedOrgUnitActionNameSpace: ResourceNameSpace = sharedOrgUnitActionNameSpace;
sharedOrganizationalUnitState: typeof SharedOrganizationalUnitState = SharedOrganizationalUnitState;
......@@ -107,10 +107,9 @@ export class PreservationSpaceNotificationListRoutable extends SharedAbstractLis
this.columnsSkippedToClear = [this.KEY_QUERY_PARAMETER_NOTIFIED_ORGUNIT_ID];
orgUnitId = queryParam.get(NotificationHelper.KEY_ORGUNIT_ID);
}
const mode = NotificationHelper.getMode(this._route);
if (mode === NotificationModeEnum.inbox) {
this.mode = NotificationHelper.getMode(this._route);
if (this.mode === NotificationModeEnum.inbox) {
this.listNewId = SessionStorageHelper.getListItem(SessionStorageEnum.notificationInboxPending);
this.subscribe(
merge(
this._actions$.pipe(ofActionCompleted(PreservationSpaceNotificationAction.AcceptSuccess)),
......@@ -125,7 +124,7 @@ export class PreservationSpaceNotificationListRoutable extends SharedAbstractLis
),
);
}
this._store.dispatch(new PreservationSpaceNotificationAction.SetMode(mode, orgUnitId));
this._store.dispatch(new PreservationSpaceNotificationAction.SetMode(this.mode, orgUnitId));
}
@Override()
......@@ -158,7 +157,7 @@ export class PreservationSpaceNotificationListRoutable extends SharedAbstractLis
this._store.dispatch(new PreservationSpaceNotificationAction.Wait(notification.resId, ViewModeEnum.list));
}
protected defineActions(): DataTableActions<NotificationDlcm>[] {
private defineActionsInbox(): DataTableActions<NotificationDlcm>[] {
return [
{
logo: IconNameEnum.approve,
......@@ -181,6 +180,14 @@ export class PreservationSpaceNotificationListRoutable extends SharedAbstractLis
];
}
protected defineActions(): DataTableActions<NotificationDlcm>[] {
if (this.mode === NotificationModeEnum.inbox) {
return this.defineActionsInbox();
} else {
return [];
}
}
defineColumns(): void {
this.columns = [
{
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment