Skip to content

Commit

Permalink
Merge branch 'main' into 127126-sm-alert-kibana-url
Browse files Browse the repository at this point in the history
  • Loading branch information
kibanamachine authored May 2, 2022
2 parents ee80d4f + 0716332 commit 264d31f
Show file tree
Hide file tree
Showing 1,376 changed files with 12,592 additions and 9,810 deletions.
1 change: 1 addition & 0 deletions .buildkite/scripts/steps/checks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ export DISABLE_BOOTSTRAP_VALIDATION=false
.buildkite/scripts/steps/checks/commit/commit.sh
.buildkite/scripts/steps/checks/bazel_packages.sh
.buildkite/scripts/steps/checks/telemetry.sh
.buildkite/scripts/steps/checks/validate_ci_groups.sh
.buildkite/scripts/steps/checks/ts_projects.sh
.buildkite/scripts/steps/checks/jest_configs.sh
.buildkite/scripts/steps/checks/doc_api_changes.sh
Expand Down
9 changes: 9 additions & 0 deletions .buildkite/scripts/steps/checks/validate_ci_groups.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/usr/bin/env bash

set -euo pipefail

source .buildkite/scripts/common/util.sh

echo --- Ensure that all tests are in a CI Group
checks-reporter-with-killswitch "Ensure that all tests are in a CI Group" \
node scripts/ensure_all_tests_in_ci_group
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
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
8 changes: 5 additions & 3 deletions docs/management/connectors/action-types/email.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,11 @@

The email connector uses the SMTP protocol to send mail messages, using an integration of https://nodemailer.com/[Nodemailer]. An exception is Microsoft Exchange, which uses HTTP protocol for sending emails, https://docs.microsoft.com/en-us/graph/api/user-sendmail[Send mail]. Email message text is sent as both plain text and html text.

NOTE: For emails to have a footer with a link back to {kib}, set the <<server-publicBaseUrl, `server.publicBaseUrl`>> configuration setting.

NOTE: When the <<action-config-email-domain-allowlist, `xpack.actions.email.domain_allowlist`>> configuration setting is used, the email addresses used for all of the Sender (from), To, CC, and BCC properties must have email domains specified in the configuration setting.
[NOTE]
====
* For emails to have a footer with a link back to {kib}, set the <<server-publicBaseUrl, `server.publicBaseUrl`>> configuration setting.
* When the <<action-config-email-domain-allowlist,`xpack.actions.email.domain_allowlist`>> configuration setting is used, the email addresses used for all of the Sender (from), To, CC, and BCC properties must have email domains specified in the configuration setting.
====

[float]
[[email-connector-configuration]]
Expand Down
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
4 changes: 2 additions & 2 deletions docs/settings/alert-action-settings.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -126,9 +126,9 @@ into a single string. This configuration can be used for environments where
the files cannot be made available.

[[action-config-email-domain-allowlist]] `xpack.actions.email.domain_allowlist` {ess-icon}::
A list of allowed email domains which can be used with the email connector. When this setting is not used, all email domains are allowed. When this setting is used, if any email is attempted to be sent that includes an addressee with an email domain that is not in the allowlist, or the from address domain is not in the allowlist, the run of the connector will fail with a message indicating the emails not allowed.
A list of allowed email domains which can be used with the email connector. When this setting is not used, all email domains are allowed. When this setting is used, if any email is attempted to be sent that (a) includes an addressee with an email domain that is not in the allowlist, or (b) includes a from address domain that is not in the allowlist, it will fail with a message indicating the email is not allowed.

WARNING: This feature is available in {kib} 7.17.4 and 8.3.0 onwards but is not supported in {kib} 8.0, 8.1 or 8.2. As such this settings should be removed before upgrading from 7.17 to 8.0, 8.1 or 8.2. It is possible to configure the settings in 7.17.4 and then upgrade to 8.3.0 directly.
WARNING: This feature is available in {kib} 7.17.4 and 8.3.0 onwards but is not supported in {kib} 8.0, 8.1 or 8.2. As such, this setting should be removed before upgrading from 7.17 to 8.0, 8.1 or 8.2. It is possible to configure the settings in 7.17.4 and then upgrade to 8.3.0 directly.

