mirror of
https://github.com/grafana/grafana.git
synced 2025-01-27 00:37:04 -06:00
datatrails: refactor: move related code to trails/MetricSelect subdir (#88262)
refactor: move related code to trails/MetricSelect subdir
This commit is contained in:
parent
f0ab501075
commit
5c29052219
@ -15,7 +15,7 @@ import {
|
||||
} from '@grafana/scenes';
|
||||
import { Stack } from '@grafana/ui';
|
||||
|
||||
import { SelectMetricAction } from '../SelectMetricAction';
|
||||
import { SelectMetricAction } from '../MetricSelect/SelectMetricAction';
|
||||
import { LOGS_METRIC, VAR_LOGS_DATASOURCE, VAR_LOGS_DATASOURCE_EXPR } from '../shared';
|
||||
|
||||
interface LogsSceneState extends SceneObjectState {
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { MetricSelectScene } from '../MetricSelectScene';
|
||||
import { MetricSelectScene } from '../MetricSelect/MetricSelectScene';
|
||||
|
||||
export function buildRelatedMetricsScene() {
|
||||
return new MetricSelectScene({});
|
||||
|
@ -7,7 +7,7 @@ import { activateFullSceneTree } from '../dashboard-scene/utils/test-utils';
|
||||
|
||||
import { DataTrail } from './DataTrail';
|
||||
import { MetricScene } from './MetricScene';
|
||||
import { MetricSelectScene } from './MetricSelectScene';
|
||||
import { MetricSelectScene } from './MetricSelect/MetricSelectScene';
|
||||
import { MetricSelectedEvent, VAR_FILTERS } from './shared';
|
||||
|
||||
describe('DataTrail', () => {
|
||||
|
@ -29,7 +29,7 @@ import { useStyles2 } from '@grafana/ui';
|
||||
import { DataTrailSettings } from './DataTrailSettings';
|
||||
import { DataTrailHistory } from './DataTrailsHistory';
|
||||
import { MetricScene } from './MetricScene';
|
||||
import { MetricSelectScene } from './MetricSelectScene';
|
||||
import { MetricSelectScene } from './MetricSelect/MetricSelectScene';
|
||||
import { MetricsHeader } from './MetricsHeader';
|
||||
import { getTrailStore } from './TrailStore/TrailStore';
|
||||
import { MetricDatasourceHelper } from './helpers/MetricDatasourceHelper';
|
||||
|
@ -22,13 +22,10 @@ import {
|
||||
import { VariableHide } from '@grafana/schema';
|
||||
import { Input, InlineSwitch, Field, Alert, Icon, useStyles2 } from '@grafana/ui';
|
||||
|
||||
import { getPreviewPanelFor } from './AutomaticMetricQueries/previewPanel';
|
||||
import { MetricScene } from './MetricScene';
|
||||
import { SelectMetricAction } from './SelectMetricAction';
|
||||
import { StatusWrapper } from './StatusWrapper';
|
||||
import { getMetricDescription } from './helpers/MetricDatasourceHelper';
|
||||
import { reportExploreMetrics } from './interactions';
|
||||
import { sortRelatedMetrics } from './relatedMetrics';
|
||||
import { MetricScene } from '../MetricScene';
|
||||
import { StatusWrapper } from '../StatusWrapper';
|
||||
import { getMetricDescription } from '../helpers/MetricDatasourceHelper';
|
||||
import { reportExploreMetrics } from '../interactions';
|
||||
import {
|
||||
getVariablesWithMetricConstant,
|
||||
MetricSelectedEvent,
|
||||
@ -36,8 +33,12 @@ import {
|
||||
VAR_DATASOURCE,
|
||||
VAR_FILTERS_EXPR,
|
||||
VAR_METRIC_NAMES,
|
||||
} from './shared';
|
||||
import { getFilters, getTrailFor } from './utils';
|
||||
} from '../shared';
|
||||
import { getFilters, getTrailFor } from '../utils';
|
||||
|
||||
import { SelectMetricAction } from './SelectMetricAction';
|
||||
import { getPreviewPanelFor } from './previewPanel';
|
||||
import { sortRelatedMetrics } from './relatedMetrics';
|
||||
|
||||
interface MetricPanel {
|
||||
name: string;
|
@ -3,7 +3,7 @@ import React from 'react';
|
||||
import { SceneObjectState, SceneObjectBase, SceneComponentProps } from '@grafana/scenes';
|
||||
import { Button } from '@grafana/ui';
|
||||
|
||||
import { MetricSelectedEvent } from './shared';
|
||||
import { MetricSelectedEvent } from '../shared';
|
||||
|
||||
export interface SelectMetricActionState extends SceneObjectState {
|
||||
title: string;
|
@ -1,12 +1,12 @@
|
||||
import { PromQuery } from '@grafana/prometheus';
|
||||
import { SceneCSSGridItem, SceneQueryRunner, SceneVariableSet } from '@grafana/scenes';
|
||||
|
||||
import { SelectMetricAction } from '../SelectMetricAction';
|
||||
import { hideEmptyPreviews } from '../hideEmptyPreviews';
|
||||
import { getAutoQueriesForMetric } from '../AutomaticMetricQueries/AutoQueryEngine';
|
||||
import { getVariablesWithMetricConstant, trailDS } from '../shared';
|
||||
import { getColorByIndex } from '../utils';
|
||||
|
||||
import { getAutoQueriesForMetric } from './AutoQueryEngine';
|
||||
import { SelectMetricAction } from './SelectMetricAction';
|
||||
import { hideEmptyPreviews } from './hideEmptyPreviews';
|
||||
|
||||
export function getPreviewPanelFor(metric: string, index: number, currentFilterCount: number, description?: string) {
|
||||
const autoQuery = getAutoQueriesForMetric(metric);
|
Loading…
Reference in New Issue
Block a user