feat: change "Submit" to "Run Notebook" (#18230)
parent
f04fc81ca6
commit
dae7953806
|
|
@ -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 = () => {
|
|||
<TimeRangeDropdown context={timeContext[id]} update={update} />
|
||||
<AutoRefreshDropdown context={timeContext[id]} update={update} />
|
||||
<SubmitQueryButton
|
||||
text="Run Notebook"
|
||||
icon={IconFont.Play}
|
||||
submitButtonDisabled={false}
|
||||
queryStatus={RemoteDataState.NotStarted}
|
||||
onSubmit={submit}
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ import {
|
|||
ComponentColor,
|
||||
ComponentSize,
|
||||
ComponentStatus,
|
||||
IconFont,
|
||||
} from '@influxdata/clockface'
|
||||
|
||||
// Actions
|
||||
|
|
@ -29,18 +30,32 @@ interface DispatchProps {
|
|||
onSubmit: typeof saveAndExecuteQueries | (() => void)
|
||||
}
|
||||
|
||||
type Props = StateProps & DispatchProps
|
||||
interface OwnProps {
|
||||
text?: string
|
||||
icon?: IconFont
|
||||
testID?: string
|
||||
}
|
||||
|
||||
type Props = OwnProps & StateProps & DispatchProps
|
||||
|
||||
class SubmitQueryButton extends PureComponent<Props> {
|
||||
public static defaultProps = {
|
||||
text: 'Submit',
|
||||
testID: 'time-machine-submit-button',
|
||||
}
|
||||
|
||||
public render() {
|
||||
const {text, icon, testID} = this.props
|
||||
|
||||
return (
|
||||
<Button
|
||||
text="Submit"
|
||||
text={text}
|
||||
icon={icon}
|
||||
size={ComponentSize.Small}
|
||||
status={this.buttonStatus}
|
||||
onClick={this.handleClick}
|
||||
color={ComponentColor.Primary}
|
||||
testID="time-machine-submit-button"
|
||||
testID={testID}
|
||||
/>
|
||||
)
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue