mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Explore: Support custom display label for derived fields buttons for Loki datasource (#37273)
This commit is contained in:
@@ -3,6 +3,7 @@ import { Observable, of, throwError } from 'rxjs';
|
||||
import {
|
||||
ArrayVector,
|
||||
CoreApp,
|
||||
DataLink,
|
||||
DataQueryRequest,
|
||||
DataSourceInstanceSettings,
|
||||
DataSourcePluginMeta,
|
||||
@@ -255,14 +256,16 @@ describe('ElasticDatasource', function (this: any) {
|
||||
{
|
||||
field: 'host',
|
||||
url: 'http://localhost:3000/${__value.raw}',
|
||||
urlDisplayLabel: 'Custom Label',
|
||||
},
|
||||
],
|
||||
});
|
||||
|
||||
expect(response.data.length).toBe(1);
|
||||
const links = response.data[0].fields.find((field: Field) => field.name === 'host').config.links;
|
||||
const links: DataLink[] = response.data[0].fields.find((field: Field) => field.name === 'host').config.links;
|
||||
expect(links.length).toBe(1);
|
||||
expect(links[0].url).toBe('http://localhost:3000/${__value.raw}');
|
||||
expect(links[0].title).toBe('Custom Label');
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user