From 5c755419c8c8955cc386f236f4439cd9a952eafc Mon Sep 17 00:00:00 2001 From: Xaviju Date: Fri, 15 Sep 2023 07:43:43 +0200 Subject: [PATCH] feat(workflows): navigate to workflows --- .../+state/effects/kanban.effects.ts | 27 ++++++++++--------- .../project-feature-kanban.component.ts | 13 +++------ .../project-feature-shell-routing.module.ts | 3 --- 3 files changed, 17 insertions(+), 26 deletions(-) diff --git a/javascript/apps/taiga/src/app/modules/project/feature-kanban/data-access/+state/effects/kanban.effects.ts b/javascript/apps/taiga/src/app/modules/project/feature-kanban/data-access/+state/effects/kanban.effects.ts index d00367172..760212afd 100644 --- a/javascript/apps/taiga/src/app/modules/project/feature-kanban/data-access/+state/effects/kanban.effects.ts +++ b/javascript/apps/taiga/src/app/modules/project/feature-kanban/data-access/+state/effects/kanban.effects.ts @@ -50,7 +50,6 @@ export class KanbanEffects { ]), fetch({ run: (action, project) => { - console.log(action); return this.projectApiService .getWorkflow(project.id, action.workflow) .pipe( @@ -75,18 +74,20 @@ export class KanbanEffects { ]), fetch({ run: (action, project) => { - return this.projectApiService.getAllStories(project.id, 'main').pipe( - map(({ stories, offset, complete }) => { - return KanbanApiActions.fetchStoriesSuccess({ - stories, - offset, - complete, - }); - }), - finalize(() => { - return KanbanActions.loadStoriesComplete(); - }) - ); + return this.projectApiService + .getAllStories(project.id, action.workflow) + .pipe( + map(({ stories, offset, complete }) => { + return KanbanApiActions.fetchStoriesSuccess({ + stories, + offset, + complete, + }); + }), + finalize(() => { + return KanbanActions.loadStoriesComplete(); + }) + ); }, onError: (action, error: HttpErrorResponse) => { return this.appService.errorManagement(error); diff --git a/javascript/apps/taiga/src/app/modules/project/feature-kanban/project-feature-kanban.component.ts b/javascript/apps/taiga/src/app/modules/project/feature-kanban/project-feature-kanban.component.ts index cde454f84..0bad84ed6 100644 --- a/javascript/apps/taiga/src/app/modules/project/feature-kanban/project-feature-kanban.component.ts +++ b/javascript/apps/taiga/src/app/modules/project/feature-kanban/project-feature-kanban.component.ts @@ -142,16 +142,9 @@ export class ProjectFeatureKanbanComponent { return; } - this.route.paramMap.subscribe((params) => { - const workflowSlug = params.get('workflow') ?? 'main'; - this.store.dispatch(KanbanActions.initKanban({ workflow: workflowSlug })); - }); - - // Load on init kanban page. Not on every reload - // const workflowSlug = this.route.snapshot.params['workflow']; - // this.store.dispatch( - // KanbanActions.initKanban({ workflow: workflowSlug }) - // ); + const workflowSlug = + this.route.snapshot.queryParamMap.get('workflow') ?? 'main'; + this.store.dispatch(KanbanActions.initKanban({ workflow: workflowSlug })); this.checkInviteModalStatus(); this.state.connect( diff --git a/javascript/apps/taiga/src/app/modules/project/feature-shell/project-feature-shell-routing.module.ts b/javascript/apps/taiga/src/app/modules/project/feature-shell/project-feature-shell-routing.module.ts index 1758c0c7d..fdb7396b1 100644 --- a/javascript/apps/taiga/src/app/modules/project/feature-shell/project-feature-shell-routing.module.ts +++ b/javascript/apps/taiga/src/app/modules/project/feature-shell/project-feature-shell-routing.module.ts @@ -50,9 +50,6 @@ const routes: Routes = [ }, { path: ':slug/kanban/:workflow', - data: { - reuseComponent: false, - }, loadChildren: () => import( '~/app/modules/project/feature-view-setter/project-feature-view-setter.module'