1- 'use strict' ;
21import React , { Component } from 'react' ;
32import { bindActionCreators } from 'redux' ;
43import { connect } from 'react-redux' ;
4+ import { capitalize } from 'lodash' ;
55import * as actions from '../../modules/actions' ;
66import ControlButton from './control-button' ;
7- import ViewSelect from './view -select' ;
7+ import ControlSelect from './control -select' ;
88import BaseHostInput from './base-host-input' ;
99import MenuBar from './menu-bar' ;
1010import viewModes from '../../../constants/view-modes' ;
11+ import diffModes from '../../../constants/diff-modes' ;
1112import { EXPAND_ALL , COLLAPSE_ALL , EXPAND_ERRORS , EXPAND_RETRIES } from '../../../constants/expand-modes' ;
1213
1314class ControlButtons extends Component {
@@ -16,10 +17,12 @@ class ControlButtons extends Component {
1617
1718 return (
1819 < div className = "common-controls" >
19- < ViewSelect options = { [
20- { value : viewModes . ALL , text : 'Show all' } ,
21- { value : viewModes . FAILED , text : 'Show only failed' }
22- ] } />
20+ < ControlSelect
21+ label = "Show tests"
22+ value = { view . viewMode }
23+ handler = { actions . changeViewMode }
24+ options = { Object . values ( viewModes ) . map ( ( value ) => ( { value, text : capitalize ( value ) } ) ) }
25+ />
2326 < div className = "control-group" >
2427 < ControlButton
2528 label = "Expand all"
@@ -51,15 +54,14 @@ class ControlButtons extends Component {
5154 isActive = { view . showSkipped }
5255 handler = { actions . toggleSkipped }
5356 />
54- < ControlButton
55- label = "Show only diff"
56- isActive = { view . showOnlyDiff }
57- handler = { actions . toggleOnlyDiff }
58- />
59- < ControlButton
60- label = "Scale images"
61- isActive = { view . scaleImages }
62- handler = { actions . toggleScaleImages }
57+ < ControlSelect
58+ label = "Diff mode"
59+ value = { view . diffMode }
60+ handler = { actions . changeDiffMode }
61+ options = { Object . values ( diffModes ) . map ( ( dm ) => {
62+ return { value : dm . id , text : dm . title } ;
63+ } ) }
64+ extendClassNames = "diff-mode"
6365 />
6466 < ControlButton
6567 label = "Group by error"
0 commit comments