Skip to content

Commit

Permalink
Merge branch '7.x' into backport/7.x/pr-110971
Browse files Browse the repository at this point in the history
  • Loading branch information
kibanamachine authored Sep 16, 2021
2 parents 01154a8 + d560d74 commit a94c240
Show file tree
Hide file tree
Showing 334 changed files with 1,346 additions and 3,055 deletions.
1 change: 0 additions & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ snapshots.js
/src/core/lib/kbn_internal_native_observable
/src/plugins/data/common/es_query/kuery/ast/_generated_/**
/src/plugins/vis_types/timelion/common/_generated_/**
/x-pack/plugins/apm/e2e/tmp/*
/x-pack/plugins/canvas/canvas_plugin
/x-pack/plugins/canvas/shareable_runtime/build
/x-pack/plugins/canvas/storybook/build
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ it('produces the right watch and ignore list', () => {
<absolute path>/x-pack/test/plugin_functional/plugins/resolver_test/docs/**,
<absolute path>/x-pack/plugins/reporting/chromium,
<absolute path>/x-pack/plugins/security_solution/cypress,
<absolute path>/x-pack/plugins/apm/e2e,
<absolute path>/x-pack/plugins/apm/scripts,
<absolute path>/x-pack/plugins/canvas/canvas_plugin_src,
<absolute path>/x-pack/plugins/cases/server/scripts,
Expand Down
1 change: 0 additions & 1 deletion packages/kbn-cli-dev-mode/src/get_server_watch_paths.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ export function getServerWatchPaths({ pluginPaths, pluginScanDirs }: Options) {
...pluginInternalDirsIgnore,
fromRoot('x-pack/plugins/reporting/chromium'),
fromRoot('x-pack/plugins/security_solution/cypress'),
fromRoot('x-pack/plugins/apm/e2e'),
fromRoot('x-pack/plugins/apm/scripts'),
fromRoot('x-pack/plugins/canvas/canvas_plugin_src'), // prevents server from restarting twice for Canvas plugin changes,
fromRoot('x-pack/plugins/cases/server/scripts'),
Expand Down
1 change: 0 additions & 1 deletion src/dev/precommit_hook/casing_check_config.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ export const IGNORE_FILE_GLOBS = [
// TODO fix file names in APM to remove these
'x-pack/plugins/apm/public/**/*',
'x-pack/plugins/apm/scripts/**/*',
'x-pack/plugins/apm/e2e/**/*',

'x-pack/plugins/maps/server/fonts/**/*',

