diff --git a/ui/src/shared/components/FluxEditor.tsx b/ui/src/shared/components/FluxEditor.tsx index 403d826d97..f5201a74eb 100644 --- a/ui/src/shared/components/FluxEditor.tsx +++ b/ui/src/shared/components/FluxEditor.tsx @@ -31,6 +31,7 @@ interface Props { script: string status: Status onChangeScript: OnChangeScript + onSubmitScript?: () => void suggestions: Suggestion[] visibility?: string } @@ -185,6 +186,11 @@ class FluxEditor extends PureComponent { private handleKeyUp = (__, e: KeyboardEvent) => { const {ctrlKey, metaKey, key} = e + const {onSubmitScript} = this.props + + if (ctrlKey && key === 'Enter' && onSubmitScript) { + onSubmitScript() + } if (ctrlKey && key === ' ') { this.showAutoComplete() diff --git a/ui/src/shared/components/TimeMachine.tsx b/ui/src/shared/components/TimeMachine.tsx index 3689350373..d0208a7139 100644 --- a/ui/src/shared/components/TimeMachine.tsx +++ b/ui/src/shared/components/TimeMachine.tsx @@ -5,7 +5,9 @@ import {get} from 'lodash' // Components import TimeMachineControls from 'src/shared/components/TimeMachineControls' -import Threesizer from 'src/shared/components/threesizer/Threesizer' +import Threesizer, { + DivisionProps, +} from 'src/shared/components/threesizer/Threesizer' import TimeMachineBottom from 'src/shared/components/TimeMachineBottom' import TimeMachineVis from 'src/shared/components/TimeMachineVis' import TimeSeries from 'src/shared/components/TimeSeries' @@ -32,7 +34,7 @@ const TimeMachine: SFC = props => {
{queriesState => { - const divisions = [ + const divisions: DivisionProps[] = [ { handleDisplay: 'none', render: () => , @@ -41,7 +43,9 @@ const TimeMachine: SFC = props => { }, { handlePixels: 12, - render: () => , + render: () => ( + + ), headerOrientation: HANDLE_HORIZONTAL, size: 0.67, }, diff --git a/ui/src/shared/components/TimeMachineQueryEditor.tsx b/ui/src/shared/components/TimeMachineQueryEditor.tsx index 3bc0c82803..1423e3b9de 100644 --- a/ui/src/shared/components/TimeMachineQueryEditor.tsx +++ b/ui/src/shared/components/TimeMachineQueryEditor.tsx @@ -76,6 +76,7 @@ class TimeMachineQueryEditor extends PureComponent { script={draftScript} status={{type: '', text: ''}} onChangeScript={onSetDraftScript} + onSubmitScript={onSubmitScript} suggestions={[]} /> ), diff --git a/ui/src/shared/components/flux_functions_toolbar/TooltipLink.tsx b/ui/src/shared/components/flux_functions_toolbar/TooltipLink.tsx index 2039de0b5d..fca3f21431 100644 --- a/ui/src/shared/components/flux_functions_toolbar/TooltipLink.tsx +++ b/ui/src/shared/components/flux_functions_toolbar/TooltipLink.tsx @@ -1,23 +1,17 @@ -import React, {PureComponent} from 'react' +import React, {SFC} from 'react' interface Props { link: string } -class TooltipLink extends PureComponent { - public render() { - const {link} = this.props - - return ( -

- Still have questions? Check out the{' '} - - Flux Docs - - . -

- ) - } -} +const TooltipLink: SFC = ({link}) => ( +

+ Still have questions? Check out the{' '} + + Flux Docs + + . +

+) export default TooltipLink diff --git a/ui/src/shared/components/threesizer/Threesizer.tsx b/ui/src/shared/components/threesizer/Threesizer.tsx index 02fbb310c3..d7a50578f1 100644 --- a/ui/src/shared/components/threesizer/Threesizer.tsx +++ b/ui/src/shared/components/threesizer/Threesizer.tsx @@ -29,13 +29,14 @@ interface State { dragEvent: any } -interface DivisionProps { +export interface DivisionProps { name?: string handleDisplay?: string handlePixels?: number style?: CSSProperties size?: number headerButtons?: JSX.Element[] + headerOrientation?: string render: (visibility: string, pixels: number) => ReactElement }