mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 09:48:58 -04:00
Remove references to deprecated IIndexPattern. (#109347)
This commit is contained in:
parent
4d115dcaa2
commit
cb3d353a36
3 changed files with 11 additions and 11 deletions
|
@ -7,7 +7,7 @@
|
|||
import rison, { RisonValue } from 'rison-node';
|
||||
import type { SeriesUrl, UrlFilter } from '../types';
|
||||
import type { AllSeries, AllShortSeries } from '../hooks/use_series_storage';
|
||||
import { IIndexPattern } from '../../../../../../../../src/plugins/data/common/index_patterns';
|
||||
import { IndexPattern } from '../../../../../../../../src/plugins/data/common/index_patterns';
|
||||
import { esFilters, ExistsFilter } from '../../../../../../../../src/plugins/data/public';
|
||||
import { URL_KEYS } from './constants/url_constants';
|
||||
import { PersistableFilter } from '../../../../../../lens/common';
|
||||
|
@ -53,7 +53,7 @@ export function createExploratoryViewUrl(allSeries: AllSeries, baseHref = '') {
|
|||
);
|
||||
}
|
||||
|
||||
export function buildPhraseFilter(field: string, value: string, indexPattern: IIndexPattern) {
|
||||
export function buildPhraseFilter(field: string, value: string, indexPattern: IndexPattern) {
|
||||
const fieldMeta = indexPattern?.fields.find((fieldT) => fieldT.name === field);
|
||||
if (fieldMeta) {
|
||||
return [esFilters.buildPhraseFilter(fieldMeta, value, indexPattern)];
|
||||
|
@ -61,7 +61,7 @@ export function buildPhraseFilter(field: string, value: string, indexPattern: II
|
|||
return [];
|
||||
}
|
||||
|
||||
export function buildPhrasesFilter(field: string, value: string[], indexPattern: IIndexPattern) {
|
||||
export function buildPhrasesFilter(field: string, value: string[], indexPattern: IndexPattern) {
|
||||
const fieldMeta = indexPattern?.fields.find((fieldT) => fieldT.name === field);
|
||||
if (fieldMeta) {
|
||||
return [esFilters.buildPhrasesFilter(fieldMeta, value, indexPattern)];
|
||||
|
@ -69,7 +69,7 @@ export function buildPhrasesFilter(field: string, value: string[], indexPattern:
|
|||
return [];
|
||||
}
|
||||
|
||||
export function buildExistsFilter(field: string, indexPattern: IIndexPattern) {
|
||||
export function buildExistsFilter(field: string, indexPattern: IndexPattern) {
|
||||
const fieldMeta = indexPattern?.fields.find((fieldT) => fieldT.name === field);
|
||||
if (fieldMeta) {
|
||||
return [esFilters.buildExistsFilter(fieldMeta, indexPattern)];
|
||||
|
@ -86,7 +86,7 @@ export function urlFilterToPersistedFilter({
|
|||
}: {
|
||||
urlFilters: UrlFilter[];
|
||||
initFilters: FiltersType;
|
||||
indexPattern: IIndexPattern;
|
||||
indexPattern: IndexPattern;
|
||||
}) {
|
||||
const parsedFilters: FiltersType = initFilters ? [...initFilters] : [];
|
||||
|
||||
|
|
|
@ -13,14 +13,14 @@ import { ObservabilityPublicPluginsStart } from '../../../../plugin';
|
|||
import { ObservabilityIndexPatterns } from '../utils/observability_index_patterns';
|
||||
import { getDataHandler } from '../../../../data_handler';
|
||||
|
||||
export interface IIndexPatternContext {
|
||||
export interface IndexPatternContext {
|
||||
loading: boolean;
|
||||
indexPatterns: IndexPatternState;
|
||||
hasAppData: HasAppDataState;
|
||||
loadIndexPattern: (params: { dataType: AppDataType }) => void;
|
||||
}
|
||||
|
||||
export const IndexPatternContext = createContext<Partial<IIndexPatternContext>>({});
|
||||
export const IndexPatternContext = createContext<Partial<IndexPatternContext>>({});
|
||||
|
||||
interface ProviderProps {
|
||||
children: JSX.Element;
|
||||
|
@ -46,7 +46,7 @@ export function IndexPatternContextProvider({ children }: ProviderProps) {
|
|||
services: { data },
|
||||
} = useKibana<ObservabilityPublicPluginsStart>();
|
||||
|
||||
const loadIndexPattern: IIndexPatternContext['loadIndexPattern'] = useCallback(
|
||||
const loadIndexPattern: IndexPatternContext['loadIndexPattern'] = useCallback(
|
||||
async ({ dataType }) => {
|
||||
if (hasAppData[dataType] === null && !loading[dataType]) {
|
||||
setLoading((prevState) => ({ ...prevState, [dataType]: true }));
|
||||
|
@ -101,7 +101,7 @@ export function IndexPatternContextProvider({ children }: ProviderProps) {
|
|||
|
||||
export const useAppIndexPatternContext = (dataType?: AppDataType) => {
|
||||
const { loading, hasAppData, loadIndexPattern, indexPatterns } = useContext(
|
||||
(IndexPatternContext as unknown) as Context<IIndexPatternContext>
|
||||
(IndexPatternContext as unknown) as Context<IndexPatternContext>
|
||||
);
|
||||
|
||||
if (dataType && !indexPatterns?.[dataType] && !loading) {
|
||||
|
|
|
@ -17,7 +17,7 @@ import {
|
|||
} from '../../../../../lens/public';
|
||||
|
||||
import { PersistableFilter } from '../../../../../lens/common';
|
||||
import { IIndexPattern } from '../../../../../../../src/plugins/data/public';
|
||||
import { IndexPattern } from '../../../../../../../src/plugins/data/public';
|
||||
|
||||
export const ReportViewTypes = {
|
||||
dist: 'data-distribution',
|
||||
|
@ -91,7 +91,7 @@ export interface UrlFilter {
|
|||
}
|
||||
|
||||
export interface ConfigProps {
|
||||
indexPattern: IIndexPattern;
|
||||
indexPattern: IndexPattern;
|
||||
series?: SeriesUrl;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue