From 87b19245234341e414f24c138b2aba00f68c4ae8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marina=20L=C3=B3pez?= Date: Tue, 3 Oct 2023 08:50:57 +0200 Subject: [PATCH] fix(kanban): load kanban when story is open --- .../project-feature-kanban.component.ts | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) 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 bf89725ac..2fd13cc7a 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 @@ -41,6 +41,7 @@ import { take, } from 'rxjs'; import * as ProjectActions from '~/app/modules/project/data-access/+state/actions/project.actions'; +import { selectWorkflow as selectWorkflowStoryDetail } from '~/app/modules/project/story-detail/data-access/+state/selectors/story-detail.selectors'; import { selectCurrentProject, selectMembers, @@ -81,6 +82,7 @@ import { KanbanHeaderComponent } from './components/kanban-header/kanban-header. interface ComponentState { loadingWorkflow: KanbanState['loadingWorkflow']; workflow: KanbanState['workflow']; + workflowStoryDetail: KanbanState['workflow']; workflows: Workflow[]; invitePeopleModal: boolean; showStoryDetail: boolean; @@ -206,8 +208,15 @@ export class ProjectFeatureKanbanComponent { combineLatest([ this.state.select('storyView'), this.state.select('showStoryDetail'), + this.state.select('workflow'), + this.state.select('workflowStoryDetail'), ]), - ([storyView, showStoryDetail]) => { + ([storyView, showStoryDetail, workflow, workflowStoryDetail]) => { + if (showStoryDetail && !workflow && workflowStoryDetail?.slug) { + this.store.dispatch( + KanbanActions.initKanban({ workflow: workflowStoryDetail.slug }) + ); + } if (showStoryDetail && storyView === 'side-view') { this.setCloseShortcut(); this.shortcutsService.setScope('side-view'); @@ -218,6 +227,10 @@ export class ProjectFeatureKanbanComponent { ); this.state.connect('storyView', this.store.select(selectStoryView)); this.state.connect('workflow', this.store.select(selectWorkflow)); + this.state.connect( + 'workflowStoryDetail', + this.store.select(selectWorkflowStoryDetail) + ); this.state.connect( 'columns', this.store.select(kanbanFeature.selectColums)