Explore/Prometheus: Update default query type option to "Both" (#28935)

* Update default option to 'both'

* Update public/app/plugins/datasource/prometheus/components/PromExploreExtraField.tsx

Co-authored-by: Diana Payton <52059945+oddlittlebird@users.noreply.github.com>

* Fix running of queries for both

* Update wording

Co-authored-by: Diana Payton <52059945+oddlittlebird@users.noreply.github.com>
This commit is contained in:
Ivana Huckova
2020-11-20 12:08:10 +01:00
committed by GitHub
parent 4c103663fb
commit 6838af5ce1
4 changed files with 12 additions and 6 deletions

View File

@@ -57,7 +57,8 @@ export const PromExploreQueryEditor: FC<Props> = (props: Props) => {
data={data}
ExtraFieldElement={
<PromExploreExtraField
queryType={query.range && query.instant ? 'both' : query.instant ? 'instant' : 'range'}
// Select "both" as default option when Explore is opened. In legacy requests, range and instant can be undefined. In this case, we want to run queries with "both".
queryType={query.range === query.instant ? 'both' : query.instant ? 'instant' : 'range'}
stepValue={query.interval || ''}
onQueryTypeChange={onQueryTypeChange}
onStepChange={onStepChange}