Skip to content

Commit

Permalink
Merge branch 'master' into IS-40736-disable-filter-with-shift
Browse files Browse the repository at this point in the history
  • Loading branch information
elasticmachine authored Dec 11, 2019
2 parents de46dd3 + eb8c0e3 commit c7f686d
Show file tree
Hide file tree
Showing 140 changed files with 1,455 additions and 1,455 deletions.
6 changes: 0 additions & 6 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,12 +131,6 @@ module.exports = {
'react-hooks/exhaustive-deps': 'off',
},
},
{
files: ['src/plugins/eui_utils/**/*.{js,ts,tsx}'],
rules: {
'react-hooks/exhaustive-deps': 'off',
},
},
{
files: ['src/plugins/kibana_react/**/*.{js,ts,tsx}'],
rules: {
Expand Down
Binary file added docs/images/kibana-status-page-7_5_0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed docs/images/kibana-status-page.png
Binary file not shown.
Binary file added docs/maps/images/top_hits.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 0 additions & 5 deletions docs/maps/indexing-geojson-data-tutorial.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -101,11 +101,6 @@ aggregation.
The remaining default settings are good, but there are a couple of
settings that you might want to change.

. Under *Source settings* > *Grid resolution*, select from the different heat map resolutions.
+
The default "Coarse" looks
good, but feel free to select a different resolution.

. Play around with the *Layer Style* >
*Color range* setting.
+
Expand Down
15 changes: 10 additions & 5 deletions docs/maps/maps-aggregations.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -34,18 +34,23 @@ The point location is the weighted centroid for all geo-points in the gridded ce

[role="xpack"]
[[maps-top-hits-aggregation]]
=== Most recent entities
=== Top hits per entity

Most recent entities uses {es} {ref}/search-aggregations-bucket-terms-aggregation.html[terms aggregation] to group your documents by entity.
Then, {ref}/search-aggregations-metrics-top-hits-aggregation.html[top hits metric aggregation] accumulates the most recent documents for each entry.
You can display the most relevant documents per entity, for example, the most recent GPS tracks per flight.
To get this data, {es} first groups your data using a {ref}/search-aggregations-bucket-terms-aggregation.html[terms aggregation],
then accumulates the most relevant documents based on sort order for each entry using a {ref}/search-aggregations-metrics-top-hits-aggregation.html[top hits metric aggregation].

Most recent entities is available for <<vector-layer, vector layers>> with *Documents* source.
To enable most recent entities, click "Show most recent documents by entity" and configure the following:
Top hits per entity is available for <<vector-layer, vector layers>> with *Documents* source.
To enable top hits:

. In *Sorting*, select the *Show documents per entity* checkbox.
. Set *Entity* to the field that identifies entities in your documents.
This field will be used in the terms aggregation to group your documents into entity buckets.
. Set *Documents per entity* to configure the maximum number of documents accumulated per entity.

[role="screenshot"]
image::maps/images/top_hits.png[]

[role="xpack"]
[[point-to-point]]
=== Point to point
Expand Down
2 changes: 1 addition & 1 deletion docs/maps/search.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ The most common cause for empty layers are searches for a field that exists in o

You can prevent the search bar from applying search context to a layer by configuring the following:

* In *Source settings*, clear the *Apply global filter to source* checkbox to turn off the global search context for the layer source.
* In *Filtering*, clear the *Apply global filter to layer data* checkbox to turn off the global search context for the layer source.

* In *Term joins*, clear the *Apply global filter to join* checkbox to turn off the global search context for the <<terms-join, term join>>.

Expand Down
9 changes: 5 additions & 4 deletions docs/setup/access.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
== Accessing Kibana

Kibana is a web application that you access through port 5601. All you need to do is point your web browser at the
machine where Kibana is running and specify the port number. For example, `localhost:5601` or
`http://YOURDOMAIN.com:5601`.
machine where Kibana is running and specify the port number. For example, `localhost:5601` or `http://YOURDOMAIN.com:5601`.
If you want to allow remote users to connect, set the parameter `server.host` in `kibana.yml` to a non-loopback address.

When you access Kibana, the <<discover,Discover>> page loads by default with the default index pattern selected. The
time filter is set to the last 15 minutes and the search query is set to match-all (\*).
Expand All @@ -15,9 +15,10 @@ If you still don't see any results, it's possible that you don't *have* any docu
[[status]]
=== Checking Kibana Status

You can reach the Kibana server's status page by navigating to `localhost:5601/status`. The status page displays
You can reach the Kibana server's status page by navigating to the status endpoint, for example, `localhost:5601/status`. The status page displays
information about the server's resource usage and lists the installed plugins.

image::images/kibana-status-page.png[]
[role="screenshot"]
image::images/kibana-status-page-7_5_0.png[]

NOTE: For JSON-formatted server status details, use the API endpoint at `localhost:5601/api/status`
34 changes: 16 additions & 18 deletions docs/setup/settings.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,7 @@ if you installed {kib} from an archive distribution (`.tar.gz` or `.zip`), by
default it is in `$KIBANA_HOME/config`. By default, with package distributions
(Debian or RPM), it is in `/etc/kibana`.

The default settings configure Kibana to run on `localhost:5601`. To change the
host or port number, or connect to Elasticsearch running on a different machine,
you'll need to update your `kibana.yml` file. You can also enable SSL and set a
The default host and port settings configure {kib} to run on `localhost:5601`. To change this behavior and allow remote users to connect, you'll need to update your `kibana.yml` file. You can also enable SSL and set a
variety of other options. Finally, environment variables can be injected into
configuration using `${MY_ENV_VAR}` syntax.

Expand All @@ -32,7 +30,7 @@ strongly recommend that you keep the default CSP rules that ship with Kibana.

`csp.strict:`:: *Default: `true`* Blocks access to Kibana to any browser that
does not enforce even rudimentary CSP rules. In practice, this will disable
support for older, less safe browsers like Internet Explorer.
support for older, less safe browsers like Internet Explorer.
See <<csp-strict-mode, Content Security Policy>> for more information.

`csp.warnLegacyBrowsers:`:: *Default: `true`* Shows a warning message after
Expand Down Expand Up @@ -65,7 +63,7 @@ connects to this Kibana instance.
`elasticsearch.requestHeadersWhitelist:`:: *Default: `[ 'authorization' ]`* List
of Kibana client-side headers to send to Elasticsearch. To send *no* client-side
headers, set this value to [] (an empty list).
Removing the `authorization` header from being whitelisted means that you cannot
Removing the `authorization` header from being whitelisted means that you cannot
use <<basic-authentication, basic authentication>> in Kibana.

`elasticsearch.requestTimeout:`:: *Default: 30000* Time in milliseconds to wait
Expand Down Expand Up @@ -164,19 +162,19 @@ The following example shows a valid logging rotate configuration:
enable log rotation. If you do not have a `logging.dest` set that is different from `stdout`
that feature would not take any effect.

`logging.rotate.everyBytes:`:: [experimental] *Default: 10485760* The maximum size of a log file (that is `not an exact` limit). After the
`logging.rotate.everyBytes:`:: [experimental] *Default: 10485760* The maximum size of a log file (that is `not an exact` limit). After the
limit is reached, a new log file is generated. The default size limit is 10485760 (10 MB) and
this option should be at least greater than 1024.

`logging.rotate.keepFiles:`:: [experimental] *Default: 7* The number of most recent rotated log files to keep
on disk. Older files are deleted during log rotation. The default value is 7. The `logging.rotate.keepFiles`
`logging.rotate.keepFiles:`:: [experimental] *Default: 7* The number of most recent rotated log files to keep
on disk. Older files are deleted during log rotation. The default value is 7. The `logging.rotate.keepFiles`
option has to be in the range of 2 to 1024 files.

`logging.rotate.pollingInterval:`:: [experimental] *Default: 10000* The number of milliseconds for the polling strategy in case
`logging.rotate.pollingInterval:`:: [experimental] *Default: 10000* The number of milliseconds for the polling strategy in case
the `logging.rotate.usePolling` is enabled. That option has to be in the range of 5000 to 3600000 milliseconds.

`logging.rotate.usePolling:`:: [experimental] *Default: false* By default we try to understand the best way to monitoring
the log file. However, there is some systems where it could not be always accurate. In those cases, if needed,
`logging.rotate.usePolling:`:: [experimental] *Default: false* By default we try to understand the best way to monitoring
the log file. However, there is some systems where it could not be always accurate. In those cases, if needed,
the `polling` method could be used enabling that option.

`logging.silent:`:: *Default: false* Set the value of this setting to `true` to
Expand Down Expand Up @@ -304,7 +302,7 @@ This setting may not be used when `server.compression.enabled` is set to `false`
send on all responses to the client from the Kibana server.

`server.host:`:: *Default: "localhost"* This setting specifies the host of the
back end server.
back end server. To allow remote users to connect, set the value to the IP address or DNS name of the {kib} server.

`server.keepaliveTimeout:`:: *Default: "120000"* The number of milliseconds to wait for additional data before restarting
the `server.socketTimeout` counter.
Expand Down Expand Up @@ -358,15 +356,15 @@ supported protocols with versions. Valid protocols: `TLSv1`, `TLSv1.1`, `TLSv1.2
setting this to `true` enables unauthenticated users to access the Kibana
server status API and status page.

`telemetry.allowChangingOptInStatus`:: *Default: true*. If `true`,
users are able to change the telemetry setting at a later time in
<<advanced-options, Advanced Settings>>. If `false`,
{kib} looks at the value of `telemetry.optIn` to determine whether to send
`telemetry.allowChangingOptInStatus`:: *Default: true*. If `true`,
users are able to change the telemetry setting at a later time in
<<advanced-options, Advanced Settings>>. If `false`,
{kib} looks at the value of `telemetry.optIn` to determine whether to send
telemetry data or not. `telemetry.allowChangingOptInStatus` and `telemetry.optIn`
cannot be `false` at the same time.

`telemetry.optIn`:: *Default: true* If `true`, telemetry data is sent to Elastic.
If `false`, collection of telemetry data is disabled.
`telemetry.optIn`:: *Default: true* If `true`, telemetry data is sent to Elastic.
If `false`, collection of telemetry data is disabled.
To enable telemetry and prevent users from disabling it,
set `telemetry.allowChangingOptInStatus` to `false` and `telemetry.optIn` to `true`.

Expand Down
6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@
"resolutions": {
"**/@types/node": "10.12.27",
"**/@types/react": "^16.9.13",
"**/@types/react-router": "^5.1.3",
"**/@types/hapi": "^17.0.18",
"**/@types/angular": "^1.6.56",
"**/typescript": "3.7.2",
Expand Down Expand Up @@ -230,7 +231,7 @@
"react-monaco-editor": "~0.27.0",
"react-redux": "^5.1.2",
"react-resize-detector": "^4.2.0",
"react-router-dom": "^4.3.1",
"react-router-dom": "^5.1.2",
"react-sizeme": "^2.3.6",
"react-use": "^13.10.2",
"reactcss": "1.2.3",
Expand Down Expand Up @@ -344,7 +345,8 @@
"@types/react-dom": "^16.9.4",
"@types/react-redux": "^6.0.6",
"@types/react-resize-detector": "^4.0.1",
"@types/react-router-dom": "^4.3.1",
"@types/react-router": "^5.1.3",
"@types/react-router-dom": "^5.1.3",
"@types/react-virtualized": "^9.18.7",
"@types/redux": "^3.6.31",
"@types/redux-actions": "^2.2.1",
Expand Down
2 changes: 1 addition & 1 deletion packages/kbn-analytics/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"kbn:watch": "node scripts/build --source-maps --watch"
},
"devDependencies": {
"@babel/cli": "7.5.5",
"@babel/cli": "^7.5.5",
"@kbn/dev-utils": "1.0.0",
"@kbn/babel-preset": "1.0.0",
"typescript": "3.7.2"
Expand Down
17 changes: 9 additions & 8 deletions src/legacy/ui/public/agg_types/agg_config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ import { i18n } from '@kbn/i18n';
import { npStart } from 'ui/new_platform';
import { SearchSourceContract, FetchOptions } from '../courier/types';
import { AggType } from './agg_type';
import { FieldParamType } from './param_types/field';
import { AggGroupNames } from '../vis/editors/default/agg_groups';
import { writeParams } from './agg_params';
import { AggConfigs } from './agg_configs';
Expand Down Expand Up @@ -204,7 +203,7 @@ export class AggConfig {
}

write(aggs?: AggConfigs) {
return writeParams(this.type.params, this, aggs);
return writeParams<AggConfig>(this.type.params, this, aggs);
}

isFilterable() {
Expand Down Expand Up @@ -425,13 +424,15 @@ export class AggConfig {
}

this.__type = type;
let availableFields = [];

const fieldParam = this.type && this.type.params.find((p: any) => p.type === 'field');

if (fieldParam) {
// @ts-ignore
availableFields = fieldParam.getAvailableFields(this.getIndexPattern().fields);
}

const fieldParam =
this.type && (this.type.params.find((p: any) => p.type === 'field') as FieldParamType);
// @ts-ignore
const availableFields = fieldParam
? fieldParam.getAvailableFields(this.getIndexPattern().fields)
: [];
// clear out the previous params except for a few special ones
this.setParams({
// split row/columns is "outside" of the agg, so don't reset it
Expand Down
7 changes: 5 additions & 2 deletions src/legacy/ui/public/agg_types/agg_configs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,10 @@ export class AggConfigs {
return aggConfigs;
}

createAggConfig(params: AggConfig | AggConfigOptions, { addToAggConfigs = true } = {}) {
createAggConfig<T extends AggConfig = AggConfig>(
params: AggConfig | AggConfigOptions,
{ addToAggConfigs = true } = {}
) {
let aggConfig;
if (params instanceof AggConfig) {
aggConfig = params;
Expand All @@ -137,7 +140,7 @@ export class AggConfigs {
if (addToAggConfigs) {
this.aggs.push(aggConfig);
}
return aggConfig;
return aggConfig as T;
}

/**
Expand Down
11 changes: 6 additions & 5 deletions src/legacy/ui/public/agg_types/agg_params.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,18 @@
* under the License.
*/

import { AggParam, initParams } from './agg_params';
import { initParams } from './agg_params';
import { BaseParamType } from './param_types/base';
import { FieldParamType } from './param_types/field';
import { OptionedParamType } from './param_types/optioned';
import { AggParamType } from '../agg_types/param_types/agg';

jest.mock('ui/new_platform');

describe('AggParams class', () => {
describe('constructor args', () => {
it('accepts an array of param defs', () => {
const params = [{ name: 'one' }, { name: 'two' }] as AggParam[];
const params = [{ name: 'one' }, { name: 'two' }] as AggParamType[];
const aggParams = initParams(params);

expect(aggParams).toHaveLength(params.length);
Expand All @@ -37,7 +38,7 @@ describe('AggParams class', () => {

describe('AggParam creation', () => {
it('Uses the FieldParamType class for params with the name "field"', () => {
const params = [{ name: 'field', type: 'field' }] as AggParam[];
const params = [{ name: 'field', type: 'field' }] as AggParamType[];
const aggParams = initParams(params);

expect(aggParams).toHaveLength(params.length);
Expand All @@ -50,7 +51,7 @@ describe('AggParams class', () => {
name: 'order',
type: 'optioned',
},
];
] as AggParamType[];
const aggParams = initParams(params);

expect(aggParams).toHaveLength(params.length);
Expand All @@ -71,7 +72,7 @@ describe('AggParams class', () => {
name: 'waist',
displayName: 'waist',
},
] as AggParam[];
] as AggParamType[];

const aggParams = initParams(params);

Expand Down
28 changes: 13 additions & 15 deletions src/legacy/ui/public/agg_types/agg_params.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,17 +44,10 @@ export interface AggParamOption {
enabled?(agg: AggConfig): boolean;
}

export interface AggParamConfig {
type: string;
}

export const initParams = <
TAggParam extends AggParam = AggParam,
TAggParamConfig extends AggParamConfig = AggParamConfig
>(
params: TAggParamConfig[]
export const initParams = <TAggParam extends AggParamType = AggParamType>(
params: TAggParam[]
): TAggParam[] =>
params.map((config: TAggParamConfig) => {
params.map((config: TAggParam) => {
const Class = paramTypeMap[config.type] || paramTypeMap._default;

return new Class(config);
Expand All @@ -74,20 +67,25 @@ export const initParams = <
* output object which is used to create the agg dsl for the search request. All other properties
* are dependent on the AggParam#write methods which should be studied for each AggType.
*/
export const writeParams = (
params: AggParam[],
aggConfig: AggConfig,
export const writeParams = <
TAggConfig extends AggConfig = AggConfig,
TAggParam extends AggParamType<TAggConfig> = AggParamType<TAggConfig>
>(
params: Array<Partial<TAggParam>> = [],
aggConfig: TAggConfig,
aggs?: AggConfigs,
locals?: Record<string, any>
) => {
const output = { params: {} as Record<string, any> };
locals = locals || {};

params.forEach(function(param) {
params.forEach(param => {
if (param.write) {
param.write(aggConfig, output, aggs, locals);
} else {
output.params[param.name] = aggConfig.params[param.name];
if (param && param.name) {
output.params[param.name] = aggConfig.params[param.name];
}
}
});

Expand Down
Loading

0 comments on commit c7f686d

Please sign in to comment.