Skip to content

Commit

Permalink
Merge branch 'main' into fix-127802
Browse files Browse the repository at this point in the history
  • Loading branch information
kibanamachine authored May 3, 2022
2 parents ca8902c + 3295c9f commit f422eea
Show file tree
Hide file tree
Showing 1,575 changed files with 22,193 additions and 12,757 deletions.
1 change: 1 addition & 0 deletions .buildkite/scripts/pipelines/pull_request/pipeline.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ const SKIPPABLE_PATHS = [
/^\.github\//,
/\.md$/,
/^\.backportrc\.json$/,
/^nav-kibana-dev\.docnav\.json$/,
];

const REQUIRED_PATHS = [
Expand Down
2 changes: 1 addition & 1 deletion .buildkite/scripts/steps/storybooks/build_and_upload.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const STORYBOOKS = [
'custom_integrations',
'dashboard_enhanced',
'dashboard',
'data_enhanced',
'data',
'embeddable',
'expression_error',
'expression_image',
Expand Down
1 change: 0 additions & 1 deletion .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@
/src/plugins/inspector/ @elastic/kibana-app-services
/src/plugins/unified_search/ @elastic/kibana-app-services
/x-pack/examples/ui_actions_enhanced_examples/ @elastic/kibana-app-services
/x-pack/plugins/data_enhanced/ @elastic/kibana-app-services
/x-pack/plugins/embeddable_enhanced/ @elastic/kibana-app-services
/x-pack/plugins/ui_actions_enhanced/ @elastic/kibana-app-services
/x-pack/plugins/runtime_fields @elastic/kibana-app-services
Expand Down
5 changes: 5 additions & 0 deletions dev_docs/getting_started/hello_world_plugin.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@ and add the following:
"id": "helloWorld",
"version": "1.0.0",
"kibanaVersion": "kibana",
"owner": {
"name": "Kibana Core",
"githubTeam": "kibana-core"
},
"ui": true
}
```
Expand Down Expand Up @@ -77,6 +81,7 @@ And add the following to it:

```
$ mkdir public
$ cd public
$ touch plugin.tsx
```

Expand Down
2 changes: 1 addition & 1 deletion dev_docs/getting_started/setting_up_a_development_env.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ In another terminal tab/window you can start Kibana.
yarn start
```

If you include the `--run-examples` flag then all of the [developer examples](https://github.com/elastic/kibana/tree/{branch}/examples). Read more about the advanced options for [Running Kibana](https://www.elastic.co/guide/en/kibana/current/running-kibana-advanced.html).
Include developer examples](https://github.com/elastic/kibana/tree/main/examples) by adding an optional `--run-examples` flag. Read more about the advanced options for [Running Kibana](https://www.elastic.co/guide/en/kibana/current/running-kibana-advanced.html).

## Code away!

Expand Down
2 changes: 1 addition & 1 deletion dev_docs/tutorials/data/search.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ export const myEnhancedSearchStrategyProvider = (
await ese.cancel(id, options, deps);
},
extend: async (id, keepAlive, options, deps) => {
// async search results are not stored indefinitely. By default, they expire after 7 days (or as defined by xpack.data_enhanced.search.sessions.defaultExpiration setting in kibana.yml).
// async search results are not stored indefinitely. By default, they expire after 7 days (or as defined by data.search.sessions.defaultExpiration setting in kibana.yml).
// call the extend method of the async strategy you are using or implement your own extend function.
await ese.extend(id, options, deps);
},
Expand Down
4 changes: 0 additions & 4 deletions docs/developer/plugin-list.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -412,10 +412,6 @@ The plugin exposes the static DefaultEditorController class to consume.
|Adds drilldown capabilities to dashboard. Owned by the Kibana App team.
|{kib-repo}blob/{branch}/x-pack/plugins/data_enhanced/README.md[dataEnhanced]
|The data_enhanced plugin is the x-pack counterpart to the src/plguins/data plugin.
|{kib-repo}blob/{branch}/x-pack/plugins/data_visualizer/README.md[dataVisualizer]
|The data_visualizer plugin enables you to explore the fields in your data.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ Import saved objects from given stream. See the [options](./kibana-plugin-core-s
<b>Signature:</b>

```typescript
import({ readStream, createNewCopies, namespace, overwrite, }: SavedObjectsImportOptions): Promise<SavedObjectsImportResponse>;
import({ readStream, createNewCopies, namespace, overwrite, refresh, }: SavedObjectsImportOptions): Promise<SavedObjectsImportResponse>;
```

## Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| { readStream, createNewCopies, namespace, overwrite, } | SavedObjectsImportOptions | |
| { readStream, createNewCopies, namespace, overwrite, refresh, } | SavedObjectsImportOptions | |

<b>Returns:</b>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@ export declare class SavedObjectsImporter

| Method | Modifiers | Description |
| --- | --- | --- |
| [import({ readStream, createNewCopies, namespace, overwrite, })](./kibana-plugin-core-server.savedobjectsimporter.import.md) | | Import saved objects from given stream. See the [options](./kibana-plugin-core-server.savedobjectsimportoptions.md) for more detailed information. |
| [import({ readStream, createNewCopies, namespace, overwrite, refresh, })](./kibana-plugin-core-server.savedobjectsimporter.import.md) | | Import saved objects from given stream. See the [options](./kibana-plugin-core-server.savedobjectsimportoptions.md) for more detailed information. |
| [resolveImportErrors({ readStream, createNewCopies, namespace, retries, })](./kibana-plugin-core-server.savedobjectsimporter.resolveimporterrors.md) | | Resolve and return saved object import errors. See the [options](./kibana-plugin-core-server.savedobjectsresolveimporterrorsoptions.md) for more detailed information. |

Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,5 @@ export interface SavedObjectsImportOptions
| [namespace?](./kibana-plugin-core-server.savedobjectsimportoptions.namespace.md) | string | <i>(Optional)</i> if specified, will import in given namespace, else will import as global object |
| [overwrite](./kibana-plugin-core-server.savedobjectsimportoptions.overwrite.md) | boolean | If true, will override existing object if present. Note: this has no effect when used with the <code>createNewCopies</code> option. |
| [readStream](./kibana-plugin-core-server.savedobjectsimportoptions.readstream.md) | Readable | The stream of [saved objects](./kibana-plugin-core-server.savedobject.md) to import |
| [refresh?](./kibana-plugin-core-server.savedobjectsimportoptions.refresh.md) | boolean \| 'wait\_for' | <i>(Optional)</i> Refresh setting, defaults to <code>wait_for</code> |

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-server](./kibana-plugin-core-server.md) &gt; [SavedObjectsImportOptions](./kibana-plugin-core-server.savedobjectsimportoptions.md) &gt; [refresh](./kibana-plugin-core-server.savedobjectsimportoptions.refresh.md)

## SavedObjectsImportOptions.refresh property

Refresh setting, defaults to `wait_for`

<b>Signature:</b>

```typescript
refresh?: boolean | 'wait_for';
```
6 changes: 0 additions & 6 deletions docs/maps/import-geospatial-data.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -96,12 +96,6 @@ To open an existing index for drawing:

. Click *Add layer*.

. Set *Scaling* to *Limit results to 10,000*.

. In **Filtering**:
** Clear the *Apply global search to layer data* checkbox.
** If your data view contains a default time field, clear the *Apply global time to layer data* checkbox.

. Click *Save & close*.

. In the legend, click the layer name and select *Edit features*.
Expand Down
1 change: 1 addition & 0 deletions nav-kibana-dev.docnav.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@
{
"label": "Contributors Newsletters",
"items": [
{ "id": "kibApril2022ContributorNewsletter" },
{ "id": "kibMarch2022ContributorNewsletter" },
{ "id": "kibFebruary2022ContributorNewsletter" },
{ "id": "kibJanuary2022ContributorNewsletter" },
Expand Down
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,6 @@
"handlebars": "4.7.7",
"he": "^1.2.0",
"history": "^4.9.0",
"history-extra": "^5.0.1",
"hjson": "3.2.1",
"http-proxy-agent": "^2.1.0",
"https-proxy-agent": "^5.0.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ import { TelemetryCounterType } from '../events';

const delay = (ms: number) => new Promise((resolve) => setTimeout(resolve, ms));

describe('AnalyticsClient', () => {
// FLAKY: https://github.com/elastic/kibana/issues/131369
describe.skip('AnalyticsClient', () => {
let analyticsClient: AnalyticsClient;
let logger: MockedLogger;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,24 @@ it('Test number primitive doc def', () => {
expect(def.type).toBe(TypeKind.NumberKind);
});

it('Test a constructor type declaration inside an interface', () => {
const node = nodes.find((n) => getNodeName(n) === 'ClassConstructorWithStaticProperties');
expect(node).toBeDefined();
const def = buildApiDeclarationTopNode(node!, {
plugins,
log,
currentPluginId: plugins[0].manifest.id,
scope: ApiScope.CLIENT,
captureReferences: false,
});

expect(def.type).toBe(TypeKind.InterfaceKind);
expect(def.children).toHaveLength(2);
expect(def.children![1].type).toBe(TypeKind.FunctionKind);
expect(def.children![1].label).toBe('new');
expect(def.children![1].id).toBe('def-public.ClassConstructorWithStaticProperties.new');
});

it('Function type is exported as type with signature', () => {
const node = nodes.find((n) => getNodeName(n) === 'FnWithGeneric');
expect(node).toBeDefined();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,17 @@ export function buildApiDeclaration(node: Node, opts: BuildApiDecOpts): ApiDecla
Node.isMethodSignature(node) ||
Node.isFunctionDeclaration(node) ||
Node.isMethodDeclaration(node) ||
Node.isConstructSignatureDeclaration(node) ||
Node.isConstructorDeclaration(node)
) {
return buildFunctionDec(node, {
...opts,
// Use "Constructor" if applicable, instead of the default "Unnamed"
name: Node.isConstructorDeclaration(node) ? 'Constructor' : node.getName() || 'Unnamed',
name: Node.isConstructSignatureDeclaration(node)
? 'new'
: Node.isConstructorDeclaration(node)
? 'Constructor'
: node.getName() || 'Unnamed',
});
} else if (
Node.isPropertySignature(node) ||
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import {
MethodDeclaration,
ConstructorDeclaration,
MethodSignature,
ConstructSignatureDeclaration,
} from 'ts-morph';

import { buildApiDecsForParameters } from './build_parameter_decs';
Expand All @@ -23,7 +24,12 @@ import { BuildApiDecOpts } from './types';
* Takes the various function-like node declaration types and converts them into an ApiDeclaration.
*/
export function buildFunctionDec(
node: FunctionDeclaration | MethodDeclaration | ConstructorDeclaration | MethodSignature,
node:
| ConstructSignatureDeclaration
| FunctionDeclaration
| MethodDeclaration
| ConstructorDeclaration
| MethodSignature,
opts: BuildApiDecOpts
): ApiDeclaration {
const fn = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,11 @@ export function buildParentApiId(parentName: string, parentsParentApiId?: string
}

export function getOptsForChild(node: Node, parentOpts: BuildApiDecOpts): BuildApiDecOpts {
const name = isNamedNode(node) ? node.getName() : 'Unnamed';
const name = Node.isConstructSignatureDeclaration(node)
? 'new'
: isNamedNode(node)
? node.getName()
: 'Unnamed';
return getOptsForChildWithName(name, parentOpts);
}

Expand Down
15 changes: 10 additions & 5 deletions packages/kbn-docs-utils/src/api_docs/build_api_docs_cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,16 @@ export function runBuildApiDocsCli() {
// Delete all files except the README that warns about the auto-generated nature of
// the folder.
const files = Fs.readdirSync(outputFolder);
files.forEach((file) => {
if (file.indexOf('README.md') < 0) {
Fs.rmSync(Path.resolve(outputFolder, file));
}
});
await Promise.all(
files
.filter((file) => file.indexOf('README.md') < 0)
.map(
(file) =>
new Promise<void>((resolve, reject) =>
Fs.rm(Path.resolve(outputFolder, file), (err) => (err ? reject(err) : resolve()))
)
)
);
}
const collectReferences = flags.references as boolean;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ beforeAll(() => {
});

test('foo service has all exports', () => {
expect(doc?.client.length).toBe(37);
expect(doc?.client.length).toBe(38);
const split = splitApisByFolder(doc);
expect(split.length).toBe(2);

Expand All @@ -47,5 +47,5 @@ test('foo service has all exports', () => {

expect(fooDoc?.common.length).toBe(1);
expect(fooDoc?.client.length).toBe(2);
expect(mainDoc?.client.length).toBe(35);
expect(mainDoc?.client.length).toBe(36);
});
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@ export interface InterfaceWithIndexSignature {
[key: string]: { foo: string };
}

export interface ClassConstructorWithStaticProperties {
staticProperty1: string;
new (config: { foo: string }): InterfaceWithIndexSignature;
}

export function plugin() {
return new PluginA();
}
Original file line number Diff line number Diff line change
Expand Up @@ -712,6 +712,67 @@
],
"initialIsOpen": false
},
{
"parentPluginId": "pluginA",
"id": "def-public.ClassConstructorWithStaticProperties",
"type": "Interface",
"tags": [],
"label": "ClassConstructorWithStaticProperties",
"description": [],
"path": "packages/kbn-docs-utils/src/api_docs/tests/__fixtures__/src/plugin_a/public/index.ts",
"deprecated": false,
"children": [
{
"parentPluginId": "pluginA",
"id": "def-public.ClassConstructorWithStaticProperties.staticProperty1",
"type": "string",
"tags": [],
"label": "staticProperty1",
"description": [],
"path": "packages/kbn-docs-utils/src/api_docs/tests/__fixtures__/src/plugin_a/public/index.ts",
"deprecated": false
},
{
"parentPluginId": "pluginA",
"id": "def-public.ClassConstructorWithStaticProperties.new",
"type": "Function",
"tags": [],
"label": "new",
"description": [],
"signature": [
"any"
],
"path": "packages/kbn-docs-utils/src/api_docs/tests/__fixtures__/src/plugin_a/public/index.ts",
"deprecated": false,
"children": [
{
"parentPluginId": "pluginA",
"id": "def-public.ClassConstructorWithStaticProperties.new.$1",
"type": "Object",
"tags": [],
"label": "config",
"description": [],
"path": "packages/kbn-docs-utils/src/api_docs/tests/__fixtures__/src/plugin_a/public/index.ts",
"deprecated": false,
"children": [
{
"parentPluginId": "pluginA",
"id": "def-public.ClassConstructorWithStaticProperties.new.$1.foo",
"type": "string",
"tags": [],
"label": "foo",
"description": [],
"path": "packages/kbn-docs-utils/src/api_docs/tests/__fixtures__/src/plugin_a/public/index.ts",
"deprecated": false
}
]
}
],
"returnComment": []
}
],
"initialIsOpen": false
},
{
"parentPluginId": "pluginA",
"id": "def-public.ExampleInterface",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/pluginA
title: "pluginA"
image: https://source.unsplash.com/400x175/?github
summary: API docs for the pluginA plugin
date: 2022-02-14
date: 2022-04-30
tags: ['contributor', 'dev', 'apidocs', 'kibana', 'pluginA']
warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info.
---
Expand All @@ -18,7 +18,7 @@ Contact Kibana Core for questions regarding this plugin.

| Public API count | Any count | Items lacking comments | Missing exports |
|-------------------|-----------|------------------------|-----------------|
| 131 | 1 | 71 | 2 |
| 136 | 1 | 76 | 2 |

## Client

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/pluginA-foo
title: "pluginA.foo"
image: https://source.unsplash.com/400x175/?github
summary: API docs for the pluginA.foo plugin
date: 2022-02-14
date: 2022-04-30
tags: ['contributor', 'dev', 'apidocs', 'kibana', 'pluginA.foo']
warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info.
---
Expand All @@ -18,7 +18,7 @@ Contact Kibana Core for questions regarding this plugin.

| Public API count | Any count | Items lacking comments | Missing exports |
|-------------------|-----------|------------------------|-----------------|
| 131 | 1 | 71 | 2 |
| 136 | 1 | 76 | 2 |

## Client

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/pluginB
title: "pluginB"
image: https://source.unsplash.com/400x175/?github
summary: API docs for the pluginB plugin
date: 2022-02-14
date: 2022-04-30
tags: ['contributor', 'dev', 'apidocs', 'kibana', 'pluginB']
warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info.
---
Expand Down
Loading

0 comments on commit f422eea

Please sign in to comment.