|
|
|
@ -231,13 +231,21 @@ export function getAnnotationsFromData( |
|
|
|
|
// annotation support API needs some work to support less "standard" editors like prometheus and here it is not
|
|
|
|
|
// polluting public API.
|
|
|
|
|
|
|
|
|
|
const legacyRunner = [ |
|
|
|
|
'prometheus', |
|
|
|
|
'loki', |
|
|
|
|
'elasticsearch', |
|
|
|
|
'grafana-opensearch-datasource', // external
|
|
|
|
|
]; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Opt out of using the default mapping functionality on frontend. |
|
|
|
|
*/ |
|
|
|
|
export function shouldUseMappingUI(datasource: DataSourceApi): boolean { |
|
|
|
|
const { type } = datasource; |
|
|
|
|
return ( |
|
|
|
|
type !== 'prometheus' && type !== 'elasticsearch' && type !== 'loki' && type !== 'grafana-opensearch-datasource' |
|
|
|
|
return !( |
|
|
|
|
type === 'datasource' || // ODD behavior for "-- Grafana --" datasource
|
|
|
|
|
legacyRunner.includes(type) |
|
|
|
|
); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -246,7 +254,5 @@ export function shouldUseMappingUI(datasource: DataSourceApi): boolean { |
|
|
|
|
*/ |
|
|
|
|
export function shouldUseLegacyRunner(datasource: DataSourceApi): boolean { |
|
|
|
|
const { type } = datasource; |
|
|
|
|
return ( |
|
|
|
|
type === 'prometheus' || type === 'elasticsearch' || type === 'loki' || type === 'grafana-opensearch-datasource' |
|
|
|
|
); |
|
|
|
|
return legacyRunner.includes(type); |
|
|
|
|
} |
|
|
|
|