diff --git a/ui/src/dashboards/components/DisplayOptions.js b/ui/src/dashboards/components/DisplayOptions.js
index 6c5d9e96e3..8c08f21eca 100644
--- a/ui/src/dashboards/components/DisplayOptions.js
+++ b/ui/src/dashboards/components/DisplayOptions.js
@@ -50,7 +50,12 @@ class DisplayOptions extends Component {
case 'single-stat':
return
case 'table':
- return
+ return (
+
+ )
default:
return (
{
- const {hex, name} = color
- return {hex, name}
-}
-
-type Color = {
- type: string
- hex: string
- id: string
- name: string
- value: number
-}
+import {updateTableOptions} from 'src/dashboards/actions/cellEditorOverlay'
type TableColumn = {
internalName: string
@@ -58,24 +37,13 @@ type QueryConfig = {
}
interface Props {
- singleStatType: string
- singleStatColors: Color[]
queryConfigs: QueryConfig[]
- handleUpdateSingleStatType: () => void
- handleUpdateSingleStatColors: () => void
handleUpdateTableOptions: (options: Options) => void
tableOptions: Options
+ onResetFocus: () => void
}
export class TableOptions extends PureComponent {
- handleToggleSingleStatType = () => {}
-
- handleAddThreshold = () => {}
-
- handleDeleteThreshold = () => () => {}
-
- handleChooseColor = () => () => {}
-
handleChooseSortBy = () => {}
handleTimeFormatChange = timeFormat => {
@@ -89,20 +57,10 @@ export class TableOptions extends PureComponent {
handleColumnRename = () => {}
- handleUpdateColorValue = () => {}
-
- handleValidateColorValue = () => {}
-
render() {
- const {
- singleStatColors,
- singleStatType,
- tableOptions: {timeFormat},
- } = this.props
+ const {tableOptions: {timeFormat}, onResetFocus} = this.props
- const disableAddThreshold = singleStatColors.length > MAX_THRESHOLDS
const TimeAxis = 'vertical'
- const sortedColors = _.sortBy(singleStatColors, color => color.value)
const columns = [
'cpu.mean_usage_system',
@@ -140,7 +98,6 @@ export class TableOptions extends PureComponent {
onChooseSortBy={this.handleChooseSortBy}
/>
@@ -148,21 +105,9 @@ export class TableOptions extends PureComponent {
columns={columns}
onColumnRename={this.handleColumnRename}
/>
-
+
-
+
@@ -170,23 +115,11 @@ export class TableOptions extends PureComponent {
}
}
-const mapStateToProps = ({
- cellEditorOverlay: {singleStatType, singleStatColors, cell: {tableOptions}},
-}) => ({
- singleStatType,
- singleStatColors,
+const mapStateToProps = ({cellEditorOverlay: {cell: {tableOptions}}}) => ({
tableOptions,
})
const mapDispatchToProps = dispatch => ({
- handleUpdateSingleStatType: bindActionCreators(
- updateSingleStatType,
- dispatch
- ),
- handleUpdateSingleStatColors: bindActionCreators(
- updateSingleStatColors,
- dispatch
- ),
handleUpdateTableOptions: bindActionCreators(updateTableOptions, dispatch),
})