From 6ab62ea9a1f55bdea26d477d05ccc3407a12c063 Mon Sep 17 00:00:00 2001 From: Xaviju Date: Wed, 4 Oct 2023 10:44:10 +0200 Subject: [PATCH] feat(workflow): Move story to other workflow --- .../+state/reducers/kanban.reducer.ts | 9 +++-- .../story-detail-workflow.component.css | 2 ++ .../story-detail-workflow.component.html | 5 ++- .../story-detail-workflow.component.ts | 17 ++++++++-- .../+state/actions/story-detail.actions.ts | 5 +++ .../+state/effects/story-detail.effects.ts | 34 ++++++++++++++++++- .../+state/reducers/story-detail.reducer.ts | 2 ++ .../story-detail/story-detail.component.html | 6 ++-- .../story-detail/story-detail.component.ts | 12 +++++++ javascript/libs/data/src/lib/story.model.ts | 1 + 10 files changed, 84 insertions(+), 9 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 2a6bb7bac..18c7ecdf0 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 @@ -10,15 +10,15 @@ import { createFeature, createSelector, on } from '@ngrx/store'; import { Status, Story, Workflow } from '@taiga/data'; import { DropCandidate } from '@taiga/ui/drag/drag.model'; import { - projectEventActions, projectApiActions, + projectEventActions, } from '~/app/modules/project/data-access/+state/actions/project.actions'; import { KanbanStory, KanbanStoryA11y, PartialStory, } from '~/app/modules/project/feature-kanban/kanban.model'; -import { StoryDetailActions } from '~/app/modules/project/story-detail/data-access/+state/actions/story-detail.actions'; +import { StoryDetailActions, StoryDetailApiActions } from '~/app/modules/project/story-detail/data-access/+state/actions/story-detail.actions'; import { moveItemArray } from '~/app/shared/utils/move-item-array'; import { pick } from '~/app/shared/utils/pick'; import { createImmerReducer } from '~/app/shared/utils/store'; @@ -627,6 +627,11 @@ export const reducer = createImmerReducer( return state; } ), + on(StoryDetailApiActions.updateStoryWorkflowSuccess, (state, { story }): KanbanState => { + state = removeStory(state, (it) => it.ref === story.ref); + + return state + }), on( KanbanActions.deleteStory, StoryDetailActions.deleteStory, diff --git a/javascript/apps/taiga/src/app/modules/project/story-detail/components/story-detail-workflow/story-detail-workflow.component.css b/javascript/apps/taiga/src/app/modules/project/story-detail/components/story-detail-workflow/story-detail-workflow.component.css index 0de4c9c37..d09785558 100644 --- a/javascript/apps/taiga/src/app/modules/project/story-detail/components/story-detail-workflow/story-detail-workflow.component.css +++ b/javascript/apps/taiga/src/app/modules/project/story-detail/components/story-detail-workflow/story-detail-workflow.component.css @@ -47,6 +47,8 @@ Copyright (c) 2023-present Kaleidos INC } .workflow-name { + @mixin ellipsis; + &:hover { color: var(--color-secondary80); background: var(--color-gray20); diff --git a/javascript/apps/taiga/src/app/modules/project/story-detail/components/story-detail-workflow/story-detail-workflow.component.html b/javascript/apps/taiga/src/app/modules/project/story-detail/components/story-detail-workflow/story-detail-workflow.component.html index 5329c5f3e..5d9420805 100644 --- a/javascript/apps/taiga/src/app/modules/project/story-detail/components/story-detail-workflow/story-detail-workflow.component.html +++ b/javascript/apps/taiga/src/app/modules/project/story-detail/components/story-detail-workflow/story-detail-workflow.component.html @@ -38,7 +38,10 @@