Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/elastic/kibana into alert…
Browse files Browse the repository at this point in the history
…ing/broken-connector
  • Loading branch information
ymao1 committed Jan 27, 2021
2 parents a1e69b4 + 0fe7b9e commit 5f64fc3
Show file tree
Hide file tree
Showing 73 changed files with 663 additions and 67 deletions.
8 changes: 4 additions & 4 deletions docs/developer/plugin-list.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -380,10 +380,6 @@ and actions.
|The features plugin enhance Kibana with a per-feature privilege system.
|{kib-repo}blob/{branch}/x-pack/plugins/file_upload/README.md[fileUpload]
|Backend and core front-end react-components for GeoJson file upload. Only supports the Maps plugin.
|{kib-repo}blob/{branch}/x-pack/plugins/fleet/README.md[fleet]
|Fleet needs to have Elasticsearch API keys enabled, and also to have TLS enabled on kibana, (if you want to run Kibana without TLS you can provide the following config flag --xpack.fleet.agents.tlsCheckDisabled=false)
Expand Down Expand Up @@ -453,6 +449,10 @@ using the CURL scripts in the scripts folder.
|Visualize geo data from Elasticsearch or 3rd party geo-services.
|{kib-repo}blob/{branch}/x-pack/plugins/maps_file_upload/README.md[mapsFileUpload]
|Deprecated - plugin targeted for removal and will get merged into file_upload plugin
|{kib-repo}blob/{branch}/x-pack/plugins/maps_legacy_licensing/README.md[mapsLegacyLicensing]
|This plugin provides access to the detailed tile map services from Elastic.
Expand Down
15 changes: 14 additions & 1 deletion docs/user/alerting/action-types/webhook.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -72,4 +72,17 @@ Password:: An optional password. If set, HTTP basic authentication is used. Cur

Webhook actions have the following properties:

Body:: A json payload sent to the request URL.
Body:: A JSON payload sent to the request URL. For example:
+
[source,text]
--
{
"short_description": "{{context.rule.name}}",
"description": "{{context.rule.description}}",
...
}
--

Mustache template variables (the text enclosed in double braces, for example, `context.rule.name`) have
their values escaped, so that the final JSON will be valid (escaping double quote characters).
For more information on Mustache template variables, refer to <<defining-alerts-actions-details>>.
2 changes: 1 addition & 1 deletion packages/kbn-optimizer/limits.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ pageLoadAssetSize:
esUiShared: 326654
expressions: 224136
features: 31211
fileUpload: 24717
globalSearch: 43548
globalSearchBar: 62888
globalSearchProviders: 25554
Expand Down Expand Up @@ -106,3 +105,4 @@ pageLoadAssetSize:
stackAlerts: 29684
presentationUtil: 28545
spacesOss: 18817
mapsFileUpload: 23775
3 changes: 2 additions & 1 deletion test/functional/apps/home/_navigation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
const appsMenu = getService('appsMenu');
const esArchiver = getService('esArchiver');

