@@ -33,12 +33,15 @@ class ClassificationGroup extends React.PureComponent {
3333 this . state = {
3434 detailsShowing : props . expanded ,
3535 retriggerDropdownOpen : false ,
36- groupedBy : 'path' ,
37- orderedBy : 'count' ,
3836 } ;
3937 }
4038
4139 toggleDetails = ( ) => {
40+ const { updateParamsAndState, name } = this . props ;
41+
42+ updateParamsAndState ( {
43+ testGroup : name === 'Possible Regressions' ? 'pr' : 'ki' ,
44+ } ) ;
4245 this . setState ( ( prevState ) => ( {
4346 detailsShowing : ! prevState . detailsShowing ,
4447 } ) ) ;
@@ -65,14 +68,6 @@ class ClassificationGroup extends React.PureComponent {
6568 JobModel . retrigger ( uniqueJobs , currentRepo , notify , times ) ;
6669 } ;
6770
68- setGroupedBy = ( groupedBy ) => {
69- this . setState ( { groupedBy } ) ;
70- } ;
71-
72- setOrderedBy = ( orderedBy ) => {
73- this . setState ( { orderedBy } ) ;
74- } ;
75-
7671 getTestsByAction = ( tests ) => {
7772 const { log, crash, test } = groupBy ( tests , 'action' ) ;
7873
@@ -83,12 +78,7 @@ class ClassificationGroup extends React.PureComponent {
8378 } ;
8479
8580 render ( ) {
86- const {
87- detailsShowing,
88- retriggerDropdownOpen,
89- groupedBy,
90- orderedBy,
91- } = this . state ;
81+ const { detailsShowing, retriggerDropdownOpen } = this . state ;
9282 const {
9383 jobs,
9484 tests,
@@ -100,6 +90,15 @@ class ClassificationGroup extends React.PureComponent {
10090 currentRepo,
10191 icon,
10292 iconColor,
93+ groupedBy,
94+ orderedBy,
95+ testGroup,
96+ selectedTest,
97+ selectedJobName,
98+ selectedTaskId,
99+ setGroupedBy,
100+ setOrderedBy,
101+ updateParamsAndState,
103102 } = this . props ;
104103 const expandIcon = detailsShowing ? faCaretDown : faCaretRight ;
105104 const expandTitle = detailsShowing
@@ -187,21 +186,23 @@ class ClassificationGroup extends React.PureComponent {
187186 < DropdownItem
188187 className = "pointable"
189188 tag = "a"
190- onClick = { ( ) => this . setGroupedBy ( 'none' ) }
189+ onClick = { ( ) => setGroupedBy ( 'none' ) }
191190 >
192191 None
193192 </ DropdownItem >
194193 < DropdownItem
195194 className = "pointable"
196195 tag = "a"
197- onClick = { ( ) => this . setGroupedBy ( 'path' ) }
196+ onClick = { ( ) => {
197+ setGroupedBy ( 'path' ) ;
198+ } }
198199 >
199200 Path
200201 </ DropdownItem >
201202 < DropdownItem
202203 className = "pointable"
203204 tag = "a"
204- onClick = { ( ) => this . setGroupedBy ( 'platform' ) }
205+ onClick = { ( ) => setGroupedBy ( 'platform' ) }
205206 >
206207 Platform
207208 </ DropdownItem >
@@ -222,14 +223,18 @@ class ClassificationGroup extends React.PureComponent {
222223 < DropdownItem
223224 className = "pointable"
224225 tag = "a"
225- onClick = { ( ) => this . setOrderedBy ( 'count' ) }
226+ onClick = { ( ) => {
227+ setOrderedBy ( 'count' ) ;
228+ } }
226229 >
227230 Count
228231 </ DropdownItem >
229232 < DropdownItem
230233 className = "pointable"
231234 tag = "a"
232- onClick = { ( ) => this . setOrderedBy ( 'text' ) }
235+ onClick = { ( ) => {
236+ setOrderedBy ( 'text' ) ;
237+ } }
233238 >
234239 Text
235240 </ DropdownItem >
@@ -251,6 +256,11 @@ class ClassificationGroup extends React.PureComponent {
251256 notify = { notify }
252257 key = { key }
253258 jobs = { jobs }
259+ testGroup = { testGroup }
260+ selectedTest = { selectedTest }
261+ selectedJobName = { selectedJobName }
262+ selectedTaskId = { selectedTaskId }
263+ updateParamsAndState = { updateParamsAndState }
254264 />
255265 ) ) }
256266 </ Collapse >
@@ -269,13 +279,21 @@ ClassificationGroup.propTypes = {
269279 expanded : PropTypes . bool ,
270280 className : PropTypes . string ,
271281 iconColor : PropTypes . string ,
282+ orderedBy : PropTypes . string ,
283+ groupedBy : PropTypes . string ,
284+ setOrderedBy : PropTypes . func ,
285+ setGroupedBy : PropTypes . func ,
272286} ;
273287
274288ClassificationGroup . defaultProps = {
275289 expanded : true ,
276290 className : '' ,
277291 iconColor : 'darker-info' ,
278292 hasRetriggerAll : false ,
293+ orderedBy : 'count' ,
294+ groupedBy : 'path' ,
295+ setOrderedBy : ( ) => { } ,
296+ setGroupedBy : ( ) => { } ,
279297} ;
280298
281299export default ClassificationGroup ;
0 commit comments