Skip to content

Commit

Permalink
Merge branch 'master' into fix-test/async_dashboard
Browse files Browse the repository at this point in the history
  • Loading branch information
elasticmachine authored Aug 9, 2020
2 parents ef580e8 + c6c300e commit 8248a32
Show file tree
Hide file tree
Showing 262 changed files with 5,927 additions and 3,318 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,10 @@ Creates [IKbnUrlStateStorage](./kibana-plugin-plugins-kibana_utils-public-state_
<b>Signature:</b>

```typescript
createKbnUrlStateStorage: ({ useHash, history }?: {
createKbnUrlStateStorage: ({ useHash, history, onGetError, onSetError, }?: {
useHash: boolean;
history?: History<any> | undefined;
onGetError?: ((error: Error) => void) | undefined;
onSetError?: ((error: Error) => void) | undefined;
}) => IKbnUrlStateStorage
```
4 changes: 2 additions & 2 deletions docs/drilldowns/explore-underlying-data.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ applies the filters and time range created by the events that triggered the acti
[role="screenshot"]
image::images/explore_data_in_chart.png[Explore underlying data from chart]

You can disable this action by adding the following line to your `kibana.yml` config.
To enable this action add the following line to your `kibana.yml` config.

["source","yml"]
-----------
xpack.discoverEnhanced.actions.exploreDataInChart.enabled: false
xpack.discoverEnhanced.actions.exploreDataInChart.enabled: true
-----------
7 changes: 7 additions & 0 deletions docs/glossary.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,13 @@ syslog, Apache, and other webserver logs. See
[[k_glos]]
== K

[[glossary-kibana-privileges]] {kib} privileges ::
// tag::kibana-privileges-def[]
Enable administrators to grant users read-only, read-write, or no access to
individual features within <<glossary-space,spaces>> in {kib}. See
{kibana-ref}/kibana-privileges.html[{kib} privileges].
// end::kibana-privileges-def[]

[[glossary-kql]] {kib} Query Language (KQL) ::
// tag::kql-def[]
The default language for querying in {kib}. KQL provides
Expand Down
12 changes: 5 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -117,9 +117,9 @@
]
},
"dependencies": {
"@babel/core": "^7.10.2",
"@babel/plugin-transform-modules-commonjs": "^7.10.1",
"@babel/register": "^7.10.1",
"@babel/core": "^7.11.1",
"@babel/plugin-transform-modules-commonjs": "^7.10.4",
"@babel/register": "^7.10.5",
"@elastic/apm-rum": "^5.2.0",
"@elastic/charts": "19.8.1",
"@elastic/datemath": "5.0.3",
Expand Down Expand Up @@ -159,7 +159,6 @@
"bluebird": "3.5.5",
"boom": "^7.2.0",
"brace": "0.11.1",
"browserslist-useragent": "^3.0.2",
"cache-loader": "^4.1.0",
"chalk": "^2.4.2",
"check-disk-space": "^2.1.0",
Expand Down Expand Up @@ -290,8 +289,8 @@
"yauzl": "2.10.0"
},
"devDependencies": {
"@babel/parser": "^7.10.2",
"@babel/types": "^7.10.2",
"@babel/parser": "^7.11.2",
"@babel/types": "^7.11.0",
"@elastic/eslint-config-kibana": "0.15.0",
"@elastic/eslint-plugin-eui": "0.0.2",
"@elastic/github-checks-reporter": "0.0.20b3",
Expand Down Expand Up @@ -319,7 +318,6 @@
"@types/babel__core": "^7.1.2",
"@types/bluebird": "^3.1.1",
"@types/boom": "^7.2.0",
"@types/browserslist-useragent": "^3.0.0",
"@types/chance": "^1.0.0",
"@types/cheerio": "^0.22.10",
"@types/chromedriver": "^81.0.0",
Expand Down
4 changes: 2 additions & 2 deletions packages/elastic-datemath/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
"kbn:watch": "yarn build --watch"
},
"devDependencies": {
"@babel/cli": "^7.10.1",
"@babel/preset-env": "^7.10.2",
"@babel/cli": "^7.10.5",
"@babel/preset-env": "^7.11.0",
"babel-plugin-add-module-exports": "^1.0.2",
"moment": "^2.24.0"
},
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.10.1",
"@babel/cli": "^7.10.5",
"@kbn/dev-utils": "1.0.0",
"@kbn/babel-preset": "1.0.0",
"typescript": "3.9.5"
Expand Down
16 changes: 8 additions & 8 deletions packages/kbn-babel-preset/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@
"version": "1.0.0",
"license": "Apache-2.0",
"dependencies": {
"@babel/plugin-proposal-class-properties": "^7.10.1",
"@babel/plugin-proposal-export-namespace-from": "^7.10.1",
"@babel/plugin-proposal-nullish-coalescing-operator": "^7.10.1",
"@babel/plugin-proposal-optional-chaining": "^7.10.1",
"@babel/plugin-proposal-private-methods": "^7.10.1",
"@babel/preset-env": "^7.10.2",
"@babel/preset-react": "^7.10.1",
"@babel/preset-typescript": "^7.10.1",
"@babel/plugin-proposal-class-properties": "^7.10.4",
"@babel/plugin-proposal-export-namespace-from": "^7.10.4",
"@babel/plugin-proposal-nullish-coalescing-operator": "^7.10.4",
"@babel/plugin-proposal-optional-chaining": "^7.11.0",
"@babel/plugin-proposal-private-methods": "^7.10.4",
"@babel/preset-env": "^7.11.0",
"@babel/preset-react": "^7.10.4",
"@babel/preset-typescript": "^7.10.4",
"babel-plugin-add-module-exports": "^1.0.2",
"babel-plugin-filter-imports": "^3.0.0",
"babel-plugin-styled-components": "^1.10.7",
Expand Down
4 changes: 2 additions & 2 deletions packages/kbn-i18n/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
"kbn:watch": "node scripts/build --watch --source-maps"
},
"devDependencies": {
"@babel/cli": "^7.10.1",
"@babel/core": "^7.10.2",
"@babel/cli": "^7.10.5",
"@babel/core": "^7.11.1",
"@kbn/babel-preset": "1.0.0",
"@kbn/dev-utils": "1.0.0",
"@types/intl-relativeformat": "^2.1.0",
Expand Down
10 changes: 5 additions & 5 deletions packages/kbn-interpreter/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,16 @@
"kbn:watch": "node scripts/build --dev --watch"
},
"dependencies": {
"@babel/runtime": "^7.10.2",
"@babel/runtime": "^7.11.2",
"@kbn/i18n": "1.0.0",
"lodash": "^4.17.15",
"uuid": "3.3.2"
},
"devDependencies": {
"@babel/cli": "^7.10.1",
"@babel/core": "^7.10.2",
"@babel/plugin-transform-modules-commonjs": "^7.10.1",
"@babel/plugin-transform-runtime": "^7.10.1",
"@babel/cli": "^7.10.5",
"@babel/core": "^7.11.1",
"@babel/plugin-transform-modules-commonjs": "^7.10.4",
"@babel/plugin-transform-runtime": "^7.11.0",
"@kbn/babel-preset": "1.0.0",
"@kbn/dev-utils": "1.0.0",
"babel-loader": "^8.0.6",
Expand Down
4 changes: 2 additions & 2 deletions packages/kbn-optimizer/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ The [Webpack config][WebpackConfig] is designed to provide the majority of what

Source maps are enabled except when building the distributable. They show the code actually being executed by the browser to strike a balance between debuggability and performance. They are not configurable at this time but will be configurable once we have a developer configuration solution that doesn't rely on the server (see [#55656](https://github.com/elastic/kibana/issues/55656)).

### IE Support
### Browser Support

To make front-end code easier to debug the optimizer uses the `BROWSERSLIST_ENV=dev` environment variable (by default) to build JS and CSS that is compatible with modern browsers. In order to support older browsers like IE in development you will need to specify the `BROWSERSLIST_ENV=production` environment variable or build a distributable for testing.
To make front-end code easier to debug the optimizer uses the `BROWSERSLIST_ENV=dev` environment variable (by default) to build JS and CSS that is compatible with modern browsers. In order to support all browsers that we support with the distributable you will need to specify the `BROWSERSLIST_ENV=production` environment variable or build a distributable for testing.

## Running the optimizer

Expand Down
2 changes: 1 addition & 1 deletion packages/kbn-optimizer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"kbn:watch": "yarn build --watch"
},
"dependencies": {
"@babel/cli": "^7.10.1",
"@babel/cli": "^7.10.5",
"@kbn/babel-preset": "1.0.0",
"@kbn/dev-utils": "1.0.0",
"@kbn/ui-shared-deps": "1.0.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/kbn-plugin-helpers/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"plugin-helpers": "bin/plugin-helpers.js"
},
"dependencies": {
"@babel/core": "^7.10.2",
"@babel/core": "^7.11.1",
"argv-split": "^2.0.1",
"commander": "^3.0.0",
"del": "^5.1.0",
Expand Down
10 changes: 5 additions & 5 deletions packages/kbn-pm/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@
"prettier": "prettier --write './src/**/*.ts'"
},
"devDependencies": {
"@babel/core": "^7.10.2",
"@babel/plugin-proposal-class-properties": "^7.10.1",
"@babel/plugin-proposal-object-rest-spread": "^7.10.1",
"@babel/preset-env": "^7.10.2",
"@babel/preset-typescript": "^7.10.1",
"@babel/core": "^7.11.1",
"@babel/plugin-proposal-class-properties": "^7.10.4",
"@babel/plugin-proposal-object-rest-spread": "^7.11.0",
"@babel/preset-env": "^7.11.0",
"@babel/preset-typescript": "^7.10.4",
"@types/cmd-shim": "^2.0.0",
"@types/cpy": "^5.1.0",
"@types/dedent": "^0.7.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/kbn-test/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"kbn:watch": "yarn build --watch"
},
"devDependencies": {
"@babel/cli": "^7.10.1",
"@babel/cli": "^7.10.5",
"@kbn/babel-preset": "1.0.0",
"@kbn/dev-utils": "1.0.0",
"@types/joi": "^13.4.2",
Expand Down
2 changes: 1 addition & 1 deletion packages/kbn-ui-framework/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"enzyme-adapter-react-16": "^1.9.1"
},
"devDependencies": {
"@babel/core": "^7.10.2",
"@babel/core": "^7.11.1",
"@elastic/eui": "0.0.55",
"@kbn/babel-preset": "1.0.0",
"@kbn/optimizer": "1.0.0",
Expand Down
36 changes: 1 addition & 35 deletions src/core/server/http/base_path_proxy_server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,9 @@ import { Agent as HttpsAgent, ServerOptions as TlsOptions } from 'https';

import apm from 'elastic-apm-node';
import { ByteSizeValue } from '@kbn/config-schema';
import { Server, Request, ResponseToolkit } from 'hapi';
import { Server, Request } from 'hapi';
import HapiProxy from 'h2o2';
import { sampleSize } from 'lodash';
import BrowserslistUserAgent from 'browserslist-useragent';
import * as Rx from 'rxjs';
import { take } from 'rxjs/operators';

Expand All @@ -41,34 +40,6 @@ export interface BasePathProxyServerOptions {
delayUntil: () => Rx.Observable<void>;
}

// Before we proxy request to a target port we may want to wait until some
// condition is met (e.g. until target listener is ready).
const checkForBrowserCompat = (log: Logger) => async (request: Request, h: ResponseToolkit) => {
if (!request.headers['user-agent'] || process.env.BROWSERSLIST_ENV === 'production') {
return h.continue;
}

const matches = BrowserslistUserAgent.matchesUA(request.headers['user-agent'], {
env: 'dev',
allowHigherVersions: true,
ignoreMinor: true,
ignorePath: true,
});

if (!matches) {
log.warn(`
Request with user-agent [${request.headers['user-agent']}]
seems like it is coming from a browser that is not supported by the dev browserlist.
Please run Kibana with the environment variable BROWSERSLIST_ENV=production to enable
support for all production browsers (like IE).
`);
}

return h.continue;
};

export class BasePathProxyServer {
private server?: Server;
private httpsAgent?: HttpsAgent;
Expand Down Expand Up @@ -155,9 +126,6 @@ export class BasePathProxyServer {
},
method: 'GET',
path: '/',
options: {
pre: [checkForBrowserCompat(this.log)],
},
});

