diff --git a/ui/src/ifql/components/NoResults.tsx b/ui/src/ifql/components/NoResults.tsx index d12519ae3..ac62f1c92 100644 --- a/ui/src/ifql/components/NoResults.tsx +++ b/ui/src/ifql/components/NoResults.tsx @@ -1,6 +1,6 @@ -import React from 'react' +import React, {SFC} from 'react' -const NoResult = () => ( +const NoResult: SFC = () => (

No Results

diff --git a/ui/src/ifql/components/TableSidebar.tsx b/ui/src/ifql/components/TableSidebar.tsx index bba948731..f7408d858 100644 --- a/ui/src/ifql/components/TableSidebar.tsx +++ b/ui/src/ifql/components/TableSidebar.tsx @@ -1,10 +1,11 @@ -import React, {PureComponent} from 'react' +import React, {PureComponent, CSSProperties} from 'react' import _ from 'lodash' import {ScriptResult} from 'src/types' import {ErrorHandling} from 'src/shared/decorators/errors' import FancyScrollbar from 'src/shared/components/FancyScrollbar' import TableSidebarItem from 'src/ifql/components/TableSidebarItem' +import {vis} from 'src/ifql/constants' interface Props { data: ScriptResult[] @@ -20,7 +21,9 @@ export default class TableSidebar extends PureComponent { return (
{!this.isDataEmpty && ( -
Results
+
+ Results +
)}
@@ -41,6 +44,14 @@ export default class TableSidebar extends PureComponent { ) } + get headingStyle(): CSSProperties { + return { + height: `${vis.TABLE_ROW_HEIGHT + 2.5}px`, + backgroundColor: '#31313d', + borderBottom: '2px solid #383846', // $g5-pepper + } + } + get isDataEmpty(): boolean { return _.isEmpty(this.props.data) } diff --git a/ui/src/ifql/components/TimeMachineTable.tsx b/ui/src/ifql/components/TimeMachineTable.tsx index 6f6466ff8..f1ae32280 100644 --- a/ui/src/ifql/components/TimeMachineTable.tsx +++ b/ui/src/ifql/components/TimeMachineTable.tsx @@ -4,8 +4,7 @@ import {Grid, GridCellProps, AutoSizer, ColumnSizer} from 'react-virtualized' import {ErrorHandling} from 'src/shared/decorators/errors' import {ScriptResult} from 'src/types' - -const TIME_COLUMN_WIDTH = 170 +import {vis} from 'src/ifql/constants' @ErrorHandling export default class TimeMachineTable extends PureComponent { @@ -18,7 +17,7 @@ export default class TimeMachineTable extends PureComponent { {({height, width}) => ( {({adjustedWidth, getColumnWidth}) => ( @@ -29,7 +28,7 @@ export default class TimeMachineTable extends PureComponent { columnWidth={getColumnWidth} height={height} rowCount={data.length} - rowHeight={30} + rowHeight={vis.TABLE_ROW_HEIGHT} width={adjustedWidth} /> )} @@ -51,8 +50,14 @@ export default class TimeMachineTable extends PureComponent { style, }: GridCellProps): React.ReactNode => { const {data} = this.props + const headerRowClass = !rowIndex ? 'table-graph-cell__fixed-row' : '' + return ( -
+
{data[rowIndex][columnIndex]}
) diff --git a/ui/src/ifql/constants/index.ts b/ui/src/ifql/constants/index.ts index be7056754..dc80186d9 100644 --- a/ui/src/ifql/constants/index.ts +++ b/ui/src/ifql/constants/index.ts @@ -3,5 +3,6 @@ import * as editor from 'src/ifql/constants/editor' import * as argTypes from 'src/ifql/constants/argumentTypes' import * as funcNames from 'src/ifql/constants/funcNames' 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} diff --git a/ui/src/ifql/constants/vis.ts b/ui/src/ifql/constants/vis.ts new file mode 100644 index 000000000..146dab065 --- /dev/null +++ b/ui/src/ifql/constants/vis.ts @@ -0,0 +1,2 @@ +export const TABLE_ROW_HEIGHT = 30 +export const TIME_COLUMN_WIDTH = 170