diff --git a/.betterer.results b/.betterer.results index 9a0c47b5748..36466a971d4 100644 --- a/.betterer.results +++ b/.betterer.results @@ -2559,11 +2559,11 @@ exports[`better eslint`] = { "public/app/features/explore/ExploreQueryInspector.tsx:5381": [ [0, 0, 0, "Do not use any type assertions.", "0"] ], - "public/app/features/explore/Logs.tsx:5381": [ + "public/app/features/explore/Logs/Logs.tsx:5381": [ [0, 0, 0, "Unexpected any. Specify a different type.", "0"], [0, 0, 0, "Do not use any type assertions.", "1"] ], - "public/app/features/explore/LogsMetaRow.tsx:5381": [ + "public/app/features/explore/Logs/LogsMetaRow.tsx:5381": [ [0, 0, 0, "Unexpected any. Specify a different type.", "0"] ], "public/app/features/explore/QueryRows.test.tsx:5381": [ diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 026393f14ba..e7b06ca3a2e 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -443,9 +443,12 @@ lerna.json @grafana/frontend-ops /public/testdata/ @grafana/grafana-frontend-platform /public/views/ @grafana/grafana-frontend-platform -/public/app/features/explore/Logs.tsx @grafana/observability-logs -/public/app/features/explore/LogsContainer.tsx @grafana/observability-logs +/public/app/features/explore/Logs/ @grafana/observability-logs +/public/app/features/explore/RawPrometheus/ @grafana/observability-metrics + +/public/app/features/explore/NodeGraph/ @grafana/observability-traces-and-profiling +/public/app/features/explore/FlameGraph/ @grafana/observability-traces-and-profiling /public/app/features/explore/TraceView/ @grafana/observability-traces-and-profiling /public/api-merged.json @grafana/backend-platform diff --git a/public/app/features/explore/Explore.tsx b/public/app/features/explore/Explore.tsx index e27a4ba2f99..d3f03870715 100644 --- a/public/app/features/explore/Explore.tsx +++ b/public/app/features/explore/Explore.tsx @@ -42,19 +42,19 @@ import { getTimeZone } from '../profile/state/selectors'; import ExploreQueryInspector from './ExploreQueryInspector'; import { ExploreToolbar } from './ExploreToolbar'; -import { FlameGraphExploreContainer } from './FlameGraphExploreContainer'; +import { FlameGraphExploreContainer } from './FlameGraph/FlameGraphExploreContainer'; import { GraphContainer } from './Graph/GraphContainer'; -import LogsContainer from './LogsContainer'; -import { LogsSamplePanel } from './LogsSamplePanel'; +import LogsContainer from './Logs/LogsContainer'; +import { LogsSamplePanel } from './Logs/LogsSamplePanel'; import { NoData } from './NoData'; import { NoDataSourceCallToAction } from './NoDataSourceCallToAction'; -import { NodeGraphContainer } from './NodeGraphContainer'; +import { NodeGraphContainer } from './NodeGraph/NodeGraphContainer'; import { QueryRows } from './QueryRows'; -import RawPrometheusContainer from './RawPrometheusContainer'; +import RawPrometheusContainer from './RawPrometheus/RawPrometheusContainer'; import { ResponseErrorContainer } from './ResponseErrorContainer'; import RichHistoryContainer from './RichHistory/RichHistoryContainer'; import { SecondaryActions } from './SecondaryActions'; -import TableContainer from './TableContainer'; +import TableContainer from './Table/TableContainer'; import { TraceViewContainer } from './TraceView/TraceViewContainer'; import { changeSize } from './state/explorePane'; import { splitOpen } from './state/main'; diff --git a/public/app/features/explore/FlameGraphExploreContainer.tsx b/public/app/features/explore/FlameGraph/FlameGraphExploreContainer.tsx similarity index 100% rename from public/app/features/explore/FlameGraphExploreContainer.tsx rename to public/app/features/explore/FlameGraph/FlameGraphExploreContainer.tsx diff --git a/public/app/features/explore/LiveLogs.test.tsx b/public/app/features/explore/Logs/LiveLogs.test.tsx similarity index 98% rename from public/app/features/explore/LiveLogs.test.tsx rename to public/app/features/explore/Logs/LiveLogs.test.tsx index 854897b1361..d1c097251b0 100644 --- a/public/app/features/explore/LiveLogs.test.tsx +++ b/public/app/features/explore/Logs/LiveLogs.test.tsx @@ -3,8 +3,9 @@ import React from 'react'; import { LogRowModel } from '@grafana/data'; +import { makeLogs } from '../__mocks__/makeLogs'; + import { LiveLogsWithTheme } from './LiveLogs'; -import { makeLogs } from './__mocks__/makeLogs'; const setup = (rows: LogRowModel[]) => render( diff --git a/public/app/features/explore/LiveLogs.tsx b/public/app/features/explore/Logs/LiveLogs.tsx similarity index 95% rename from public/app/features/explore/LiveLogs.tsx rename to public/app/features/explore/Logs/LiveLogs.tsx index 5d258946562..3439db19eae 100644 --- a/public/app/features/explore/LiveLogs.tsx +++ b/public/app/features/explore/Logs/LiveLogs.tsx @@ -5,12 +5,11 @@ import tinycolor from 'tinycolor2'; import { LogRowModel, TimeZone, dateTimeFormat, GrafanaTheme2, LogsSortOrder } from '@grafana/data'; import { Button, Themeable2, withTheme2 } from '@grafana/ui'; -import { LogMessageAnsi } from '../logs/components/LogMessageAnsi'; -import { getLogRowStyles } from '../logs/components/getLogRowStyles'; -import { sortLogRows } from '../logs/utils'; - -import { ElapsedTime } from './ElapsedTime'; -import { filterLogRowsByIndex } from './state/utils'; +import { LogMessageAnsi } from '../../logs/components/LogMessageAnsi'; +import { getLogRowStyles } from '../../logs/components/getLogRowStyles'; +import { sortLogRows } from '../../logs/utils'; +import { ElapsedTime } from '../ElapsedTime'; +import { filterLogRowsByIndex } from '../state/utils'; const getStyles = (theme: GrafanaTheme2) => ({ logsRowsLive: css` diff --git a/public/app/features/explore/Logs.test.tsx b/public/app/features/explore/Logs/Logs.test.tsx similarity index 100% rename from public/app/features/explore/Logs.test.tsx rename to public/app/features/explore/Logs/Logs.test.tsx diff --git a/public/app/features/explore/Logs.tsx b/public/app/features/explore/Logs/Logs.tsx similarity index 99% rename from public/app/features/explore/Logs.tsx rename to public/app/features/explore/Logs/Logs.tsx index bf96418700a..38b50850c06 100644 --- a/public/app/features/explore/Logs.tsx +++ b/public/app/features/explore/Logs/Logs.tsx @@ -43,8 +43,8 @@ import { dedupLogRows, filterLogLevels } from 'app/core/logsModel'; import store from 'app/core/store'; import { ExploreId } from 'app/types/explore'; -import { LogRows } from '../logs/components/LogRows'; -import { LogRowContextModal } from '../logs/components/log-context/LogRowContextModal'; +import { LogRows } from '../../logs/components/LogRows'; +import { LogRowContextModal } from '../../logs/components/log-context/LogRowContextModal'; import { LogsMetaRow } from './LogsMetaRow'; import LogsNavigation from './LogsNavigation'; diff --git a/public/app/features/explore/LogsContainer.tsx b/public/app/features/explore/Logs/LogsContainer.tsx similarity index 95% rename from public/app/features/explore/LogsContainer.tsx rename to public/app/features/explore/Logs/LogsContainer.tsx index 73f76fd680f..c91410d29fe 100644 --- a/public/app/features/explore/LogsContainer.tsx +++ b/public/app/features/explore/Logs/LogsContainer.tsx @@ -23,15 +23,20 @@ import { Collapse } from '@grafana/ui'; import { StoreState } from 'app/types'; import { ExploreId, ExploreItemState } from 'app/types/explore'; -import { getTimeZone } from '../profile/state/selectors'; +import { getTimeZone } from '../../profile/state/selectors'; +import { + addResultsToCache, + clearCache, + loadSupplementaryQueryData, + setSupplementaryQueryEnabled, +} from '../state/query'; +import { updateTimeRange } from '../state/time'; +import { LiveTailControls } from '../useLiveTailControls'; +import { getFieldLinksForExplore } from '../utils/links'; import { LiveLogsWithTheme } from './LiveLogs'; import { Logs } from './Logs'; -import { addResultsToCache, clearCache, loadSupplementaryQueryData, setSupplementaryQueryEnabled } from './state/query'; -import { updateTimeRange } from './state/time'; -import { LiveTailControls } from './useLiveTailControls'; import { LogsCrossFadeTransition } from './utils/LogsCrossFadeTransition'; -import { getFieldLinksForExplore } from './utils/links'; interface LogsContainerProps extends PropsFromRedux { width: number; diff --git a/public/app/features/explore/LogsMetaRow.test.tsx b/public/app/features/explore/Logs/LogsMetaRow.test.tsx similarity index 97% rename from public/app/features/explore/LogsMetaRow.test.tsx rename to public/app/features/explore/Logs/LogsMetaRow.test.tsx index 4096e2ab5ed..d367e9d358c 100644 --- a/public/app/features/explore/LogsMetaRow.test.tsx +++ b/public/app/features/explore/Logs/LogsMetaRow.test.tsx @@ -5,8 +5,8 @@ import React, { ComponentProps } from 'react'; import { LogLevel, LogsDedupStrategy, MutableDataFrame } from '@grafana/data'; -import { MAX_CHARACTERS } from '../logs/components/LogRowMessage'; -import { logRowsToReadableJson } from '../logs/utils'; +import { MAX_CHARACTERS } from '../../logs/components/LogRowMessage'; +import { logRowsToReadableJson } from '../../logs/utils'; import { LogsMetaRow } from './LogsMetaRow'; diff --git a/public/app/features/explore/LogsMetaRow.tsx b/public/app/features/explore/Logs/LogsMetaRow.tsx similarity index 93% rename from public/app/features/explore/LogsMetaRow.tsx rename to public/app/features/explore/Logs/LogsMetaRow.tsx index 4b7553a59b0..5bf8cf7a034 100644 --- a/public/app/features/explore/LogsMetaRow.tsx +++ b/public/app/features/explore/Logs/LogsMetaRow.tsx @@ -6,12 +6,11 @@ import { LogsDedupStrategy, LogsMetaItem, LogsMetaKind, LogRowModel, CoreApp, da import { reportInteraction } from '@grafana/runtime'; import { Button, Dropdown, Menu, ToolbarButton, Tooltip, useStyles2 } from '@grafana/ui'; -import { downloadLogsModelAsTxt } from '../inspector/utils/download'; -import { LogLabels } from '../logs/components/LogLabels'; -import { MAX_CHARACTERS } from '../logs/components/LogRowMessage'; -import { logRowsToReadableJson } from '../logs/utils'; - -import { MetaInfoText, MetaItemProps } from './MetaInfoText'; +import { downloadLogsModelAsTxt } from '../../inspector/utils/download'; +import { LogLabels } from '../../logs/components/LogLabels'; +import { MAX_CHARACTERS } from '../../logs/components/LogRowMessage'; +import { logRowsToReadableJson } from '../../logs/utils'; +import { MetaInfoText, MetaItemProps } from '../MetaInfoText'; const getStyles = () => ({ metaContainer: css` diff --git a/public/app/features/explore/LogsNavigation.test.tsx b/public/app/features/explore/Logs/LogsNavigation.test.tsx similarity index 100% rename from public/app/features/explore/LogsNavigation.test.tsx rename to public/app/features/explore/Logs/LogsNavigation.test.tsx diff --git a/public/app/features/explore/LogsNavigation.tsx b/public/app/features/explore/Logs/LogsNavigation.tsx similarity index 100% rename from public/app/features/explore/LogsNavigation.tsx rename to public/app/features/explore/Logs/LogsNavigation.tsx diff --git a/public/app/features/explore/LogsNavigationPages.test.tsx b/public/app/features/explore/Logs/LogsNavigationPages.test.tsx similarity index 100% rename from public/app/features/explore/LogsNavigationPages.test.tsx rename to public/app/features/explore/Logs/LogsNavigationPages.test.tsx diff --git a/public/app/features/explore/LogsNavigationPages.tsx b/public/app/features/explore/Logs/LogsNavigationPages.tsx similarity index 100% rename from public/app/features/explore/LogsNavigationPages.tsx rename to public/app/features/explore/Logs/LogsNavigationPages.tsx diff --git a/public/app/features/explore/LogsSample.test.tsx b/public/app/features/explore/Logs/LogsSample.test.tsx similarity index 100% rename from public/app/features/explore/LogsSample.test.tsx rename to public/app/features/explore/Logs/LogsSample.test.tsx diff --git a/public/app/features/explore/LogsSamplePanel.tsx b/public/app/features/explore/Logs/LogsSamplePanel.tsx similarity index 97% rename from public/app/features/explore/LogsSamplePanel.tsx rename to public/app/features/explore/Logs/LogsSamplePanel.tsx index 6a3492e120f..4ea42f1c9fc 100644 --- a/public/app/features/explore/LogsSamplePanel.tsx +++ b/public/app/features/explore/Logs/LogsSamplePanel.tsx @@ -17,9 +17,9 @@ import { Button, Collapse, Icon, Tooltip, useStyles2 } from '@grafana/ui'; import { dataFrameToLogsModel } from 'app/core/logsModel'; import store from 'app/core/store'; -import { LogRows } from '../logs/components/LogRows'; +import { LogRows } from '../../logs/components/LogRows'; +import { SupplementaryResultError } from '../SupplementaryResultError'; -import { SupplementaryResultError } from './SupplementaryResultError'; import { SETTINGS_KEYS } from './utils/logs'; type Props = { diff --git a/public/app/features/explore/LogsVolumePanel.test.tsx b/public/app/features/explore/Logs/LogsVolumePanel.test.tsx similarity index 97% rename from public/app/features/explore/LogsVolumePanel.test.tsx rename to public/app/features/explore/Logs/LogsVolumePanel.test.tsx index 683600d1f56..d19cb19fdf6 100644 --- a/public/app/features/explore/LogsVolumePanel.test.tsx +++ b/public/app/features/explore/Logs/LogsVolumePanel.test.tsx @@ -5,7 +5,7 @@ import { DataQueryResponse, LoadingState, EventBusSrv } from '@grafana/data'; import { LogsVolumePanel } from './LogsVolumePanel'; -jest.mock('./Graph/ExploreGraph', () => { +jest.mock('../Graph/ExploreGraph', () => { const ExploreGraph = () => ExploreGraph; return { ExploreGraph, diff --git a/public/app/features/explore/LogsVolumePanel.tsx b/public/app/features/explore/Logs/LogsVolumePanel.tsx similarity index 97% rename from public/app/features/explore/LogsVolumePanel.tsx rename to public/app/features/explore/Logs/LogsVolumePanel.tsx index a39b18cf52b..871b3388d7d 100644 --- a/public/app/features/explore/LogsVolumePanel.tsx +++ b/public/app/features/explore/Logs/LogsVolumePanel.tsx @@ -13,9 +13,8 @@ import { } from '@grafana/data'; import { Icon, Tooltip, TooltipDisplayMode, useStyles2, useTheme2 } from '@grafana/ui'; -import { getLogsVolumeDataSourceInfo, isLogsVolumeLimited } from '../logs/utils'; - -import { ExploreGraph } from './Graph/ExploreGraph'; +import { getLogsVolumeDataSourceInfo, isLogsVolumeLimited } from '../../logs/utils'; +import { ExploreGraph } from '../Graph/ExploreGraph'; type Props = { logsVolumeData: DataQueryResponse | undefined; diff --git a/public/app/features/explore/LogsVolumePanelList.test.tsx b/public/app/features/explore/Logs/LogsVolumePanelList.test.tsx similarity index 98% rename from public/app/features/explore/LogsVolumePanelList.test.tsx rename to public/app/features/explore/Logs/LogsVolumePanelList.test.tsx index 160628c8271..3809e56a5bb 100644 --- a/public/app/features/explore/LogsVolumePanelList.test.tsx +++ b/public/app/features/explore/Logs/LogsVolumePanelList.test.tsx @@ -6,7 +6,7 @@ import { DataQueryResponse, LoadingState, EventBusSrv } from '@grafana/data'; import { LogsVolumePanelList } from './LogsVolumePanelList'; -jest.mock('./Graph/ExploreGraph', () => { +jest.mock('../Graph/ExploreGraph', () => { const ExploreGraph = () => ExploreGraph; return { ExploreGraph, diff --git a/public/app/features/explore/LogsVolumePanelList.tsx b/public/app/features/explore/Logs/LogsVolumePanelList.tsx similarity index 97% rename from public/app/features/explore/LogsVolumePanelList.tsx rename to public/app/features/explore/Logs/LogsVolumePanelList.tsx index 490eaaf81a4..3b9e6eb8182 100644 --- a/public/app/features/explore/LogsVolumePanelList.tsx +++ b/public/app/features/explore/Logs/LogsVolumePanelList.tsx @@ -14,10 +14,10 @@ import { } from '@grafana/data'; import { Button, InlineField, useStyles2 } from '@grafana/ui'; -import { mergeLogsVolumeDataFrames, isLogsVolumeLimited, getLogsVolumeMaximumRange } from '../logs/utils'; +import { mergeLogsVolumeDataFrames, isLogsVolumeLimited, getLogsVolumeMaximumRange } from '../../logs/utils'; +import { SupplementaryResultError } from '../SupplementaryResultError'; import { LogsVolumePanel } from './LogsVolumePanel'; -import { SupplementaryResultError } from './SupplementaryResultError'; import { isTimeoutErrorResponse } from './utils/logsVolumeResponse'; type Props = { diff --git a/public/app/features/explore/utils/LogsCrossFadeTransition.tsx b/public/app/features/explore/Logs/utils/LogsCrossFadeTransition.tsx similarity index 100% rename from public/app/features/explore/utils/LogsCrossFadeTransition.tsx rename to public/app/features/explore/Logs/utils/LogsCrossFadeTransition.tsx diff --git a/public/app/features/explore/utils/logs.ts b/public/app/features/explore/Logs/utils/logs.ts similarity index 100% rename from public/app/features/explore/utils/logs.ts rename to public/app/features/explore/Logs/utils/logs.ts diff --git a/public/app/features/explore/utils/logsVolumeResponse.test.ts b/public/app/features/explore/Logs/utils/logsVolumeResponse.test.ts similarity index 100% rename from public/app/features/explore/utils/logsVolumeResponse.test.ts rename to public/app/features/explore/Logs/utils/logsVolumeResponse.test.ts diff --git a/public/app/features/explore/utils/logsVolumeResponse.ts b/public/app/features/explore/Logs/utils/logsVolumeResponse.ts similarity index 100% rename from public/app/features/explore/utils/logsVolumeResponse.ts rename to public/app/features/explore/Logs/utils/logsVolumeResponse.ts diff --git a/public/app/features/explore/NodeGraphContainer.test.tsx b/public/app/features/explore/NodeGraph/NodeGraphContainer.test.tsx similarity index 100% rename from public/app/features/explore/NodeGraphContainer.test.tsx rename to public/app/features/explore/NodeGraph/NodeGraphContainer.test.tsx diff --git a/public/app/features/explore/NodeGraphContainer.tsx b/public/app/features/explore/NodeGraph/NodeGraphContainer.tsx similarity index 93% rename from public/app/features/explore/NodeGraphContainer.tsx rename to public/app/features/explore/NodeGraph/NodeGraphContainer.tsx index a55d71636d1..afd7a9981a3 100644 --- a/public/app/features/explore/NodeGraphContainer.tsx +++ b/public/app/features/explore/NodeGraph/NodeGraphContainer.tsx @@ -7,11 +7,10 @@ import { applyFieldOverrides, DataFrame, GrafanaTheme2, SplitOpen } from '@grafa import { config, reportInteraction } from '@grafana/runtime'; import { Collapse, useStyles2, useTheme2 } from '@grafana/ui'; -import { NodeGraph } from '../../plugins/panel/nodeGraph'; -import { useCategorizeFrames } from '../../plugins/panel/nodeGraph/useCategorizeFrames'; -import { ExploreId, StoreState } from '../../types'; - -import { useLinks } from './utils/links'; +import { NodeGraph } from '../../../plugins/panel/nodeGraph'; +import { useCategorizeFrames } from '../../../plugins/panel/nodeGraph/useCategorizeFrames'; +import { ExploreId, StoreState } from '../../../types'; +import { useLinks } from '../utils/links'; const getStyles = (theme: GrafanaTheme2) => ({ warningText: css` diff --git a/public/app/features/explore/RawPrometheusContainer.test.tsx b/public/app/features/explore/RawPrometheus/RawPrometheusContainer.test.tsx similarity index 100% rename from public/app/features/explore/RawPrometheusContainer.test.tsx rename to public/app/features/explore/RawPrometheus/RawPrometheusContainer.test.tsx diff --git a/public/app/features/explore/RawPrometheusContainer.tsx b/public/app/features/explore/RawPrometheus/RawPrometheusContainer.tsx similarity index 97% rename from public/app/features/explore/RawPrometheusContainer.tsx rename to public/app/features/explore/RawPrometheus/RawPrometheusContainer.tsx index 517eb695712..fa10a7f55c7 100644 --- a/public/app/features/explore/RawPrometheusContainer.tsx +++ b/public/app/features/explore/RawPrometheus/RawPrometheusContainer.tsx @@ -10,9 +10,9 @@ import { PANEL_BORDER } from 'app/core/constants'; import { StoreState, TABLE_RESULTS_STYLE } from 'app/types'; import { ExploreId, ExploreItemState, TABLE_RESULTS_STYLES, TableResultsStyle } from 'app/types/explore'; -import { MetaInfoText } from './MetaInfoText'; -import RawListContainer from './PrometheusListView/RawListContainer'; -import { getFieldLinksForExplore } from './utils/links'; +import { MetaInfoText } from '../MetaInfoText'; +import RawListContainer from '../PrometheusListView/RawListContainer'; +import { getFieldLinksForExplore } from '../utils/links'; interface RawPrometheusContainerProps { ariaLabel?: string; diff --git a/public/app/features/explore/TableContainer.test.tsx b/public/app/features/explore/Table/TableContainer.test.tsx similarity index 100% rename from public/app/features/explore/TableContainer.test.tsx rename to public/app/features/explore/Table/TableContainer.test.tsx diff --git a/public/app/features/explore/TableContainer.tsx b/public/app/features/explore/Table/TableContainer.tsx similarity index 97% rename from public/app/features/explore/TableContainer.tsx rename to public/app/features/explore/Table/TableContainer.tsx index 767f801f6e9..34ad8d8d807 100644 --- a/public/app/features/explore/TableContainer.tsx +++ b/public/app/features/explore/Table/TableContainer.tsx @@ -7,8 +7,8 @@ import { config } from 'app/core/config'; import { StoreState } from 'app/types'; import { ExploreId, ExploreItemState } from 'app/types/explore'; -import { MetaInfoText } from './MetaInfoText'; -import { getFieldLinksForExplore } from './utils/links'; +import { MetaInfoText } from '../MetaInfoText'; +import { getFieldLinksForExplore } from '../utils/links'; interface TableContainerProps { ariaLabel?: string; diff --git a/public/app/features/logs/components/log-context/LogRowContextModal.tsx b/public/app/features/logs/components/log-context/LogRowContextModal.tsx index 5de66b363f6..1172748793d 100644 --- a/public/app/features/logs/components/log-context/LogRowContextModal.tsx +++ b/public/app/features/logs/components/log-context/LogRowContextModal.tsx @@ -20,8 +20,8 @@ import { DataQuery, TimeZone } from '@grafana/schema'; import { Icon, Button, LoadingBar, Modal, useTheme2 } from '@grafana/ui'; import { dataFrameToLogsModel } from 'app/core/logsModel'; import store from 'app/core/store'; +import { SETTINGS_KEYS } from 'app/features/explore/Logs/utils/logs'; import { splitOpen } from 'app/features/explore/state/main'; -import { SETTINGS_KEYS } from 'app/features/explore/utils/logs'; import { useDispatch } from 'app/types'; import { sortLogRows } from '../../utils';