From e8f139af3b63be9b438fee12ea3788a6f75394de Mon Sep 17 00:00:00 2001 From: Xaviju Date: Mon, 9 Oct 2023 13:59:25 +0200 Subject: [PATCH] feat(workflow): Move story to other workflow --- .../data-access/+state/reducers/kanban.reducer.ts | 1 - .../project/story-detail/story-detail.component.ts | 10 +++++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/javascript/apps/taiga/src/app/modules/project/feature-kanban/data-access/+state/reducers/kanban.reducer.ts b/javascript/apps/taiga/src/app/modules/project/feature-kanban/data-access/+state/reducers/kanban.reducer.ts index 171e03ea6..86c905ac7 100644 --- a/javascript/apps/taiga/src/app/modules/project/feature-kanban/data-access/+state/reducers/kanban.reducer.ts +++ b/javascript/apps/taiga/src/app/modules/project/feature-kanban/data-access/+state/reducers/kanban.reducer.ts @@ -38,7 +38,6 @@ import { replaceStory, setIntialPosition, } from './kanban.reducer.helpers'; -import { StoryDetailApiActions } from '~/app/modules/project/story-detail/data-access/+state/actions/story-detail.actions'; export interface KanbanState { loadingWorkflow: boolean; diff --git a/javascript/apps/taiga/src/app/modules/project/story-detail/story-detail.component.ts b/javascript/apps/taiga/src/app/modules/project/story-detail/story-detail.component.ts index 6d2ca4b6e..718697cc7 100644 --- a/javascript/apps/taiga/src/app/modules/project/story-detail/story-detail.component.ts +++ b/javascript/apps/taiga/src/app/modules/project/story-detail/story-detail.component.ts @@ -71,6 +71,7 @@ import { DateDistancePipe } from '~/app/shared/pipes/date-distance/date-distance import { ResizedDirective } from '~/app/shared/resize/resize.directive'; import { UserAvatarComponent } from '~/app/shared/user-avatar/user-avatar.component'; import { filterNil } from '~/app/shared/utils/operators'; +import { selectCurrentWorkflowSlug } from '../feature-kanban/data-access/+state/selectors/kanban.selectors'; import { StoryDetailAssignComponent } from './components/story-detail-assign/story-detail-assign.component'; import { StoryDetailDescriptionComponent } from './components/story-detail-description/story-detail-description.component'; import { StoryDetailHeaderComponent } from './components/story-detail-header/story-detail-header.component'; @@ -113,6 +114,7 @@ export interface StoryDetailState { user: User; attachments: Attachment[]; loadingAttachments: LoadingAttachment[]; + workflowSlug: Workflow['slug']; } export interface StoryDetailForm { @@ -292,6 +294,11 @@ export class StoryDetailComponent { this.store.select(storyDetailFeature.selectLoadingAttachments) ); + this.state.connect( + 'workflowSlug', + this.store.select(selectCurrentWorkflowSlug) + ); + this.state .select('story') .pipe(filterNil(), take(1)) @@ -427,10 +434,11 @@ export class StoryDetailComponent { const ref = this.state.get('story').ref; this.store.dispatch(StoryDetailActions.leaveStoryDetail()); + this.store; void this.router.navigateByUrl( `project/${this.state.get('project').id}/${ this.state.get('project').slug - }/kanban/${this.state.get('story').workflow.slug}` + }/kanban/${this.state.get('workflowSlug') || 'main'}` ); if (ref) { requestAnimationFrame(() => {