Skip to content

Commit

Permalink
Merge branch 'main' into kbn-108972-add-themehimBHto-management-mount
Browse files Browse the repository at this point in the history
  • Loading branch information
kibanamachine authored Nov 17, 2021
2 parents e07f13e + 0c4b58d commit a536b91
Show file tree
Hide file tree
Showing 15 changed files with 186 additions and 145 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import {
} from '@elastic/eui';
import { FormattedMessage } from '@kbn/i18n/react';
import { i18n } from '@kbn/i18n';
import { euiLightVars } from '@kbn/ui-shared-deps-src/theme';

interface ToolBarPaginationProps {
pageSize: number;
Expand All @@ -27,6 +28,11 @@ interface ToolBarPaginationProps {
onPageSizeChange: (size: number) => void;
}

const TOOL_BAR_PAGINATION_STYLES = {
marginLeft: 'auto',
marginRight: euiLightVars.euiSizeL,
};

export const ToolBarPagination = ({
pageSize,
pageCount,
Expand Down Expand Up @@ -61,12 +67,7 @@ export const ToolBarPagination = ({
));

return (
<EuiFlexGroup
justifyContent="spaceBetween"
alignItems="center"
gutterSize="xs"
responsive={false}
>
<EuiFlexGroup alignItems="center" gutterSize="xs" responsive={false}>
<EuiFlexItem grow={false}>
<EuiPopover
button={
Expand All @@ -92,7 +93,7 @@ export const ToolBarPagination = ({
</EuiPopover>
</EuiFlexItem>

<EuiFlexItem grow={false}>
<EuiFlexItem grow={false} style={TOOL_BAR_PAGINATION_STYLES}>
<EuiPagination
aria-label={i18n.translate('discover.docTable.documentsNavigation', {
defaultMessage: 'Documents navigation',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ const optionalArchivePackageProps: readonly OptionalPackageProp[] = [
'readme',
'assets',
'data_streams',
'internal',
'license',
'type',
'categories',
Expand Down
6 changes: 1 addition & 5 deletions x-pack/plugins/fleet/server/services/epm/packages/get.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,15 +54,11 @@ export async function getPackages(
});
// get the installed packages
const packageSavedObjects = await getPackageSavedObjects(savedObjectsClient);
// filter out any internal packages
const savedObjectsVisible = packageSavedObjects.saved_objects.filter(
(o) => !o.attributes.internal
);
const packageList = registryItems
.map((item) =>
createInstallableFrom(
item,
savedObjectsVisible.find(({ id }) => id === item.name)
packageSavedObjects.saved_objects.find(({ id }) => id === item.name)
)
)
.sort(sortByName);
Expand Down
3 changes: 1 addition & 2 deletions x-pack/plugins/fleet/server/services/epm/packages/install.ts
Original file line number Diff line number Diff line change
Expand Up @@ -530,7 +530,7 @@ export async function createInstallation(options: {
installSource: InstallSource;
}) {
const { savedObjectsClient, packageInfo, installSource } = options;
const { internal = false, name: pkgName, version: pkgVersion } = packageInfo;
const { name: pkgName, version: pkgVersion } = packageInfo;
const removable = !isUnremovablePackage(pkgName);
const toSaveESIndexPatterns = generateESIndexPatterns(packageInfo.data_streams);

Expand All @@ -549,7 +549,6 @@ export async function createInstallation(options: {
es_index_patterns: toSaveESIndexPatterns,
name: pkgName,
version: pkgVersion,
internal,
removable,
install_version: pkgVersion,
install_status: 'installing',
Expand Down
4 changes: 1 addition & 3 deletions x-pack/plugins/fleet/server/services/epm/registry/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,7 @@ export async function fetchList(params?: SearchParams): Promise<RegistrySearchRe

export async function fetchFindLatestPackage(packageName: string): Promise<RegistrySearchResult> {
const registryUrl = getRegistryUrl();
const url = new URL(
`${registryUrl}/search?package=${packageName}&internal=true&experimental=true`
);
const url = new URL(`${registryUrl}/search?package=${packageName}&experimental=true`);

setKibanaVersion(url);

Expand Down
9 changes: 8 additions & 1 deletion x-pack/plugins/security_solution/cypress/screens/timeline.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ export const SELECT_CASE = (id: string) => {
return `[data-test-subj="cases-table-row-select-${id}"]`;
};

export const CELL = '[data-test-subj="statefulCell"]';
export const CORRELATION_EVENT_TABLE_CELL =
'[data-test-subj="eql-events-table"] [data-test-subj="statefulCell"]';

export const CLOSE_TIMELINE_BTN = '[data-test-subj="close-timeline"]';

Expand Down Expand Up @@ -104,6 +105,9 @@ export const OPEN_TIMELINE_TEMPLATE_ICON =

export const PIN_EVENT = '[data-test-subj="pin"]';

export const PINNED_EVENT_TABLE_CELL =
'[data-test-subj="pinned-events-table"] [data-test-subj="statefulCell"]';

export const PINNED_TAB_BUTTON = '[data-test-subj="timelineTabs-pinned"]';

export const PROCESS_KPI = '[data-test-subj="siem-timeline-process-kpi"';
Expand All @@ -120,6 +124,9 @@ export const SEARCH_OR_FILTER_CONTAINER =

export const INDICATOR_MATCH_ROW_RENDER = '[data-test-subj="threat-match-row"]';

export const QUERY_EVENT_TABLE_CELL =
'[data-test-subj="query-events-table"] [data-test-subj="statefulCell"]';

export const QUERY_TAB_BUTTON = '[data-test-subj="timelineTabs-query"]';

export const SERVER_SIDE_EVENT_COUNT = '[data-test-subj="server-side-event-count"]';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*/

import {
CELL,
CORRELATION_EVENT_TABLE_CELL,
DATA_PROVIDERS,
DATE_PICKER_END,
DATE_PICKER_START,
Expand All @@ -17,8 +17,10 @@ import {
NOTE_DESCRIPTION,
NOTE_PREVIEW,
NOTES_TAB_BUTTON,
PINNED_EVENT_TABLE_CELL,
PINNED_TAB_BUTTON,
PROCESS_KPI,
QUERY_EVENT_TABLE_CELL,
SOURCE_IP_KPI,
TIMELINE_CORRELATION_TAB,
TIMELINE_CORRELATION_INPUT,
Expand Down Expand Up @@ -62,7 +64,7 @@ const timelineDetails = {
};

const detectionAlert = {
timestamp: 'Oct 7, 2021 @ 11:14:10.888',
timestamp: 'Nov 17, 2021 @ 09:36:25.499',
message: '—',
eventCategory: 'file',
eventAction: 'initial_scan',
Expand All @@ -73,7 +75,7 @@ const detectionAlert = {
};

const event = {
timestamp: 'Oct 6, 2021 @ 17:09:29.438',
timestamp: 'Nov 4, 2021 @ 11:09:29.438',
message: '—',
eventCategory: 'file',
eventAction: 'initial_scan',
Expand All @@ -98,7 +100,7 @@ describe('Import timeline after upgrade', () => {
cy.readFile(`cypress/fixtures/${timeline}`).then((file) => {
const timelineJson = JSON.parse(file);
const regex = new RegExp(
`\\S${timelineJson.globalNotes[0].createdBy}added a note\\d* \\w* ago${timelineJson.globalNotes[0].createdBy} added a note${timelineJson.globalNotes[0].note}`
`\\S${timelineJson.globalNotes[0].createdBy}added a note\\S*\\s?(\\S*)?\\s?(\\S*)?${timelineJson.globalNotes[0].createdBy} added a note${timelineJson.globalNotes[0].note}`
);

cy.get(TIMELINE_NAME).should('have.text', timelineJson.title);
Expand Down Expand Up @@ -147,30 +149,31 @@ describe('Import timeline after upgrade', () => {
cy.get(NOTES_TAB_BUTTON).should('have.text', timelineDetails.notesTab);
cy.get(PINNED_TAB_BUTTON).should('have.text', timelineDetails.pinnedTab);

cy.get(CELL).eq(0).should('contain', detectionAlert.timestamp);
cy.get(CELL).eq(1).should('contain', detectionAlert.message);
cy.get(CELL).eq(2).should('contain', detectionAlert.eventCategory);
cy.get(CELL).eq(3).should('contain', detectionAlert.eventAction);
cy.get(CELL).eq(4).should('contain', detectionAlert.hostName);
cy.get(CELL).eq(5).should('contain', detectionAlert.sourceIp);
cy.get(CELL).eq(6).should('contain', detectionAlert.destinationIp);
cy.get(CELL).eq(7).should('contain', detectionAlert.userName);

cy.get(CELL).eq(8).should('contain', event.timestamp);
cy.get(CELL).eq(9).should('contain', event.message);
cy.get(CELL).eq(10).should('contain', event.eventCategory);
cy.get(CELL).eq(11).should('contain', event.eventAction);
cy.get(CELL).eq(12).should('contain', event.hostName);
cy.get(CELL).eq(13).should('contain', event.sourceIp);
cy.get(CELL).eq(14).should('contain', event.destinationIp);
cy.get(CELL).eq(15).should('contain', event.userName);
cy.get(QUERY_EVENT_TABLE_CELL).eq(0).should('contain', detectionAlert.timestamp);
cy.get(QUERY_EVENT_TABLE_CELL).eq(1).should('contain', detectionAlert.message);
cy.get(QUERY_EVENT_TABLE_CELL).eq(2).should('contain', detectionAlert.eventCategory);
cy.get(QUERY_EVENT_TABLE_CELL).eq(3).should('contain', detectionAlert.eventAction);
cy.get(QUERY_EVENT_TABLE_CELL).eq(4).should('contain', detectionAlert.hostName);
cy.get(QUERY_EVENT_TABLE_CELL).eq(5).should('contain', detectionAlert.sourceIp);
cy.get(QUERY_EVENT_TABLE_CELL).eq(6).should('contain', detectionAlert.destinationIp);
cy.get(QUERY_EVENT_TABLE_CELL).eq(7).should('contain', detectionAlert.userName);

cy.get(QUERY_EVENT_TABLE_CELL).eq(8).should('contain', event.timestamp);
cy.get(QUERY_EVENT_TABLE_CELL).eq(9).should('contain', event.message);
cy.get(QUERY_EVENT_TABLE_CELL).eq(10).should('contain', event.eventCategory);
cy.get(QUERY_EVENT_TABLE_CELL).eq(11).should('contain', event.eventAction);
cy.get(QUERY_EVENT_TABLE_CELL).eq(12).should('contain', event.hostName);
cy.get(QUERY_EVENT_TABLE_CELL).eq(13).should('contain', event.sourceIp);
cy.get(QUERY_EVENT_TABLE_CELL).eq(14).should('contain', event.destinationIp);
cy.get(QUERY_EVENT_TABLE_CELL).eq(15).should('contain', event.userName);
});
});

it('Displays the correct timeline details inside the query tab', () => {
it('Displays the correct timeline details inside the correlation tab', () => {
goToCorrelationTab();

cy.get(TIMELINE_CORRELATION_INPUT).should('be.empty');
cy.get(CORRELATION_EVENT_TABLE_CELL).should('not.exist');
});

it('Displays the correct timeline details inside the notes tab', () => {
Expand All @@ -179,27 +182,27 @@ describe('Import timeline after upgrade', () => {
cy.readFile(`cypress/fixtures/${timeline}`).then((file) => {
const timelineJson = JSON.parse(file);
const descriptionRegex = new RegExp(
`\\S${username}added description\\d* \\w* ago${timelineJson.description}`
`\\S${username}added description\\S*\\s?(\\S*)?\\s?(\\S*)?${timelineJson.description}`
);
const noteRegex = new RegExp(
`\\S${timelineJson.globalNotes[0].createdBy}added a note\\d* \\w* ago${timelineJson.globalNotes[0].createdBy} added a note${timelineJson.globalNotes[0].note}`
`\\S${timelineJson.globalNotes[0].createdBy}added a note\\S*\\s?(\\S*)?\\s?(\\S*)?${timelineJson.globalNotes[0].createdBy} added a note${timelineJson.globalNotes[0].note}`
);

cy.get(NOTE_DESCRIPTION).invoke('text').should('match', descriptionRegex);
cy.get(NOTE_PREVIEW).invoke('text').should('match', noteRegex);
cy.get(NOTE_PREVIEW).last().invoke('text').should('match', noteRegex);
});
});

it('Displays the correct timeline details inside the pinned tab', () => {
goToPinnedTab();

cy.get(CELL).eq(0).should('contain', detectionAlert.timestamp);
cy.get(CELL).eq(1).should('contain', detectionAlert.message);
cy.get(CELL).eq(2).should('contain', detectionAlert.eventCategory);
cy.get(CELL).eq(3).should('contain', detectionAlert.eventAction);
cy.get(CELL).eq(4).should('contain', detectionAlert.hostName);
cy.get(CELL).eq(5).should('contain', detectionAlert.sourceIp);
cy.get(CELL).eq(6).should('contain', detectionAlert.destinationIp);
cy.get(CELL).eq(7).should('contain', detectionAlert.userName);
cy.get(PINNED_EVENT_TABLE_CELL).eq(0).should('contain', detectionAlert.timestamp);
cy.get(PINNED_EVENT_TABLE_CELL).eq(1).should('contain', detectionAlert.message);
cy.get(PINNED_EVENT_TABLE_CELL).eq(2).should('contain', detectionAlert.eventCategory);
cy.get(PINNED_EVENT_TABLE_CELL).eq(3).should('contain', detectionAlert.eventAction);
cy.get(PINNED_EVENT_TABLE_CELL).eq(4).should('contain', detectionAlert.hostName);
cy.get(PINNED_EVENT_TABLE_CELL).eq(5).should('contain', detectionAlert.sourceIp);
cy.get(PINNED_EVENT_TABLE_CELL).eq(6).should('contain', detectionAlert.destinationIp);
cy.get(PINNED_EVENT_TABLE_CELL).eq(7).should('contain', detectionAlert.userName);
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,14 @@ import { FormattedMessage } from '@kbn/i18n/react';

export const OutOfDate = React.memo<{ style?: React.CSSProperties }>(({ style, ...otherProps }) => {
return (
<EuiText color="subdued" size="xs" className="eui-textNoWrap" style={style} {...otherProps}>
<EuiIcon size="m" type="alert" color="warning" />
<EuiText
color="subdued"
size="xs"
className="eui-textNoWrap eui-displayInlineBlock"
style={style}
{...otherProps}
>
<EuiIcon className={'eui-alignTop'} size="m" type="alert" color="warning" />
<FormattedMessage id="xpack.securitySolution.outOfDateLabel" defaultMessage="Out-of-date" />
</EuiText>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*/

import React, { memo, useMemo } from 'react';
import { EuiTab, EuiTabs, EuiFlyoutBody, EuiSpacer } from '@elastic/eui';
import { EuiTab, EuiTabs, EuiFlyoutBody } from '@elastic/eui';
import { EndpointIndexUIQueryParams } from '../../../types';

import { EndpointDetailsFlyoutHeader } from './flyout_header';
Expand Down Expand Up @@ -68,7 +68,6 @@ export const EndpointDetailsFlyoutTabs = memo(
return (
<>
<EndpointDetailsFlyoutHeader hostname={hostname} hasBorder>
<EuiSpacer size="s" />
<EuiTabs style={{ marginBottom: '-25px' }}>{renderTabs}</EuiTabs>
</EndpointDetailsFlyoutHeader>
<EuiFlyoutBody data-test-subj="endpointDetailsFlyoutBody">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export const EndpointDetailsFlyoutHeader = memo(
<EuiLoadingContent lines={1} />
) : (
<EuiToolTip content={hostname} anchorClassName="eui-textTruncate">
<EuiTitle>
<EuiTitle size="s">
<h2
style={{ overflow: 'hidden', textOverflow: 'ellipsis' }}
data-test-subj="endpointDetailsFlyoutTitle"
Expand Down
Loading

0 comments on commit a536b91

Please sign in to comment.