mirror of
https://github.com/grafana/grafana.git
synced 2026-07-29 15:59:50 -05:00
Dashboards: Filter out expressions when going to Explore (#64654)
* Filter out expressions when going from dashboard to explore * Move expression UID constant to types
This commit is contained in:
@@ -30,6 +30,7 @@ import { RefreshPicker } from '@grafana/ui';
|
||||
import store from 'app/core/store';
|
||||
import { TimeSrv } from 'app/features/dashboard/services/TimeSrv';
|
||||
import { PanelModel } from 'app/features/dashboard/state';
|
||||
import { ExpressionDatasourceUID } from 'app/features/expressions/types';
|
||||
import { ExploreId, QueryOptions, QueryTransaction } from 'app/types/explore';
|
||||
|
||||
import { config } from '../config';
|
||||
@@ -67,8 +68,12 @@ export async function getExploreUrl(args: GetExploreUrlArguments): Promise<strin
|
||||
|
||||
/** In Explore, we don't have legend formatter and we don't want to keep
|
||||
* legend formatting as we can't change it
|
||||
*
|
||||
* We also don't have expressions, so filter those out
|
||||
*/
|
||||
let exploreTargets: DataQuery[] = panel.targets.map((t) => omit(t, 'legendFormat'));
|
||||
let exploreTargets: DataQuery[] = panel.targets
|
||||
.map((t) => omit(t, 'legendFormat'))
|
||||
.filter((t) => t.datasource?.uid !== ExpressionDatasourceUID);
|
||||
let url: string | undefined;
|
||||
// if the mixed datasource is not enabled for explore, choose only one datasource
|
||||
if (
|
||||
|
||||
Reference in New Issue
Block a user