Skip to content

Commit

Permalink
Merge branch 'backport/7.x/pr-62606' of https://github.com/shahzad31/…
Browse files Browse the repository at this point in the history
…kibana into backport/7.x/pr-62606
  • Loading branch information
shahzad31 committed Apr 22, 2020
2 parents e6a5c67 + 430124b commit 1b7c887
Show file tree
Hide file tree
Showing 81 changed files with 1,084 additions and 679 deletions.
95 changes: 94 additions & 1 deletion docs/release-notes/highlights-7.7.0.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,104 @@

Explore the new features in Kibana 7.7.

coming::[7.7.0]

//NOTE: The notable-highlights tagged regions are re-used in the
//Installation and Upgrade Guide

// tag::notable-highlights[]

coming::[7.7.0]

[float]
[[alerting-framework-highlights]]
=== New alerting framework

beta:[]Alerting allows you to detect complex conditions in
{kib} apps and trigger actions when those conditions are met.
Alerting is integrated with <<xpack-apm,APM>>, <<xpack-infra,Metrics>>,
<<xpack-siem,SIEM>>, and <<xpack-uptime,Uptime>> and is
centrally managed from <<management, Management>>.
Alerting has built-in <<action-types, actions>> and
<<alert-types, alerts>> for you to use.

[role="screenshot"]
image:user/alerting/images/alerting-overview.png[Alerts and actions UI]

[float]
[[canvas-visualizations-highlights]]
=== Canvas with your visualizations

Visualizations that you created in Lens, Visualize, and
TSVB can now be embedded in a Canvas workpad. This makes it easier for you
to brand your Canvas presentation to your executive team and partners.

[role="screenshot"]
image:release-notes/images/7-7-canvas-and-lens.png[Embedded maps in Canvas]

[float]
[[lens-filtering-highlights]]
=== Improved filtering of Lens visualizations in dashboards

Digging into the Lens visualizations on your
dashboard just got faster. You can now filter the data in one
Lens visualization, and immediately apply that filter to all
Lens visualizations on the dashboard.

[role="screenshot"]
image:release-notes/images/7-7-lens-filter-in-dashboard.png[Filter Lens visualizations in dashboard]

[float]
[[lens-formatting-highlights]]
=== Number formatting in Lens

To accurately display the data in Lens visualizations,
try out the new number formats. The new dropdown has options for formatting
numbers as percentages
and bytes. There's also a field for setting how many decimal places to display.

[role="screenshot"]
image:release-notes/images/7-7-lens-format-values.png[Formatted values in Lens]

[float]
[[map-points-highlights]]
=== Individual map points on zoom

*Elastic Maps* improves the way you work with large amounts of coordinate data.
With the new default setting, points are clustered on a map until you zoom into an area with
less than 10,000 discrete points. Then, you'll see
individual points. This feature is useful for map data
points that are in both dense urban areas and rural locations.

[role="screenshot"]
image:release-notes/images/7-7-maps-zoom.png[Individual map points on zoom]

[float]
[[map-distance-filter-highlights]]
=== Distance filters in Elastic Maps

The distance filter is a new way
to filter map data
within a specific radius. Simply select a
central location, and then draw a circle around it with your mouse.
The distance filter is in addition to the tools for filtering data by custom shape and by rectangular bound.

[role="screenshot"]
image:release-notes/images/7-7-maps-distance-filter.png[Distance filters in Elastic Maps]

[float]
=== Learn more

Get details on these release highlights and more in the {kib} 7.7 release blog.
For a complete list of enhancements and other changes, check out the
{kibana-ref}/release-notes-7.7.0.html[{kib} 7.7 release notes].

// end::notable-highlights[]

[float]
=== Give 7.7 a try

Try 7.7 now by deploying {es} and {kib} on
https://www.elastic.co/cloud/elasticsearch-service/signup[Elastic Cloud] or
by https://www.elastic.co/start[downloading them].
Let us know what you think on Twitter https://twitter.com/elastic[(@elastic)]
or in our https://discuss.elastic.co/c/elasticsearch[forum].
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/release-notes/images/7-7-maps-zoom.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 7 additions & 0 deletions packages/kbn-storybook/storybook_config/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,13 @@ module.exports = async ({ config }) => {
},
});

config.module.rules.push({
test: /\.(html|md|txt|tmpl)$/,
use: {
loader: 'raw-loader',
},
});

