Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into task/olm-delete-p…
Browse files Browse the repository at this point in the history
…olicy-list-code
  • Loading branch information
paul-tavares committed Dec 30, 2020
2 parents e14e4d5 + 0c9a573 commit 6da1329
Show file tree
Hide file tree
Showing 9 changed files with 317 additions and 32 deletions.
Binary file modified docs/user/ml/images/ml-data-visualizer-sample.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
18 changes: 10 additions & 8 deletions vars/tasks.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -115,14 +115,16 @@ def functionalXpack(Map params = [:]) {
task(kibanaPipeline.functionalTestProcess('xpack-savedObjectsFieldMetrics', './test/scripts/jenkins_xpack_saved_objects_field_metrics.sh'))
}

whenChanged([
'x-pack/plugins/security_solution/',
'x-pack/test/security_solution_cypress/',
'x-pack/plugins/triggers_actions_ui/public/application/sections/action_connector_form/',
'x-pack/plugins/triggers_actions_ui/public/application/context/actions_connectors_context.tsx',
]) {
task(kibanaPipeline.functionalTestProcess('xpack-securitySolutionCypress', './test/scripts/jenkins_security_solution_cypress.sh'))
}
whenChanged([
'x-pack/plugins/security_solution/',
'x-pack/test/security_solution_cypress/',
'x-pack/plugins/triggers_actions_ui/public/application/sections/action_connector_form/',
'x-pack/plugins/triggers_actions_ui/public/application/context/actions_connectors_context.tsx',
]) {
if (githubPr.isPr()) {
task(kibanaPipeline.functionalTestProcess('xpack-securitySolutionCypress', './test/scripts/jenkins_security_solution_cypress.sh'))
}
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ export const CreatePackagePolicyPageLayout: React.FunctionComponent<{
</EuiFlexItem>
<EuiFlexItem>
<EuiText>
<h1>
{from === 'edit' ? (
<h1 data-test-subj={`${dataTestSubj}_pageTitle`}>
{from === 'edit' || from === 'package-edit' ? (
<FormattedMessage
id="xpack.fleet.editPackagePolicy.pageTitleWithPackageName"
defaultMessage="Edit {packageName} integration"
Expand All @@ -78,7 +78,7 @@ export const CreatePackagePolicyPageLayout: React.FunctionComponent<{

return from === 'edit' || from === 'package-edit' ? (
<EuiText>
<h1>
<h1 data-test-subj={`${dataTestSubj}_pageTitle`}>
<FormattedMessage
id="xpack.fleet.editPackagePolicy.pageTitle"
defaultMessage="Edit integration"
Expand All @@ -95,7 +95,7 @@ export const CreatePackagePolicyPageLayout: React.FunctionComponent<{
</h1>
</EuiText>
);
}, [from, packageInfo]);
}, [dataTestSubj, from, packageInfo]);

const pageDescription = useMemo(() => {
return from === 'edit' || from === 'package-edit' ? (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1876,7 +1876,7 @@ describe('IndexPattern Data Source suggestions', () => {
expect(suggestions.length).toBe(6);
});

it('returns an only metric version of a given table', () => {
it('returns an only metric version of a given table, but does not include current state as reduced', () => {
const initialState = testInitialState();
const state: IndexPatternPrivateState = {
indexPatternRefs: [],
Expand Down Expand Up @@ -1953,6 +1953,21 @@ describe('IndexPattern Data Source suggestions', () => {
};

const suggestions = getSuggestionSubset(getDatasourceSuggestionsFromCurrentState(state));
expect(suggestions).not.toContainEqual(
expect.objectContaining({
table: expect.objectContaining({
changeType: 'reduced',
columns: [
expect.objectContaining({
operation: expect.objectContaining({ label: 'field2' }),
}),
expect.objectContaining({
operation: expect.objectContaining({ label: 'Average of field1' }),
}),
],
}),
})
);
expect(suggestions).toContainEqual(
expect.objectContaining({
table: expect.objectContaining({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -583,8 +583,9 @@ function createSimplifiedTableSuggestions(state: IndexPatternPrivateState, layer
columnOrder: [...bucketedColumns, ...availableMetricColumns],
};

if (availableReferenceColumns.length) {
// Don't remove buckets when dealing with any refs. This can break refs.
if (availableBucketedColumns.length <= 1 || availableReferenceColumns.length) {
// Don't simplify when dealing with single-bucket table. Also don't break
// reference-based columns by removing buckets.
return [];
} else if (availableMetricColumns.length > 1) {
return [{ ...layer, columnOrder: [...bucketedColumns, availableMetricColumns[0]] }];
Expand All @@ -597,7 +598,6 @@ function createSimplifiedTableSuggestions(state: IndexPatternPrivateState, layer
availableReferenceColumns.length
? []
: availableMetricColumns.map((columnId) => {
// build suggestions with only metrics
return { ...layer, columnOrder: [columnId] };
})
)
Expand All @@ -606,8 +606,7 @@ function createSimplifiedTableSuggestions(state: IndexPatternPrivateState, layer
state,
layerId,
updatedLayer,
changeType:
layer.columnOrder.length === updatedLayer.columnOrder.length ? 'unchanged' : 'reduced',
changeType: 'reduced',
label:
updatedLayer.columnOrder.length === 1
? getMetricSuggestionTitle(updatedLayer, availableMetricColumns.length === 1)
Expand Down
11 changes: 3 additions & 8 deletions x-pack/plugins/security_solution/common/endpoint/index_data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -232,8 +232,8 @@ const createPolicy = async (
): Promise<CreatePackagePolicyResponse['item']> => {
// Create Agent Policy first
const newAgentPolicyData: CreateAgentPolicyRequest['body'] = {
name: `Policy for ${policyName}`,
description: '',
name: `Policy for ${policyName} (${Math.random().toString(36).substr(2, 5)})`,
description: `Policy created with endpoint data generator (${policyName})`,
namespace: 'default',
};
let agentPolicy;
Expand Down Expand Up @@ -368,12 +368,7 @@ const fleetEnrollAgentForHost = async (
},
},
host: {
architecture: 'x86_64',
hostname: endpointHost.host,
name: endpointHost.host,
id: '1c032ec0-3a94-4d54-9ad2-c5610c0eaba4',
ip: ['fe80::703b:b9e6:887d:7f5/64', '10.0.2.15/24', '::1/128', '127.0.0.1/8'],
mac: ['08:00:27:d8:c5:c0'],
...endpointHost.host,
},
os: {
family: 'windows',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,21 +18,21 @@ const TRANSLATIONS: Readonly<{ [K in 'title' | 'description' | 'label']: string
title: i18n.translate(
'xpack.securitySolution.endpoint.policy.details.antivirusRegistration.type',
{
defaultMessage: 'Register as anti-virus',
defaultMessage: 'Register as antivirus',
}
),
description: i18n.translate(
'xpack.securitySolution.endpoint.policy.details.antivirusRegistration.explanation',
{
defaultMessage:
'Toggle on to register Elastic as an official Anti-Virus solution for Windows OS. ' +
'Toggle on to register Elastic as an official Antivirus solution for Windows OS. ' +
'This will also disable Windows Defender.',
}
),
label: i18n.translate(
'xpack.securitySolution.endpoint.policy.details.antivirusRegistration.toggle',
{
defaultMessage: 'Register as anti-virus',
defaultMessage: 'Register as antivirus',
}
),
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* you may not use this file except in compliance with the Elastic License.
*/

import { EuiFlexGroup, EuiFlexItem, EuiSuperSelect, EuiToolTip } from '@elastic/eui';
import { EuiFlexGroup, EuiFlexItem, EuiToolTip } from '@elastic/eui';
import React, { useCallback } from 'react';
import styled, { createGlobalStyle } from 'styled-components';

Expand All @@ -15,6 +15,7 @@ import { DispatchUpdateReduxTime } from '../../../../common/components/super_dat
import { DataProvider } from '../data_providers/data_provider';
import { QueryBarTimeline } from '../query_bar';

import { EuiSuperSelect } from './super_select';
import { options } from './helpers';
import * as i18n from './translations';

Expand All @@ -28,8 +29,8 @@ const SearchOrFilterGlobalStyle = createGlobalStyle`
width: 350px !important;
}
.${searchOrFilterPopoverClassName}__popoverPanel {
width: ${searchOrFilterPopoverWidth};
.${searchOrFilterPopoverClassName}.euiPopover__panel {
width: ${searchOrFilterPopoverWidth} !important;
.euiSuperSelect__listbox {
width: ${searchOrFilterPopoverWidth} !important;
Expand Down
Loading

0 comments on commit 6da1329

Please sign in to comment.