Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into ingest/rename-dat…
Browse files Browse the repository at this point in the history
…asources
  • Loading branch information
jen-huang committed Jun 30, 2020
2 parents 2585d2d + 0047eed commit b312459
Show file tree
Hide file tree
Showing 137 changed files with 7,270 additions and 4,821 deletions.
8 changes: 4 additions & 4 deletions docs/glossary.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ See {kibana-ref}/alerting-getting-started.html[Alerts and Actions].
[[glossary-annotation]] annotation ::
// tag::annotation-def[]
A way to augment a data display with descriptive domain knowledge.
// end::alerts-annotation-def[]
// end::annotation-def[]


[[glossary-app]] app ::
Expand Down Expand Up @@ -90,7 +90,7 @@ See {kibana-ref}/canvas.html[Canvas].
// end::canvas-def[]

[[glossary-canvas-language]] Canvas expression language::
// tag::ccanvas-language-def[]
// tag::canvas-language-def[]
A pipeline-based expression language for manipulating and visualizing data.
Includes dozens of functions and other capabilities, such as table transforms,
type casting, and sub-expressions. Supports TinyMath functions for complex math calculations.
Expand Down Expand Up @@ -354,11 +354,11 @@ Timestamped data such as logs, metrics, and events that is indexed on an ongoing


[[glossary-TSVB-data]] TSVB ::
// tag::TSVB-def[]
// tag::tsvb-def[]
A time series data visualizer that allows you to combine an
infinite number of aggregations to display complex data.
See {kibana-ref}/TSVB.html[TSVB].
// end::TSVB-def[]
// end::tsvb-def[]


[float]
Expand Down
1 change: 1 addition & 0 deletions packages/eslint-config-kibana/typescript.js
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ module.exports = {
}],
'@typescript-eslint/no-var-requires': 'error',
'@typescript-eslint/unified-signatures': 'error',
'@typescript-eslint/prefer-ts-expect-error': 'warn',
'constructor-super': 'error',
'dot-notation': 'error',
'eqeqeq': ['error', 'always', {'null': 'ignore'}],
Expand Down
6 changes: 5 additions & 1 deletion src/plugins/discover/public/application/angular/discover.js
Original file line number Diff line number Diff line change
Expand Up @@ -1011,7 +1011,11 @@ function discoverController(
$scope.indexPattern.popularizeField(columnName, 1);
}
const columns = columnActions.removeColumn($scope.state.columns, columnName);
setAppState({ columns });
// The state's sort property is an array of [sortByColumn,sortDirection]
const sort = $scope.state.sort.length
? $scope.state.sort.filter((subArr) => subArr[0] !== columnName)
: [];
setAppState({ columns, sort });
};

$scope.moveColumn = function moveColumn(columnName, newIndex) {
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/usage_collection/public/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import { PluginInitializerContext } from '../../../core/public';
import { UsageCollectionPlugin } from './plugin';

export { METRIC_TYPE } from '@kbn/analytics';
export { UsageCollectionSetup } from './plugin';
export { UsageCollectionSetup, UsageCollectionStart } from './plugin';

export function plugin(initializerContext: PluginInitializerContext) {
return new UsageCollectionPlugin(initializerContext);
Expand Down
15 changes: 15 additions & 0 deletions test/functional/apps/discover/_discover.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import expect from '@kbn/expect';

export default function ({ getService, getPageObjects }) {
const browser = getService('browser');
const log = getService('log');
const retry = getService('retry');
const esArchiver = getService('esArchiver');
Expand Down Expand Up @@ -268,5 +269,19 @@ export default function ({ getService, getPageObjects }) {
expect(toastMessage).to.be('Invalid time range');
});
});

describe('managing fields', function () {
it('should add a field, sort by it, remove it and also sorting by it', async function () {
await PageObjects.timePicker.setDefaultAbsoluteRangeViaUiSettings();
await PageObjects.common.navigateToApp('discover');
await PageObjects.discover.clickFieldListItemAdd('_score');
await PageObjects.discover.clickFieldSort('_score');
const currentUrlWithScore = await browser.getCurrentUrl();
expect(currentUrlWithScore).to.contain('_score');
await PageObjects.discover.clickFieldListItemAdd('_score');
const currentUrlWithoutScore = await browser.getCurrentUrl();
expect(currentUrlWithoutScore).not.to.contain('_score');
});
});
});
}
4 changes: 4 additions & 0 deletions test/functional/page_objects/discover_page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,10 @@ export function DiscoverPageProvider({ getService, getPageObjects }: FtrProvider
return await testSubjects.click(`field-${field}`);
}

