Merge pull request #3016 from influxdata/feature/table-fixed-column

Table graph option for fixed column and hover bug fix
pull/10616/head
Iris Scholten 2018-03-20 15:10:08 -07:00 committed by GitHub
commit fc11c83342
12 changed files with 250 additions and 141 deletions

View File

@ -284,6 +284,7 @@ func MarshalDashboard(d chronograf.Dashboard) ([]byte, error) {
SortBy: sortBy, SortBy: sortBy,
Wrapping: c.TableOptions.Wrapping, Wrapping: c.TableOptions.Wrapping,
ColumnNames: columnNames, ColumnNames: columnNames,
FixFirstColumn: c.TableOptions.FixFirstColumn,
} }
cells[i] = &DashboardCell{ cells[i] = &DashboardCell{
@ -447,6 +448,7 @@ func UnmarshalDashboard(data []byte, d *chronograf.Dashboard) error {
tableOptions.TimeFormat = c.TableOptions.TimeFormat tableOptions.TimeFormat = c.TableOptions.TimeFormat
tableOptions.VerticalTimeAxis = c.TableOptions.VerticalTimeAxis tableOptions.VerticalTimeAxis = c.TableOptions.VerticalTimeAxis
tableOptions.Wrapping = c.TableOptions.Wrapping tableOptions.Wrapping = c.TableOptions.Wrapping
tableOptions.FixFirstColumn = c.TableOptions.FixFirstColumn
} }

View File

@ -321,6 +321,7 @@ type TableOptions struct {
SortBy *TableColumn `protobuf:"bytes,3,opt,name=sortBy" json:"sortBy,omitempty"` SortBy *TableColumn `protobuf:"bytes,3,opt,name=sortBy" json:"sortBy,omitempty"`
Wrapping string `protobuf:"bytes,4,opt,name=wrapping,proto3" json:"wrapping,omitempty"` Wrapping string `protobuf:"bytes,4,opt,name=wrapping,proto3" json:"wrapping,omitempty"`
ColumnNames []*TableColumn `protobuf:"bytes,5,rep,name=columnNames" json:"columnNames,omitempty"` ColumnNames []*TableColumn `protobuf:"bytes,5,rep,name=columnNames" json:"columnNames,omitempty"`
FixFirstColumn bool `protobuf:"varint,6,opt,name=fixFirstColumn,proto3" json:"fixFirstColumn,omitempty"`
} }
func (m *TableOptions) Reset() { *m = TableOptions{} } func (m *TableOptions) Reset() { *m = TableOptions{} }
@ -363,6 +364,13 @@ func (m *TableOptions) GetColumnNames() []*TableColumn {
return nil return nil
} }
func (m *TableOptions) GetFixFirstColumn() bool {
if m != nil {
return m.FixFirstColumn
}
return false
}
type TableColumn struct { type TableColumn struct {
InternalName string `protobuf:"bytes,1,opt,name=internalName,proto3" json:"internalName,omitempty"` InternalName string `protobuf:"bytes,1,opt,name=internalName,proto3" json:"internalName,omitempty"`
DisplayName string `protobuf:"bytes,2,opt,name=displayName,proto3" json:"displayName,omitempty"` DisplayName string `protobuf:"bytes,2,opt,name=displayName,proto3" json:"displayName,omitempty"`
@ -1314,103 +1322,104 @@ func init() {
func init() { proto.RegisterFile("internal.proto", fileDescriptorInternal) } func init() { proto.RegisterFile("internal.proto", fileDescriptorInternal) }
var fileDescriptorInternal = []byte{ var fileDescriptorInternal = []byte{
// 1558 bytes of a gzipped FileDescriptorProto // 1573 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x57, 0x5f, 0x6f, 0xdb, 0x46, 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x57, 0x5f, 0x8f, 0xdb, 0x44,
0x12, 0x07, 0x25, 0x51, 0x12, 0x47, 0x4e, 0xce, 0xe0, 0xf9, 0x12, 0x5e, 0x0e, 0x38, 0xe8, 0x88, 0x10, 0x97, 0x93, 0x38, 0x89, 0x27, 0xd7, 0xe3, 0x64, 0x8e, 0xd6, 0x14, 0x09, 0x05, 0x8b, 0x3f,
0x3b, 0x9c, 0xee, 0x4f, 0x7c, 0x07, 0x05, 0x45, 0x8b, 0xa0, 0x0d, 0x20, 0x5b, 0x6d, 0xea, 0xc6, 0xe1, 0x4f, 0x0f, 0x94, 0x0a, 0x81, 0x2a, 0xa8, 0x94, 0xbb, 0xd0, 0x72, 0xf4, 0xda, 0xbb, 0x6e,
0x89, 0x9d, 0x95, 0xed, 0x3e, 0x15, 0xc1, 0x4a, 0x1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xc6, 0xff, 0x1c, 0x9c, 0xfd, 0x2c, 0x08, 0xc7, 0x87, 0xd1,
0x90, 0x46, 0xe3, 0xa6, 0xfc, 0x3b, 0x7f, 0xf0, 0x4b, 0x00, 0x00, 0x00, 0xff, 0xff, 0xe8, 0x64, 0x24, 0xc6, 0xd1, 0x71, 0xce, 0x78, 0xba, 0xac, 0x57, 0x01, 0x31, 0xdd, 0x38, 0x45, 0x4a, 0x0e,
0x6b, 0x1b, 0xaf, 0x0f, 0x00, 0x00, 0x69, 0x34, 0xac, 0xcb, 0xbf, 0xf8, 0xdb, 0xff, 0x04, 0x00, 0x00, 0xff, 0xff, 0xc4, 0x7e, 0x5e,
0x7e, 0xd7, 0x0f, 0x00, 0x00,
} }

View File

@ -46,6 +46,7 @@ message TableOptions {
TableColumn sortBy = 3; // which column should a table be sorted by TableColumn sortBy = 3; // which column should a table be sorted by
string wrapping = 4; // option for text wrapping string wrapping = 4; // option for text wrapping
repeated TableColumn columnNames = 5; // names and renames for columns repeated TableColumn columnNames = 5; // names and renames for columns
bool fixFirstColumn = 6; // first column should be fixed/frozen
} }
message TableColumn { message TableColumn {

View File

@ -573,6 +573,7 @@ type TableOptions struct {
SortBy TableColumn `json:"sortBy"` SortBy TableColumn `json:"sortBy"`
Wrapping string `json:"wrapping"` Wrapping string `json:"wrapping"`
ColumnNames []TableColumn `json:"columnNames"` ColumnNames []TableColumn `json:"columnNames"`
FixFirstColumn bool `json:"fixFirstColumn"`
} }
// DashboardsStore is the storage and retrieval of dashboards // DashboardsStore is the storage and retrieval of dashboards

View File

@ -550,7 +550,8 @@ func TestServer(t *testing.T) {
"internalName": "", "internalName": "",
"displayName": ""}, "displayName": ""},
"wrapping": "", "wrapping": "",
"columnNames": null "columnNames": null,
"fixFirstColumn": false
}, },
"links": { "links": {
"self": "/chronograf/v1/dashboards/1000/cells/8f61c619-dd9b-4761-8aa8-577f27247093" "self": "/chronograf/v1/dashboards/1000/cells/8f61c619-dd9b-4761-8aa8-577f27247093"
@ -799,7 +800,8 @@ func TestServer(t *testing.T) {
"displayName":"" "displayName":""
}, },
"wrapping":"", "wrapping":"",
"columnNames":null "columnNames":null,
"fixFirstColumn":false
}, },
"legend":{ "legend":{
"type": "static", "type": "static",

View File

@ -532,7 +532,7 @@ func TestService_ReplaceDashboardCell(t *testing.T) {
} }
} }
`))), `))),
want: `{"i":"3c5c4102-fa40-4585-a8f9-917c77e37192","x":0,"y":0,"w":4,"h":4,"name":"Untitled Cell","queries":[{"query":"SELECT mean(\"usage_user\") AS \"mean_usage_user\" FROM \"telegraf\".\"autogen\".\"cpu\" WHERE time \u003e :dashboardTime: AND \"cpu\"=:cpu: GROUP BY :interval: FILL(null)","queryConfig":{"id":"3cd3eaa4-a4b8-44b3-b69e-0c7bf6b91d9e","database":"telegraf","measurement":"cpu","retentionPolicy":"autogen","fields":[{"value":"mean","type":"func","alias":"mean_usage_user","args":[{"value":"usage_user","type":"field","alias":""}]}],"tags":{"cpu":["ChristohersMBP2.lan"]},"groupBy":{"time":"2s","tags":[]},"areTagsAccepted":true,"fill":"null","rawText":"SELECT mean(\"usage_user\") AS \"mean_usage_user\" FROM \"telegraf\".\"autogen\".\"cpu\" WHERE time \u003e :dashboardTime: AND \"cpu\"=:cpu: GROUP BY :interval: FILL(null)","range":{"upper":"","lower":"now() - 15m"},"shifts":[]},"source":""}],"axes":{"x":{"bounds":["",""],"label":"","prefix":"","suffix":"","base":"","scale":""},"y":{"bounds":["",""],"label":"","prefix":"","suffix":"","base":"","scale":""},"y2":{"bounds":["",""],"label":"","prefix":"","suffix":"","base":"","scale":""}},"type":"line","colors":[{"id":"0","type":"min","hex":"#00C9FF","name":"laser","value":"0"},{"id":"1","type":"max","hex":"#9394FF","name":"comet","value":"100"}],"legend":{},"tableOptions":{"timeFormat":"","verticalTimeAxis":false,"sortBy":{"internalName":"","displayName":""},"wrapping":"","columnNames":null},"links":{"self":"/chronograf/v1/dashboards/1/cells/3c5c4102-fa40-4585-a8f9-917c77e37192"}} want: `{"i":"3c5c4102-fa40-4585-a8f9-917c77e37192","x":0,"y":0,"w":4,"h":4,"name":"Untitled Cell","queries":[{"query":"SELECT mean(\"usage_user\") AS \"mean_usage_user\" FROM \"telegraf\".\"autogen\".\"cpu\" WHERE time \u003e :dashboardTime: AND \"cpu\"=:cpu: GROUP BY :interval: FILL(null)","queryConfig":{"id":"3cd3eaa4-a4b8-44b3-b69e-0c7bf6b91d9e","database":"telegraf","measurement":"cpu","retentionPolicy":"autogen","fields":[{"value":"mean","type":"func","alias":"mean_usage_user","args":[{"value":"usage_user","type":"field","alias":""}]}],"tags":{"cpu":["ChristohersMBP2.lan"]},"groupBy":{"time":"2s","tags":[]},"areTagsAccepted":true,"fill":"null","rawText":"SELECT mean(\"usage_user\") AS \"mean_usage_user\" FROM \"telegraf\".\"autogen\".\"cpu\" WHERE time \u003e :dashboardTime: AND \"cpu\"=:cpu: GROUP BY :interval: FILL(null)","range":{"upper":"","lower":"now() - 15m"},"shifts":[]},"source":""}],"axes":{"x":{"bounds":["",""],"label":"","prefix":"","suffix":"","base":"","scale":""},"y":{"bounds":["",""],"label":"","prefix":"","suffix":"","base":"","scale":""},"y2":{"bounds":["",""],"label":"","prefix":"","suffix":"","base":"","scale":""}},"type":"line","colors":[{"id":"0","type":"min","hex":"#00C9FF","name":"laser","value":"0"},{"id":"1","type":"max","hex":"#9394FF","name":"comet","value":"100"}],"legend":{},"tableOptions":{"timeFormat":"","verticalTimeAxis":false,"sortBy":{"internalName":"","displayName":""},"wrapping":"","columnNames":null,"fixFirstColumn":false},"links":{"self":"/chronograf/v1/dashboards/1/cells/3c5c4102-fa40-4585-a8f9-917c77e37192"}}
`, `,
}, },
{ {

View File

@ -0,0 +1,25 @@
import React, {SFC} from 'react'
import classnames from 'classnames'
interface Props {
fixed: boolean
onToggleFixFirstColumn: () => void
}
const GraphOptionsFixFirstColumn: SFC<Props> = ({
fixed,
onToggleFixFirstColumn,
}) =>
<div
className={classnames('query-builder--list-item', {
active: fixed,
})}
onClick={onToggleFixFirstColumn}
>
<span>
<div className="query-builder--checkbox" data-test="checkbox" />
<label>Fix First Column</label>
</span>
</div>
export default GraphOptionsFixFirstColumn

View File

@ -9,6 +9,7 @@ import GraphOptionsTimeFormat from 'src/dashboards/components/GraphOptionsTimeFo
import GraphOptionsTimeAxis from 'src/dashboards/components/GraphOptionsTimeAxis' import GraphOptionsTimeAxis from 'src/dashboards/components/GraphOptionsTimeAxis'
import GraphOptionsSortBy from 'src/dashboards/components/GraphOptionsSortBy' import GraphOptionsSortBy from 'src/dashboards/components/GraphOptionsSortBy'
import GraphOptionsTextWrapping from 'src/dashboards/components/GraphOptionsTextWrapping' import GraphOptionsTextWrapping from 'src/dashboards/components/GraphOptionsTextWrapping'
import GraphOptionsFixFirstColumn from 'src/dashboards/components/GraphOptionsFixFirstColumn'
import GraphOptionsCustomizeColumns from 'src/dashboards/components/GraphOptionsCustomizeColumns' import GraphOptionsCustomizeColumns from 'src/dashboards/components/GraphOptionsCustomizeColumns'
import ThresholdsList from 'src/shared/components/ThresholdsList' import ThresholdsList from 'src/shared/components/ThresholdsList'
@ -28,6 +29,7 @@ type Options = {
sortBy: TableColumn sortBy: TableColumn
wrapping: string wrapping: string
columnNames: TableColumn[] columnNames: TableColumn[]
fixFirstColumn: boolean
} }
interface QueryConfig { interface QueryConfig {
@ -84,7 +86,7 @@ export class TableOptions extends PureComponent<Props, {}> {
const {handleUpdateTableOptions, tableOptions} = this.props const {handleUpdateTableOptions, tableOptions} = this.props
handleUpdateTableOptions({ handleUpdateTableOptions({
...tableOptions, ...tableOptions,
columnNames: this.computedColumnNames columnNames: this.computedColumnNames,
}) })
} }
@ -107,6 +109,12 @@ export class TableOptions extends PureComponent<Props, {}> {
handleToggleTextWrapping = () => {} handleToggleTextWrapping = () => {}
handleToggleFixFirstColumn = () => {
const {handleUpdateTableOptions, tableOptions} = this.props
const fixFirstColumn = !tableOptions.fixFirstColumn
handleUpdateTableOptions({...tableOptions, fixFirstColumn})
}
handleColumnRename = column => { handleColumnRename = column => {
const {handleUpdateTableOptions, tableOptions} = this.props const {handleUpdateTableOptions, tableOptions} = this.props
const {columnNames} = tableOptions const {columnNames} = tableOptions
@ -118,14 +126,19 @@ export class TableOptions extends PureComponent<Props, {}> {
render() { render() {
const { const {
tableOptions: {timeFormat, columnNames: columns, verticalTimeAxis}, tableOptions: {
timeFormat,
columnNames: columns,
verticalTimeAxis,
fixFirstColumn,
},
onResetFocus, onResetFocus,
tableOptions tableOptions,
} = this.props } = this.props
const tableSortByOptions = this.computedColumnNames.map(col => ({ const tableSortByOptions = this.computedColumnNames.map(col => ({
text: col.displayName || col.internalName, text: col.displayName || col.internalName,
key: col.internalName key: col.internalName,
})) }))
return ( return (
@ -153,6 +166,10 @@ export class TableOptions extends PureComponent<Props, {}> {
thresholdsListType="background" thresholdsListType="background"
onToggleTextWrapping={this.handleToggleTextWrapping} onToggleTextWrapping={this.handleToggleTextWrapping}
/> />
<GraphOptionsFixFirstColumn
fixed={fixFirstColumn}
onToggleFixFirstColumn={this.handleToggleFixFirstColumn}
/>
</div> </div>
<GraphOptionsCustomizeColumns <GraphOptionsCustomizeColumns
columns={columns} columns={columns}
@ -169,11 +186,11 @@ export class TableOptions extends PureComponent<Props, {}> {
} }
const mapStateToProps = ({cellEditorOverlay: {cell: {tableOptions}}}) => ({ const mapStateToProps = ({cellEditorOverlay: {cell: {tableOptions}}}) => ({
tableOptions tableOptions,
}) })
const mapDispatchToProps = dispatch => ({ const mapDispatchToProps = dispatch => ({
handleUpdateTableOptions: bindActionCreators(updateTableOptions, dispatch) handleUpdateTableOptions: bindActionCreators(updateTableOptions, dispatch),
}) })
export default connect(mapStateToProps, mapDispatchToProps)(TableOptions) export default connect(mapStateToProps, mapDispatchToProps)(TableOptions)

View File

@ -14,6 +14,7 @@ import {
NULL_HOVER_TIME, NULL_HOVER_TIME,
TIME_FORMAT_DEFAULT, TIME_FORMAT_DEFAULT,
TIME_COLUMN_DEFAULT, TIME_COLUMN_DEFAULT,
FIX_FIRST_COLUMN_DEFAULT,
} from 'src/shared/constants/tableGraph' } from 'src/shared/constants/tableGraph'
import {generateThresholdsListHexs} from 'shared/constants/colorOperations' import {generateThresholdsListHexs} from 'shared/constants/colorOperations'
@ -56,10 +57,10 @@ class TableGraph extends Component {
} }
handleHover = (columnIndex, rowIndex) => () => { handleHover = (columnIndex, rowIndex) => () => {
const {onSetHoverTime, tableOptions} = this.props const {onSetHoverTime, tableOptions: {verticalTimeAxis}} = this.props
const {data} = this.state const data = verticalTimeAxis ? this.state.data : this.state.unzippedData
if (onSetHoverTime) { if (onSetHoverTime) {
const hoverTime = tableOptions.verticalTimeAxis const hoverTime = verticalTimeAxis
? data[rowIndex][0] ? data[rowIndex][0]
: data[0][columnIndex] : data[0][columnIndex]
onSetHoverTime(hoverTime.toString()) onSetHoverTime(hoverTime.toString())
@ -80,24 +81,30 @@ class TableGraph extends Component {
} }
} }
cellRenderer = ({columnIndex, rowIndex, key, parent, style}) => { cellRenderer = ({columnIndex, rowIndex, key, style, parent}) => {
const data = _.get(this.props, ['tableOptions', 'verticalTimeAxis'], true) const {colors, tableOptions} = this.props
const {hoveredColumnIndex, hoveredRowIndex} = this.state
const data = _.get(tableOptions, 'verticalTimeAxis', true)
? this.state.data ? this.state.data
: this.state.unzippedData : this.state.unzippedData
const {hoveredColumnIndex, hoveredRowIndex} = this.state
const {colors} = this.props
const columnCount = _.get(data, ['0', 'length'], 0) const columnCount = _.get(data, ['0', 'length'], 0)
const rowCount = data.length const rowCount = data.length
const {tableOptions} = this.props
const timeFormat = _.get(tableOptions, 'timeFormat', TIME_FORMAT_DEFAULT) const timeFormat = _.get(tableOptions, 'timeFormat', TIME_FORMAT_DEFAULT)
const columnNames = _.get(tableOptions, 'columnNames', [ const columnNames = _.get(tableOptions, 'columnNames', [
TIME_COLUMN_DEFAULT, TIME_COLUMN_DEFAULT,
]) ])
const fixFirstColumn = _.get(
tableOptions,
'fixFirstColumn',
FIX_FIRST_COLUMN_DEFAULT
)
const isFixedRow = rowIndex === 0 && columnIndex > 0 const isFixedRow = rowIndex === 0 && columnIndex > 0
const isFixedColumn = rowIndex > 0 && columnIndex === 0 const isFixedColumn = fixFirstColumn && rowIndex > 0 && columnIndex === 0
const isTimeData = tableOptions.verticalTimeAxis const isTimeData = tableOptions.verticalTimeAxis
? isFixedColumn ? rowIndex > 0 && columnIndex === 0
: isFixedRow : isFixedRow
const isFixedCorner = rowIndex === 0 && columnIndex === 0 const isFixedCorner = rowIndex === 0 && columnIndex === 0
const isLastRow = rowIndex === rowCount - 1 const isLastRow = rowIndex === rowCount - 1
@ -173,6 +180,12 @@ class TableGraph extends Component {
hoveredRowIndex === NULL_ROW_INDEX hoveredRowIndex === NULL_ROW_INDEX
? this.calcHoverTimeIndex(data, hoverTime, verticalTimeAxis) ? this.calcHoverTimeIndex(data, hoverTime, verticalTimeAxis)
: hoveredRowIndex : hoveredRowIndex
const fixedColumnCount = tableOptions.fixFirstColumn ? 1 : undefined
const hoveringThisTable = hoveredColumnIndex !== NULL_COLUMN_INDEX
const scrollToRow =
!hoveringThisTable && verticalTimeAxis ? hoverTimeIndex : undefined
const scrollToColumn =
!hoveringThisTable && !verticalTimeAxis ? hoverTimeIndex : undefined
return ( return (
<div <div
@ -188,7 +201,7 @@ class TableGraph extends Component {
rowHeight={ROW_HEIGHT} rowHeight={ROW_HEIGHT}
height={tableHeight} height={tableHeight}
width={tableWidth} width={tableWidth}
fixedColumnCount={1} fixedColumnCount={fixedColumnCount}
fixedRowCount={1} fixedRowCount={1}
enableFixedColumnScroll={true} enableFixedColumnScroll={true}
enableFixedRowScroll={true} enableFixedRowScroll={true}
@ -198,8 +211,8 @@ class TableGraph extends Component {
columnNames={ columnNames={
tableOptions ? tableOptions.columnNames : [TIME_COLUMN_DEFAULT] tableOptions ? tableOptions.columnNames : [TIME_COLUMN_DEFAULT]
} }
scrollToRow={verticalTimeAxis ? hoverTimeIndex : undefined} scrollToRow={scrollToRow}
scrollToColumn={verticalTimeAxis ? undefined : hoverTimeIndex} scrollToColumn={scrollToColumn}
verticalTimeAxis={verticalTimeAxis} verticalTimeAxis={verticalTimeAxis}
sortByColumnIndex={sortByColumnIndex} sortByColumnIndex={sortByColumnIndex}
cellRenderer={this.cellRenderer} cellRenderer={this.cellRenderer}

View File

@ -8,6 +8,8 @@ export const TIME_FORMAT_CUSTOM = 'Custom'
export const TIME_COLUMN_DEFAULT = {internalName: 'time', displayName: ''} export const TIME_COLUMN_DEFAULT = {internalName: 'time', displayName: ''}
export const FIX_FIRST_COLUMN_DEFAULT = true
export const FORMAT_OPTIONS = [ export const FORMAT_OPTIONS = [
{text: TIME_FORMAT_DEFAULT}, {text: TIME_FORMAT_DEFAULT},
{text: 'MM/DD/YYYY HH:mm'}, {text: 'MM/DD/YYYY HH:mm'},
@ -26,4 +28,5 @@ export const DEFAULT_TABLE_OPTIONS = {
sortBy: TIME_COLUMN_DEFAULT, sortBy: TIME_COLUMN_DEFAULT,
wrapping: 'truncate', wrapping: 'truncate',
columnNames: [TIME_COLUMN_DEFAULT], columnNames: [TIME_COLUMN_DEFAULT],
fixFirstColumn: FIX_FIRST_COLUMN_DEFAULT,
} }

View File

@ -0,0 +1,28 @@
import React from 'react'
import GraphOptionsFixFirstColumn from 'src/dashboards/components/GraphOptionsFixFirstColumn'
import {shallow} from 'enzyme'
const setup = (override = {}) => {
const props = {
fixed: true,
onToggleFixFirstColumn: () => {},
...override,
}
const wrapper = shallow(<GraphOptionsFixFirstColumn {...props} />)
return {wrapper, props}
}
describe('Dashboards.Components.GraphOptionsFixFirstColumn', () => {
describe('rendering', () => {
it('shows checkbox and label', () => {
const {wrapper} = setup()
const label = wrapper.find('label')
const checkbox = wrapper.find({'data-test': 'checkbox'})
expect(label.exists()).toBe(true)
expect(checkbox.exists()).toBe(true)
})
})
})

View File

@ -10,36 +10,37 @@ import GraphOptionsTextWrapping from 'src/dashboards/components/GraphOptionsText
import GraphOptionsCustomizeColumns from 'src/dashboards/components/GraphOptionsCustomizeColumns' import GraphOptionsCustomizeColumns from 'src/dashboards/components/GraphOptionsCustomizeColumns'
import ThresholdsList from 'src/shared/components/ThresholdsList' import ThresholdsList from 'src/shared/components/ThresholdsList'
import ThresholdsListTypeToggle from 'src/shared/components/ThresholdsListTypeToggle' import ThresholdsListTypeToggle from 'src/shared/components/ThresholdsListTypeToggle'
import GraphOptionsFixFirstColumn from 'src/dashboards/components/GraphOptionsFixFirstColumn'
import {shallow} from 'enzyme' import {shallow} from 'enzyme'
const queryConfigs = [ const queryConfigs = [
{ {
measurement: "dev", measurement: 'dev',
fields: [ fields: [
{ {
alias: "boom", alias: 'boom',
value: "test" value: 'test',
}, },
{ {
alias: "again", alias: 'again',
value: "again" value: 'again',
}, },
] ],
}, },
{ {
measurement: "prod", measurement: 'prod',
fields: [ fields: [
{ {
alias: "boom", alias: 'boom',
value: "test" value: 'test',
}, },
{ {
alias: "again", alias: 'again',
value: "again" value: 'again',
}, },
] ],
} },
] ]
const defaultProps = { const defaultProps = {
@ -51,6 +52,7 @@ const defaultProps = {
sortBy: {internalName: '', displayName: ''}, sortBy: {internalName: '', displayName: ''},
wrapping: '', wrapping: '',
columnNames: [], columnNames: [],
fixFirstColumn: true,
}, },
onResetFocus: () => {}, onResetFocus: () => {},
} }
@ -104,14 +106,14 @@ describe('Dashboards.Components.TableOptions', () => {
it('should render all components', () => { it('should render all components', () => {
const queryConfigs = [ const queryConfigs = [
{ {
measurement: "dev", measurement: 'dev',
fields: [ fields: [
{ {
alias: "boom", alias: 'boom',
value: "test" value: 'test',
}, },
] ],
} },
] ]
const expectedSortOptions = [ const expectedSortOptions = [
@ -125,25 +127,31 @@ describe('Dashboards.Components.TableOptions', () => {
}, },
] ]
const {wrapper} = setup({ queryConfigs }) const {wrapper} = setup({queryConfigs})
const fancyScrollbar = wrapper.find(FancyScrollbar) const fancyScrollbar = wrapper.find(FancyScrollbar)
const graphOptionsTimeFormat = wrapper.find(GraphOptionsTimeFormat) const graphOptionsTimeFormat = wrapper.find(GraphOptionsTimeFormat)
const graphOptionsTimeAxis = wrapper.find(GraphOptionsTimeAxis) const graphOptionsTimeAxis = wrapper.find(GraphOptionsTimeAxis)
const graphOptionsSortBy = wrapper.find(GraphOptionsSortBy) const graphOptionsSortBy = wrapper.find(GraphOptionsSortBy)
const graphOptionsTextWrapping = wrapper.find(GraphOptionsTextWrapping) const graphOptionsTextWrapping = wrapper.find(GraphOptionsTextWrapping)
const graphOptionsFixFirstColumn = wrapper.find(
GraphOptionsFixFirstColumn
)
const graphOptionsCustomizeColumns = wrapper.find( const graphOptionsCustomizeColumns = wrapper.find(
GraphOptionsCustomizeColumns GraphOptionsCustomizeColumns
) )
const thresholdsList = wrapper.find(ThresholdsList) const thresholdsList = wrapper.find(ThresholdsList)
const thresholdsListTypeToggle = wrapper.find(ThresholdsListTypeToggle) const thresholdsListTypeToggle = wrapper.find(ThresholdsListTypeToggle)
expect(graphOptionsSortBy.props().sortByOptions).toEqual(expectedSortOptions) expect(graphOptionsSortBy.props().sortByOptions).toEqual(
expectedSortOptions
)
expect(fancyScrollbar.exists()).toBe(true) expect(fancyScrollbar.exists()).toBe(true)
expect(graphOptionsTimeFormat.exists()).toBe(true) expect(graphOptionsTimeFormat.exists()).toBe(true)
expect(graphOptionsTimeAxis.exists()).toBe(true) expect(graphOptionsTimeAxis.exists()).toBe(true)
expect(graphOptionsSortBy.exists()).toBe(true) expect(graphOptionsSortBy.exists()).toBe(true)
expect(graphOptionsTextWrapping.exists()).toBe(true) expect(graphOptionsTextWrapping.exists()).toBe(true)
expect(graphOptionsFixFirstColumn.exists()).toBe(true)
expect(graphOptionsCustomizeColumns.exists()).toBe(true) expect(graphOptionsCustomizeColumns.exists()).toBe(true)
expect(thresholdsList.exists()).toBe(true) expect(thresholdsList.exists()).toBe(true)
expect(thresholdsListTypeToggle.exists()).toBe(true) expect(thresholdsListTypeToggle.exists()).toBe(true)