From 0f127df5d8edfd9d81101924bb3bca18fe488108 Mon Sep 17 00:00:00 2001 From: "florian.azizian" <florian.azizian@maarch.org> Date: Mon, 17 Feb 2020 23:57:15 +0100 Subject: [PATCH] FEAT #13049 TIME 0:15 close and index on different group --- src/frontend/app/actions/actions.service.ts | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/src/frontend/app/actions/actions.service.ts b/src/frontend/app/actions/actions.service.ts index 5ae853e023d..e5b623b1bf2 100644 --- a/src/frontend/app/actions/actions.service.ts +++ b/src/frontend/app/actions/actions.service.ts @@ -32,6 +32,7 @@ import { ContinueAvisCircuitActionComponent } from './avis-continue-circuit-acti import { SendAvisParallelComponent } from './avis-parallel-send-action/send-avis-parallel-action.component'; import { GiveAvisParallelActionComponent } from './avis-give-parallel-action/give-avis-parallel-action.component'; import { ValidateAvisParallelComponent } from './avis-parallel-validate-action/validate-avis-parallel-action.component'; +import { HeaderService } from '../../service/header.service'; @Injectable() export class ActionsService { @@ -62,6 +63,7 @@ export class ActionsService { public dialog: MatDialog, private notify: NotificationService, private router: Router, + public headerService: HeaderService ) { } @@ -301,7 +303,20 @@ export class ActionsService { filter((data: string) => data === 'success'), tap((result: any) => { this.endAction(result); - this.router.navigate(['/indexing/' + this.currentGroupId]); + let firstGroup: number = 0; + this.headerService.user.groups.filter((group: any) => group.can_index === true).forEach((group: any) => { + if (firstGroup == 0) { + firstGroup = group.id; + } + if (group.id == this.currentGroupId) { + this.router.navigate(['/indexing/' + this.currentGroupId]); + } + }); + if (firstGroup == 0) { + this.router.navigate(['/home']); + } else { + this.router.navigate(['/indexing/' + firstGroup]); + } }), finalize(() => this.loading = false), catchError((err: any) => { -- GitLab