@@ -66,15 +66,6 @@ const ProjectPage = () => {
6666 } = useTestRunState ( ) ;
6767 const testRunDispatch = useTestRunDispatch ( ) ;
6868
69- // filter
70- const [ query , setQuery ] = React . useState ( "" ) ;
71- const [ os , setOs ] = React . useState ( "" ) ;
72- const [ device , setDevice ] = React . useState ( "" ) ;
73- const [ browser , setBrowser ] = React . useState ( "" ) ;
74- const [ viewport , setViewport ] = React . useState ( "" ) ;
75- const [ testStatus , setTestStatus ] = React . useState ( "" ) ;
76- const [ filteredTestRuns , setFilteredTestRuns ] = React . useState < TestRun [ ] > ( [ ] ) ;
77-
7869 const queryParams : QueryParams = React . useMemo (
7970 ( ) => getQueryParams ( location . search ) ,
8071 [ location . search ]
@@ -98,20 +89,6 @@ const ProjectPage = () => {
9889 }
9990 } , [ queryParams . testId , testRunDispatch ] ) ;
10091
101- useEffect ( ( ) => {
102- setFilteredTestRuns (
103- testRuns . filter (
104- ( t ) =>
105- t . name . toLowerCase ( ) . includes ( query . toLowerCase ( ) ) && // by query
106- ( os ? t . os === os : true ) && // by OS
107- ( device ? t . device === device : true ) && // by device
108- ( viewport ? t . viewport === viewport : true ) && // by viewport
109- ( testStatus ? t . status === testStatus : true ) && // by status
110- ( browser ? t . browser === browser : true ) // by browser
111- )
112- ) ;
113- } , [ query , os , device , browser , viewport , testStatus , testRuns ] ) ;
114-
11592 const getTestRunListCalback : any = React . useCallback (
11693 ( page : number ) =>
11794 selectedBuildId &&
@@ -145,59 +122,51 @@ const ProjectPage = () => {
145122 } , [ getBuildListCalback ] ) ;
146123
147124 return (
148- < Grid container className = { classes . root } >
149- < Grid item xs = { 3 } className = { classes . root } >
150- < ProjectSelect onProjectSelect = { ( id ) => history . push ( id ) } />
151- < Box height = "85%" my = { 0.5 } >
152- < BuildList />
153- </ Box >
154- < Grid container justify = "center" >
155- < Grid item >
156- < Pagination
157- size = "small"
158- defaultPage = { 1 }
159- count = { Math . ceil ( total / take ) }
160- onChange = { ( event , page ) => getBuildListCalback ( page ) }
161- />
125+ < React . Fragment >
126+ < Grid container className = { classes . root } >
127+ < Grid item xs = { 3 } className = { classes . root } >
128+ < ProjectSelect onProjectSelect = { ( id ) => history . push ( id ) } />
129+ < Box height = "85%" my = { 0.5 } >
130+ < BuildList />
131+ </ Box >
132+ < Grid container justify = "center" >
133+ < Grid item >
134+ < Pagination
135+ size = "small"
136+ defaultPage = { 1 }
137+ count = { Math . ceil ( total / take ) }
138+ onChange = { ( event , page ) => getBuildListCalback ( page ) }
139+ />
140+ </ Grid >
162141 </ Grid >
163142 </ Grid >
164- </ Grid >
165- < Grid item xs = { 9 } className = { classes . root } >
166- { selectedBuild && < BuildDetails build = { selectedBuild } /> }
167- < Filters
168- items = { testRuns }
169- queryState = { [ query , setQuery ] }
170- osState = { [ os , setOs ] }
171- deviceState = { [ device , setDevice ] }
172- browserState = { [ browser , setBrowser ] }
173- viewportState = { [ viewport , setViewport ] }
174- testStatusState = { [ testStatus , setTestStatus ] }
175- />
176- < Box height = "70%" my = { 0.5 } >
177- < TestRunList items = { filteredTestRuns } />
178- </ Box >
179- < Grid container justify = "center" >
180- < Grid item >
181- < Pagination
182- size = "small"
183- defaultPage = { 1 }
184- count = { Math . ceil ( testRunTotal / testRunTake ) }
185- onChange = { ( event , page ) => getTestRunListCalback ( page ) }
186- />
143+ < Grid item xs = { 9 } className = { classes . root } >
144+ { selectedBuild && < BuildDetails build = { selectedBuild } /> }
145+ < Box height = "80%" my = { 0.5 } >
146+ < TestRunList items = { testRuns } />
147+ </ Box >
148+ < Grid container justify = "center" >
149+ < Grid item >
150+ < Pagination
151+ size = "small"
152+ defaultPage = { 1 }
153+ count = { Math . ceil ( testRunTotal / testRunTake ) }
154+ onChange = { ( event , page ) => getTestRunListCalback ( page ) }
155+ />
156+ </ Grid >
187157 </ Grid >
188158 </ Grid >
189-
190- { selectedTestRunIndex !== undefined && testRuns [ selectedTestRunIndex ] && (
191- < Dialog open = { true } fullScreen className = { classes . modal } >
192- < TestDetailsModal testRun = { testRuns [ selectedTestRunIndex ] } />
193- < ArrowButtons
194- testRuns = { testRuns }
195- selectedTestRunIndex = { selectedTestRunIndex }
196- />
197- </ Dialog >
198- ) }
199159 </ Grid >
200- </ Grid >
160+ { selectedTestRunIndex !== undefined && testRuns [ selectedTestRunIndex ] && (
161+ < Dialog open = { true } fullScreen className = { classes . modal } >
162+ < TestDetailsModal testRun = { testRuns [ selectedTestRunIndex ] } />
163+ < ArrowButtons
164+ testRuns = { testRuns }
165+ selectedTestRunIndex = { selectedTestRunIndex }
166+ />
167+ </ Dialog >
168+ ) }
169+ </ React . Fragment >
201170 ) ;
202171} ;
203172
0 commit comments