Skip to content

Commit

Permalink
fix(kanban): load kanban when story is open
Browse files Browse the repository at this point in the history
  • Loading branch information
cocotime committed Oct 3, 2023
1 parent ba70e24 commit 87b1924
Showing 1 changed file with 14 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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');
Expand All @@ -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)
Expand Down

0 comments on commit 87b1924

Please sign in to comment.