chore: reduce Explore barrel files (#116051)

chore: Explore barrel files
This commit is contained in:
Hugo Häggmark
2026-01-12 05:57:09 +01:00
committed by GitHub
parent f581a5a69b
commit 2a6a48ac39
10 changed files with 15 additions and 13 deletions
-5
View File
@@ -2610,11 +2610,6 @@
"count": 2
}
},
"public/app/features/explore/hooks/useStateSync/index.ts": {
"no-barrel-files/no-barrel-files": {
"count": 1
}
},
"public/app/features/explore/spec/helper/setup.tsx": {
"@typescript-eslint/no-explicit-any": {
"count": 1
+1 -1
View File
@@ -73,7 +73,7 @@ import {
contentOutlineTrackUnpinClicked,
} from '../ContentOutline/ContentOutlineAnalyticEvents';
import { useContentOutlineContext } from '../ContentOutline/ContentOutlineContext';
import { getUrlStateFromPaneState } from '../hooks/useStateSync';
import { getUrlStateFromPaneState } from '../hooks/useStateSync/external.utils';
import { changePanelState } from '../state/explorePane';
import { changeQueries, runQueries } from '../state/query';
@@ -12,7 +12,7 @@ import {
import { t } from '@grafana/i18n';
import { ClipboardButton, CustomCellRendererProps, IconButton, Modal, useTheme2 } from '@grafana/ui';
import { getLogsPermalinkRange } from 'app/core/utils/shortLinks';
import { getUrlStateFromPaneState } from 'app/features/explore/hooks/useStateSync';
import { getUrlStateFromPaneState } from 'app/features/explore/hooks/useStateSync/external.utils';
import { LogsFrame, DATAPLANE_ID_NAME } from 'app/features/logs/logsFrame';
import { getState } from 'app/store/store';
@@ -12,8 +12,6 @@ import { syncFromURL } from './synchronizer/fromURL';
import { initializeFromURL } from './synchronizer/init';
import { syncToURL, syncToURLPredicate } from './synchronizer/toURL';
export { getUrlStateFromPaneState } from './external.utils';
/**
* Bi-directionally syncs URL changes with Explore's state.
*/
@@ -11,7 +11,7 @@ import { withUniqueRefIds } from 'app/features/explore/utils/queries';
import { ExploreItemState } from 'app/types/explore';
import { ThunkDispatch } from 'app/types/store';
import { getUrlStateFromPaneState } from '../index';
import { getUrlStateFromPaneState } from '../external.utils';
import { urlDiff } from '../internal.utils';
import { ExploreURLV1 } from '../migrators/v1';
@@ -11,7 +11,7 @@ import { withUniqueRefIds } from 'app/features/explore/utils/queries';
import { getDatasourceSrv } from 'app/features/plugins/datasource_srv';
import { ThunkDispatch } from 'app/types/store';
import { getUrlStateFromPaneState } from '../index';
import { getUrlStateFromPaneState } from '../external.utils';
import {
getDefaultQuery,
getPaneDatasource,
@@ -11,7 +11,7 @@ import { runQueries } from 'app/features/explore/state/query';
import { changeRangeAction } from 'app/features/explore/state/time';
import { ExploreState } from 'app/types/explore';
import { getUrlStateFromPaneState } from '../index';
import { getUrlStateFromPaneState } from '../external.utils';
import { InitState } from '../internal.utils';
/*
+1 -1
View File
@@ -30,7 +30,7 @@ import { parseDataplaneLogsFrame } from 'app/features/logs/logsFrame';
import { ExploreItemState } from 'app/types/explore';
import { getLinkSrv } from '../../panel/panellinks/link_srv';
import { getUrlStateFromPaneState } from '../hooks/useStateSync';
import { getUrlStateFromPaneState } from '../hooks/useStateSync/external.utils';
type DataLinkFilter = (link: DataLink, scopedVars: ScopedVars) => boolean;
@@ -1,6 +1,8 @@
import { DataFrameType, Field, FieldType, LogRowModel, MutableDataFrame } from '@grafana/data';
import { mockTimeRange } from '@grafana/plugin-ui';
import { setTemplateSrv } from '@grafana/runtime';
import { ExploreFieldLinkModel, getFieldLinksForExplore } from 'app/features/explore/utils/links';
import { TemplateSrv } from 'app/features/templating/template_srv';
import { GetFieldLinksFn } from 'app/plugins/panel/logs/types';
import { getAllFields, createLogLineLinks, FieldDef, getDataframeFields } from './logParser';
@@ -466,6 +468,10 @@ describe('logParser', () => {
});
describe('getDataframeFields', () => {
beforeEach(() => {
setTemplateSrv(new TemplateSrv());
});
it('should add row labels as variables for links', () => {
const row = createLogRow({
labels: { service_name: 'checkout', service_namespace: 'prod' },
@@ -1,6 +1,8 @@
import { FieldType, getDefaultTimeRange, LogsSortOrder, toDataFrame } from '@grafana/data';
import { setTemplateSrv } from '@grafana/runtime';
import { contextSrv } from 'app/core/services/context_srv';
import { getFieldLinksForExplore } from 'app/features/explore/utils/links';
import { TemplateSrv } from 'app/features/templating/template_srv';
import { GetFieldLinksFn } from 'app/plugins/panel/logs/types';
import { createLogLine } from '../mocks/logRow';
@@ -70,6 +72,7 @@ describe('getTempoTraceFromLinks', () => {
wrapLogMessage: true,
}
);
setTemplateSrv(new TemplateSrv());
});
test('Gets the trace information from a link', () => {