mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Annotations: do not show fields mappings for -- grafana -- datasource (#51256)
This commit is contained in:
parent
ba00d12c0f
commit
3b1c7cc359
@ -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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user