grafana/public/app/plugins/datasource/graphite/versions.ts
Piotr Jamróz 6495a73ebd
Graphite: fix autocomplete when tags are not available (#31680)
* Return empty list of tags when tags are not available

In some configurations graphite-web fail to return the list of tags. It shouldn't however prevent displaying list of metrics (which is concatenated with tags).

* Populate jsonData with default version of Graphite

The version of Graphite is preselected in the dropdown but was not saved in jsonData initially.

* Fix a typo

* Show a popup with an error message

* Always use the latest Graphite value as the default one when creating a datasource

* Move autocomplete error handling to GraphiteQueryCtrl

* Test error handing in Graphite autocomplete

* Test default Graphite version fallback

* Rename graphite_versions.ts to versions.ts

* Remove redundant import

* Code formatting, minor renaming

* Remove redundant error info
2021-03-16 10:59:53 +01:00

6 lines
155 B
TypeScript

import { last } from 'lodash';
export const GRAPHITE_VERSIONS = ['0.9', '1.0', '1.1'];
export const DEFAULT_GRAPHITE_VERSION = last(GRAPHITE_VERSIONS)!;