Utils: Use 's' as default for unit-less intervals (#23248)

* Utils: Use 's' as default for unit-less intervals

If the user specifies a string that is a unit-less number, it is
assumed that they meant seconds.

Fixes #22362

* Rephrase tooltip for better line break position
This commit is contained in:
Andreas Opferkuch
2020-04-02 13:43:32 +02:00
committed by GitHub
parent a4d4dd325f
commit 7e85e4d096
5 changed files with 46 additions and 5 deletions

View File

@@ -48,7 +48,9 @@ export function PromExploreQueryEditor(props: Props) {
onKeyDownFunc={onReturnKeyDown}
value={query.interval || ''}
hasTooltip={true}
tooltipContent={'Needs to be a valid time unit string, for example 5s, 1m, 3h, 1d, 1y'}
tooltipContent={
'Time units can be used here, for example: 5s, 1m, 3h, 1d, 1y (Default if no unit is specified: s)'
}
/>
}
/>

View File

@@ -8,7 +8,7 @@ exports[`PromExploreQueryEditor should render component 1`] = `
label="Step"
onChangeFunc={[Function]}
onKeyDownFunc={[Function]}
tooltipContent="Needs to be a valid time unit string, for example 5s, 1m, 3h, 1d, 1y"
tooltipContent="Time units can be used here, for example: 5s, 1m, 3h, 1d, 1y (Default if no unit is specified: s)"
value="1s"
/>
}