`xpack.actions.enabledActionTypes` {ess-icon}::
A list of action types that are enabled. It defaults to `[*]`, enabling all types. The names for built-in {kib} action types are prefixed with a `.` and include: `.email`, `.index`, `.jira`, `.pagerduty`, `.resilient`, `.server-log`, `.servicenow`, .`servicenow-itom`, `.servicenow-sir`, `.slack`, `.swimlane`, `.teams`, `.xmatters`, and `.webhook`. An empty list `[]` will disable all action types.
Expand Down
9 changes: 4 additions & 5 deletions docs/setup/settings.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -500,7 +500,7 @@ send on all responses to the client from the {kib} server. *Default: `{}`*

|[[server-host]] `server.host:`
| This setting specifies the host of the
back end server. To allow remote users to connect, set the value to the IP address or DNS name of the {kib} server. *Default: `"localhost"`*
back end server. To allow remote users to connect, set the value to the IP address or DNS name of the {kib} server. Use `0.0.0.0` to make Kibana listen on all IPs (public and private). *Default: `"localhost"`*

| `server.keepaliveTimeout:`
| The number of milliseconds to wait for additional data before restarting
Expand Down Expand Up @@ -543,10 +543,6 @@ inactive socket. *Default: `"120000"`*
| Paths to a PEM-encoded X.509 server certificate and its corresponding private key. These
are used by {kib} to establish trust when receiving inbound SSL/TLS connections from users.

|[[server-uuid]] `server.uuid:`
| The unique identifier for this {kib} instance.


|===

