Use ThresholdsColorToggle in TableOptions

pull/2993/head
Alex P 2018-03-14 21:02:13 -07:00
parent 47a66d2ae0
commit 72b9279336
4 changed files with 10 additions and 12 deletions

View File

@ -5,7 +5,7 @@ import {bindActionCreators} from 'redux'
import FancyScrollbar from 'shared/components/FancyScrollbar'
import ThresholdsList from 'shared/components/ThresholdsList'
import ThresholdColorToggle from 'shared/components/ThresholdColorToggle'
import ThresholdsColorToggle from 'shared/components/ThresholdsColorToggle'
import {updateAxes} from 'src/dashboards/actions/cellEditorOverlay'
@ -56,7 +56,7 @@ class SingleStatOptions extends Component {
maxLength="5"
/>
</div>
<ThresholdColorToggle containerClass="form-group col-xs-6" />
<ThresholdsColorToggle containerClass="form-group col-xs-6" />
</div>
</div>
</FancyScrollbar>

View File

@ -9,7 +9,7 @@ import GraphOptionsSortBy from 'src/dashboards/components/GraphOptionsSortBy'
import GraphOptionsTextWrapping from 'src/dashboards/components/GraphOptionsTextWrapping'
import GraphOptionsCustomizeColumns from 'src/dashboards/components/GraphOptionsCustomizeColumns'
import ThresholdsList from 'src/shared/components/ThresholdsList'
import GraphOptionsThresholdColoring from 'src/dashboards/components/GraphOptionsThresholdColoring'
import ThresholdsColorToggle from 'src/shared/components/ThresholdsColorToggle'
import {updateTableOptions} from 'src/dashboards/actions/cellEditorOverlay'
@ -107,7 +107,7 @@ export class TableOptions extends PureComponent<Props, {}> {
/>
<ThresholdsList onResetFocus={onResetFocus} />
<div className="form-group-wrapper graph-options-group">
<GraphOptionsThresholdColoring />
<ThresholdsColorToggle containerClass="form-group col-xs-6" />
</div>
</div>
</FancyScrollbar>

View File

@ -6,7 +6,7 @@ import {updateSingleStatType} from 'src/dashboards/actions/cellEditorOverlay'
import {SINGLE_STAT_TEXT, SINGLE_STAT_BG} from 'shared/constants/thresholds'
class ThresholdColorToggle extends Component {
class ThresholdsColorToggle extends Component {
handleToggleSingleStatType = newType => () => {
const {handleUpdateSingleStatType} = this.props
@ -39,7 +39,7 @@ class ThresholdColorToggle extends Component {
}
const {func, string} = PropTypes
ThresholdColorToggle.propTypes = {
ThresholdsColorToggle.propTypes = {
singleStatType: string.isRequired,
handleUpdateSingleStatType: func.isRequired,
containerClass: string.isRequired,
@ -56,5 +56,5 @@ const mapDispatchToProps = dispatch => ({
),
})
export default connect(mapStateToProps, mapDispatchToProps)(
ThresholdColorToggle
ThresholdsColorToggle
)

View File

@ -9,7 +9,7 @@ import GraphOptionsSortBy from 'src/dashboards/components/GraphOptionsSortBy'
import GraphOptionsTextWrapping from 'src/dashboards/components/GraphOptionsTextWrapping'
import GraphOptionsCustomizeColumns from 'src/dashboards/components/GraphOptionsCustomizeColumns'
import ThresholdsList from 'src/shared/components/ThresholdsList'
import GraphOptionsThresholdColoring from 'src/dashboards/components/GraphOptionsThresholdColoring'
import ThresholdsColorToggle from 'src/dashboards/components/ThresholdsColorToggle'
import {shallow} from 'enzyme'
@ -45,9 +45,7 @@ describe('Dashboards.Components.TableOptions', () => {
GraphOptionsCustomizeColumns
)
const thresholdsList = wrapper.find(ThresholdsList)
const graphOptionsThresholdColoring = wrapper.find(
GraphOptionsThresholdColoring
)
const thresholdsColorToggle = wrapper.find(ThresholdsColorToggle)
expect(fancyScrollbar.exists()).toBe(true)
expect(graphOptionsTimeFormat.exists()).toBe(true)
@ -56,7 +54,7 @@ describe('Dashboards.Components.TableOptions', () => {
expect(graphOptionsTextWrapping.exists()).toBe(true)
expect(graphOptionsCustomizeColumns.exists()).toBe(true)
expect(thresholdsList.exists()).toBe(true)
expect(graphOptionsThresholdColoring.exists()).toBe(true)
expect(thresholdsColorToggle.exists()).toBe(true)
})
})
})