Skip to content

Commit

Permalink
Merge branch 'master' into newplatform/data-plugin/saved-queries-2
Browse files Browse the repository at this point in the history
  • Loading branch information
elasticmachine authored Dec 2, 2019
2 parents 49dfee8 + 9e24cb2 commit dfbf0bf
Show file tree
Hide file tree
Showing 146 changed files with 2,561 additions and 1,295 deletions.
1 change: 1 addition & 0 deletions src/cli/cluster/cluster_manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,7 @@ export default class ClusterManager {
fromRoot('x-pack/legacy/plugins/reporting/.chromium'),
fromRoot('x-pack/legacy/plugins/siem/cypress'),
fromRoot('x-pack/legacy/plugins/apm/cypress'),
fromRoot('x-pack/legacy/plugins/apm/scripts'),
fromRoot('x-pack/legacy/plugins/canvas/canvas_plugin_src') // prevents server from restarting twice for Canvas plugin changes
];

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,9 @@ import {
applyFiltersPopover,
changeTimeFilter,
extractTimeFilter,
IndexPatternsStart,
} from '../../../../../../plugins/data/public';
import { IndexPatternsStart } from '../../index_patterns';

export const GLOBAL_APPLY_FILTER_ACTION = 'GLOBAL_APPLY_FILTER_ACTION';