Expand Down
4 changes: 0 additions & 4 deletions src/dev/typescript/projects.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,6 @@ export const PROJECTS = [
createProject('x-pack/plugins/osquery/cypress/tsconfig.json', {
name: 'osquery/cypress',
}),
createProject('x-pack/plugins/apm/e2e/tsconfig.json', {
name: 'apm/cypress',
disableTypeCheck: true,
}),
createProject('x-pack/plugins/apm/ftr_e2e/tsconfig.json', {
name: 'apm/ftr_e2e',
disableTypeCheck: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* Side Public License, v 1.
*/

import { DataView } from './index_pattern';
import { DataView } from './data_view';

export interface DataViewCache {
get: (id: string) => Promise<DataView> | undefined;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ import { DATA_VIEW_SAVED_OBJECT_TYPE, SavedObjectsClientCommon } from '../..';

import { createDataViewCache } from '.';
import type { RuntimeField } from '../types';
import { DataView } from './index_pattern';
import { createEnsureDefaultDataView, EnsureDefaultDataView } from './ensure_default_index_pattern';
import { DataView } from './data_view';
import { createEnsureDefaultDataView, EnsureDefaultDataView } from './ensure_default_data_view';
import {
OnNotification,
OnError,
Expand Down Expand Up @@ -241,7 +241,7 @@ export class DataViewsService {
/**
* Checks if current user has a user created index pattern ignoring fleet's server default index patterns
*/
async hasUserIndexPattern(): Promise<boolean> {
async hasUserDataView(): Promise<boolean> {
return this.apiClient.hasUserIndexPattern();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,17 @@
*/

import { includes } from 'lodash';
import { DataViewsContract } from './index_patterns';
import { DataViewsContract } from './data_views';
import { UiSettingsCommon } from '../types';

export type EnsureDefaultDataView = () => Promise<unknown> | undefined;

export const createEnsureDefaultDataView = (
uiSettings: UiSettingsCommon,
onRedirectNoIndexPattern: () => Promise<unknown> | void
onRedirectNoDefaultView: () => Promise<unknown> | void
) => {
/**
* Checks whether a default index pattern is set and exists and defines
* Checks whether a default data view is set and exists and defines
* one otherwise.
*/
return async function ensureDefaultDataView(this: DataViewsContract) {
Expand All @@ -36,12 +36,12 @@ export const createEnsureDefaultDataView = (
}

// If there is any user index pattern created, set the first as default
// if there is 0 patterns, then don't even call `hasUserIndexPattern()`
if (patterns.length >= 1 && (await this.hasUserIndexPattern().catch(() => true))) {
// if there is 0 patterns, then don't even call `hasUserDataView()`
if (patterns.length >= 1 && (await this.hasUserDataView().catch(() => true))) {
defaultId = patterns[0];
await uiSettings.set('defaultIndex', defaultId);
} else {
return onRedirectNoIndexPattern();
return onRedirectNoDefaultView();
}
};
};
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* Side Public License, v 1.
*/

import { IndexPattern } from './index_pattern';
import { IndexPattern } from './data_view';

import { fieldFormatsMock } from '../../../../field_formats/common/mocks';
import { flattenHitWrapper } from './flatten_hit';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
*/

import _ from 'lodash';
import { DataView } from './index_pattern';
import { DataView } from './data_view';

// Takes a hit, merges it with any stored/scripted fields, and with the metaFields
// returns a flattened version
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
*/

import _ from 'lodash';
import { DataView } from './index_pattern';
import { DataView } from './data_view';
import { FieldFormatsContentType } from '../../../../field_formats/common';

const formattedCache = new WeakMap();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@
export * from './_pattern_cache';
export * from './flatten_hit';
export * from './format_hit';
export * from './index_pattern';
export * from './index_patterns';
export * from './data_view';
export * from './data_views';
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
* Side Public License, v 1.
*/

import { IndexPattern } from './index_pattern';
import { IndexPatternSpec } from '../types';
import { IndexPattern } from './data_view';
import { DataViewSpec } from '../types';
import { FieldFormatsStartCommon } from '../../../../field_formats/common';
import { fieldFormatsMock } from '../../../../field_formats/common/mocks';

Expand Down Expand Up @@ -37,7 +37,7 @@ export const createStubIndexPattern = ({
opts,
deps,
}: {
spec: IndexPatternSpec;
spec: DataViewSpec;
opts?: {
shortDotsEnable?: boolean;
metaFields?: string[];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

import { map, last } from 'lodash';

import { IndexPattern } from './index_pattern';
import { IndexPattern } from './data_view';

import { DuplicateField } from '../../../../kibana_utils/common';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

import { i18n } from '@kbn/i18n';
import { ExpressionFunctionDefinition } from 'src/plugins/expressions/common';
import { DataViewsContract } from '../index_patterns';
import { DataViewsContract } from '../data_views';
import { DataViewSpec } from '..';
import { SavedObjectReference } from '../../../../../core/types';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { findIndex } from 'lodash';
import { IFieldType } from './types';
import { DataViewField } from './index_pattern_field';
import { FieldSpec, DataViewFieldMap } from '../types';
import { DataView } from '../index_patterns';
import { DataView } from '../data_views';

type FieldMap = Map<DataViewField['name'], DataViewField>;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
*/

import { IndexPatternField } from './index_pattern_field';
import { IndexPattern } from '../index_patterns';
import { IndexPattern } from '..';
import { KBN_FIELD_TYPES } from '../../../common';
import { FieldSpec, RuntimeField } from '../types';
import { FieldFormat } from '../../../../field_formats/common';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,8 @@ export {
IndexPatternsContract,
DataViewsService,
DataViewsContract,
} from './index_patterns';
export type {
IndexPattern,
IndexPatternListItem,
DataView,
DataViewListItem,
} from './index_patterns';
} from './data_views';
// todo was trying to export this as type but wasn't working
export { IndexPattern, IndexPatternListItem, DataView, DataViewListItem } from './data_views';
export * from './errors';
export * from './expressions';
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
*/

import { stubFieldSpecMap, stubLogstashFieldSpecMap } from './field.stub';
import { createStubIndexPattern } from './index_patterns/index_pattern.stub';
export { createStubIndexPattern } from './index_patterns/index_pattern.stub';
import { createStubIndexPattern } from './data_views/index_pattern.stub';
export { createStubIndexPattern } from './data_views/index_pattern.stub';
import { SavedObject } from '../../../../core/types';
import { IndexPatternAttributes } from '../types';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,9 @@ export class DataViewMissingIndices extends KbnError {
);
}
}

/**
* @deprecated Use DataViewMissingIndices. All index pattern interfaces were renamed.
*/

export class IndexPatternMissingIndices extends DataViewMissingIndices {}
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@
*/

export * from './fields/fields.mocks';
export * from './index_patterns/index_pattern.stub';
export * from './data_views/index_pattern.stub';
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* Side Public License, v 1.
*/

import type { IndexPatternSavedObjectAttrs } from './index_patterns';
import type { IndexPatternSavedObjectAttrs } from './data_views';
import type { SavedObjectsClientCommon } from '../types';

import { DATA_VIEW_SAVED_OBJECT_TYPE } from '../constants';
Expand Down
4 changes: 2 additions & 2 deletions src/plugins/data/common/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

export * from './constants';
export * from './es_query';
export * from './index_patterns';
export * from './data_views';
export * from './kbn_field_types';
export * from './query';
export * from './search';
Expand All @@ -25,4 +25,4 @@ export * from './exports';
* @removeBy 8.1
*/

export { IndexPatternAttributes, DataViewAttributes } from './types';
export { IndexPatternAttributes } from './types';
2 changes: 1 addition & 1 deletion src/plugins/data/common/mocks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@
* Side Public License, v 1.
*/

export * from './index_patterns/fields/fields.mocks';
export * from './data_views/fields/fields.mocks';
2 changes: 1 addition & 1 deletion src/plugins/data/common/search/aggs/agg_config.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import { AggType } from './agg_type';
import { AggTypesRegistryStart } from './agg_types_registry';
import { mockAggTypesRegistry } from './test_helpers';
import { MetricAggType } from './metrics/metric_agg_type';
import { IndexPattern, IndexPatternField, IIndexPatternFieldList } from '../../index_patterns';
import { IndexPattern, IndexPatternField, IIndexPatternFieldList } from '../..';

describe('AggConfig', () => {
let indexPattern: IndexPattern;
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/data/common/search/aggs/agg_configs.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { AggConfig } from './agg_config';
import { AggConfigs } from './agg_configs';
import { AggTypesRegistryStart } from './agg_types_registry';
import { mockAggTypesRegistry } from './test_helpers';
import { IndexPattern } from '../../index_patterns/';
import { IndexPattern } from '../..';
import { stubIndexPattern } from '../../stubs';
import { IEsSearchResponse } from '..';

Expand Down
2 changes: 1 addition & 1 deletion src/plugins/data/common/search/aggs/agg_configs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import { AggConfig, AggConfigSerialized, IAggConfig } from './agg_config';
import { IAggType } from './agg_type';
import { AggTypesRegistryStart } from './agg_types_registry';
import { AggGroupNames } from './agg_groups';
import { IndexPattern } from '../../index_patterns/index_patterns/index_pattern';
import { IndexPattern } from '../..';
import { TimeRange, getTime, calculateBounds } from '../../../common';
import { IBucketAggConfig } from './buckets';
import { insertTimeShiftSplit, mergeTimeShifts } from './utils/time_splits';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ import { AggConfigs, CreateAggConfigParams } from '../agg_configs';
import { BUCKET_TYPES } from './bucket_agg_types';
import { IBucketAggConfig } from './bucket_agg_type';
import { mockAggTypesRegistry } from '../test_helpers';
import type { IndexPatternField } from '../../../index_patterns';
import { IndexPattern } from '../../../index_patterns/index_patterns/index_pattern';
import type { IndexPatternField } from '../../..';
import { IndexPattern } from '../../..';

const indexPattern = {
id: '1234',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import moment from 'moment-timezone';
import { i18n } from '@kbn/i18n';

import { KBN_FIELD_TYPES, TimeRange, TimeRangeBounds, UI_SETTINGS } from '../../../../common';
import { IFieldType } from '../../../index_patterns';
import { IFieldType } from '../../..';

import { ExtendedBounds, extendedBoundsToAst, timerangeToAst } from '../../expressions';
import { intervalOptions, autoInterval, isAutoInterval } from './_interval_options';
Expand Down
4 changes: 2 additions & 2 deletions src/plugins/data/common/search/aggs/buckets/terms.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ import { AggConfigs } from '../agg_configs';
import { METRIC_TYPES } from '../metrics';
import { mockAggTypesRegistry } from '../test_helpers';
import { BUCKET_TYPES } from './bucket_agg_types';
import type { IndexPatternField } from '../../../index_patterns';
import { IndexPattern } from '../../../index_patterns/index_patterns/index_pattern';
import type { IndexPatternField } from '../../..';
import { IndexPattern } from '../../..';

describe('Terms Agg', () => {
describe('order agg editor UI', () => {
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/data/common/search/aggs/param_types/field.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import {
import { BaseParamType } from './base';
import { propFilter } from '../utils';
import { KBN_FIELD_TYPES } from '../../../kbn_field_types/types';
import { isNestedField, IndexPatternField } from '../../../index_patterns/fields';
import { isNestedField, IndexPatternField } from '../../../data_views/fields';

const filterByType = propFilter('type');

Expand Down
2 changes: 1 addition & 1 deletion src/plugins/data/common/search/aggs/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

import { Assign } from '@kbn/utility-types';
import { DatatableColumn } from 'src/plugins/expressions';
import { IndexPattern } from '../../index_patterns/index_patterns/index_pattern';
import { IndexPattern } from '../..';
import {
aggAvg,
aggBucketAvg,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
*/

import { DatatableColumn } from 'src/plugins/expressions/common';
import { IndexPattern } from '../../../index_patterns';
import { IndexPattern } from '../../..';
import { AggConfigs, CreateAggConfigParams } from '../agg_configs';
import { AggTypesRegistryStart } from '../agg_types_registry';
import { IAggType } from '../agg_type';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jest.mock('moment', () => {
return moment;
});

import { IndexPattern, IndexPatternField } from '../../../index_patterns';
import { IndexPattern, IndexPatternField } from '../../..';
import { AggParamsDateHistogram } from '../buckets';
import { inferTimeZone } from './infer_time_zone';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
*/

import moment from 'moment';
import { IndexPattern } from '../../../index_patterns';
import { IndexPattern } from '../../..';
import { AggParamsDateHistogram } from '../buckets';

export function inferTimeZone(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ import { Observable } from 'rxjs';
import type { Datatable, ExpressionFunctionDefinition } from 'src/plugins/expressions/common';
import { buildExpressionFunction } from '../../../../../../plugins/expressions/common';

import { IndexPatternExpressionType } from '../../../index_patterns/expressions';
import { IndexPatternsContract } from '../../../index_patterns/index_patterns';
import { IndexPatternExpressionType } from '../../../data_views/expressions';
import { IndexPatternsContract } from '../../..';

import { AggsStart, AggExpressionType, aggCountFnName } from '../../aggs';
import { ISearchStartSearchSource } from '../../search_source';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import { from } from 'rxjs';
import type { MockedKeys } from '@kbn/utility-types/jest';
import type { Filter } from '../../../es_query';
import type { IndexPattern } from '../../../index_patterns';
import type { IndexPattern } from '../../..';
import type { IAggConfigs } from '../../aggs';
import type { ISearchSource } from '../../search_source';
import { searchSourceCommonMock, searchSourceInstanceMock } from '../../search_source/mocks';
Expand Down
Loading

0 comments on commit a94c240

Please sign in to comment.