@@ -6,16 +6,18 @@ import React, { useState } from 'react';
66import { routePaths } from '../../../../routes/routePaths' ;
77import { translate } from './translate' ;
88import { Configuration } from './Configuration' ;
9+ import styles from './NestedRow.module.scss' ;
910import { Runs } from './Runs' ;
1011import { BasePage } from '../BasePage' ;
1112import { useService } from './useService' ;
12- import { useLocationPath , useSelector } from '../../../hooks' ;
13+ import { useHistory , useLocationPath , useSelector } from '../../../hooks' ;
1314import FilterComponent , {
1415 getInitialFilterStateForRuns ,
1516} from '../../../components/Filters' ;
1617import { workspaceSelectors } from '../../../../redux/selectors' ;
1718import { DEFAULT_WORKSPACE_NAME } from '../../../../constants' ;
1819import { List } from '../Stacks/List' ;
20+ import { Box , FlexBox , Paragraph } from '../../../components' ;
1921
2022const FilterWrapperForRun = ( ) => {
2123 const locationPath = useLocationPath ( ) ;
@@ -42,8 +44,51 @@ const FilterWrapperForRun = () => {
4244 </ FilterComponent >
4345 ) ;
4446} ;
45- const getTabPages = ( stackId : TId , selectedWorkspace : string ) : TabPage [ ] => {
47+
48+ const getTabPages = (
49+ stackId : TId ,
50+ selectedWorkspace : string ,
51+ tiles ?: any ,
52+ history ?: any ,
53+ ) : TabPage [ ] => {
4654 return [
55+ {
56+ text : 'Components' ,
57+ Component : ( ) => (
58+ < FlexBox . Row
59+ marginVertical = "sm"
60+ marginHorizontal = "md"
61+ className = { styles . nestedrow }
62+ padding = "md"
63+ alignItems = "center"
64+ >
65+ { tiles &&
66+ tiles . map ( ( tile : any , index : number ) => (
67+ < Box key = { index } className = { styles . tile } color = "black" >
68+ < Paragraph
69+ size = "small"
70+ style = { { cursor : 'pointer' } }
71+ onClick = { ( ) => {
72+ history . push (
73+ routePaths . stackComponents . configuration (
74+ tile . type ,
75+ tile . id ,
76+ selectedWorkspace ,
77+ ) ,
78+ ) ;
79+ } }
80+ >
81+ < span >
82+ { tile . type } { '>' } { ' ' }
83+ </ span > { ' ' }
84+ < span className = { styles . name } > { tile . name } </ span >
85+ </ Paragraph >
86+ </ Box >
87+ ) ) }
88+ </ FlexBox . Row >
89+ ) ,
90+ path : routePaths . stack . components ( stackId , selectedWorkspace ) ,
91+ } ,
4792 {
4893 text : translate ( 'tabs.configuration.text' ) ,
4994 Component : ( ) => < Configuration stackId = { stackId } /> ,
@@ -87,9 +132,23 @@ export interface StackDetailRouteParams {
87132
88133export const StackDetail : React . FC = ( ) => {
89134 const { stack } = useService ( ) ;
135+ const history = useHistory ( ) ;
136+ const nestedRowtiles = [ ] ;
137+ for ( const [ key ] of Object . entries ( stack . components ) ) {
138+ nestedRowtiles . push ( {
139+ type : key ,
140+ name : stack . components [ key ] [ 0 ] . name ,
141+ id : stack . components [ key ] [ 0 ] . id ,
142+ } ) ;
143+ }
90144 const selectedWorkspace = useSelector ( workspaceSelectors . selectedWorkspace ) ;
91145
92- const tabPages = getTabPages ( stack . id , selectedWorkspace ) ;
146+ const tabPages = getTabPages (
147+ stack . id ,
148+ selectedWorkspace ,
149+ nestedRowtiles ,
150+ history ,
151+ ) ;
93152 const breadcrumbs = getBreadcrumbs ( stack . id , selectedWorkspace ) ;
94153
95154 // const boxStyle = {
0 commit comments