Skip to content

Commit

Permalink
feat(workflow): Move story to other workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
Xaviju committed Oct 9, 2023
1 parent 238e683 commit e8f139a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -113,6 +114,7 @@ export interface StoryDetailState {
user: User;
attachments: Attachment[];
loadingAttachments: LoadingAttachment[];
workflowSlug: Workflow['slug'];
}

export interface StoryDetailForm {
Expand Down Expand Up @@ -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))
Expand Down Expand Up @@ -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(() => {
Expand Down

0 comments on commit e8f139a

Please sign in to comment.