Skip to content

Commit

Permalink
Merge branch '7.8' into backport/7.8/pr-66432
Browse files Browse the repository at this point in the history
  • Loading branch information
DianaDerevyankina committed Jun 2, 2020
2 parents f7e7bc4 + db3d039 commit 011b1d6
Show file tree
Hide file tree
Showing 85 changed files with 16,255 additions and 1,066 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

## ChromeNavLink.euiIconType property

A EUI iconType that will be used for the app's icon. This icon takes precendence over the `icon` property.
A EUI iconType that will be used for the app's icon. This icon takes precedence over the `icon` property.

<b>Signature:</b>

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [kibana-plugin-core-public](./kibana-plugin-core-public.md) &gt; [ChromeNavLink](./kibana-plugin-core-public.chromenavlink.md) &gt; [href](./kibana-plugin-core-public.chromenavlink.href.md)

## ChromeNavLink.href property

Settled state between `url`<!-- -->, `baseUrl`<!-- -->, and `active`

<b>Signature:</b>

```typescript
readonly href?: string;
```
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,9 @@ export interface ChromeNavLink
| [category](./kibana-plugin-core-public.chromenavlink.category.md) | <code>AppCategory</code> | The category the app lives in |
| [disabled](./kibana-plugin-core-public.chromenavlink.disabled.md) | <code>boolean</code> | Disables a link from being clickable. |
| [disableSubUrlTracking](./kibana-plugin-core-public.chromenavlink.disablesuburltracking.md) | <code>boolean</code> | A flag that tells legacy chrome to ignore the link when tracking sub-urls |
| [euiIconType](./kibana-plugin-core-public.chromenavlink.euiicontype.md) | <code>string</code> | A EUI iconType that will be used for the app's icon. This icon takes precendence over the <code>icon</code> property. |
| [euiIconType](./kibana-plugin-core-public.chromenavlink.euiicontype.md) | <code>string</code> | A EUI iconType that will be used for the app's icon. This icon takes precedence over the <code>icon</code> property. |
| [hidden](./kibana-plugin-core-public.chromenavlink.hidden.md) | <code>boolean</code> | Hides a link from the navigation. |
| [href](./kibana-plugin-core-public.chromenavlink.href.md) | <code>string</code> | Settled state between <code>url</code>, <code>baseUrl</code>, and <code>active</code> |
| [icon](./kibana-plugin-core-public.chromenavlink.icon.md) | <code>string</code> | A URL to an image file used as an icon. Used as a fallback if <code>euiIconType</code> is not provided. |
| [id](./kibana-plugin-core-public.chromenavlink.id.md) | <code>string</code> | A unique identifier for looking up links. |
| [linkToLastSubUrl](./kibana-plugin-core-public.chromenavlink.linktolastsuburl.md) | <code>boolean</code> | Whether or not the subUrl feature should be enabled. |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@
<b>Signature:</b>

```typescript
export declare type ChromeNavLinkUpdateableFields = Partial<Pick<ChromeNavLink, 'active' | 'disabled' | 'hidden' | 'url' | 'subUrlBase'>>;
export declare type ChromeNavLinkUpdateableFields = Partial<Pick<ChromeNavLink, 'active' | 'disabled' | 'hidden' | 'url' | 'subUrlBase' | 'href'>>;
```
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@
<b>Signature:</b>

```typescript
QueryStringInput: React.FC<Pick<Props, "query" | "placeholder" | "onChange" | "onSubmit" | "prepend" | "indexPatterns" | "disableAutoFocus" | "screenTitle" | "persistedLog" | "bubbleSubmitEvent" | "languageSwitcherPopoverAnchorPosition" | "dataTestSubj">>
QueryStringInput: React.FC<Pick<Props, "query" | "placeholder" | "onChange" | "onSubmit" | "prepend" | "indexPatterns" | "dataTestSubj" | "disableAutoFocus" | "screenTitle" | "persistedLog" | "bubbleSubmitEvent" | "languageSwitcherPopoverAnchorPosition">>
```
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<b>Signature:</b>