// Handle Typescript files
config.module.rules.push({
test: /\.tsx?$/,
Expand Down
3 changes: 3 additions & 0 deletions src/legacy/core_plugins/kibana/public/discover/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,9 @@ export class DiscoverPlugin implements Plugin<void, void> {
await this.initializeServices();
await this.initializeInnerAngular();

// make sure the index pattern list is up to date
const [, { data: dataStart }] = await core.getStartServices();
await dataStart.indexPatterns.clearCache();
const { renderApp } = await import('./np_ready/application');
const unmount = await renderApp(innerAngularName, params.element);
return () => {
Expand Down
2 changes: 2 additions & 0 deletions src/plugins/dashboard/public/plugin.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,8 @@ export class DashboardPlugin
localStorage: new Storage(localStorage),
usageCollection,
};
// make sure the index pattern list is up to date
await dataStart.indexPatterns.clearCache();
const { renderApp } = await import('./application/application');
const unmount = renderApp(params.element, params.appBasePath, deps);
return () => {
Expand Down
20 changes: 20 additions & 0 deletions src/plugins/vis_type_timeseries/server/saved_objects/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/*
* 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.
*/

export { tsvbTelemetrySavedObjectType } from './tsvb_telemetry';
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

import { APICaller, CoreSetup, Plugin, PluginInitializerContext } from 'kibana/server';
import { UsageCollectionSetup } from '../../../usage_collection/server';
import { tsvbTelemetrySavedObjectType } from './saved_object_type';
import { tsvbTelemetrySavedObjectType } from '../saved_objects';

export interface ValidationTelemetryServiceSetup {
logFailedValidation: () => void;
Expand Down
2 changes: 2 additions & 0 deletions src/plugins/visualize/public/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,8 @@ export class VisualizePlugin
};
setServices(deps);

// make sure the index pattern list is up to date
await pluginsStart.data.indexPatterns.clearCache();
const { renderApp } = await import('./application/application');
const unmount = renderApp(params.element, params.appBasePath, deps);
return () => {
Expand Down
2 changes: 2 additions & 0 deletions test/functional/page_objects/dashboard_page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,8 @@ export function DashboardPageProvider({ getService, getPageObjects }: FtrProvide

public async clickNewDashboard() {
await listingTable.clickNewButton('createDashboardPromptButton');
// make sure the dashboard page is shown
await this.waitForRenderComplete();
}

public async clickCreateDashboardPrompt() {
Expand Down
4 changes: 0 additions & 4 deletions x-pack/legacy/plugins/siem/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@ import { i18n } from '@kbn/i18n';
import { resolve } from 'path';
import { Root } from 'joi';

// eslint-disable-next-line @kbn/eslint/no-restricted-paths
import { savedObjectMappings } from '../../../plugins/siem/server/saved_objects';

import { APP_ID, APP_NAME } from '../../../plugins/siem/common/constants';
import { DEFAULT_APP_CATEGORIES } from '../../../../src/core/utils';

Expand Down Expand Up @@ -46,7 +43,6 @@ export const siem = (kibana: any) => {
category: DEFAULT_APP_CATEGORIES.security,
},
],
mappings: savedObjectMappings,
},
config(Joi: Root) {
return Joi.object()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
* or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with the Elastic License.
*/
import { useForm } from '../../../../../../../../../src/plugins/es_ui_shared/static/forms/hook_form_lib/hooks';
jest.mock(
'../../../../../../../../../src/plugins/es_ui_shared/static/forms/hook_form_lib/hooks/use_form'
);
export const mockFormHook = {
isSubmitted: false,
isSubmitting: false,
Expand Down Expand Up @@ -35,3 +39,5 @@ export const getFormMock = (sampleData: any) => ({
}),
getFormData: () => sampleData,
});

export const useFormMock = useForm as jest.Mock;
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ import { Router, routeData, mockHistory, mockLocation } from '../__mock__/router

import { useInsertTimeline } from '../../../../components/timeline/insert_timeline_popover/use_insert_timeline';
import { usePostCase } from '../../../../containers/case/use_post_case';
import { useGetTags } from '../../../../containers/case/use_get_tags';

jest.mock('../../../../components/timeline/insert_timeline_popover/use_insert_timeline');
jest.mock('../../../../containers/case/use_post_case');
import { useForm } from '../../../../../../../../../src/plugins/es_ui_shared/static/forms/hook_form_lib/hooks';
Expand All @@ -22,6 +24,14 @@ import { SiemPageName } from '../../../home/types';
jest.mock(
'../../../../../../../../../src/plugins/es_ui_shared/static/forms/hook_form_lib/hooks/use_form'
);
jest.mock('../../../../containers/case/use_get_tags');
jest.mock(
'../../../../../../../../../src/plugins/es_ui_shared/static/forms/hook_form_lib/components/form_data_provider',
() => ({
FormDataProvider: ({ children }: { children: ({ tags }: { tags: string[] }) => void }) =>
children({ tags: ['rad', 'dude'] }),
})
);

export const useFormMock = useForm as jest.Mock;

Expand All @@ -40,9 +50,11 @@ const defaultInsertTimeline = {
handleCursorChange,
handleOnTimelineChange,
};

const sampleTags = ['coke', 'pepsi'];
const sampleData = {
description: 'what a great description',
tags: ['coke', 'pepsi'],
tags: sampleTags,
title: 'what a cool title',
};
const defaultPostCase = {
Expand All @@ -52,14 +64,28 @@ const defaultPostCase = {
postCase,
};
describe('Create case', () => {
// Suppress warnings about "noSuggestions" prop
/* eslint-disable no-console */
const originalError = console.error;
beforeAll(() => {
console.error = jest.fn();
});
afterAll(() => {
console.error = originalError;
});
/* eslint-enable no-console */
const fetchTags = jest.fn();
const formHookMock = getFormMock(sampleData);

beforeEach(() => {
jest.resetAllMocks();
useInsertTimelineMock.mockImplementation(() => defaultInsertTimeline);
usePostCaseMock.mockImplementation(() => defaultPostCase);
useFormMock.mockImplementation(() => ({ form: formHookMock }));
jest.spyOn(routeData, 'useLocation').mockReturnValue(mockLocation);
(useGetTags as jest.Mock).mockImplementation(() => ({
tags: sampleTags,
fetchTags,
}));
});

it('should post case on submit click', async () => {
Expand Down Expand Up @@ -118,4 +144,19 @@ describe('Create case', () => {
);
expect(wrapper.find(`[data-test-subj="create-case-loading-spinner"]`).exists()).toBeTruthy();
});
it('Tag options render with new tags added', () => {
const wrapper = mount(
<TestProviders>
<Router history={mockHistory}>
<Create />
</Router>
</TestProviders>
);
expect(
wrapper
.find(`[data-test-subj="caseTags"] [data-test-subj="input"]`)
.first()
.prop('options')
).toEqual([{ label: 'coke' }, { label: 'pepsi' }, { label: 'rad' }, { label: 'dude' }]);
});
});
Loading

0 comments on commit 1b7c887

Please sign in to comment.