this.server.route({
Expand All @@ -175,7 +143,6 @@ export class BasePathProxyServer {
method: '*',
options: {
pre: [
checkForBrowserCompat(this.log),
// Before we proxy request to a target port we may want to wait until some
// condition is met (e.g. until target listener is ready).
async (request, responseToolkit) => {
Expand Down Expand Up @@ -210,7 +177,6 @@ export class BasePathProxyServer {
method: '*',
options: {
pre: [
checkForBrowserCompat(this.log),
// Before we proxy request to a target port we may want to wait until some
// condition is met (e.g. until target listener is ready).
async (request, responseToolkit) => {
Expand Down
2 changes: 2 additions & 0 deletions src/plugins/dashboard/public/application/legacy_app.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import {
createKbnUrlStateStorage,
redirectWhenMissing,
SavedObjectNotFound,
withNotifyOnErrors,
} from '../../../kibana_utils/public';
import { DashboardListing, EMPTY_FILTER } from './listing/dashboard_listing';
import { addHelpMenuToAppChrome } from './help_menu/help_menu_util';
Expand Down Expand Up @@ -65,6 +66,7 @@ export function initDashboardApp(app, deps) {
createKbnUrlStateStorage({
history,
useHash: deps.uiSettings.get('state:storeInSessionStorage'),
...withNotifyOnErrors(deps.core.notifications.toasts),
})
);

Expand Down
1 change: 1 addition & 0 deletions src/plugins/discover/public/application/angular/context.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ function ContextAppRouteController($routeParams, $scope, $route) {
timeFieldName: indexPattern.timeFieldName,
storeInSessionStorage: getServices().uiSettings.get('state:storeInSessionStorage'),
history: getServices().history(),
toasts: getServices().core.notifications.toasts,
});
this.state = { ...appState.getState() };
this.anchorId = $routeParams.id;
Expand Down
11 changes: 11 additions & 0 deletions src/plugins/discover/public/application/angular/context_state.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,13 @@
*/
import _ from 'lodash';
import { History } from 'history';
import { NotificationsStart } from 'kibana/public';
import {
createStateContainer,
createKbnUrlStateStorage,
syncStates,
BaseStateContainer,
withNotifyOnErrors,
} from '../../../../kibana_utils/public';
import { esFilters, FilterManager, Filter, Query } from '../../../../data/public';

Expand Down Expand Up @@ -74,6 +76,13 @@ interface GetStateParams {
* History instance to use
*/
history: History;

/**
* Core's notifications.toasts service
* In case it is passed in,
* kbnUrlStateStorage will use it notifying about inner errors
*/
toasts?: NotificationsStart['toasts'];
}

interface GetStateReturn {
Expand Down Expand Up @@ -123,10 +132,12 @@ export function getState({
timeFieldName,
storeInSessionStorage = false,
history,
toasts,
}: GetStateParams): GetStateReturn {
const stateStorage = createKbnUrlStateStorage({
useHash: storeInSessionStorage,
history,
...(toasts && withNotifyOnErrors(toasts)),
});

const globalStateInitial = stateStorage.get(GLOBAL_STATE_URL_KEY) as GlobalState;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,7 @@ function discoverController($element, $route, $scope, $timeout, $window, Promise
defaultAppState: getStateDefaults(),
storeInSessionStorage: config.get('state:storeInSessionStorage'),
history,
toasts: core.notifications.toasts,
});
if (appStateContainer.getState().index !== $scope.indexPattern.id) {
//used index pattern is different than the given by url/state which is invalid
Expand Down
Loading

0 comments on commit 8248a32

Please sign in to comment.