@@ -13,10 +13,12 @@ import { BasePage } from '../BasePage';
1313import { useService } from './useService' ;
1414import { useLocationPath , useSelector } from '../../../hooks' ;
1515import FilterComponent , {
16+ getInitialFilterState ,
1617 getInitialFilterStateForRuns ,
1718} from '../../../components/Filters' ;
1819import { workspaceSelectors } from '../../../../redux/selectors' ;
19- import { List } from '../Stacks/List' ;
20+ import { List as StackComponenList } from '../Stacks/List' ;
21+ import { List } from '../../stacks/Stacks/List' ;
2022
2123const FilterWrapperForRun = ( ) => {
2224 const locationPath = useLocationPath ( ) ;
@@ -46,6 +48,35 @@ const FilterWrapperForRun = () => {
4648 </ FilterComponent >
4749 ) ;
4850} ;
51+
52+ const FilterWrapperForStacks = ( ) => {
53+ const locationPath = useLocationPath ( ) ;
54+
55+ // TODO: Dev please note: getInitialFilterState is for stack inital filter value for any other component you need to modify it
56+ const [ filters , setFilter ] = useState ( [ getInitialFilterState ( ) ] ) ;
57+ function getFilter ( values : any ) {
58+ const filterValuesMap = values . map ( ( v : any ) => {
59+ return {
60+ column : v . column . selectedValue ,
61+ type : v . contains . selectedValue ,
62+ value : v . filterValue ,
63+ } ;
64+ } ) ;
65+ return filterValuesMap ;
66+ }
67+ return (
68+ < FilterComponent
69+ getInitials = { getInitialFilterState }
70+ filters = { filters }
71+ setFilter = { setFilter }
72+ >
73+ < List
74+ stackComponentId = { locationPath . split ( '/' ) [ 5 ] }
75+ filter = { getFilter ( filters ) }
76+ />
77+ </ FilterComponent >
78+ ) ;
79+ } ;
4980const getTabPages = (
5081 stackId : TId ,
5182 locationPath : any ,
@@ -70,6 +101,15 @@ const getTabPages = (
70101 selectedWorkspace ,
71102 ) ,
72103 } ,
104+ {
105+ text : 'Stacks' ,
106+ Component : FilterWrapperForStacks ,
107+ path : routePaths . stackComponents . stacks (
108+ locationPath . split ( '/' ) [ 4 ] ,
109+ stackId ,
110+ selectedWorkspace ,
111+ ) ,
112+ } ,
73113 ] ;
74114} ;
75115
@@ -191,12 +231,12 @@ export const StackDetail: React.FC = () => {
191231 </Box>
192232 </Box> */ }
193233 < Box paddingTop = { 'xl' } >
194- < List
234+ < StackComponenList
195235 filter = { [ ] }
196236 pagination = { false }
197237 isExpended
198238 id = { stackComponent . id }
199- > </ List >
239+ > </ StackComponenList >
200240 { /* <>
201241 <table className={cn(styles.table)}>
202242 <tbody>
0 commit comments