interface ActionContext {
Expand Down Expand Up @@ -74,7 +75,7 @@ export function createFilterAction(
if (selectedFilters.length > 1) {
const indexPatterns = await Promise.all(
filters.map(filter => {
return indexPatternsService.indexPatterns.get(filter.meta.index);
return indexPatternsService.indexPatterns.get(filter.meta.index!);
})
);

Expand Down
3 changes: 1 addition & 2 deletions src/legacy/core_plugins/data/public/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ export {
FieldListInterface,
IndexPattern,
IndexPatterns,
StaticIndexPattern,
} from './index_patterns';
export { QueryStringInput } from './query';
export { SearchBar, SearchBarProps } from './search';
Expand All @@ -48,4 +47,4 @@ export {
/** @public static code */
export * from '../common';
export { FilterStateManager } from './filter/filter_manager';
export { getFromSavedObject, getRoutes } from './index_patterns';
export { getFromSavedObject, getRoutes, flattenHitWrapper } from './index_patterns';
19 changes: 18 additions & 1 deletion src/legacy/core_plugins/data/public/index_patterns/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,21 @@
* under the License.
*/

export * from './index_patterns_service';
import { IFieldType, IIndexPattern, indexPatterns } from '../../../../../plugins/data/public';

const getFromSavedObject = indexPatterns.getFromSavedObject;
const getRoutes = indexPatterns.getRoutes;
const flattenHitWrapper = indexPatterns.flattenHitWrapper;

export { getFromSavedObject, getRoutes, flattenHitWrapper };
export { IFieldType as FieldType };
export { IIndexPattern as StaticIndexPattern };
export {
Field,
FieldListInterface,
IndexPattern,
IndexPatterns,
IndexPatternsStart,
IndexPatternsSetup,
IndexPatternsService,
} from '../../../../../plugins/data/public';
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
*/
import { isEmpty } from 'lodash';
import { IUiSettingsClient, SavedObjectsClientContract } from 'src/core/public';
import { getFromSavedObject } from '../../../index_patterns';
import { getFromSavedObject } from '../../../';

export async function fetchIndexPatterns(
savedObjectsClient: SavedObjectsClientContract,
Expand Down
2 changes: 1 addition & 1 deletion src/legacy/core_plugins/data/public/shim/legacy_module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import { once } from 'lodash';

// @ts-ignore
import { uiModules } from 'ui/modules';
import { IndexPatterns } from '../index_patterns/index_patterns';
import { IndexPatterns } from '../';

/** @internal */
export const initLegacyModule = once((indexPatterns: IndexPatterns): void => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import { mount } from 'enzyme';
import { IndexPattern } from 'ui/index_patterns';
// @ts-ignore
import { findTestSubject } from '@elastic/eui/lib/test';
import { flattenHitWrapper } from '../../../../data/public/index_patterns/index_patterns/flatten_hit';
import { flattenHitWrapper } from '../../../../data/public/';
import { DocViewTable } from './table';

// @ts-ignore
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,15 +47,15 @@ import {

// @ts-ignore
import { initDashboardApp } from './legacy_app';
import { DataStart } from '../../../data/public';
import { DataStart, IndexPatterns } from '../../../data/public';
import { IEmbeddableStart } from '../../../../../plugins/embeddable/public';
import { NavigationStart } from '../../../navigation/public';
import { DataPublicPluginStart as NpDataStart } from '../../../../../plugins/data/public';
import { SharePluginStart } from '../../../../../plugins/share/public';

export interface RenderDeps {
core: LegacyCoreStart;
indexPatterns: DataStart['indexPatterns']['indexPatterns'];
indexPatterns: IndexPatterns;
dataStart: DataStart;
npDataStart: NpDataStart;
navigation: NavigationStart;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
* under the License.
*/

import { StaticIndexPattern } from 'plugins/data';
import moment from 'moment';
import { Subscription } from 'rxjs';

Expand All @@ -31,7 +30,13 @@ import {
import { ViewMode } from '../../../embeddable_api/public/np_ready/public';
import { SavedObjectDashboard } from './saved_dashboard/saved_dashboard';
import { DashboardAppState, SavedDashboardPanel, ConfirmModalFn } from './types';
import { TimeRange, Query, esFilters, SavedQuery } from '../../../../../../src/plugins/data/public';
import {
IIndexPattern,
TimeRange,
Query,
esFilters,
SavedQuery,
} from '../../../../../../src/plugins/data/public';

import { DashboardAppController } from './dashboard_app_controller';
import { RenderDeps } from './application';
Expand All @@ -54,7 +59,7 @@ export interface DashboardAppScope extends ng.IScope {
savedQuery?: SavedQuery;
refreshInterval: any;
panels: SavedDashboardPanel[];
indexPatterns: StaticIndexPattern[];
indexPatterns: IIndexPattern[];
$evalAsync: any;
dashboardViewMode: ViewMode;
expandedPanel?: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ import {
unhashUrl,
} from './legacy_imports';
import { FilterStateManager, IndexPattern } from '../../../data/public';
import { Query, SavedQuery } from '../../../../../plugins/data/public';
import { Query, SavedQuery, IndexPatterns } from '../../../../../plugins/data/public';

import './dashboard_empty_screen_directive';

Expand Down Expand Up @@ -78,9 +78,7 @@ export interface DashboardAppControllerDependencies extends RenderDeps {
$routeParams: any;
getAppState: any;
globalState: State;
indexPatterns: {
getDefault: () => Promise<IndexPattern>;
};
indexPatterns: IndexPatterns;
dashboardConfig: any;
kbnUrl: KbnUrl;
AppStateClass: TAppStateClass<DashboardAppState>;
Expand Down Expand Up @@ -171,7 +169,7 @@ export class DashboardAppController {
} else {
indexPatterns.getDefault().then(defaultIndexPattern => {
$scope.$evalAsync(() => {
$scope.indexPatterns = [defaultIndexPattern];
$scope.indexPatterns = [defaultIndexPattern as IndexPattern];
});
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@
* under the License.
*/

import { StaticIndexPattern } from '../../../kibana_services';
import { IIndexPattern } from '../../../../../../../../plugins/data/public';
import { SortOrder } from '../components/table_header/helpers';

export function getSort(
sort?: SortOrder[],
indexPattern?: StaticIndexPattern,
indexPattern?: IIndexPattern,
defaultSortOrder?: SortOrder
): any;
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,9 @@
*/

import { EmbeddableInput, EmbeddableOutput, IEmbeddable } from 'src/plugins/embeddable/public';
import { StaticIndexPattern } from '../kibana_services';
import { SavedSearch } from '../types';
import { SortOrder } from '../angular/doc_table/components/table_header/helpers';
import { esFilters, TimeRange, Query } from '../../../../../../plugins/data/public';
import { esFilters, IIndexPattern, TimeRange, Query } from '../../../../../../plugins/data/public';

export interface SearchInput extends EmbeddableInput {
timeRange: TimeRange;
Expand All @@ -34,7 +33,7 @@ export interface SearchInput extends EmbeddableInput {

export interface SearchOutput extends EmbeddableOutput {
editUrl: string;
indexPatterns?: StaticIndexPattern[];
indexPatterns?: IIndexPattern[];
editable: boolean;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ import { KbnUrlProvider, RedirectWhenMissingProvider } from 'ui/url';
// @ts-ignore
import { createTopNavDirective, createTopNavHelper } from 'ui/kbn_top_nav/kbn_top_nav';
import { configureAppAngularModule } from 'ui/legacy_compat';
import { IndexPatterns } from '../../../data/public/index_patterns/index_patterns';
import { IndexPatterns } from '../../../../../plugins/data/public';
import { Storage } from '../../../../../plugins/kibana_utils/public';
import { NavigationStart } from '../../../navigation/public';
import { createDocTableDirective } from './angular/doc_table/doc_table';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ export { unhashUrl } from 'ui/state_management/state_hashing';

// EXPORT types
export { Vis } from 'ui/vis';
export { StaticIndexPattern, IndexPatterns, IndexPattern, FieldType } from 'ui/index_patterns';
export { IndexPatterns, IndexPattern, FieldType } from 'ui/index_patterns';
export { ElasticSearchHit } from 'ui/registry/doc_views_types';
export { DocViewRenderProps, DocViewRenderFn } from 'ui/registry/doc_views';
export { Adapters } from 'ui/inspector/types';
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,7 @@
* under the License.
*/

import { setup as data } from '../../../../../../../data/public/legacy';
const { FieldImpl: Field } = data.indexPatterns.__LEGACY;

import { Field } from '../../../../../../../../../plugins/data/public';
import { RegistryFieldFormatEditorsProvider } from 'ui/registry/field_format_editors';
import { docTitle } from 'ui/doc_title';
import { KbnUrlProvider } from 'ui/url';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,15 @@
* under the License.
*/

import {
getServices,
getFromSavedObject,
StaticIndexPattern,
VisSavedObject,
} from '../kibana_services';
import { getServices, getFromSavedObject, VisSavedObject } from '../kibana_services';

import { IIndexPattern } from '../../../../../../plugins/data/public';

const { savedObjectsClient, uiSettings } = getServices();

export async function getIndexPattern(
savedVis: VisSavedObject
): Promise<StaticIndexPattern | undefined> {
): Promise<IIndexPattern | undefined> {
if (savedVis.vis.type.name !== 'metrics') {
return savedVis.vis.indexPattern;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
*/

import _, { forEach } from 'lodash';
import { StaticIndexPattern } from 'ui/index_patterns';
import { PersistedState } from 'ui/persisted_state';
import { Subscription } from 'rxjs';
import * as Rx from 'rxjs';
Expand All @@ -33,6 +32,7 @@ import { IExpressionLoaderParams } from 'src/plugins/expressions/public';
import { SearchSourceContract } from '../../../../../ui/public/courier';
import { VISUALIZE_EMBEDDABLE_TYPE } from './constants';
import {
IIndexPattern,
TimeRange,
Query,
onlyDisabledFiltersChanged,
Expand Down Expand Up @@ -61,7 +61,7 @@ export interface VisSavedObject extends SavedObject {

export interface VisualizeEmbeddableConfiguration {
savedVisualization: VisSavedObject;
indexPatterns?: StaticIndexPattern[];
indexPatterns?: IIndexPattern[];
editUrl: string;
editable: boolean;
appState?: AppState;
Expand All @@ -81,7 +81,7 @@ export interface VisualizeInput extends EmbeddableInput {

export interface VisualizeOutput extends EmbeddableOutput {
editUrl: string;
indexPatterns?: StaticIndexPattern[];
indexPatterns?: IIndexPattern[];
savedObjectId: string;
visTypeName: string;
}
Expand Down Expand Up @@ -149,8 +149,6 @@ export class VisualizeEmbeddable extends Embeddable<VisualizeInput, VisualizeOut

this.vis._setUiState(this.uiState);

this.appState = appState;

this.subscriptions.push(
Rx.merge(this.getOutput$(), this.getInput$()).subscribe(() => {
this.handleChanges();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,6 @@ export {

// export types
export { METRIC_TYPE };
export { StaticIndexPattern } from 'ui/index_patterns';
export { AppState } from 'ui/state_management/app_state';
export { VisType } from 'ui/vis';

Expand Down

This file was deleted.

Loading

0 comments on commit dfbf0bf

Please sign in to comment.