diff --git a/javascript/apps/taiga/src/app/modules/project/data-access/+state/actions/project.actions.ts b/javascript/apps/taiga/src/app/modules/project/data-access/+state/actions/project.actions.ts index b52ce1af1..f8c9f970f 100644 --- a/javascript/apps/taiga/src/app/modules/project/data-access/+state/actions/project.actions.ts +++ b/javascript/apps/taiga/src/app/modules/project/data-access/+state/actions/project.actions.ts @@ -134,7 +134,6 @@ export const projectApiActions = createActionGroup({ 'create Workflow Error': emptyProps(), 'Update Workflow Success': props<{ workflow: Workflow; - oldSlug: Workflow['slug']; }>(), }, }); @@ -169,6 +168,7 @@ export const projectEventActions = createActionGroup({ 'Remove Member': props<{ membership: Membership; workspace: string }>(), 'Update Member': props<{ membership: Membership }>(), 'Create Workflow': props<{ workflow: Workflow }>(), + 'Update Workflow': props<{ workflow: Workflow }>(), 'Create comment': props<{ storyRef: Story['ref']; comment: UserComment }>(), 'Status reorder': props<{ id: Status['id']; diff --git a/javascript/apps/taiga/src/app/modules/project/data-access/+state/effects/project.effects.ts b/javascript/apps/taiga/src/app/modules/project/data-access/+state/effects/project.effects.ts index d3d1f4b31..58fc97ab9 100644 --- a/javascript/apps/taiga/src/app/modules/project/data-access/+state/effects/project.effects.ts +++ b/javascript/apps/taiga/src/app/modules/project/data-access/+state/effects/project.effects.ts @@ -224,16 +224,11 @@ export class ProjectEffects { .updateWorkflow(action.name, action.slug, project.id) .pipe( map((updatedWorkflow) => { - // void this.router.navigate( - // [`project/${project.id}/${project.slug}/kanban/${updatedWorkflow.slug}`], - // { replaceUrl: true } - // ); this.location.go( `project/${project.id}/${project.slug}/kanban/${updatedWorkflow.slug}` ); return ProjectActions.projectApiActions.updateWorkflowSuccess({ workflow: updatedWorkflow, - oldSlug: action.slug, }); }) ); diff --git a/javascript/apps/taiga/src/app/modules/project/data-access/+state/reducers/project.reducer.ts b/javascript/apps/taiga/src/app/modules/project/data-access/+state/reducers/project.reducer.ts index 84d595eab..2b3aed4af 100644 --- a/javascript/apps/taiga/src/app/modules/project/data-access/+state/reducers/project.reducer.ts +++ b/javascript/apps/taiga/src/app/modules/project/data-access/+state/reducers/project.reducer.ts @@ -114,10 +114,13 @@ export const reducer = createImmerReducer( ), on( ProjectActions.projectApiActions.updateWorkflowSuccess, - (state, { workflow, oldSlug }): ProjectState => { + ProjectActions.projectEventActions.updateWorkflow, + (state, { workflow }): ProjectState => { if (state.currentProjectId) { const workflows = state.projects[state.currentProjectId].workflows; - const workflowIndex = workflows.findIndex((it) => it.slug === oldSlug); + const workflowIndex = workflows.findIndex( + (it) => it.id === workflow.id + ); workflows[workflowIndex].name = workflow.name; workflows[workflowIndex].slug = workflow.slug; } diff --git a/javascript/apps/taiga/src/app/modules/project/feature-kanban/components/kanban-header/kanban-header.component.html b/javascript/apps/taiga/src/app/modules/project/feature-kanban/components/kanban-header/kanban-header.component.html index c23886ec5..ecd18cb3a 100644 --- a/javascript/apps/taiga/src/app/modules/project/feature-kanban/components/kanban-header/kanban-header.component.html +++ b/javascript/apps/taiga/src/app/modules/project/feature-kanban/components/kanban-header/kanban-header.component.html @@ -33,10 +33,12 @@ [(open)]="openWorkflowOptions">