diff --git a/javascript/apps/taiga/src/app/modules/project/feature-navigation/components/project-navigation-menu/project-navigation-menu.component.html b/javascript/apps/taiga/src/app/modules/project/feature-navigation/components/project-navigation-menu/project-navigation-menu.component.html index ffaa27f02..13aa5ee14 100644 --- a/javascript/apps/taiga/src/app/modules/project/feature-navigation/components/project-navigation-menu/project-navigation-menu.component.html +++ b/javascript/apps/taiga/src/app/modules/project/feature-navigation/components/project-navigation-menu/project-navigation-menu.component.html @@ -211,7 +211,8 @@ '/project', project.id, project.slug, - 'kanban' + 'kanban', + project.workflows[0].slug ]" routerLinkActive> + import( + '~/app/modules/project/feature-overview/project-feature-overview.module' + ).then((m) => m.ProjectFeatureOverviewModule), + data: { + overview: true, + }, + }, + { + path: ':slug/overview', + loadChildren: () => + import( + '~/app/modules/project/feature-overview/project-feature-overview.module' + ).then((m) => m.ProjectFeatureOverviewModule), + data: { + overview: true, + }, + }, + { + path: ':slug/new-workflow', + loadChildren: () => + import( + '~/app/modules/project/feature-new-workflow/project-feature-new-workflow.module' + ).then((m) => m.ProjectFeatureNewWorkflowModule), + resolve: { + project: ProjectAdminResolver, + }, + data: { + newKanban: true, + }, + }, + { + path: ':slug/kanban', + loadChildren: () => + import( + '~/app/modules/project/feature-view-setter/project-feature-view-setter.module' + ).then((m) => m.ProjectFeatureViewSetterModule), + canDeactivate: [CanDeactivateGuard], + data: { + redirect: true, + kanban: true, + }, + }, + { + path: 'kanban', + loadChildren: () => + import( + '~/app/modules/project/feature-view-setter/project-feature-view-setter.module' + ).then((m) => m.ProjectFeatureViewSetterModule), + canDeactivate: [CanDeactivateGuard], + data: { + redirect: true, + kanban: true, + }, + }, { path: ':slug/kanban/:workflow', loadChildren: () => @@ -91,39 +148,6 @@ const routes: Routes = [ project: ProjectAdminResolver, }, }, - { - path: 'overview', - loadChildren: () => - import( - '~/app/modules/project/feature-overview/project-feature-overview.module' - ).then((m) => m.ProjectFeatureOverviewModule), - data: { - overview: true, - }, - }, - { - path: ':slug/overview', - loadChildren: () => - import( - '~/app/modules/project/feature-overview/project-feature-overview.module' - ).then((m) => m.ProjectFeatureOverviewModule), - data: { - overview: true, - }, - }, - { - path: ':slug/new-workflow', - loadChildren: () => - import( - '~/app/modules/project/feature-new-workflow/project-feature-new-workflow.module' - ).then((m) => m.ProjectFeatureNewWorkflowModule), - resolve: { - project: ProjectAdminResolver, - }, - data: { - newKanban: true, - }, - }, ], }, ]; diff --git a/javascript/apps/taiga/src/app/modules/project/feature-view-setter/project-feature-view-setter.component.ts b/javascript/apps/taiga/src/app/modules/project/feature-view-setter/project-feature-view-setter.component.ts index a041ca31b..9a49a6a9c 100644 --- a/javascript/apps/taiga/src/app/modules/project/feature-view-setter/project-feature-view-setter.component.ts +++ b/javascript/apps/taiga/src/app/modules/project/feature-view-setter/project-feature-view-setter.component.ts @@ -52,6 +52,7 @@ import { filterNil } from '~/app/shared/utils/operators'; import { ProjectFeatureStoryWrapperFullViewModule } from '../feature-story-wrapper-full-view/project-feature-story-wrapper-full-view.module'; import { selectRouteParams } from '~/app/router-selectors'; import { ProjectFeatureViewSetterKanbanComponent } from './project-feature-view-setter.component-kanban.component'; +import { selectCurrentProject } from '../data-access/+state/selectors/project.selectors'; interface ProjectFeatureViewSetterComponentState { storyView: StoryView; @@ -60,6 +61,7 @@ interface ProjectFeatureViewSetterComponentState { kanbanHost: ViewContainerRef | undefined; url: string; workflowSlug?: Workflow['slug']; + project: Project; } interface StoryParams { @@ -101,6 +103,19 @@ export class ProjectFeatureViewSetterComponent implements OnDestroy { ) { this.state.connect('storyView', this.store.select(selectStoryView)); this.state.connect('selectStory', this.store.select(selectStory)); + this.state.connect( + 'project', + this.store.select(selectCurrentProject).pipe(filterNil()) + ); + + if (this.route.snapshot.data['redirect']) { + void this.router.navigate( + [this.state.get('project')?.workflows?.[0]?.slug], + { + relativeTo: this.route, + } + ); + } this.state.connect( 'url', diff --git a/javascript/libs/ui/src/lib/breadcrumb/breadcrumb.component.css b/javascript/libs/ui/src/lib/breadcrumb/breadcrumb.component.css index e1b40d484..f0198ccba 100644 --- a/javascript/libs/ui/src/lib/breadcrumb/breadcrumb.component.css +++ b/javascript/libs/ui/src/lib/breadcrumb/breadcrumb.component.css @@ -27,6 +27,10 @@ Copyright (c) 2023-present Kaleidos INC .crumb { padding: var(--spacing-4); white-space: nowrap; + + &:first-of-type { + padding-inline-start: 0; + } } .crumb-divider {