Skip to content

Commit

Permalink
feat(workflows): navigate to workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
Xaviju committed Sep 15, 2023
1 parent 9da4f83 commit ce0f68d
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 26 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ export class KanbanEffects {
]),
fetch({
run: (action, project) => {
console.log(action);
return this.projectApiService
.getWorkflow(project.id, action.workflow)
.pipe(
Expand All @@ -75,18 +74,20 @@ export class KanbanEffects {
]),
fetch({
run: (action, project) => {
return this.projectApiService.getAllStories(project.id, 'main').pipe(
map(({ stories, offset, complete }) => {
return KanbanApiActions.fetchStoriesSuccess({
stories,
offset,
complete,
});
}),
finalize(() => {
return KanbanActions.loadStoriesComplete();
})
);
return this.projectApiService
.getAllStories(project.id, action.workflow)
.pipe(
map(({ stories, offset, complete }) => {
return KanbanApiActions.fetchStoriesSuccess({
stories,
offset,
complete,
});
}),
finalize(() => {
return KanbanActions.loadStoriesComplete();
})
);
},
onError: (action, error: HttpErrorResponse) => {
return this.appService.errorManagement(error);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,16 +134,9 @@ export class ProjectFeatureKanbanComponent {
return;
}

this.route.paramMap.subscribe((params) => {
const workflowSlug = params.get('workflow') ?? 'main';
this.store.dispatch(KanbanActions.initKanban({ workflow: workflowSlug }));
});

// Load on init kanban page. Not on every reload
// const workflowSlug = this.route.snapshot.params['workflow'];
// this.store.dispatch(
// KanbanActions.initKanban({ workflow: workflowSlug })
// );
const workflowSlug =
this.route.snapshot.queryParamMap.get('workflow') ?? 'main';
this.store.dispatch(KanbanActions.initKanban({ workflow: workflowSlug }));

this.checkInviteModalStatus();
this.state.connect(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,6 @@ const routes: Routes = [
},
{
path: ':slug/kanban/:workflow',
data: {
reuseComponent: false,
},
loadChildren: () =>
import(
'~/app/modules/project/feature-view-setter/project-feature-view-setter.module'
Expand Down

0 comments on commit ce0f68d

Please sign in to comment.