describe('Kibana browser back navigation should work', function describeIndexTests() {
// Failing: See https://github.com/elastic/kibana/issues/88826
describe.skip('Kibana browser back navigation should work', function describeIndexTests() {
before(async () => {
await esArchiver.loadIfNeeded('discover');
await esArchiver.loadIfNeeded('logstash_functional');
Expand Down
3 changes: 2 additions & 1 deletion test/functional/apps/management/_test_huge_fields.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ export default function ({ getService, getPageObjects }) {
const security = getService('security');
const PageObjects = getPageObjects(['common', 'home', 'settings']);

describe('test large number of fields', function () {
// Failing: See https://github.com/elastic/kibana/issues/89031
describe.skip('test large number of fields', function () {
this.tags(['skipCloud']);

const EXPECTED_FIELD_COUNT = '10006';
Expand Down
2 changes: 1 addition & 1 deletion x-pack/.i18nrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"xpack.endpoint": "plugins/endpoint",
"xpack.enterpriseSearch": "plugins/enterprise_search",
"xpack.features": "plugins/features",
"xpack.fileUpload": "plugins/file_upload",
"xpack.fileUpload": "plugins/maps_file_upload",
"xpack.globalSearch": ["plugins/global_search"],
"xpack.globalSearchBar": ["plugins/global_search_bar"],
"xpack.graph": ["plugins/graph"],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,12 @@ export const WorkplaceSearchConfigured: React.FC<InitialAppData> = (props) => {
<Route exact path="/">
{errorConnecting ? <ErrorState /> : <Overview />}
</Route>
<Route path={PERSONAL_SOURCES_PATH}>
{/* TODO: replace Layout with PrivateSourcesLayout (needs to be created) */}
<Layout navigation={<></>} restrictWidth readOnlyMode={readOnlyMode}>
<SourcesRouter />
</Layout>
</Route>
<Route path={SOURCES_PATH}>
<Layout
navigation={<WorkplaceSearchNav sourcesSubNav={showSourcesSubnav && <SourceSubNav />} />}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { EuiCallOut, EuiEmptyPrompt, EuiSpacer, EuiPanel } from '@elastic/eui';

import { LicensingLogic } from '../../../../applications/shared/licensing';

import { ADD_SOURCE_PATH } from '../../routes';
import { ADD_SOURCE_PATH, getSourcesPath } from '../../routes';

import noSharedSourcesIcon from '../../assets/share_circle.svg';

Expand Down Expand Up @@ -74,12 +74,17 @@ export const PrivateSources: React.FC = () => {
sidebarLinks.push({
title: PRIVATE_LINK_TITLE,
iconType: 'plusInCircle',
path: ADD_SOURCE_PATH,
path: getSourcesPath(ADD_SOURCE_PATH, false),
});
}

const headerAction = (
<EuiButtonTo to={ADD_SOURCE_PATH} fill color="primary" data-test-subj="AddSourceButton">
<EuiButtonTo
to={getSourcesPath(ADD_SOURCE_PATH, false)}
fill
color="primary"
data-test-subj="AddSourceButton"
>
{PRIVATE_LINK_TITLE}
</EuiButtonTo>
);
Expand Down
3 changes: 0 additions & 3 deletions x-pack/plugins/file_upload/README.md

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,15 @@ const PERCENT_SIGN_25_SEQUENCE = 'test%25';

window.scrollTo = jest.fn();

jest.mock('@elastic/eui', () => {
const original = jest.requireActual('@elastic/eui');

return {
...original,
EuiIcon: 'eui-icon', // using custom react-svg icon causes issues, mocking for now.
};
});

describe('<App />', () => {
let testBed: AppTestBed;
const { server, httpRequestsMockHelpers } = setupEnvironment();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ jest.mock('@elastic/eui', () => {
}}
/>
),
EuiIcon: 'eui-icon', // using custom react-svg icon causes issues, mocking for now.
};
});

Expand Down Expand Up @@ -236,6 +237,12 @@ export const setup = async (arg?: { appServicesContext: Partial<AppServicesConte
actions: {
setWaitForSnapshotPolicy,
savePolicy,
timeline: {
hasHotPhase: () => exists('ilmTimelineHotPhase'),
hasWarmPhase: () => exists('ilmTimelineWarmPhase'),
hasColdPhase: () => exists('ilmTimelineColdPhase'),
hasDeletePhase: () => exists('ilmTimelineDeletePhase'),
},
hot: {
setMaxSize,
setMaxDocs,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -824,4 +824,50 @@ describe('<EditPolicy />', () => {
expect(actions.cold.searchableSnapshotDisabledDueToRollover()).toBeTruthy();
});
});

describe('policy timeline', () => {
beforeEach(async () => {
httpRequestsMockHelpers.setLoadPolicies([getDefaultHotPhasePolicy('my_policy')]);
httpRequestsMockHelpers.setListNodes({
nodesByRoles: {},
nodesByAttributes: { test: ['123'] },
isUsingDeprecatedDataRoleConfig: false,
});
httpRequestsMockHelpers.setLoadSnapshotPolicies([]);

await act(async () => {
testBed = await setup();
});

const { component } = testBed;
component.update();
});

test('showing all phases on the timeline', async () => {
const { actions } = testBed;
// This is how the default policy should look
expect(actions.timeline.hasHotPhase()).toBe(true);
expect(actions.timeline.hasWarmPhase()).toBe(false);
expect(actions.timeline.hasColdPhase()).toBe(false);
expect(actions.timeline.hasDeletePhase()).toBe(false);

await actions.warm.enable(true);
expect(actions.timeline.hasHotPhase()).toBe(true);
expect(actions.timeline.hasWarmPhase()).toBe(true);
expect(actions.timeline.hasColdPhase()).toBe(false);
expect(actions.timeline.hasDeletePhase()).toBe(false);

await actions.cold.enable(true);
expect(actions.timeline.hasHotPhase()).toBe(true);
expect(actions.timeline.hasWarmPhase()).toBe(true);
expect(actions.timeline.hasColdPhase()).toBe(true);
expect(actions.timeline.hasDeletePhase()).toBe(false);

await actions.delete.enable(true);
expect(actions.timeline.hasHotPhase()).toBe(true);
expect(actions.timeline.hasWarmPhase()).toBe(true);
expect(actions.timeline.hasColdPhase()).toBe(true);
expect(actions.timeline.hasDeletePhase()).toBe(true);
});
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,15 @@ for (let i = 0; i < 105; i++) {
}
window.scrollTo = jest.fn();

jest.mock('@elastic/eui', () => {
const original = jest.requireActual('@elastic/eui');

return {
...original,
EuiIcon: 'eui-icon', // using custom react-svg icon causes issues, mocking for now.
};
});

let component: ReactElement;
const activatePhase = async (rendered: ReactWrapper, phase: string) => {
const testSubject = `enablePhaseSwitch-${phase}`;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ export interface Phases {
delete?: SerializedDeletePhase;
}

export type PhasesExceptDelete = keyof Omit<Phases, 'delete'>;

export interface PolicyFromES {
modified_date: string;
name: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,6 @@ export { OptionalLabel } from './optional_label';
export { PolicyJsonFlyout } from './policy_json_flyout';
export { DescribedFormRow, ToggleFieldWithDescribedFormRow } from './described_form_row';
export { FieldLoadingError } from './field_loading_error';
export { Timeline } from './timeline';

export * from './phases';
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with the Elastic License.
*/
export { Timeline } from './timeline';
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with the Elastic License.
*/

import React, { FunctionComponent } from 'react';

export const InfinityIconSvg: FunctionComponent = (props) => {
return (
<svg
viewBox="0 0 16 16"
aria-hidden="true"
xmlns="http://www.w3.org/2000/svg"
fill="none"
{...props}
>
<defs />
<path
fillRule="evenodd"
clipRule="evenodd"
d="M5.44354 9.86928c-.47429.46802-1.12585.75702-1.84475.75702-1.45038 0-2.626143-1.17576-2.626143-2.62614S2.14841 5.37401 3.59879 5.37401c.71899 0 1.37049.28893 1.84473.75702l.00033-.00033.27438.27438L7.31327 8.0001l-.00001.00001.68777.68777.00001-.00002 1.86843 1.86844-.00078.0007c.65021.6442 1.54481 1.042 2.53251 1.042C14.3888 11.599 16 9.98772 16 8.00016s-1.6112-3.59879-3.5988-3.59879c-.9876 0-1.8822.39779-2.53249 1.04188l.00072.00073-.76518.76516.68777.68777.79978-.79975-.0002-.00017c.471-.44801 1.1082-.72298 1.8096-.72298 1.4504 0 2.6262 1.17577 2.6262 2.62615s-1.1758 2.62614-2.6262 2.62614c-.7012 0-1.3384-.2749-1.8094-.72282l.0002-.00024L8.68881 8.0001l.00278-.00277-.68777-.68777-.00278.00278-1.90297-1.90295-.0007.0007c-.64728-.62456-1.52806-1.00872-2.49858-1.00872C1.61124 4.40137 0 6.0126 0 8.00016 0 9.98772 1.61124 11.599 3.59879 11.599c.97055 0 1.85122-.3841 2.49844-1.0086l.00065.0006.80272-.8027-.68777-.68777-.76902.76901-.00027-.00026z"
/>
</svg>
);
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
$ilmTimelineBarHeight: $euiSizeS;

/*
* For theming we need to shade or tint to get the right color from the base EUI color
*/
$ilmDeletePhaseBackgroundColor: tintOrShade($euiColorVis5_behindText, 80%,80%);
$ilmDeletePhaseColor: shadeOrTint($euiColorVis5, 40%, 40%);

.ilmTimeline {
overflow: hidden;
width: 100%;

&__phasesContainer {
/*
* Let the delete icon sit on the same line as the phase color bars
*/
display: inline-block;
width: 100%;

&__phase:first-child {
padding-left: 0;
padding-right: $euiSizeS;
}

&__phase:last-child {
padding-left: $euiSizeS;
padding-right: 0;
}

&__phase:only-child {
padding-left: 0;
padding-right: 0;
}

&__phase {
/*
* Let the phase color bars sit horizontally
*/
display: inline-block;

padding-left: $euiSizeS;
padding-right: $euiSizeS;
}
}

&__deleteIconContainer {
/*
* Create a bit of space between the timeline and the delete icon
*/
padding: $euiSizeM;
margin-left: $euiSizeM;
background-color: $ilmDeletePhaseBackgroundColor;
color: $ilmDeletePhaseColor;
border-radius: calc(#{$euiSizeS} / 2);
}

&__colorBar {
display: inline-block;
height: $ilmTimelineBarHeight;
border-radius: calc(#{$ilmTimelineBarHeight} / 2);
width: 100%;
}

&__hotPhase {
width: var(--ilm-timeline-hot-phase-width);

&__colorBar {
background-color: $euiColorVis9;
}
}

&__warmPhase {
width: var(--ilm-timeline-warm-phase-width);

&__colorBar {
background-color: $euiColorVis5;
}
}

&__coldPhase {
width: var(--ilm-timeline-cold-phase-width);

&__colorBar {
background-color: $euiColorVis1;
}
}
}
Loading

0 comments on commit 5f64fc3

Please sign in to comment.