From dae7953806e012fedd4b70864e719f80bbd5a447 Mon Sep 17 00:00:00 2001 From: alexpaxton Date: Tue, 26 May 2020 15:02:36 -0700 Subject: [PATCH] feat: change "Submit" to "Run Notebook" (#18230) --- .../notebooks/components/header/Buttons.tsx | 9 +++++++- .../components/SubmitQueryButton.tsx | 21 ++++++++++++++++--- 2 files changed, 26 insertions(+), 4 deletions(-) diff --git a/ui/src/notebooks/components/header/Buttons.tsx b/ui/src/notebooks/components/header/Buttons.tsx index 9e425517c6..86b3270145 100644 --- a/ui/src/notebooks/components/header/Buttons.tsx +++ b/ui/src/notebooks/components/header/Buttons.tsx @@ -1,14 +1,19 @@ +// Libraries import React, {FC, useContext, useCallback} from 'react' +// Contexts import {NotebookContext} from 'src/notebooks/context/notebook' import {TimeProvider, TimeContext, TimeBlock} from 'src/notebooks/context/time' import AppSettingProvider from 'src/notebooks/context/app' +// Components import TimeZoneDropdown from 'src/notebooks/components/header/TimeZoneDropdown' import TimeRangeDropdown from 'src/notebooks/components/header/TimeRangeDropdown' import AutoRefreshDropdown from 'src/notebooks/components/header/AutoRefreshDropdown' - import {SubmitQueryButton} from 'src/timeMachine/components/SubmitQueryButton' +import {IconFont} from '@influxdata/clockface' + +// Types import {RemoteDataState} from 'src/types' export interface TimeContextProps { @@ -44,6 +49,8 @@ const Buttons: FC = () => { void) } -type Props = StateProps & DispatchProps +interface OwnProps { + text?: string + icon?: IconFont + testID?: string +} + +type Props = OwnProps & StateProps & DispatchProps class SubmitQueryButton extends PureComponent { + public static defaultProps = { + text: 'Submit', + testID: 'time-machine-submit-button', + } + public render() { + const {text, icon, testID} = this.props + return (