@@ -7,14 +7,18 @@ import { translate } from '../translate';
77import { useLocationPath } from '../../../../../../hooks' ;
88import { matchPath } from 'react-router-dom' ;
99import { useSelector } from './../../../../../../../ui/hooks' ;
10- import { stackComponentSelectors } from '../../../../../../../redux/selectors' ;
10+ import {
11+ projectSelectors ,
12+ stackComponentSelectors ,
13+ } from '../../../../../../../redux/selectors' ;
1114
1215export const Menu : React . FC = ( ) => {
1316 const locationPath = useLocationPath ( ) ;
1417
1518 const stackComponentsTypes : any [ ] = useSelector (
1619 stackComponentSelectors . stackComponentTypes ,
1720 ) ;
21+ const selectedProject = useSelector ( projectSelectors . selectedProject ) ;
1822
1923 return (
2024 < >
@@ -34,14 +38,14 @@ export const Menu: React.FC = () => {
3438 Icon = { ( ) => (
3539 < icons . pipeline color = { iconColors . white } size = { iconSizes . md } />
3640 ) }
37- to = { routePaths . pipelines . list }
41+ to = { routePaths . pipelines . list ( selectedProject ) }
3842 text = { translate ( 'menu.pipelines.text' ) }
3943 />
4044 < MenuItem
4145 isActive = { ( ) => {
4246 return (
4347 ! ! matchPath ( locationPath , {
44- path : routePaths . pipelines . allRuns ,
48+ path : routePaths . pipelines . allRuns ( selectedProject ) ,
4549 exact : false ,
4650 } ) ||
4751 ! ! matchPath ( locationPath , {
@@ -53,7 +57,7 @@ export const Menu: React.FC = () => {
5357 Icon = { ( ) => (
5458 < icons . pipeline color = { iconColors . white } size = { iconSizes . md } />
5559 ) }
56- to = { routePaths . pipelines . allRuns }
60+ to = { routePaths . pipelines . allRuns ( selectedProject ) }
5761 text = { 'Runs' }
5862 />
5963 < MenuItem
@@ -79,7 +83,7 @@ export const Menu: React.FC = () => {
7983 < MenuItem
8084 isActive = { ( ) => {
8185 return ! ! matchPath ( locationPath , {
82- path : routePaths . stackComponents . base ( '' ) ,
86+ path : routePaths . stackComponents . base ( '' , selectedProject ) ,
8387 exact : false ,
8488 } ) ;
8589 } }
@@ -88,6 +92,7 @@ export const Menu: React.FC = () => {
8892 ) }
8993 to = { routePaths . stackComponents . base (
9094 stackComponentsTypes ? stackComponentsTypes [ 0 ] : '' ,
95+ selectedProject ,
9196 ) }
9297 text = { translate ( 'menu.stackComponents.text' ) }
9398 />
@@ -97,7 +102,7 @@ export const Menu: React.FC = () => {
97102 < MenuItem
98103 isActive = { ( ) => {
99104 return ! ! matchPath ( locationPath , {
100- path : routePaths . stackComponents . base ( item ) ,
105+ path : routePaths . stackComponents . base ( item , selectedProject ) ,
101106 exact : false ,
102107 } ) ;
103108 } }
@@ -108,7 +113,7 @@ export const Menu: React.FC = () => {
108113 size = { iconSizes . md }
109114 />
110115 ) }
111- to = { routePaths . stackComponents . base ( item ) }
116+ to = { routePaths . stackComponents . base ( item , selectedProject ) }
112117 text = { item }
113118 />
114119 ) ) }
0 commit comments