```typescript
SearchBar: React.ComponentClass<Pick<Pick<SearchBarProps, "query" | "isLoading" | "filters" | "intl" | "indexPatterns" | "refreshInterval" | "screenTitle" | "dataTestSubj" | "customSubmitButton" | "showQueryBar" | "showQueryInput" | "showFilterBar" | "showDatePicker" | "showAutoRefreshOnly" | "isRefreshPaused" | "dateRangeFrom" | "dateRangeTo" | "showSaveQuery" | "savedQuery" | "onQueryChange" | "onQuerySubmit" | "onSaved" | "onSavedQueryUpdated" | "onClearSavedQuery" | "onRefresh" | "timeHistory" | "onFiltersUpdated" | "onRefreshChange">, "query" | "isLoading" | "filters" | "indexPatterns" | "refreshInterval" | "screenTitle" | "dataTestSubj" | "customSubmitButton" | "showQueryBar" | "showQueryInput" | "showFilterBar" | "showDatePicker" | "showAutoRefreshOnly" | "isRefreshPaused" | "dateRangeFrom" | "dateRangeTo" | "showSaveQuery" | "savedQuery" | "onQueryChange" | "onQuerySubmit" | "onSaved" | "onSavedQueryUpdated" | "onClearSavedQuery" | "onRefresh" | "timeHistory" | "onFiltersUpdated" | "onRefreshChange">, any> & {
WrappedComponent: React.ComponentType<Pick<SearchBarProps, "query" | "isLoading" | "filters" | "intl" | "indexPatterns" | "refreshInterval" | "screenTitle" | "dataTestSubj" | "customSubmitButton" | "showQueryBar" | "showQueryInput" | "showFilterBar" | "showDatePicker" | "showAutoRefreshOnly" | "isRefreshPaused" | "dateRangeFrom" | "dateRangeTo" | "showSaveQuery" | "savedQuery" | "onQueryChange" | "onQuerySubmit" | "onSaved" | "onSavedQueryUpdated" | "onClearSavedQuery" | "onRefresh" | "timeHistory" | "onFiltersUpdated" | "onRefreshChange"> & ReactIntl.InjectedIntlProps>;
SearchBar: React.ComponentClass<Pick<Pick<SearchBarProps, "query" | "isLoading" | "filters" | "intl" | "indexPatterns" | "dataTestSubj" | "refreshInterval" | "screenTitle" | "customSubmitButton" | "showQueryBar" | "showQueryInput" | "showFilterBar" | "showDatePicker" | "showAutoRefreshOnly" | "isRefreshPaused" | "dateRangeFrom" | "dateRangeTo" | "showSaveQuery" | "savedQuery" | "onQueryChange" | "onQuerySubmit" | "onSaved" | "onSavedQueryUpdated" | "onClearSavedQuery" | "onRefresh" | "timeHistory" | "onFiltersUpdated" | "onRefreshChange">, "query" | "isLoading" | "filters" | "indexPatterns" | "dataTestSubj" | "refreshInterval" | "screenTitle" | "customSubmitButton" | "showQueryBar" | "showQueryInput" | "showFilterBar" | "showDatePicker" | "showAutoRefreshOnly" | "isRefreshPaused" | "dateRangeFrom" | "dateRangeTo" | "showSaveQuery" | "savedQuery" | "onQueryChange" | "onQuerySubmit" | "onSaved" | "onSavedQueryUpdated" | "onClearSavedQuery" | "onRefresh" | "timeHistory" | "onFiltersUpdated" | "onRefreshChange">, any> & {
WrappedComponent: React.ComponentType<Pick<SearchBarProps, "query" | "isLoading" | "filters" | "intl" | "indexPatterns" | "dataTestSubj" | "refreshInterval" | "screenTitle" | "customSubmitButton" | "showQueryBar" | "showQueryInput" | "showFilterBar" | "showDatePicker" | "showAutoRefreshOnly" | "isRefreshPaused" | "dateRangeFrom" | "dateRangeTo" | "showSaveQuery" | "savedQuery" | "onQueryChange" | "onQuerySubmit" | "onSaved" | "onSavedQueryUpdated" | "onClearSavedQuery" | "onRefresh" | "timeHistory" | "onFiltersUpdated" | "onRefreshChange"> & ReactIntl.InjectedIntlProps>;
}
```
6 changes: 3 additions & 3 deletions docs/index.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@

