Skip to content

Commit

Permalink
Merge branch 'master' into alerting/view-in-app
Browse files Browse the repository at this point in the history
* master:
  [NP] Cutover ensureDefaultIndexPattern to kibana_utils (elastic#59895)
  Closes elastic#60265. Adds Beta badge to service map (elastic#60482)
  [Visualize] Duplicated query filters in es request (elastic#60106)
  [ML] Disable functional transform tests
  Fixes to service map single node banner (elastic#60072)
  [Uptime] replace fetch with kibana http (elastic#59881)
  Upgrade @types/node to match Node.js runtime (elastic#60368)
  • Loading branch information
gmmorris committed Mar 18, 2020
2 parents 4584654 + 965679a commit 02b6be3
Show file tree
Hide file tree
Showing 94 changed files with 767 additions and 971 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ esFilters: {
getPhraseFilterField: (filter: import("../common").PhraseFilter) => string;
getPhraseFilterValue: (filter: import("../common").PhraseFilter) => string | number | boolean;
getDisplayValueFromFilter: typeof getDisplayValueFromFilter;
compareFilters: (first: import("../common").Filter | import("../common").Filter[], second: import("../common").Filter | import("../common").Filter[], comparatorOptions?: import("./query/filter_manager/lib/compare_filters").FilterCompareOptions) => boolean;
COMPARE_ALL_OPTIONS: import("./query/filter_manager/lib/compare_filters").FilterCompareOptions;
compareFilters: (first: import("../common").Filter | import("../common").Filter[], second: import("../common").Filter | import("../common").Filter[], comparatorOptions?: import("../common").FilterCompareOptions) => boolean;
COMPARE_ALL_OPTIONS: import("../common").FilterCompareOptions;
generateFilters: typeof generateFilters;
onlyDisabledFiltersChanged: (newFilters?: import("../common").Filter[] | undefined, oldFilters?: import("../common").Filter[] | undefined) => boolean;
changeTimeFilter: typeof changeTimeFilter;
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
"url": "https://github.com/elastic/kibana.git"
},
"resolutions": {
"**/@types/node": "10.12.27",
"**/@types/node": ">=10.17.17 <10.20.0",
"**/@types/react": "^16.9.19",
"**/@types/react-router": "^5.1.3",
"**/@types/hapi": "^17.0.18",
Expand Down Expand Up @@ -351,7 +351,7 @@
"@types/mocha": "^5.2.7",
"@types/moment-timezone": "^0.5.12",
"@types/mustache": "^0.8.31",
"@types/node": "^10.12.27",
"@types/node": ">=10.17.17 <10.20.0",
"@types/node-forge": "^0.9.0",
"@types/normalize-path": "^3.0.0",
"@types/numeral": "^0.0.26",
Expand Down
8 changes: 7 additions & 1 deletion packages/kbn-dev-utils/src/run/run.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
* under the License.
*/

import { inspect } from 'util';

// @ts-ignore @types are outdated and module is super simple
import exitHook from 'exit-hook';

Expand Down Expand Up @@ -62,7 +64,11 @@ export async function run(fn: RunFn, options: Options = {}) {

process.on('unhandledRejection', error => {
log.error('UNHANDLED PROMISE REJECTION');
log.error(error);
log.error(
error instanceof Error
? error
: new Error(`non-Error type rejection value: ${inspect(error)}`)
);
process.exit(1);
});

Expand Down
5 changes: 4 additions & 1 deletion packages/kbn-pm/dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -39806,6 +39806,7 @@ exports.isFailError = fail_1.isFailError;
*/
Object.defineProperty(exports, "__esModule", { value: true });
const tslib_1 = __webpack_require__(36);
const util_1 = __webpack_require__(29);
// @ts-ignore @types are outdated and module is super simple
const exit_hook_1 = tslib_1.__importDefault(__webpack_require__(348));
const tooling_log_1 = __webpack_require__(415);
Expand All @@ -39825,7 +39826,9 @@ async function run(fn, options = {}) {
});
process.on('unhandledRejection', error => {
log.error('UNHANDLED PROMISE REJECTION');
log.error(error);
log.error(error instanceof Error
? error
: new Error(`non-Error type rejection value: ${util_1.inspect(error)}`));
process.exit(1);
});
const handleErrorWithoutExit = (error) => {
Expand Down
2 changes: 1 addition & 1 deletion packages/kbn-pm/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"@types/lodash.clonedeepwith": "^4.5.3",
"@types/log-symbols": "^2.0.0",
"@types/ncp": "^2.0.1",
"@types/node": "^10.12.27",
"@types/node": ">=10.17.17 <10.20.0",
"@types/ora": "^1.3.5",
"@types/read-pkg": "^4.0.0",
"@types/strip-ansi": "^3.0.0",
Expand Down
7 changes: 6 additions & 1 deletion packages/kbn-test/src/functional_test_runner/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
*/

import { resolve } from 'path';
import { inspect } from 'util';
import { run, createFlagError, Flags } from '@kbn/dev-utils';
import { FunctionalTestRunner } from './functional_test_runner';

Expand Down Expand Up @@ -86,7 +87,11 @@ export function runFtrCli() {
}
};

process.on('unhandledRejection', err => teardown(err));
process.on('unhandledRejection', err =>
teardown(
err instanceof Error ? err : new Error(`non-Error type rejection value: ${inspect(err)}`)
)
);
process.on('SIGTERM', () => teardown());
process.on('SIGINT', () => teardown());

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ export { IInjector } from 'ui/chrome';
export { absoluteToParsedUrl } from 'ui/url/absolute_to_parsed_url';
export {
configureAppAngularModule,
ensureDefaultIndexPattern,
IPrivate,
migrateLegacyQuery,
PrivateProvider,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ import dashboardTemplate from './dashboard_app.html';
import dashboardListingTemplate from './listing/dashboard_listing_ng_wrapper.html';
import { createHashHistory } from 'history';

import { ensureDefaultIndexPattern } from '../legacy_imports';
import { initDashboardAppDirective } from './dashboard_app';
import { createDashboardEditUrl, DashboardConstants } from './dashboard_constants';
import {
createKbnUrlStateStorage,
ensureDefaultIndexPattern,
redirectWhenMissing,
InvalidJSONProperty,
SavedObjectNotFound,
Expand Down Expand Up @@ -137,8 +137,8 @@ export function initDashboardApp(app, deps) {
});
},
resolve: {
dash: function($rootScope, $route, kbnUrl, history) {
return ensureDefaultIndexPattern(deps.core, deps.data, $rootScope, kbnUrl).then(() => {
dash: function($route, history) {
return ensureDefaultIndexPattern(deps.core, deps.data, history).then(() => {
const savedObjectsClient = deps.savedObjectsClient;
const title = $route.current.params.title;
if (title) {
Expand Down Expand Up @@ -172,11 +172,9 @@ export function initDashboardApp(app, deps) {
controller: createNewDashboardCtrl,
requireUICapability: 'dashboard.createNew',
resolve: {
dash: function($rootScope, kbnUrl, history) {
return ensureDefaultIndexPattern(deps.core, deps.data, $rootScope, kbnUrl)
.then(() => {
return deps.savedDashboards.get();
})
dash: history =>
ensureDefaultIndexPattern(deps.core, deps.data, history)
.then(() => deps.savedDashboards.get())
.catch(
redirectWhenMissing({
history,
Expand All @@ -185,22 +183,19 @@ export function initDashboardApp(app, deps) {
},
toastNotifications: deps.core.notifications.toasts,
})
);
},
),
},
})
.when(createDashboardEditUrl(':id'), {
...defaults,
template: dashboardTemplate,
controller: createNewDashboardCtrl,
resolve: {
dash: function($rootScope, $route, kbnUrl, history) {
dash: function($route, kbnUrl, history) {
const id = $route.current.params.id;

return ensureDefaultIndexPattern(deps.core, deps.data, $rootScope, kbnUrl)
.then(() => {
return deps.savedDashboards.get(id);
})
return ensureDefaultIndexPattern(deps.core, deps.data, history)
.then(() => deps.savedDashboards.get(id))
.then(savedDashboard => {
deps.chrome.recentlyAccessed.add(
savedDashboard.getFullPath(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,14 +54,17 @@ import { search } from '../../../../../plugins/data/public';
export const { getRequestInspectorStats, getResponseInspectorStats, tabifyAggResponse } = search;
// @ts-ignore
export { intervalOptions } from 'ui/agg_types';
export { subscribeWithScope } from '../../../../../plugins/kibana_legacy/public';
// @ts-ignore
export { timezoneProvider } from 'ui/vis/lib/timezone';
export { unhashUrl, redirectWhenMissing } from '../../../../../plugins/kibana_utils/public';
export {
unhashUrl,
redirectWhenMissing,
ensureDefaultIndexPattern,
} from '../../../../../plugins/kibana_utils/public';
export {
formatMsg,
formatStack,
subscribeWithScope,
} from '../../../../../plugins/kibana_legacy/public';

// EXPORT types
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,9 @@ app.config($routeProvider => {
template: indexTemplate,
reloadOnSearch: false,
resolve: {
savedObjects: function($route, kbnUrl, Promise, $rootScope) {
savedObjects: function($route, Promise) {
const savedSearchId = $route.current.params.id;
return ensureDefaultIndexPattern(core, data, $rootScope, kbnUrl).then(() => {
return ensureDefaultIndexPattern(core, data, history).then(() => {
const { appStateContainer } = getState({ history });
const { index } = appStateContainer.getState();
return Promise.props({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ export { DashboardConstants } from '../dashboard/np_ready/dashboard_constants';
export { VisSavedObject, VISUALIZE_EMBEDDABLE_TYPE } from '../../../visualizations/public/';
export {
configureAppAngularModule,
ensureDefaultIndexPattern,
IPrivate,
migrateLegacyQuery,
PrivateProvider,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import { createHashHistory } from 'history';
import {
createKbnUrlStateStorage,
redirectWhenMissing,
ensureDefaultIndexPattern,
} from '../../../../../../plugins/kibana_utils/public';

import editorTemplate from './editor/editor.html';
Expand All @@ -32,7 +33,6 @@ import visualizeListingTemplate from './listing/visualize_listing.html';
import { initVisualizeAppDirective } from './visualize_app';
import { VisualizeConstants } from './visualize_constants';
import { VisualizeListingController } from './listing/visualize_listing';
import { ensureDefaultIndexPattern } from '../legacy_imports';

import {
getLandingBreadcrumbs,
Expand Down Expand Up @@ -82,8 +82,7 @@ export function initVisualizeApp(app, deps) {
controllerAs: 'listingController',
resolve: {
createNewVis: () => false,
hasDefaultIndex: ($rootScope, kbnUrl) =>
ensureDefaultIndexPattern(deps.core, deps.data, $rootScope, kbnUrl),
hasDefaultIndex: history => ensureDefaultIndexPattern(deps.core, deps.data, history),
},
})
.when(VisualizeConstants.WIZARD_STEP_1_PAGE_PATH, {
Expand All @@ -94,16 +93,15 @@ export function initVisualizeApp(app, deps) {
controllerAs: 'listingController',
resolve: {
createNewVis: () => true,
hasDefaultIndex: ($rootScope, kbnUrl) =>
ensureDefaultIndexPattern(deps.core, deps.data, $rootScope, kbnUrl),
hasDefaultIndex: history => ensureDefaultIndexPattern(deps.core, deps.data, history),
},
})
.when(VisualizeConstants.CREATE_PATH, {
...defaults,
template: editorTemplate,
k7Breadcrumbs: getCreateBreadcrumbs,
resolve: {
savedVis: function($route, $rootScope, kbnUrl, history) {
savedVis: function($route, history) {
const { core, data, savedVisualizations, visualizations, toastNotifications } = deps;
const visTypes = visualizations.all();
const visType = find(visTypes, { name: $route.current.params.type });
Expand All @@ -121,7 +119,7 @@ export function initVisualizeApp(app, deps) {
);
}

return ensureDefaultIndexPattern(core, data, $rootScope, kbnUrl)
return ensureDefaultIndexPattern(core, data, history)
.then(() => savedVisualizations.get($route.current.params))
.then(savedVis => {
if (savedVis.vis.type.setup) {
Expand All @@ -144,9 +142,9 @@ export function initVisualizeApp(app, deps) {
template: editorTemplate,
k7Breadcrumbs: getEditBreadcrumbs,
resolve: {
savedVis: function($route, $rootScope, kbnUrl, history) {
savedVis: function($route, history) {
const { chrome, core, data, savedVisualizations, toastNotifications } = deps;
return ensureDefaultIndexPattern(core, data, $rootScope, kbnUrl)
return ensureDefaultIndexPattern(core, data, history)
.then(() => savedVisualizations.get($route.current.params.id))
.then(savedVis => {
chrome.recentlyAccessed.add(savedVis.getFullPath(), savedVis.title, savedVis.id);
Expand Down
5 changes: 1 addition & 4 deletions src/legacy/ui/public/legacy_compat/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,4 @@
* under the License.
*/

export {
configureAppAngularModule,
ensureDefaultIndexPattern,
} from '../../../../plugins/kibana_legacy/public';
export { configureAppAngularModule } from '../../../../plugins/kibana_legacy/public';
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
*/

import { compareFilters, COMPARE_ALL_OPTIONS } from './compare_filters';
import { buildEmptyFilter, buildQueryFilter, FilterStateStore } from '../../../../common';
import { buildEmptyFilter, buildQueryFilter, FilterStateStore } from '../../es_query';

describe('filter manager utilities', () => {
describe('compare filters', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
*/

import { defaults, isEqual, omit, map } from 'lodash';
import { FilterMeta, Filter } from '../../../../common';
import { FilterMeta, Filter } from '../../es_query';

export interface FilterCompareOptions {
disabled?: boolean;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,8 @@
*/

import { dedupFilters } from './dedup_filters';
import {
Filter,
IIndexPattern,
IFieldType,
buildRangeFilter,
buildQueryFilter,
FilterStateStore,
} from '../../../../common';
import { Filter, buildRangeFilter, buildQueryFilter, FilterStateStore } from '../../es_query';
import { IIndexPattern, IFieldType } from '../../index_patterns';

describe('filter manager utilities', () => {
let indexPattern: IIndexPattern;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

import { filter, find } from 'lodash';
import { compareFilters, FilterCompareOptions } from './compare_filters';
import { Filter } from '../../../../common';
import { Filter } from '../../es_query';

/**
* Combine 2 filter collections, removing duplicates
Expand Down
22 changes: 22 additions & 0 deletions src/plugins/data/common/query/filter_manager/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/*
* Licensed to Elasticsearch B.V. under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch B.V. licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

export { dedupFilters } from './dedup_filters';
export { uniqFilters } from './uniq_filters';
export { compareFilters, COMPARE_ALL_OPTIONS, FilterCompareOptions } from './compare_filters';
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
*/

import { uniqFilters } from './uniq_filters';
import { buildQueryFilter, Filter, FilterStateStore } from '../../../../common';
import { buildQueryFilter, Filter, FilterStateStore } from '../../es_query';

describe('filter manager utilities', () => {
describe('niqFilter', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
* under the License.
*/
import { each, union } from 'lodash';
import { Filter } from '../../es_query';
import { dedupFilters } from './dedup_filters';
import { Filter } from '../../../../common';

/**
* Remove duplicate filters from an array of filters
Expand Down
1 change: 1 addition & 0 deletions src/plugins/data/common/query/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,5 @@
* under the License.
*/

export * from './filter_manager';
export * from './types';
4 changes: 2 additions & 2 deletions src/plugins/data/public/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,13 @@ import {
isQueryStringFilter,
isRangeFilter,
toggleFilterNegated,
compareFilters,
COMPARE_ALL_OPTIONS,
} from '../common';

import { FilterLabel } from './ui/filter_bar';

import {
compareFilters,
COMPARE_ALL_OPTIONS,
generateFilters,
onlyDisabledFiltersChanged,
changeTimeFilter,
Expand Down
Loading

0 comments on commit 02b6be3

Please sign in to comment.