Skip to content

Commit

Permalink
Merge branch 'master' of github.com:elastic/kibana into telemetry/ser…
Browse files Browse the repository at this point in the history
…ver_fetcher
  • Loading branch information
Bamieh committed Nov 13, 2019
2 parents d88e765 + 59e0a1c commit 6a077d3
Show file tree
Hide file tree
Showing 107 changed files with 5,009 additions and 923 deletions.
2 changes: 1 addition & 1 deletion src/legacy/core_plugins/telemetry/common/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export const LOCALSTORAGE_KEY = 'telemetry.data';
/**
* Link to the Elastic Telemetry privacy statement.
*/
export const PRIVACY_STATEMENT_URL = `https://www.elastic.co/legal/telemetry-privacy-statement`;
export const PRIVACY_STATEMENT_URL = `https://www.elastic.co/legal/privacy-statement`;

/**
* The type name used within the Monitoring index to publish localization stats.
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export class OptInBanner extends React.PureComponent<Props> {
const title = (
<FormattedMessage
id="telemetry.welcomeBanner.title"
defaultMessage="Help us improve the Elastic Stack!"
defaultMessage="Help us improve the Elastic Stack"
/>
);
return (
Expand All @@ -45,12 +45,18 @@ export class OptInBanner extends React.PureComponent<Props> {
<EuiFlexGroup gutterSize="s" alignItems="center">
<EuiFlexItem grow={false}>
<EuiButton size="s" onClick={() => this.props.optInClick(true)}>
<FormattedMessage id="telemetry.welcomeBanner.yesButtonLabel" defaultMessage="Yes" />
<FormattedMessage
id="telemetry.welcomeBanner.enableButtonLabel"
defaultMessage="Enable"
/>
</EuiButton>
</EuiFlexItem>
<EuiFlexItem grow={false}>
<EuiButton size="s" onClick={() => this.props.optInClick(false)}>
<FormattedMessage id="telemetry.welcomeBanner.noButtonLabel" defaultMessage="No" />
<FormattedMessage
id="telemetry.welcomeBanner.disableButtonLabel"
defaultMessage="Disable"
/>
</EuiButton>
</EuiFlexItem>
</EuiFlexGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
/*
* 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.
*/
import React from 'react';
import { shallowWithIntl } from 'test_utils/enzyme_helpers';
import { OptInMessage } from './opt_in_message';

describe('OptInMessage', () => {
it('renders as expected', () => {
expect(
shallowWithIntl(<OptInMessage fetchTelemetry={jest.fn(async () => [])} />)
).toMatchSnapshot();
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@ import * as React from 'react';
import { EuiLink } from '@elastic/eui';
import { FormattedMessage } from '@kbn/i18n/react';

import { getConfigTelemetryDesc, PRIVACY_STATEMENT_URL } from '../../common/constants';
import { OptInExampleFlyout } from './opt_in_details_component';
import { PRIVACY_STATEMENT_URL } from '../../common/constants';

interface Props {
fetchTelemetry: () => Promise<any[]>;
Expand All @@ -46,60 +45,22 @@ export class OptInMessage extends React.PureComponent<Props, State> {
};

render() {
const { showDetails, showExample } = this.state;

const getDetails = () => (
<FormattedMessage
id="telemetry.welcomeBanner.telemetryConfigDetailsDescription"
defaultMessage="No information about the data you process or store will be sent. This feature
will periodically send basic feature usage statistics. See an {exampleLink} or read our {telemetryPrivacyStatementLink}.
You can disable this feature at any time."
values={{
exampleLink: (
<EuiLink onClick={this.toggleShowExample}>
<FormattedMessage
id="telemetry.welcomeBanner.telemetryConfigDetailsDescription.exampleLinkText"
defaultMessage="example"
/>
</EuiLink>
),
telemetryPrivacyStatementLink: (
<EuiLink href={PRIVACY_STATEMENT_URL} target="_blank">
<FormattedMessage
id="telemetry.welcomeBanner.telemetryConfigDetailsDescription.telemetryPrivacyStatementLinkText"
defaultMessage="telemetry privacy statement"
/>
</EuiLink>
),
}}
/>
);

const getFlyoutDetails = () => (
<OptInExampleFlyout
onClose={() => this.setState({ showExample: false })}
fetchTelemetry={this.props.fetchTelemetry}
/>
);

const getReadMore = () => (
<EuiLink onClick={() => this.setState({ showDetails: true })}>
<FormattedMessage
id="telemetry.welcomeBanner.telemetryConfigDescription.readMoreLinkText"
defaultMessage="Read more"
/>
</EuiLink>
);

return (
<React.Fragment>
{getConfigTelemetryDesc()} {!showDetails && getReadMore()}
{showDetails && (
<span style={{ display: 'block', paddingTop: '10px' }}>
{getDetails()}
{showExample && getFlyoutDetails()}
</span>
)}
<FormattedMessage
id="telemetry.telemetryBannerDescription"
defaultMessage="Want to help us improve the Elastic Stack? Data usage collection is currently disabled. Enabling data usage collection helps us manage and improve our products and services. See our {privacyStatementLink} for more details."
values={{
privacyStatementLink: (
<EuiLink href={PRIVACY_STATEMENT_URL} target="_blank">
<FormattedMessage
id="telemetry.welcomeBanner.telemetryConfigDetailsDescription.telemetryPrivacyStatementLinkText"
defaultMessage="Privacy Statement"
/>
</EuiLink>
),
}}
/>
</React.Fragment>
);
}
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,16 @@
*/

/** Top-level (global) navigation link to the `Hosts` page */
export const NAVIGATION_HOSTS = '[data-test-subj="navigation-link-hosts"]';
export const NAVIGATION_HOSTS = '[data-test-subj="navigation-hosts"]';

/** Top-level (global) navigation link to the `Network` page */
export const NAVIGATION_NETWORK = '[data-test-subj="navigation-link-network"]';
export const NAVIGATION_NETWORK = '[data-test-subj="navigation-network"]';

/** Top-level (global) navigation link to the `Overview` page */
export const NAVIGATION_OVERVIEW = '[data-test-subj="navigation-link-overview"]';
export const NAVIGATION_OVERVIEW = '[data-test-subj="navigation-overview"]';

/** Top-level (global) navigation link to the `Timelines` page */
export const NAVIGATION_TIMELINES = '[data-test-subj="navigation-link-timelines"]';
export const NAVIGATION_TIMELINES = '[data-test-subj="navigation-timelines"]';

export const HOSTS_PAGE_TABS = {
allHosts: '[data-test-subj="navigation-allHosts"]',
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/*
* 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 { UtilityBar } from './utility_bar';
export { UtilityBarAction } from './utility_bar_action';
export { UtilityBarGroup } from './utility_bar_group';
export { UtilityBarSection } from './utility_bar_section';
export { UtilityBarText } from './utility_bar_text';
Loading

0 comments on commit 6a077d3

Please sign in to comment.