[NOTE]
Expand Down Expand Up @@ -627,6 +623,9 @@ all http requests to https over the port configured as <<server-port, `server.po
| An array of supported protocols with versions.
Valid protocols: `TLSv1`, `TLSv1.1`, `TLSv1.2`, `TLSv1.3`. *Default: TLSv1.1, TLSv1.2, TLSv1.3*

|[[server-uuid]] `server.uuid:`
| The unique identifier for this {kib} instance. It must be a valid UUIDv4. It gets automatically generated on the first startup if not specified and persisted in the `data` path.

| [[settings-xsrf-allowlist]] `server.xsrf.allowlist:`
| It is not recommended to disable protections for
arbitrary API endpoints. Instead, supply the `kbn-xsrf` header.
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@
"base64-js": "^1.3.1",
"bitmap-sdf": "^1.0.3",
"brace": "0.11.1",
"broadcast-channel": "^4.11.0",
"broadcast-channel": "4.10.0",
"canvg": "^3.0.9",
"chalk": "^4.1.0",
"cheerio": "^1.0.0-rc.10",
Expand Down Expand Up @@ -249,7 +249,7 @@
"deep-freeze-strict": "^1.1.1",
"deepmerge": "^4.2.2",
"del": "^5.1.0",
"elastic-apm-node": "^3.31.0",
"elastic-apm-node": "^3.32.0",
"email-addresses": "^5.0.0",
"execa": "^4.0.2",
"exit-hook": "^2.2.0",
Expand Down
3 changes: 3 additions & 0 deletions packages/kbn-doc-links/src/get_doc_links.ts
Original file line number Diff line number Diff line change
Expand Up @@ -459,6 +459,9 @@ export const getDocLinks = ({ kibanaBranch }: GetDocLinkOptions): DocLinks => {
monitorLogstash: `${ELASTIC_WEBSITE_URL}guide/en/logstash/${DOC_LINK_VERSION}/monitoring-with-metricbeat.html`,
troubleshootKibana: `${KIBANA_DOCS}monitor-troubleshooting.html`,
},
reporting: {
cloudMinimumRequirements: `${KIBANA_DOCS}reporting-getting-started.html#reporting-on-cloud-resource-requirements`,
},
security: {
apiKeyServiceSettings: `${ELASTICSEARCH_DOCS}security-settings.html#api-key-service-settings`,
clusterPrivileges: `${ELASTICSEARCH_DOCS}security-privileges.html#privileges-list-cluster`,
Expand Down
3 changes: 3 additions & 0 deletions packages/kbn-doc-links/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,9 @@ export interface DocLinks {
gdalTutorial: string;
}>;
readonly monitoring: Record<string, string>;
readonly reporting: Readonly<{
cloudMinimumRequirements: string;
}>;
readonly security: Readonly<{
apiKeyServiceSettings: string;
clusterPrivileges: string;
Expand Down
3 changes: 1 addition & 2 deletions packages/kbn-optimizer/limits.yml
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,7 @@ pageLoadAssetSize:
fieldFormats: 65209
kibanaReact: 74422
share: 71239
uiActions: 35121
dataEnhanced: 24980
uiActions: 35121
embeddable: 87309
embeddableEnhanced: 22107
uiActionsEnhanced: 38494
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@
*/

export { NoDataViews, NoDataViewsComponent } from './no_data_views';
export { KibanaNoDataPage } from './kibana_no_data_page';
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
id: sharedUX/Components/KibanaNoDataPage
slug: /shared-ux-components/kibana_no_data_page
title: Kibana No Data Page
summary: A page to be displayed when there is no data in Elasticsearch, or no data views
tags: ['shared-ux', 'component']
date: 2022-04-20
---

## Description

Many plugins display "no data" page, either when there is no data in Elasticsearch, or there haven't been any data views created yet. This component is meant
to be used in those scenarios. It displays an appropriate message to the user and facilitate addition of integrations and creation of data views.

## Component: `KibanaNoDataPage`

- uses `hasUserDataView` and `hasData` API from `HasData` service in `data_views` plugin to check for existence of data / data views
- uses `onDataViewCreated` callback to be called once the data view has been created
- receives (noDataConfig)[https://github.com/elastic/kibana/blob/main/packages/kbn-shared-ux-components/src/page_template/no_data_page/types.ts] as configuration for the page in case of no data
- needs to be wrapped in `ServicesContext` provided by the start contract of the `shared_ux` plugin to be used

## EUI Promotion Status
This component is not currently considered for promotion to EUI.
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0 and the Server Side Public License, v 1; you may not use this file except
* in compliance with, at your election, the Elastic License 2.0 or the Server
* Side Public License, v 1.
*/

import { action } from '@storybook/addon-actions';
import React from 'react';
import { servicesFactory, DataServiceFactoryConfig } from '@kbn/shared-ux-storybook';
import { SharedUxServicesProvider } from '@kbn/shared-ux-services';
import mdx from './kibana_no_data_page.mdx';
import { NoDataPageProps } from '../page_template';
import { KibanaNoDataPage } from './kibana_no_data_page';

export default {
title: 'No Data/Kibana No Data Page',
description: 'A component to display when there is no data available',
parameters: {
docs: {
page: mdx,
},
},
};

const noDataConfig = {
solution: 'Analytics',
logo: 'logoKibana',
action: {
elasticAgent: {
title: 'Add Integrations',
},
},
docsLink: 'http://www.docs.com',
};

type Params = Pick<NoDataPageProps, 'solution' | 'logo'> & DataServiceFactoryConfig;

export const PureComponent = (params: Params) => {
const { solution, logo, hasESData, hasUserDataView } = params;
const serviceParams = { hasESData, hasUserDataView, hasDataViews: false };
const services = servicesFactory(serviceParams);
return (
<SharedUxServicesProvider {...services}>
<KibanaNoDataPage
onDataViewCreated={action('onDataViewCreated')}
noDataConfig={{ ...noDataConfig, solution, logo }}
/>
</SharedUxServicesProvider>
);
};

PureComponent.argTypes = {
solution: {
control: 'text',
defaultValue: 'Observability',
},
logo: {
control: { type: 'radio' },
options: ['logoElastic', 'logoKibana', 'logoCloud', undefined],
defaultValue: undefined,
},
hasESData: {
control: 'boolean',
defaultValue: false,
},
hasUserDataView: {
control: 'boolean',
defaultValue: false,
},
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0 and the Server Side Public License, v 1; you may not use this file except
* in compliance with, at your election, the Elastic License 2.0 or the Server
* Side Public License, v 1.
*/

import React from 'react';
import { act } from 'react-dom/test-utils';

import { mountWithIntl } from '@kbn/test-jest-helpers';
import { SharedUxServicesProvider, mockServicesFactory } from '@kbn/shared-ux-services';

import { KibanaNoDataPage } from './kibana_no_data_page';
import { NoDataConfigPage } from '../page_template';
import { NoDataViews } from './no_data_views';

describe('Kibana No Data Page', () => {
const noDataConfig = {
solution: 'Analytics',
pageTitle: 'Analytics',
logo: 'logoKibana',
action: {
elasticAgent: {
title: 'Add Integrations',
},
},
docsLink: 'http://www.docs.com',
};
const onDataViewCreated = jest.fn();
const config = {
hasESData: false,
hasDataView: false,
hasUserDataView: false,
};

afterEach(() => {
jest.resetAllMocks();
});

test('renders NoDataConfigPage', async () => {
const services = mockServicesFactory({ config: { ...config, hasESData: false } });
const component = mountWithIntl(
<SharedUxServicesProvider {...services}>
<KibanaNoDataPage noDataConfig={noDataConfig} onDataViewCreated={onDataViewCreated} />
</SharedUxServicesProvider>
);

await act(() => new Promise(setImmediate));
component.update();

expect(component.find(NoDataConfigPage).length).toBe(1);
expect(component.find(NoDataViews).length).toBe(0);
});

test('renders NoDataViews', async () => {
const services = mockServicesFactory({ config: { ...config, hasESData: true } });
const component = mountWithIntl(
<SharedUxServicesProvider {...services}>
<KibanaNoDataPage noDataConfig={noDataConfig} onDataViewCreated={onDataViewCreated} />
</SharedUxServicesProvider>
);

await act(() => new Promise(setImmediate));
component.update();

expect(component.find(NoDataViews).length).toBe(1);
expect(component.find(NoDataConfigPage).length).toBe(0);
});
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0 and the Server Side Public License, v 1; you may not use this file except
* in compliance with, at your election, the Elastic License 2.0 or the Server
* Side Public License, v 1.
*/
import React, { useEffect, useState } from 'react';
import { useData } from '@kbn/shared-ux-services';
import { NoDataConfigPage, NoDataPageProps } from '../page_template';
import { NoDataViews } from './no_data_views';

export interface Props {
onDataViewCreated: (dataView: unknown) => void;
noDataConfig: NoDataPageProps;
}

export const KibanaNoDataPage = ({ onDataViewCreated, noDataConfig }: Props) => {
const { hasESData, hasUserDataView } = useData();
const [dataExists, setDataExists] = useState(false);
const [hasUserDataViews, setHasUserDataViews] = useState(false);

useEffect(() => {
const checkData = async () => {
setDataExists(await hasESData());
setHasUserDataViews(await hasUserDataView());
};
// TODO: add error handling
// https://github.com/elastic/kibana/issues/130913
checkData().catch(() => {});
}, [hasESData, hasUserDataView]);

if (!dataExists) {
return <NoDataConfigPage noDataConfig={noDataConfig} />;
}

if (!hasUserDataViews) {
return <NoDataViews onDataViewCreated={onDataViewCreated} />;
}

return null;
};
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import mdx from './no_data_views.mdx';
const services = servicesFactory({});

export default {
title: 'No Data Views',
title: 'No Data/No Data Views',
description: 'A component to display when there are no user-created data views available.',
parameters: {
docs: {
Expand Down
Loading

0 comments on commit 264d31f

Please sign in to comment.