Skip to content

Commit

Permalink
Merge branch '7.x' into backport/7.x/pr-102145
Browse files Browse the repository at this point in the history
  • Loading branch information
kibanamachine committed Jun 15, 2021
2 parents c13a925 + 3953dc7 commit efc7933
Show file tree
Hide file tree
Showing 177 changed files with 4,446 additions and 2,810 deletions.
15 changes: 15 additions & 0 deletions docs/CHANGELOG.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,21 @@ The existing agents in {kib} are not migrated as part of the migration to Fleet.
The existing agent API keys are invalidated and display as `Inactive` on the *Agents* page.
====

[discrete]
[[breaking-98039]]
.Disable Explore underlying data context menu
[%collapsible]
====
*Details* +
The *Explore underlying data* context menu on dashboards is now disabled by default. For more information, refer to {kibana-pull}98039[#98039].

*Impact* +
To enable the *Explore underlying data* context menu, set `xpack.discoverEnhanced.actions.exploreDataInContextMenu.enabled` to `true` in kibana.yml.
====

// end::notable-breaking-changes[]


[float]
[[deprecations-7.13.0]]
=== Deprecations
Expand Down
16 changes: 16 additions & 0 deletions docs/discover/search-sessions.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -68,3 +68,19 @@ behaves differently:
* Relative dates are converted to absolute dates.
* Panning and zooming is disabled for maps.
* Changing a filter, query, or drilldown starts a new search session, which can be slow.

[float]
==== Limitations

Certain visualization features do not fully support background search sessions yet. If a dashboard using these features gets restored,
all panels using unsupported features won't load immediately, but instead send out additional data requests which can take a while to complete.
In this case a warning *Your search session is still running* will be shown.

You can either wait for these additional requests to complete or come back to the dashboard later when all data requests have been finished.

A panel on a dashboard can behave like this if one of the following features is used:
* *Lens* - A *top values* dimension with an enabled setting *Group other values as "Other"* (configurable in the *Advanced* section of the dimension)
* *Lens* - An *intervals* dimension is used
* *Aggregation based* visualizations - A *terms* aggregation is used with an enabled setting *Group other values in separate bucket*
* *Aggregation based* visualizations - A *histogram* aggregation is used
* *Maps* - Layers using joins, blended layers or tracks layers are used
13 changes: 10 additions & 3 deletions docs/user/dashboard/aggregation-reference.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ This reference can help simplify the comparison if you need a specific feature.

| Table with summary row
^| X
|
^| X
|
|
|
Expand Down Expand Up @@ -65,7 +65,7 @@ This reference can help simplify the comparison if you need a specific feature.

| Heat map
^| X
|
^| X
|
|
^| X
Expand Down Expand Up @@ -333,7 +333,7 @@ build their advanced visualization.

| Math on aggregated data
|
|
^| X
^| X
^| X
^| X
Expand All @@ -352,6 +352,13 @@ build their advanced visualization.
^| X
^| X

| Time shifts
|
^| X
^| X
^| X
^| X

| Fully custom {es} queries
|
|
Expand Down
5 changes: 4 additions & 1 deletion docs/user/dashboard/create-panels-with-editors.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,16 @@
[[lens-editor]]
=== Lens

*Lens* is the drag and drop editor that creates visualizations of your data.
*Lens* is the drag and drop editor that creates visualizations of your data, recommended for most
users.

With *Lens*, you can:

* Use the automatically generated suggestions to change the visualization type.
* Create visualizations with multiple layers and indices.
* Change the aggregation and labels to customize the data.
* Perform math on aggregations using *Formula*.
* Use time shifts to compare data at two times, such as month over month.

[role="screenshot"]
image:dashboard/images/lens_advanced_1_1.png[Lens]
Expand Down
4 changes: 3 additions & 1 deletion docs/user/dashboard/lens.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,9 @@ image::images/lens_missing_values_strategy.png[Lens Missing values strategies me
[[is-it-possible-to-change-the-scale-of-Y-axis]]
===== Is it possible to statically define the scale of the y-axis in a visualization?

The ability to start the y-axis from another value than 0, or use a logarithmic scale, is unsupported in *Lens*.
Yes, you can set the bounds on bar, line and area chart types in Lens, unless using percentage mode. Bar
and area charts must have 0 in the bounds. Logarithmic scales are unsupported in *Lens*.
To set the y-axis bounds, click the icon representing the axis you want to customize.

[float]
[[is-it-possible-to-have-pagination-for-datatable]]
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -667,7 +667,7 @@
"callsites": "^3.1.0",
"chai": "3.5.0",
"chance": "1.0.18",
"chromedriver": "^90.0.0",
"chromedriver": "^91.0.1",
"clean-webpack-plugin": "^3.0.0",
"cmd-shim": "^2.1.0",
"compression-webpack-plugin": "^4.0.0",
Expand Down Expand Up @@ -835,4 +835,4 @@
"yargs": "^15.4.1",
"zlib": "^1.0.5"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,7 @@ import React, { createContext, useContext } from 'react';

import { useRequest } from '../../../public';

import { Error as CustomError } from './section_error';

import { Privileges } from '../types';
import { Privileges, Error as CustomError } from '../types';

interface Authorization {
isLoading: boolean;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,6 @@ export { WithPrivileges } from './with_privileges';

export { NotAuthorizedSection } from './not_authorized_section';

export { Error, SectionError } from './section_error';
export { SectionError } from './section_error';

export { PageError } from './page_error';
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 { EuiSpacer, EuiEmptyPrompt, EuiPageContent } from '@elastic/eui';
import React from 'react';
import { APP_WRAPPER_CLASS } from '../../../../../../src/core/public';
import { Error } from '../types';

interface Props {
title: React.ReactNode;
error: Error;
actions?: JSX.Element;
isCentered?: boolean;
}

/*
* A reusable component to handle full page errors.
* This is based on Kibana design guidelines related
* to the new management navigation structure.
* In some scenarios, it replaces the usage of <SectionError />.
*/

export const PageError: React.FunctionComponent<Props> = ({
title,
error,
actions,
isCentered,
...rest
}) => {
const {
error: errorString,
cause, // wrapEsError() on the server adds a "cause" array
message,
} = error;

const errorContent = (
<EuiPageContent verticalPosition="center" horizontalPosition="center" color="danger">
<EuiEmptyPrompt
title={<h2>{title}</h2>}
body={
<>
{cause ? message || errorString : <p>{message || errorString}</p>}
{cause && (
<>
<EuiSpacer size="s" />
<ul>
{cause.map((causeMsg, i) => (
<li key={i}>{causeMsg}</li>
))}
</ul>
</>
)}
</>
}
iconType="alert"
actions={actions}
{...rest}
/>
</EuiPageContent>
);

if (isCentered) {
return <div className={APP_WRAPPER_CLASS}>{errorContent}</div>;
}

return errorContent;
};
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,7 @@

import { EuiCallOut, EuiSpacer } from '@elastic/eui';
import React, { Fragment } from 'react';

export interface Error {
error: string;
cause?: string[];
message?: string;
}
import { Error } from '../types';

interface Props {
title: React.ReactNode;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ export {
AuthorizationProvider,
AuthorizationContext,
SectionError,
Error,
PageError,
useAuthorizationContext,
} from './components';

export { Privileges, MissingPrivileges } from './types';
export { Privileges, MissingPrivileges, Error } from './types';
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,9 @@ export interface Privileges {
hasAllPrivileges: boolean;
missingPrivileges: MissingPrivileges;
}

export interface Error {
error: string;
cause?: string[];
message?: string;
}
1 change: 1 addition & 0 deletions src/plugins/es_ui_shared/public/authorization/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ export {
NotAuthorizedSection,
Privileges,
SectionError,
PageError,
useAuthorizationContext,
WithPrivileges,
} from '../../__packages_do_not_import__/authorization';
1 change: 1 addition & 0 deletions src/plugins/es_ui_shared/public/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ export {
Privileges,
MissingPrivileges,
SectionError,
PageError,
Error,
useAuthorizationContext,
} from './authorization';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const DEFAULT_OPTIONS = {
stripEmptyFields: true,
};

interface UseFormReturn<T extends FormData, I extends FormData> {
export interface UseFormReturn<T extends FormData, I extends FormData> {
form: FormHook<T, I>;
}

Expand Down
3 changes: 2 additions & 1 deletion src/plugins/newsfeed/kibana.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@
"id": "newsfeed",
"version": "kibana",
"server": true,
"ui": true
"ui": true,
"requiredPlugins": ["screenshotMode"]
}
5 changes: 5 additions & 0 deletions src/plugins/newsfeed/public/lib/api.test.mocks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

import { storageMock } from './storage.mock';
import { driverMock } from './driver.mock';
import { NeverFetchNewsfeedApiDriver } from './never_fetch_driver';

export const storageInstanceMock = storageMock.create();
jest.doMock('./storage', () => ({
Expand All @@ -18,3 +19,7 @@ export const driverInstanceMock = driverMock.create();
jest.doMock('./driver', () => ({
NewsfeedApiDriver: jest.fn().mockImplementation(() => driverInstanceMock),
}));

jest.doMock('./never_fetch_driver', () => ({
NeverFetchNewsfeedApiDriver: jest.fn(() => new NeverFetchNewsfeedApiDriver()),
}));
24 changes: 21 additions & 3 deletions src/plugins/newsfeed/public/lib/api.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,16 @@
*/

import { driverInstanceMock, storageInstanceMock } from './api.test.mocks';

import moment from 'moment';
import { getApi } from './api';
import { TestScheduler } from 'rxjs/testing';
import { FetchResult, NewsfeedPluginBrowserConfig } from '../types';
import { take } from 'rxjs/operators';

import { NewsfeedApiDriver as MockNewsfeedApiDriver } from './driver';
import { NeverFetchNewsfeedApiDriver as MockNeverFetchNewsfeedApiDriver } from './never_fetch_driver';

const kibanaVersion = '8.0.0';
const newsfeedId = 'test';

Expand Down Expand Up @@ -46,6 +50,8 @@ describe('getApi', () => {
afterEach(() => {
storageInstanceMock.isAnyUnread$.mockReset();
driverInstanceMock.fetchNewsfeedItems.mockReset();
(MockNewsfeedApiDriver as jest.Mock).mockClear();
(MockNeverFetchNewsfeedApiDriver as jest.Mock).mockClear();
});

it('merges the newsfeed and unread observables', () => {
Expand All @@ -60,7 +66,7 @@ describe('getApi', () => {
a: createFetchResult({ feedItems: ['item' as any] }),
})
);
const api = getApi(createConfig(1000), kibanaVersion, newsfeedId);
const api = getApi(createConfig(1000), kibanaVersion, newsfeedId, false);

expectObservable(api.fetchResults$.pipe(take(1))).toBe('(a|)', {
a: createFetchResult({
Expand All @@ -83,7 +89,7 @@ describe('getApi', () => {
a: createFetchResult({ feedItems: ['item' as any] }),
})
);
const api = getApi(createConfig(2), kibanaVersion, newsfeedId);
const api = getApi(createConfig(2), kibanaVersion, newsfeedId, false);

expectObservable(api.fetchResults$.pipe(take(2))).toBe('a-(b|)', {
a: createFetchResult({
Expand Down Expand Up @@ -111,7 +117,7 @@ describe('getApi', () => {
a: createFetchResult({}),
})
);
const api = getApi(createConfig(10), kibanaVersion, newsfeedId);
const api = getApi(createConfig(10), kibanaVersion, newsfeedId, false);

expectObservable(api.fetchResults$.pipe(take(2))).toBe('a--(b|)', {
a: createFetchResult({
Expand All @@ -123,4 +129,16 @@ describe('getApi', () => {
});
});
});

it('uses the news feed API driver if in not screenshot mode', () => {
getApi(createConfig(10), kibanaVersion, newsfeedId, false);
expect(MockNewsfeedApiDriver).toHaveBeenCalled();
expect(MockNeverFetchNewsfeedApiDriver).not.toHaveBeenCalled();
});

it('uses the never fetch news feed API driver if in not screenshot mode', () => {
getApi(createConfig(10), kibanaVersion, newsfeedId, true);
expect(MockNewsfeedApiDriver).not.toHaveBeenCalled();
expect(MockNeverFetchNewsfeedApiDriver).toHaveBeenCalled();
});
});
Loading

0 comments on commit efc7933

Please sign in to comment.