Skip to content

Commit

Permalink
merge with master
Browse files Browse the repository at this point in the history
  • Loading branch information
nreese committed Apr 13, 2020
2 parents e2ac7d7 + 8cef945 commit 13cad80
Show file tree
Hide file tree
Showing 53 changed files with 971 additions and 1,187 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { fitToLayerExtent, updateSourceProp } from '../../actions/map_actions';
function mapStateToProps(state = {}) {
const selectedLayer = getSelectedLayer(state);
return {
key: selectedLayer ? selectedLayer.getId() : '',
key: selectedLayer ? `${selectedLayer.getId()}${selectedLayer.isJoinable()}` : '',
selectedLayer,
};
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,8 @@ export function buildMapsTelemetry({
const mapsCount = layerLists.length;

const dataSourcesCount = layerLists.map(lList => {
// todo: not every source-descriptor has an id
// @ts-ignore
const sourceIdList = lList.map((layer: LayerDescriptor) => layer.sourceDescriptor.id);
return _.uniq(sourceIdList).length;
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,16 @@ import {
FIFTH_RULE,
FIRST_RULE,
RULE_NAME,
RULE_SWITCH,
SECOND_RULE,
SEVENTH_RULE,
} from '../screens/signal_detection_rules';

import { goToManageSignalDetectionRules } from '../tasks/detections';
import {
goToManageSignalDetectionRules,
waitForSignalsPanelToBeLoaded,
waitForSignalsIndexToBeCreated,
} from '../tasks/detections';
import { esArchiverLoad, esArchiverUnload } from '../tasks/es_archiver';
import { loginAndWaitForPageWithoutDateRange } from '../tasks/login';
import {
Expand All @@ -32,8 +37,10 @@ describe('Signal detection rules', () => {
esArchiverUnload('prebuilt_rules_loaded');
});

it.skip('Sorts by activated rules', () => {
it('Sorts by activated rules', () => {
loginAndWaitForPageWithoutDateRange(DETECTIONS);
waitForSignalsPanelToBeLoaded();
waitForSignalsIndexToBeCreated();
goToManageSignalDetectionRules();
waitForLoadElasticPrebuiltDetectionRulesTableToBeLoaded();
cy.get(RULE_NAME)
Expand All @@ -52,10 +59,24 @@ describe('Signal detection rules', () => {

cy.get(RULE_NAME)
.eq(FIRST_RULE)
.should('have.text', fifthRuleName);
cy.get(RULE_NAME)
.invoke('text')
.then(firstRuleName => {
cy.get(RULE_NAME)
.eq(SECOND_RULE)
.invoke('text')
.then(secondRuleName => {
const expectedRulesNames = `${firstRuleName} ${secondRuleName}`;
cy.wrap(expectedRulesNames).should('include', fifthRuleName);
cy.wrap(expectedRulesNames).should('include', seventhRuleName);
});
});

cy.get(RULE_SWITCH)
.eq(FIRST_RULE)
.should('have.attr', 'role', 'switch');
cy.get(RULE_SWITCH)
.eq(SECOND_RULE)
.should('have.text', seventhRuleName);
.should('have.attr', 'role', 'switch');
});
});
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export const ShellEnrollmentInstructions: React.FunctionComponent<Props> = ({
// apiKey.api_key
// } sh -c "$(curl ${kibanaUrl}/api/ingest_manager/fleet/install/${currentPlatform})"`;

const quickInstallInstructions = `./agent enroll ${kibanaUrl} ${apiKey.api_key}`;
const quickInstallInstructions = `./elastic-agent enroll ${kibanaUrl} ${apiKey.api_key}`;

return (
<>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,15 @@ import React, { memo } from 'react';
import styled from 'styled-components';
import { EuiFlexGroup, EuiFlexItem, EuiTabs, EuiTab, EuiSpacer } from '@elastic/eui';
import { Props as EuiTabProps } from '@elastic/eui/src/components/tabs/tab';
import { EuiFlexItemProps } from '@elastic/eui/src/components/flex/flex_item';

const Container = styled.div`
border-bottom: ${props => props.theme.eui.euiBorderThin};
background-color: ${props => props.theme.eui.euiPageBackgroundColor};
`;

const Wrapper = styled.div`
max-width: 1200px;
const Wrapper = styled.div<{ maxWidth?: number }>`
max-width: ${props => props.maxWidth || 1200}px;
margin-left: auto;
margin-right: auto;
padding-top: ${props => props.theme.eui.paddingSizes.xl};
Expand All @@ -30,22 +31,36 @@ const Tabs = styled(EuiTabs)`
`;

export interface HeaderProps {
restrictHeaderWidth?: number;
leftColumn?: JSX.Element;
rightColumn?: JSX.Element;
rightColumnGrow?: EuiFlexItemProps['grow'];
tabs?: EuiTabProps[];
}

const HeaderColumns: React.FC<Omit<HeaderProps, 'tabs'>> = memo(({ leftColumn, rightColumn }) => (
<EuiFlexGroup alignItems="center">
{leftColumn ? <EuiFlexItem>{leftColumn}</EuiFlexItem> : null}
{rightColumn ? <EuiFlexItem>{rightColumn}</EuiFlexItem> : null}
</EuiFlexGroup>
));
const HeaderColumns: React.FC<Omit<HeaderProps, 'tabs'>> = memo(
({ leftColumn, rightColumn, rightColumnGrow }) => (
<EuiFlexGroup alignItems="center">
{leftColumn ? <EuiFlexItem>{leftColumn}</EuiFlexItem> : null}
{rightColumn ? <EuiFlexItem grow={rightColumnGrow}>{rightColumn}</EuiFlexItem> : null}
</EuiFlexGroup>
)
);

export const Header: React.FC<HeaderProps> = ({ leftColumn, rightColumn, tabs }) => (
export const Header: React.FC<HeaderProps> = ({
leftColumn,
rightColumn,
rightColumnGrow,
tabs,
restrictHeaderWidth,
}) => (
<Container>
<Wrapper>
<HeaderColumns leftColumn={leftColumn} rightColumn={rightColumn} />
<Wrapper maxWidth={restrictHeaderWidth}>
<HeaderColumns
leftColumn={leftColumn}
rightColumn={rightColumn}
rightColumnGrow={rightColumnGrow}
/>
<EuiFlexGroup>
{tabs ? (
<EuiFlexItem>
Expand Down
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;
* you may not use this file except in compliance with the Elastic License.
*/

import React from 'react';
import { EuiCallOut, EuiOverlayMask, EuiConfirmModal, EuiSpacer } from '@elastic/eui';
import { FormattedMessage } from '@kbn/i18n/react';
import { i18n } from '@kbn/i18n';
import { AgentConfig } from '../../../../types';

export const ConfirmCreateDatasourceModal: React.FunctionComponent<{
onConfirm: () => void;
onCancel: () => void;
agentCount: number;
agentConfig: AgentConfig;
}> = ({ onConfirm, onCancel, agentCount, agentConfig }) => {
return (
<EuiOverlayMask>
<EuiConfirmModal
title={
<FormattedMessage
id="xpack.ingestManager.createDatasource.confirmModalTitle"
defaultMessage="Save and deploy changes"
/>
}
onCancel={onCancel}
onConfirm={onConfirm}
cancelButtonText={
<FormattedMessage
id="xpack.ingestManager.deleteApiKeys.confirmModal.cancelButtonLabel"
defaultMessage="Cancel"
/>
}
confirmButtonText={
<FormattedMessage
id="xpack.ingestManager.createDatasource.confirmModalConfirmButtonLabel"
defaultMessage="Save and deploy changes"
/>
}
buttonColor="primary"
>
<EuiCallOut
iconType="iInCircle"
title={i18n.translate('xpack.ingestManager.createDatasource.confirmModalCalloutTitle', {
defaultMessage:
'This action will update {agentCount, plural, one {# agent} other {# agents}}',
values: {
agentCount,
},
})}
>
<FormattedMessage
id="xpack.ingestManager.createDatasource.confirmModalCalloutDescription"
defaultMessage="Fleet has detected that the selected agent configuration, {configName}, is already in use by
some of your agents. As a result of this action, Fleet will deploy updates to all agents
that use this configuration."
values={{
configName: <b>{agentConfig.name}</b>,
}}
/>
</EuiCallOut>
<EuiSpacer size="l" />
<FormattedMessage
id="xpack.ingestManager.createDatasource.confirmModalDescription"
defaultMessage="This action can not be undone. Are you sure you wish to continue?"
/>
</EuiConfirmModal>
</EuiOverlayMask>
);
};
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@
*/
export { CreateDatasourcePageLayout } from './layout';
export { DatasourceInputPanel } from './datasource_input_panel';
export { ConfirmCreateDatasourceModal } from './confirm_modal';
export { DatasourceInputVarField } from './datasource_input_var_field';
Loading

0 comments on commit 13cad80

Please sign in to comment.