mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Chore: Remove sharemodal and search service barrel files (#97563)
* refactor(search-service): delete barrel file and update imports across frontend * refactor(sharemodal): delete barrel file and update imports * refactor(search-service): update features/search/service imports * chore(betterer): update results file
This commit is contained in:
parent
9a3f8c93dc
commit
1ff0978efe
@ -2519,10 +2519,6 @@ exports[`better eslint`] = {
|
||||
"public/app/features/dashboard/components/ShareModal/SharePublicDashboard/SharePublicDashboard.tsx:5381": [
|
||||
[0, 0, 0, "No untranslated strings. Wrap text with <Trans />", "0"]
|
||||
],
|
||||
"public/app/features/dashboard/components/ShareModal/index.ts:5381": [
|
||||
[0, 0, 0, "Do not re-export imported variable (\`./ShareModal\`)", "0"],
|
||||
[0, 0, 0, "Do not use export all (\`export * from ...\`)", "1"]
|
||||
],
|
||||
"public/app/features/dashboard/components/SubMenu/DashboardLinksDashboard.tsx:5381": [
|
||||
[0, 0, 0, "Do not use any type assertions.", "0"],
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "1"]
|
||||
@ -3772,10 +3768,6 @@ exports[`better eslint`] = {
|
||||
[0, 0, 0, "Do not use any type assertions.", "0"],
|
||||
[0, 0, 0, "Do not use any type assertions.", "1"]
|
||||
],
|
||||
"public/app/features/search/service/index.ts:5381": [
|
||||
[0, 0, 0, "Do not use export all (\`export * from ...\`)", "0"],
|
||||
[0, 0, 0, "Do not re-export imported variable (\`./searcher\`)", "1"]
|
||||
],
|
||||
"public/app/features/search/service/sql.ts:5381": [
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "0"]
|
||||
],
|
||||
|
@ -8,7 +8,8 @@ import { getGrafanaContextMock } from 'test/mocks/getGrafanaContextMock';
|
||||
import { DataFrame, DataFrameView, FieldType } from '@grafana/data';
|
||||
import { config } from '@grafana/runtime';
|
||||
import { HOME_NAV_ID } from 'app/core/reducers/navModel';
|
||||
import { DashboardQueryResult, getGrafanaSearcher, QueryResponse } from 'app/features/search/service';
|
||||
import { getGrafanaSearcher } from 'app/features/search/service/searcher';
|
||||
import { DashboardQueryResult, QueryResponse } from 'app/features/search/service/types';
|
||||
|
||||
import { Page } from '../Page/Page';
|
||||
|
||||
|
@ -10,7 +10,8 @@ import { Alert, Icon, Input, LoadingBar, useStyles2 } from '@grafana/ui';
|
||||
import { t } from 'app/core/internationalization';
|
||||
import { skipToken, useGetFolderQuery } from 'app/features/browse-dashboards/api/browseDashboardsAPI';
|
||||
import { DashboardViewItemWithUIItems, DashboardsTreeItem } from 'app/features/browse-dashboards/types';
|
||||
import { QueryResponse, getGrafanaSearcher } from 'app/features/search/service';
|
||||
import { getGrafanaSearcher } from 'app/features/search/service/searcher';
|
||||
import { QueryResponse } from 'app/features/search/service/types';
|
||||
import { queryResultToViewItem } from 'app/features/search/service/utils';
|
||||
import { DashboardViewItem } from 'app/features/search/types';
|
||||
import { PermissionLevelString } from 'app/types';
|
||||
|
@ -3,7 +3,7 @@ import { useAsync } from 'react-use';
|
||||
import { SelectableValue } from '@grafana/data';
|
||||
import { Icon, Select } from '@grafana/ui';
|
||||
import { DEFAULT_SORT } from 'app/features/search/constants';
|
||||
import { getGrafanaSearcher } from 'app/features/search/service';
|
||||
import { getGrafanaSearcher } from 'app/features/search/service/searcher';
|
||||
|
||||
export interface Props {
|
||||
onChange: (sortValue: SelectableValue) => void;
|
||||
|
@ -3,7 +3,7 @@ import { LocationService } from '@grafana/runtime';
|
||||
import appEvents from 'app/core/app_events';
|
||||
import { getExploreUrl } from 'app/core/utils/explore';
|
||||
import { SaveDashboardDrawer } from 'app/features/dashboard/components/SaveDashboard/SaveDashboardDrawer';
|
||||
import { ShareModal } from 'app/features/dashboard/components/ShareModal';
|
||||
import { ShareModal } from 'app/features/dashboard/components/ShareModal/ShareModal';
|
||||
import { DashboardModel } from 'app/features/dashboard/state/DashboardModel';
|
||||
|
||||
import { getTimeSrv } from '../../features/dashboard/services/TimeSrv';
|
||||
|
@ -7,7 +7,7 @@ import { FilterInput, useStyles2 } from '@grafana/ui';
|
||||
import { Page } from 'app/core/components/Page/Page';
|
||||
import { t } from 'app/core/internationalization';
|
||||
import { ActionRow } from 'app/features/search/page/components/ActionRow';
|
||||
import { getGrafanaSearcher } from 'app/features/search/service';
|
||||
import { getGrafanaSearcher } from 'app/features/search/service/searcher';
|
||||
|
||||
import { useDispatch } from '../../types';
|
||||
|
||||
|
@ -1,5 +1,6 @@
|
||||
import { DataFrame, DataFrameView, FieldType } from '@grafana/data';
|
||||
import { DashboardQueryResult, getGrafanaSearcher, QueryResponse } from 'app/features/search/service';
|
||||
import { getGrafanaSearcher } from 'app/features/search/service/searcher';
|
||||
import { DashboardQueryResult, QueryResponse } from 'app/features/search/service/types';
|
||||
|
||||
import { listDashboards } from './services';
|
||||
|
||||
|
@ -1,6 +1,7 @@
|
||||
import { config, getBackendSrv } from '@grafana/runtime';
|
||||
import { GENERAL_FOLDER_UID } from 'app/features/search/constants';
|
||||
import { getGrafanaSearcher, NestedFolderDTO } from 'app/features/search/service';
|
||||
import { getGrafanaSearcher } from 'app/features/search/service/searcher';
|
||||
import { NestedFolderDTO } from 'app/features/search/service/types';
|
||||
import { queryResultToViewItem } from 'app/features/search/service/utils';
|
||||
import { DashboardViewItem } from 'app/features/search/types';
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { ActionRow } from 'app/features/search/page/components/ActionRow';
|
||||
import { getGrafanaSearcher } from 'app/features/search/service';
|
||||
import { getGrafanaSearcher } from 'app/features/search/service/searcher';
|
||||
import { useSearchStateManager } from 'app/features/search/state/SearchStateManager';
|
||||
|
||||
export function BrowseFilters() {
|
||||
|
@ -2,7 +2,8 @@ import { DataFrame, DataFrameView, FieldType } from '@grafana/data';
|
||||
import { config } from '@grafana/runtime';
|
||||
import { ContextSrv, contextSrv } from 'app/core/services/context_srv';
|
||||
import impressionSrv from 'app/core/services/impression_srv';
|
||||
import { DashboardQueryResult, getGrafanaSearcher, QueryResponse } from 'app/features/search/service';
|
||||
import { getGrafanaSearcher } from 'app/features/search/service/searcher';
|
||||
import { DashboardQueryResult, QueryResponse } from 'app/features/search/service/types';
|
||||
|
||||
import { getRecentDashboardActions, getSearchResultActions } from './dashboardActions';
|
||||
|
||||
|
@ -5,7 +5,7 @@ import { config } from '@grafana/runtime';
|
||||
import { t } from 'app/core/internationalization';
|
||||
import { contextSrv } from 'app/core/services/context_srv';
|
||||
import impressionSrv from 'app/core/services/impression_srv';
|
||||
import { getGrafanaSearcher } from 'app/features/search/service';
|
||||
import { getGrafanaSearcher } from 'app/features/search/service/searcher';
|
||||
|
||||
import { CommandPaletteAction } from '../types';
|
||||
import { RECENT_DASHBOARDS_PRIORITY, SEARCH_RESULTS_PRIORITY } from '../values';
|
||||
|
@ -1,2 +0,0 @@
|
||||
export { ShareModal, addDashboardShareTab, addPanelShareTab } from './ShareModal';
|
||||
export * from './types';
|
@ -32,7 +32,7 @@ import { DashboardPrompt } from '../components/DashboardPrompt/DashboardPrompt';
|
||||
import { DashboardSettings } from '../components/DashboardSettings';
|
||||
import { PanelInspector } from '../components/Inspector/PanelInspector';
|
||||
import { PanelEditor } from '../components/PanelEditor/PanelEditor';
|
||||
import { ShareModal } from '../components/ShareModal';
|
||||
import { ShareModal } from '../components/ShareModal/ShareModal';
|
||||
import { SubMenu } from '../components/SubMenu/SubMenu';
|
||||
import { DashboardGrid } from '../dashgrid/DashboardGrid';
|
||||
import { liveTimer } from '../dashgrid/liveTimer';
|
||||
|
@ -6,7 +6,7 @@ import appEvents from 'app/core/app_events';
|
||||
import config from 'app/core/config';
|
||||
import { LS_PANEL_COPY_KEY, PANEL_BORDER } from 'app/core/constants';
|
||||
import store from 'app/core/store';
|
||||
import { ShareModal } from 'app/features/dashboard/components/ShareModal';
|
||||
import { ShareModal } from 'app/features/dashboard/components/ShareModal/ShareModal';
|
||||
import { DashboardModel } from 'app/features/dashboard/state/DashboardModel';
|
||||
import { PanelModel } from 'app/features/dashboard/state/PanelModel';
|
||||
import { UnlinkModal } from 'app/features/dashboard-scene/scene/UnlinkModal';
|
||||
|
@ -4,7 +4,7 @@ import userEvent from '@testing-library/user-event';
|
||||
import { PanelPluginMeta, PluginMetaInfo, PluginType } from '@grafana/data';
|
||||
import { config } from '@grafana/runtime';
|
||||
import { Panel } from '@grafana/schema';
|
||||
import { getGrafanaSearcher } from 'app/features/search/service';
|
||||
import { getGrafanaSearcher } from 'app/features/search/service/searcher';
|
||||
|
||||
import { backendSrv } from '../../../../core/services/backend_srv';
|
||||
import * as panelUtils from '../../../panel/state/util';
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { getGrafanaSearcher } from 'app/features/search/service';
|
||||
import { getGrafanaSearcher } from 'app/features/search/service/searcher';
|
||||
|
||||
class ValidationError extends Error {
|
||||
type: string;
|
||||
|
@ -8,7 +8,7 @@ import { DashboardPicker } from 'app/core/components/Select/DashboardPicker';
|
||||
import { TagFilter } from 'app/core/components/TagFilter/TagFilter';
|
||||
import { Trans, t } from 'app/core/internationalization';
|
||||
|
||||
import { getGrafanaSearcher } from '../search/service';
|
||||
import { getGrafanaSearcher } from '../search/service/searcher';
|
||||
|
||||
import { PlaylistTable } from './PlaylistTable';
|
||||
import { Playlist } from './types';
|
||||
|
@ -5,7 +5,7 @@ import configureMockStore from 'redux-mock-store';
|
||||
import { locationService } from '@grafana/runtime';
|
||||
import { setStore } from 'app/store/store';
|
||||
|
||||
import { DashboardQueryResult } from '../search/service';
|
||||
import { DashboardQueryResult } from '../search/service/types';
|
||||
|
||||
import { PlaylistSrv } from './PlaylistSrv';
|
||||
import { Playlist, PlaylistItem } from './types';
|
||||
|
@ -10,7 +10,8 @@ import { dispatch } from 'app/store/store';
|
||||
|
||||
import { ScopedResourceClient } from '../apiserver/client';
|
||||
import { Resource, ResourceForCreate, ResourceClient } from '../apiserver/types';
|
||||
import { DashboardQueryResult, getGrafanaSearcher, SearchQuery } from '../search/service';
|
||||
import { getGrafanaSearcher } from '../search/service/searcher';
|
||||
import { DashboardQueryResult, SearchQuery } from '../search/service/types';
|
||||
|
||||
import { Playlist, PlaylistItem, PlaylistAPI } from './types';
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { DashboardQueryResult } from '../search/service';
|
||||
import { DashboardQueryResult } from '../search/service/types';
|
||||
|
||||
export type PlaylistMode = boolean | 'tv';
|
||||
|
||||
|
@ -9,7 +9,8 @@ import { config } from '@grafana/runtime';
|
||||
import { Alert, Spinner, useStyles2 } from '@grafana/ui';
|
||||
import EmptyListCTA from 'app/core/components/EmptyListCTA/EmptyListCTA';
|
||||
import { SearchResultsTable } from 'app/features/search/page/components/SearchResultsTable';
|
||||
import { getGrafanaSearcher, SearchQuery } from 'app/features/search/service';
|
||||
import { getGrafanaSearcher } from 'app/features/search/service/searcher';
|
||||
import { SearchQuery } from 'app/features/search/service/types';
|
||||
|
||||
type Props = {
|
||||
plugin: PluginMeta;
|
||||
|
@ -4,7 +4,7 @@ import { Observable, Subject } from 'rxjs';
|
||||
import { Field, locationUtil } from '@grafana/data';
|
||||
import { locationService } from '@grafana/runtime';
|
||||
|
||||
import { QueryResponse } from '../service';
|
||||
import { QueryResponse } from '../service/types';
|
||||
|
||||
export function useKeyNavigationListener() {
|
||||
const eventsRef = useRef(new Subject<React.KeyboardEvent>());
|
||||
|
@ -3,7 +3,8 @@ import { Subject } from 'rxjs';
|
||||
|
||||
import { applyFieldOverrides, createTheme, DataFrame, DataFrameView, FieldType, toDataFrame } from '@grafana/data';
|
||||
|
||||
import { DashboardQueryResult, getGrafanaSearcher, QueryResponse } from '../../service';
|
||||
import { getGrafanaSearcher } from '../../service/searcher';
|
||||
import { DashboardQueryResult, QueryResponse } from '../../service/types';
|
||||
import { DashboardSearchItemType } from '../../types';
|
||||
|
||||
import { SearchResultsTable } from './SearchResultsTable';
|
||||
|
@ -14,7 +14,7 @@ import { useTableStyles } from '@grafana/ui/src/components/Table/styles';
|
||||
import { useCustomFlexLayout } from 'app/features/browse-dashboards/components/customFlexTableLayout';
|
||||
|
||||
import { useSearchKeyboardNavigation } from '../../hooks/useSearchKeyboardSelection';
|
||||
import { QueryResponse } from '../../service';
|
||||
import { QueryResponse } from '../../service/types';
|
||||
import { SelectionChecker, SelectionToggle } from '../selection';
|
||||
|
||||
import { generateColumns } from './columns';
|
||||
|
@ -18,7 +18,7 @@ import { formatDate, formatDuration } from 'app/core/internationalization/dates'
|
||||
import { PluginIconName } from 'app/features/plugins/admin/types';
|
||||
import { ShowModalReactEvent } from 'app/types/events';
|
||||
|
||||
import { QueryResponse, SearchResultMeta } from '../../service';
|
||||
import { QueryResponse, SearchResultMeta } from '../../service/types';
|
||||
import { getIconForKind } from '../../service/utils';
|
||||
import { SelectionChecker, SelectionToggle } from '../selection';
|
||||
|
||||
|
@ -9,10 +9,9 @@ import {
|
||||
import { config, getBackendSrv } from '@grafana/runtime';
|
||||
import { TermCount } from 'app/core/components/TagFilter/TagFilter';
|
||||
|
||||
import { DashboardQueryResult, GrafanaSearcher, QueryResponse, SearchQuery, SearchResultMeta } from './types';
|
||||
import { replaceCurrentFolderQuery } from './utils';
|
||||
|
||||
import { DashboardQueryResult, GrafanaSearcher, QueryResponse, SearchQuery, SearchResultMeta } from '.';
|
||||
|
||||
// The backend returns an empty frame with a special name to indicate that the indexing engine is being rebuilt,
|
||||
// and that it can not serve any search requests. We are temporarily using the old SQL Search API as a fallback when that happens.
|
||||
const loadingFrameName = 'Loading';
|
||||
|
@ -1,7 +1,7 @@
|
||||
import { SelectableValue, DataFrame, DataFrameView } from '@grafana/data';
|
||||
import { TermCount } from 'app/core/components/TagFilter/TagFilter';
|
||||
|
||||
import { GrafanaSearcher, QueryResponse, SearchQuery } from '.';
|
||||
import { GrafanaSearcher, QueryResponse, SearchQuery } from './types';
|
||||
|
||||
// This is a dummy search useful for tests
|
||||
export class DummySearcher implements GrafanaSearcher {
|
||||
|
@ -3,7 +3,7 @@ import uFuzzy from '@leeoniya/ufuzzy';
|
||||
import { DataFrameView, SelectableValue } from '@grafana/data';
|
||||
import { TermCount } from 'app/core/components/TagFilter/TagFilter';
|
||||
|
||||
import { DashboardQueryResult, GrafanaSearcher, QueryResponse, SearchQuery } from '.';
|
||||
import { DashboardQueryResult, GrafanaSearcher, QueryResponse, SearchQuery } from './types';
|
||||
|
||||
export class FrontendSearcher implements GrafanaSearcher {
|
||||
readonly cache = new Map<string, Promise<FullResultCache>>();
|
||||
|
@ -1,2 +0,0 @@
|
||||
export * from './types';
|
||||
export { getGrafanaSearcher } from './searcher';
|
@ -7,11 +7,9 @@ import { PermissionLevelString } from 'app/types';
|
||||
import { DEFAULT_MAX_VALUES, GENERAL_FOLDER_UID, TYPE_KIND_MAP } from '../constants';
|
||||
import { DashboardSearchHit, DashboardSearchItemType } from '../types';
|
||||
|
||||
import { LocationInfo } from './types';
|
||||
import { DashboardQueryResult, GrafanaSearcher, LocationInfo, QueryResponse, SearchQuery } from './types';
|
||||
import { replaceCurrentFolderQuery } from './utils';
|
||||
|
||||
import { DashboardQueryResult, GrafanaSearcher, QueryResponse, SearchQuery } from '.';
|
||||
|
||||
interface APIQuery {
|
||||
query?: string;
|
||||
tag?: string[];
|
||||
|
@ -9,10 +9,9 @@ import {
|
||||
import { config, getBackendSrv } from '@grafana/runtime';
|
||||
import { TermCount } from 'app/core/components/TagFilter/TagFilter';
|
||||
|
||||
import { DashboardQueryResult, GrafanaSearcher, QueryResponse, SearchQuery, SearchResultMeta } from './types';
|
||||
import { replaceCurrentFolderQuery } from './utils';
|
||||
|
||||
import { DashboardQueryResult, GrafanaSearcher, QueryResponse, SearchQuery, SearchResultMeta } from '.';
|
||||
|
||||
// The backend returns an empty frame with a special name to indicate that the indexing engine is being rebuilt,
|
||||
// and that it can not serve any search requests. We are temporarily using the old SQL Search API as a fallback when that happens.
|
||||
const loadingFrameName = 'Loading';
|
||||
|
@ -1,7 +1,8 @@
|
||||
import { DataFrameView } from '@grafana/data';
|
||||
import { locationService } from '@grafana/runtime';
|
||||
|
||||
import { DashboardQueryResult, getGrafanaSearcher } from '../service';
|
||||
import { getGrafanaSearcher } from '../service/searcher';
|
||||
import { DashboardQueryResult } from '../service/types';
|
||||
import { SearchLayout } from '../types';
|
||||
import * as utils from '../utils';
|
||||
|
||||
|
@ -13,7 +13,8 @@ import {
|
||||
reportSearchQueryInteraction,
|
||||
reportSearchResultInteraction,
|
||||
} from '../page/reporting';
|
||||
import { getGrafanaSearcher, SearchQuery } from '../service';
|
||||
import { getGrafanaSearcher } from '../service/searcher';
|
||||
import { SearchQuery } from '../service/types';
|
||||
import { SearchLayout, SearchQueryParams, SearchState } from '../types';
|
||||
import { parseRouteParams } from '../utils';
|
||||
|
||||
|
@ -2,7 +2,7 @@ import { Action } from 'redux';
|
||||
|
||||
import { WithAccessControlMetadata } from '@grafana/data';
|
||||
|
||||
import { QueryResponse } from './service';
|
||||
import { QueryResponse } from './service/types';
|
||||
|
||||
export enum DashboardSearchItemType {
|
||||
DashDB = 'dash-db',
|
||||
|
@ -34,7 +34,7 @@ import {
|
||||
import { hasAlphaPanels } from 'app/core/config';
|
||||
import * as DFImport from 'app/features/dataframe-import';
|
||||
import { getManagedChannelInfo } from 'app/features/live/info';
|
||||
import { SearchQuery } from 'app/features/search/service';
|
||||
import { SearchQuery } from 'app/features/search/service/types';
|
||||
|
||||
import { GrafanaDatasource } from '../datasource';
|
||||
import { defaultQuery, GrafanaQuery, GrafanaQueryType } from '../types';
|
||||
|
@ -2,7 +2,7 @@ import { useEffect, useState } from 'react';
|
||||
import * as React from 'react';
|
||||
|
||||
import { InlineField, Input, InlineFieldRow, CodeEditor } from '@grafana/ui';
|
||||
import { SearchQuery } from 'app/features/search/service';
|
||||
import { SearchQuery } from 'app/features/search/service/types';
|
||||
|
||||
interface Props {
|
||||
value: SearchQuery;
|
||||
|
@ -2,7 +2,7 @@ import { DataFrameJSON } from '@grafana/data';
|
||||
import { LiveDataFilter } from '@grafana/runtime';
|
||||
import { DataQuery } from '@grafana/schema';
|
||||
import { TimeRegionConfig } from 'app/core/utils/timeRegions';
|
||||
import { SearchQuery } from 'app/features/search/service';
|
||||
import { SearchQuery } from 'app/features/search/service/types';
|
||||
|
||||
//----------------------------------------------
|
||||
// Query
|
||||
|
Loading…
Reference in New Issue
Block a user