:include-xpack: true
:lang: en
:kib-repo-dir: {docdir}
:kib-repo-dir: {kibana-root}/docs
:blog-ref: https://www.elastic.co/blog/
:wikipedia: https://en.wikipedia.org/wiki

include::{asciidoc-dir}/../../shared/versions/stack/{source_branch}.asciidoc[]
include::{docs-root}/shared/versions/stack/{source_branch}.asciidoc[]

:docker-repo: docker.elastic.co/kibana/kibana
:docker-image: docker.elastic.co/kibana/kibana:{version}
Expand All @@ -18,7 +18,7 @@ include::{asciidoc-dir}/../../shared/versions/stack/{source_branch}.asciidoc[]
:blob: {repo}blob/{branch}/
:security-ref: https://www.elastic.co/community/security/

include::{asciidoc-dir}/../../shared/attributes.asciidoc[]
include::{docs-root}/shared/attributes.asciidoc[]

include::user/index.asciidoc[]

Expand Down
16 changes: 5 additions & 11 deletions docs/settings/ml-settings.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@
++++

You do not need to configure any settings to use {kib} {ml-features}. They are
enabled by default.
enabled by default.

[[general-ml-settings-kb]]
==== General {ml} settings

[cols="2*<"]
|===
| `xpack.ml.enabled`
| `xpack.ml.enabled` {ess-icon}
| Set to `true` (default) to enable {kib} {ml-features}. +
+
If set to `false` in `kibana.yml`, the {ml} icon is hidden in this {kib}
Expand All @@ -23,13 +23,7 @@ enabled by default.

|===

[[data-visualizer-settings]]
==== {data-viz} settings
[[advanced-ml-settings-kb]]
==== Advanced {ml} settings

[cols="2*<"]
|===
| `xpack.ml.file_data_visualizer.max_file_size`
| Sets the file size limit when importing data in the {data-viz}. The default
value is `100MB`. The highest supported value for this setting is `1GB`.

|===
Refer to <<kibana-ml-settings,Advanced {ml} settings in {kib}>>.
26 changes: 13 additions & 13 deletions docs/setup/settings.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -627,17 +627,17 @@ Valid locales are: `en`, `zh-CN`, `ja-JP`. *Default: `en`*

|===

