Tweak styles
Co-authored-by: Chris Henn <chris.henn@influxdata.com> Co-authored-by: Andrew Watkins <andrew.watkinz@gmail.com>pull/3519/head
parent
4d3e31676c
commit
4a4e1ef421
|
@ -1,6 +1,6 @@
|
||||||
import React from 'react'
|
import React, {SFC} from 'react'
|
||||||
|
|
||||||
const NoResult = () => (
|
const NoResult: SFC = () => (
|
||||||
<div className="graph-empty">
|
<div className="graph-empty">
|
||||||
<p>No Results</p>
|
<p>No Results</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -1,10 +1,11 @@
|
||||||
import React, {PureComponent} from 'react'
|
import React, {PureComponent, CSSProperties} from 'react'
|
||||||
import _ from 'lodash'
|
import _ from 'lodash'
|
||||||
|
|
||||||
import {ScriptResult} from 'src/types'
|
import {ScriptResult} from 'src/types'
|
||||||
import {ErrorHandling} from 'src/shared/decorators/errors'
|
import {ErrorHandling} from 'src/shared/decorators/errors'
|
||||||
import FancyScrollbar from 'src/shared/components/FancyScrollbar'
|
import FancyScrollbar from 'src/shared/components/FancyScrollbar'
|
||||||
import TableSidebarItem from 'src/ifql/components/TableSidebarItem'
|
import TableSidebarItem from 'src/ifql/components/TableSidebarItem'
|
||||||
|
import {vis} from 'src/ifql/constants'
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
data: ScriptResult[]
|
data: ScriptResult[]
|
||||||
|
@ -20,7 +21,9 @@ export default class TableSidebar extends PureComponent<Props> {
|
||||||
return (
|
return (
|
||||||
<div className="time-machine--sidebar">
|
<div className="time-machine--sidebar">
|
||||||
{!this.isDataEmpty && (
|
{!this.isDataEmpty && (
|
||||||
<div className="query-builder--heading">Results</div>
|
<div className="query-builder--heading" style={this.headingStyle}>
|
||||||
|
Results
|
||||||
|
</div>
|
||||||
)}
|
)}
|
||||||
<FancyScrollbar>
|
<FancyScrollbar>
|
||||||
<div className="time-machine-vis--sidebar query-builder--list">
|
<div className="time-machine-vis--sidebar query-builder--list">
|
||||||
|
@ -41,6 +44,14 @@ export default class TableSidebar extends PureComponent<Props> {
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
get headingStyle(): CSSProperties {
|
||||||
|
return {
|
||||||
|
height: `${vis.TABLE_ROW_HEIGHT + 2.5}px`,
|
||||||
|
backgroundColor: '#31313d',
|
||||||
|
borderBottom: '2px solid #383846', // $g5-pepper
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
get isDataEmpty(): boolean {
|
get isDataEmpty(): boolean {
|
||||||
return _.isEmpty(this.props.data)
|
return _.isEmpty(this.props.data)
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,8 +4,7 @@ import {Grid, GridCellProps, AutoSizer, ColumnSizer} from 'react-virtualized'
|
||||||
|
|
||||||
import {ErrorHandling} from 'src/shared/decorators/errors'
|
import {ErrorHandling} from 'src/shared/decorators/errors'
|
||||||
import {ScriptResult} from 'src/types'
|
import {ScriptResult} from 'src/types'
|
||||||
|
import {vis} from 'src/ifql/constants'
|
||||||
const TIME_COLUMN_WIDTH = 170
|
|
||||||
|
|
||||||
@ErrorHandling
|
@ErrorHandling
|
||||||
export default class TimeMachineTable extends PureComponent<ScriptResult> {
|
export default class TimeMachineTable extends PureComponent<ScriptResult> {
|
||||||
|
@ -18,7 +17,7 @@ export default class TimeMachineTable extends PureComponent<ScriptResult> {
|
||||||
{({height, width}) => (
|
{({height, width}) => (
|
||||||
<ColumnSizer
|
<ColumnSizer
|
||||||
width={width}
|
width={width}
|
||||||
columnMinWidth={TIME_COLUMN_WIDTH}
|
columnMinWidth={vis.TIME_COLUMN_WIDTH}
|
||||||
columnCount={this.columnCount}
|
columnCount={this.columnCount}
|
||||||
>
|
>
|
||||||
{({adjustedWidth, getColumnWidth}) => (
|
{({adjustedWidth, getColumnWidth}) => (
|
||||||
|
@ -29,7 +28,7 @@ export default class TimeMachineTable extends PureComponent<ScriptResult> {
|
||||||
columnWidth={getColumnWidth}
|
columnWidth={getColumnWidth}
|
||||||
height={height}
|
height={height}
|
||||||
rowCount={data.length}
|
rowCount={data.length}
|
||||||
rowHeight={30}
|
rowHeight={vis.TABLE_ROW_HEIGHT}
|
||||||
width={adjustedWidth}
|
width={adjustedWidth}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
|
@ -51,8 +50,14 @@ export default class TimeMachineTable extends PureComponent<ScriptResult> {
|
||||||
style,
|
style,
|
||||||
}: GridCellProps): React.ReactNode => {
|
}: GridCellProps): React.ReactNode => {
|
||||||
const {data} = this.props
|
const {data} = this.props
|
||||||
|
const headerRowClass = !rowIndex ? 'table-graph-cell__fixed-row' : ''
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div key={key} style={style} className="table-graph-cell">
|
<div
|
||||||
|
key={key}
|
||||||
|
style={style}
|
||||||
|
className={`table-graph-cell ${headerRowClass}`}
|
||||||
|
>
|
||||||
{data[rowIndex][columnIndex]}
|
{data[rowIndex][columnIndex]}
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
|
|
|
@ -3,5 +3,6 @@ import * as editor from 'src/ifql/constants/editor'
|
||||||
import * as argTypes from 'src/ifql/constants/argumentTypes'
|
import * as argTypes from 'src/ifql/constants/argumentTypes'
|
||||||
import * as funcNames from 'src/ifql/constants/funcNames'
|
import * as funcNames from 'src/ifql/constants/funcNames'
|
||||||
import * as builder from 'src/ifql/constants/builder'
|
import * as builder from 'src/ifql/constants/builder'
|
||||||
|
import * as vis from 'src/ifql/constants/vis'
|
||||||
|
|
||||||
export {ast, funcNames, argTypes, editor, builder}
|
export {ast, funcNames, argTypes, editor, builder, vis}
|
||||||
|
|
|
@ -0,0 +1,2 @@
|
||||||
|
export const TABLE_ROW_HEIGHT = 30
|
||||||
|
export const TIME_COLUMN_WIDTH = 170
|
Loading…
Reference in New Issue