mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
DataLinks: Add internal links in table and allow custom query (#25613)
* Add internal links in table and with custom query * Add specific types for internal and external link * Change the datalink types to be more backward compatible * Refactor the link utils for explore * Add internal linking to table panels * Fix derived field condition * Prettify * Add and fix tests * Prettify * Fix imports and tests * Remove unused type * Update packages/grafana-data/src/types/explore.ts Co-authored-by: Dominik Prokop <dominik.prokop@grafana.com> * Update packages/grafana-data/src/types/explore.ts Co-authored-by: Dominik Prokop <dominik.prokop@grafana.com> Co-authored-by: Dominik Prokop <dominik.prokop@grafana.com>
This commit is contained in:
@@ -129,11 +129,13 @@ describe('enhanceDataFrame', () => {
|
||||
{
|
||||
matcherRegex: 'trace2=(\\w+)',
|
||||
name: 'trace2',
|
||||
url: 'test',
|
||||
datasourceUid: 'uid',
|
||||
},
|
||||
{
|
||||
matcherRegex: 'trace2=(\\w+)',
|
||||
name: 'trace2',
|
||||
url: 'test',
|
||||
datasourceUid: 'uid2',
|
||||
},
|
||||
],
|
||||
@@ -150,11 +152,13 @@ describe('enhanceDataFrame', () => {
|
||||
expect(fc.getFieldByName('trace2').config.links.length).toBe(2);
|
||||
expect(fc.getFieldByName('trace2').config.links[0]).toEqual({
|
||||
title: '',
|
||||
meta: { datasourceUid: 'uid' },
|
||||
internal: { datasourceUid: 'uid', query: { query: 'test' } },
|
||||
url: '',
|
||||
});
|
||||
expect(fc.getFieldByName('trace2').config.links[1]).toEqual({
|
||||
title: '',
|
||||
meta: { datasourceUid: 'uid2' },
|
||||
internal: { datasourceUid: 'uid2', query: { query: 'test' } },
|
||||
url: '',
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user