include::{docdir}/settings/alert-action-settings.asciidoc[]
include::{docdir}/settings/apm-settings.asciidoc[]
include::{docdir}/settings/dev-settings.asciidoc[]
include::{docdir}/settings/graph-settings.asciidoc[]
include::{docdir}/settings/infrastructure-ui-settings.asciidoc[]
include::{docdir}/settings/i18n-settings.asciidoc[]
include::{docdir}/settings/logs-ui-settings.asciidoc[]
include::{docdir}/settings/ml-settings.asciidoc[]
include::{docdir}/settings/monitoring-settings.asciidoc[]
include::{docdir}/settings/reporting-settings.asciidoc[]
include::{kib-repo-dir}/settings/alert-action-settings.asciidoc[]
include::{kib-repo-dir}/settings/apm-settings.asciidoc[]
include::{kib-repo-dir}/settings/dev-settings.asciidoc[]
include::{kib-repo-dir}/settings/graph-settings.asciidoc[]
include::{kib-repo-dir}/settings/infrastructure-ui-settings.asciidoc[]
include::{kib-repo-dir}/settings/i18n-settings.asciidoc[]
include::{kib-repo-dir}/settings/logs-ui-settings.asciidoc[]
include::{kib-repo-dir}/settings/ml-settings.asciidoc[]
include::{kib-repo-dir}/settings/monitoring-settings.asciidoc[]
include::{kib-repo-dir}/settings/reporting-settings.asciidoc[]
include::secure-settings.asciidoc[]
include::{docdir}/settings/security-settings.asciidoc[]
include::{docdir}/settings/spaces-settings.asciidoc[]
include::{docdir}/settings/telemetry-settings.asciidoc[]
include::{kib-repo-dir}/settings/security-settings.asciidoc[]
include::{kib-repo-dir}/settings/spaces-settings.asciidoc[]
include::{kib-repo-dir}/settings/telemetry-settings.asciidoc[]
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,7 @@
"chai": "3.5.0",
"chance": "1.0.18",
"cheerio": "0.22.0",
"chromedriver": "^81.0.0",
"chromedriver": "^83.0.0",
"classnames": "2.2.6",
"dedent": "^0.7.0",
"delete-empty": "^2.0.0",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
body {
color: green;
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
*/

import './legacy/styles.scss';
import './index.scss';
import { fooLibFn } from '../../foo/public/index';
export * from './lib';
export { fooLibFn };

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,17 @@ import { inspect } from 'util';
import cpy from 'cpy';
import del from 'del';
import { toArray, tap } from 'rxjs/operators';
import { createAbsolutePathSerializer, ToolingLog, REPO_ROOT } from '@kbn/dev-utils';
import { ToolingLog, REPO_ROOT } from '@kbn/dev-utils';
import { runOptimizer, OptimizerConfig, OptimizerUpdate, logOptimizerState } from '@kbn/optimizer';

const TMP_DIR = Path.resolve(__dirname, '../__fixtures__/__tmp__');
const MOCK_REPO_SRC = Path.resolve(__dirname, '../__fixtures__/mock_repo');
const MOCK_REPO_DIR = Path.resolve(TMP_DIR, 'mock_repo');

expect.addSnapshotSerializer(createAbsolutePathSerializer(REPO_ROOT));
expect.addSnapshotSerializer({
print: (value: string) => value.split(REPO_ROOT).join('<absolute path>').replace(/\\/g, '/'),
test: (value: any) => typeof value === 'string' && value.includes(REPO_ROOT),
});

beforeAll(async () => {
await del(TMP_DIR);
Expand Down Expand Up @@ -135,28 +138,30 @@ it('builds expected bundles, saves bundle counts to metadata', async () => {
const foo = config.bundles.find((b) => b.id === 'foo')!;
expect(foo).toBeTruthy();
foo.cache.refresh();
expect(foo.cache.getModuleCount()).toBe(4);
expect(foo.cache.getModuleCount()).toBe(5);
expect(foo.cache.getReferencedFiles()).toMatchInlineSnapshot(`
Array [
<absolute path>/packages/kbn-optimizer/src/__fixtures__/__tmp__/mock_repo/plugins/foo/public/async_import.ts,
<absolute path>/packages/kbn-optimizer/src/__fixtures__/__tmp__/mock_repo/plugins/foo/public/ext.ts,
<absolute path>/packages/kbn-optimizer/src/__fixtures__/__tmp__/mock_repo/plugins/foo/public/index.ts,
<absolute path>/packages/kbn-optimizer/src/__fixtures__/__tmp__/mock_repo/plugins/foo/public/lib.ts,
<absolute path>/packages/kbn-ui-shared-deps/public_path_module_creator.js,
]
`);

const bar = config.bundles.find((b) => b.id === 'bar')!;
expect(bar).toBeTruthy();
bar.cache.refresh();
expect(bar.cache.getModuleCount()).toBe(
// code + styles + style/css-loader runtimes
15
// code + styles + style/css-loader runtimes + public path updater
21
);

expect(bar.cache.getReferencedFiles()).toMatchInlineSnapshot(`
Array [
<absolute path>/node_modules/css-loader/package.json,
<absolute path>/node_modules/style-loader/package.json,
<absolute path>/packages/kbn-optimizer/src/__fixtures__/__tmp__/mock_repo/plugins/bar/public/index.scss,
<absolute path>/packages/kbn-optimizer/src/__fixtures__/__tmp__/mock_repo/plugins/bar/public/index.ts,
<absolute path>/packages/kbn-optimizer/src/__fixtures__/__tmp__/mock_repo/plugins/bar/public/legacy/styles.scss,
<absolute path>/packages/kbn-optimizer/src/__fixtures__/__tmp__/mock_repo/plugins/bar/public/lib.ts,
Expand All @@ -165,6 +170,7 @@ it('builds expected bundles, saves bundle counts to metadata', async () => {
<absolute path>/packages/kbn-optimizer/src/__fixtures__/__tmp__/mock_repo/plugins/foo/public/index.ts,
<absolute path>/packages/kbn-optimizer/src/__fixtures__/__tmp__/mock_repo/plugins/foo/public/lib.ts,
<absolute path>/packages/kbn-optimizer/src/__fixtures__/__tmp__/mock_repo/src/legacy/ui/public/icon.svg,
<absolute path>/packages/kbn-ui-shared-deps/public_path_module_creator.js,
]
`);
});
Expand Down Expand Up @@ -205,6 +211,7 @@ it('uses cache on second run and exist cleanly', async () => {
*/
const expectFileMatchesSnapshotWithCompression = (filePath: string, snapshotLabel: string) => {
const raw = Fs.readFileSync(Path.resolve(MOCK_REPO_DIR, filePath), 'utf8');

expect(raw).toMatchSnapshot(snapshotLabel);

// Verify the brotli variant matches
Expand Down
24 changes: 15 additions & 9 deletions packages/kbn-optimizer/src/worker/webpack.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
* under the License.
*/

import Fs from 'fs';
import Path from 'path';

import normalizePath from 'normalize-path';
Expand Down Expand Up @@ -84,12 +85,17 @@ function dynamicExternals(bundle: Bundle, context: string, request: string) {
}

export function getWebpackConfig(bundle: Bundle, worker: WorkerConfig) {
const extensions = ['.js', '.ts', '.tsx', '.json'];
const entryExtension = extensions.find((ext) =>
Fs.existsSync(Path.resolve(bundle.contextDir, bundle.entry) + ext)
);

const commonConfig: webpack.Configuration = {
node: { fs: 'empty' },
context: bundle.contextDir,
cache: true,
entry: {
[bundle.id]: bundle.entry,
[bundle.id]: `${bundle.entry}${entryExtension}`,
},

devtool: worker.dist ? false : '#cheap-source-map',
Expand Down Expand Up @@ -141,13 +147,6 @@ export function getWebpackConfig(bundle: Bundle, worker: WorkerConfig) {
],

rules: [
{
include: Path.join(bundle.contextDir, bundle.entry),
loader: UiSharedDeps.publicPathLoader,
options: {
key: bundle.id,
},
},
{
test: /\.css$/,
include: /node_modules/,
Expand Down Expand Up @@ -278,6 +277,13 @@ export function getWebpackConfig(bundle: Bundle, worker: WorkerConfig) {
},
},
},
{
include: [`${Path.resolve(bundle.contextDir, bundle.entry)}${entryExtension}`],
loader: UiSharedDeps.publicPathLoader,
options: {
key: bundle.id,
},
},
{
test: /\.(html|md|txt|tmpl)$/,
use: {
Expand All @@ -288,7 +294,7 @@ export function getWebpackConfig(bundle: Bundle, worker: WorkerConfig) {
},

resolve: {
extensions: ['.js', '.ts', '.tsx', '.json'],
extensions,
mainFields: ['browser', 'main'],
alias: {
tinymath: require.resolve('tinymath/lib/tinymath.es5.js'),
Expand Down
2 changes: 2 additions & 0 deletions packages/kbn-ui-shared-deps/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@
"devDependencies": {
"@kbn/babel-preset": "1.0.0",
"@kbn/dev-utils": "1.0.0",
"loader-utils": "^1.2.3",
"val-loader": "^1.1.1",
"css-loader": "^3.4.2",
"del": "^5.1.0",
"webpack": "^4.41.5"
Expand Down
10 changes: 9 additions & 1 deletion packages/kbn-ui-shared-deps/public_path_loader.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,15 @@
* under the License.
*/

const Qs = require('querystring');
const { stringifyRequest } = require('loader-utils');

const VAL_LOADER = require.resolve('val-loader');
const MODULE_CREATOR = require.resolve('./public_path_module_creator');

module.exports = function (source) {
const options = this.query;
return `__webpack_public_path__ = window.__kbnPublicPath__['${options.key}'];${source}`;
const valOpts = Qs.stringify({ key: options.key });
const req = `${VAL_LOADER}?${valOpts}!${MODULE_CREATOR}`;
return `import ${stringifyRequest(this, req)};${source}`;
};
24 changes: 24 additions & 0 deletions packages/kbn-ui-shared-deps/public_path_module_creator.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/*
* 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.
*/

module.exports = function ({ key }) {
return {
code: `__webpack_public_path__ = window.__kbnPublicPath__['${key}']`,
};
};
Loading

0 comments on commit 011b1d6

Please sign in to comment.