public async clickFieldSort(field: string) {
return await testSubjects.click(`docTableHeaderFieldSort_${field}`);
}

public async clickFieldListItemAdd(field: string) {
await testSubjects.moveMouseTo(`field-${field}`);
await testSubjects.click(`fieldToggle-${field}`);
Expand Down
5 changes: 1 addition & 4 deletions x-pack/plugins/apm/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,13 @@ module.exports = {
roots: [`${rootDir}/common`, `${rootDir}/public`, `${rootDir}/server`],
collectCoverage: true,
collectCoverageFrom: [
...jestConfig.collectCoverageFrom,
'**/*.{js,mjs,jsx,ts,tsx}',
'!**/{__test__,__snapshots__,__examples__,integration_tests,tests}/**',
'!**/*.stories.{js,mjs,ts,tsx}',
'!**/*.test.{js,mjs,ts,tsx}',
'!**/dev_docs/**',
'!**/e2e/**',
'!**/scripts/**',
'!**/target/**',
'!**/typings/**',
'!**/mocks/**',
],
coverageDirectory: `${rootDir}/target/coverage/jest`,
coverageReporters: ['html'],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@

import { i18n } from '@kbn/i18n';
import { sum } from 'lodash';
// eslint-disable-next-line @kbn/eslint/no-restricted-paths
import { FetchDataParams } from '../../../../observability/public/data_handler';
import { ApmFetchDataResponse } from '../../../../observability/public/typings/fetch_data_response';
import {
ApmFetchDataResponse,
FetchDataParams,
} from '../../../../observability/public';
import { callApmApi } from './createCallApmApi';
import { Theme } from '../../utils/get_theme';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,13 +147,14 @@ async function init() {
}

async function isSecurityEnabled() {
interface XPackInfo {
features: { security?: { allow_rbac: boolean } };
try {
await callKibana({
url: `/internal/security/me`,
});
return true;
} catch (err) {
return false;
}
const { features } = await callKibana<XPackInfo>({
url: `/api/xpack/v1/info`,
});
return features.security?.allow_rbac;
}

async function callKibana<T>(options: AxiosRequestConfig): Promise<T> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
* you may not use this file except in compliance with the Elastic License.
*/
import { rangeFilter } from '../../../common/utils/range_filter';
import { Coordinates } from '../../../../observability/public/typings/fetch_data_response';
import { Coordinates } from '../../../../observability/public';
import { PROCESSOR_EVENT } from '../../../common/elasticsearch_fieldnames';
import { Setup, SetupTimeRange } from '../helpers/setup_request';
import { ProcessorEvent } from '../../../common/processor_event';
Expand Down
2 changes: 0 additions & 2 deletions x-pack/plugins/canvas/canvas_plugin_src/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ import { modelSpecs } from './uis/models';
import { initializeViews } from './uis/views';
import { initializeArgs } from './uis/arguments';
import { tagSpecs } from './uis/tags';
import { templateSpecs } from './templates';

interface SetupDeps {
canvas: CanvasSetup;
Expand Down Expand Up @@ -59,7 +58,6 @@ export class CanvasSrcPlugin implements Plugin<void, void, SetupDeps, StartDeps>
plugins.canvas.addViewUIs(initializeViews(core, plugins));
plugins.canvas.addArgumentUIs(initializeArgs(core, plugins));
plugins.canvas.addTagUIs(tagSpecs);
plugins.canvas.addTemplates(templateSpecs);
plugins.canvas.addTransformUIs(transformSpecs);
}

Expand Down
21 changes: 0 additions & 21 deletions x-pack/plugins/canvas/canvas_plugin_src/templates/index.ts

This file was deleted.

Loading

0 comments on commit b312459

Please sign in to comment.