Skip to content

Commit

Permalink
Merge branch 'master' into remove-es-storage
Browse files Browse the repository at this point in the history
  • Loading branch information
kibanamachine authored Dec 15, 2020
2 parents 4bb090b + 013c176 commit 7ba4e53
Show file tree
Hide file tree
Showing 92 changed files with 2,039 additions and 726 deletions.
14 changes: 14 additions & 0 deletions docs/user/dashboard/dashboard.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,20 @@ To view the data field summary information, navigate to the field, then click *i
[role="screenshot"]
image::images/lens_data_info.png[Data summary window]

*Lens* shows a summary depending on the type of data: date fields show the time distribution, string fields show the top 10 values, and numeric fields show a detailed summary with the top 10 values and a value distribution.

[role="screenshot"]
image::images/lens_data_info_documents.png[Data summary analyzed documents]

*Lens* uses a sample of 5,000 documents to perform the field analysis. The bottom line of the summary shows the percentage of sampled documents over all available documents.

When *Lens* presents the top 10 values distribution, it also shows the percentage of "Other" values. For array value fields, the percentage distribution is considers each value in the array separate.

[role="screenshot"]
image::images/lens_data_info_other.png[Data summary window with Other]

NOTE: the sum of all the entries and "Other" may be above 100% by a small amount, that is due to a rounding problem when presenting all values as integers.

[float]
[[change-the-visualization-type]]
==== Change the visualization type
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 3 additions & 2 deletions test/api_integration/apis/saved_objects/find.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,8 @@ export default function ({ getService }) {
}));
});

describe('page beyond total', () => {
// FLAKY: https://github.com/elastic/kibana/issues/85911
describe.skip('page beyond total', () => {
it('should return 200 with empty response', async () =>
await supertest
.get('/api/saved_objects/_find?type=visualization&page=100&per_page=100')
Expand Down Expand Up @@ -419,7 +420,7 @@ export default function ({ getService }) {
}));
});

describe('without kibana index', () => {
describe.skip('without kibana index', () => {
before(
async () =>
// just in case the kibana server has recreated it
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 React, { useMemo, useState } from 'react';
import React, { useMemo, useState, useCallback } from 'react';

import { EuiIcon, EuiFlexItem, EuiCard, EuiFlexGroup } from '@elastic/eui';

Expand All @@ -16,15 +16,18 @@ export const CreateAlert = ({
}: Pick<AlertingExampleComponentParams, 'triggersActionsUi'>) => {
const [alertFlyoutVisible, setAlertFlyoutVisibility] = useState<boolean>(false);

const onCloseAlertFlyout = useCallback(() => setAlertFlyoutVisibility(false), [
setAlertFlyoutVisibility,
]);

const AddAlertFlyout = useMemo(
() =>
triggersActionsUi.getAddAlertFlyout({
consumer: ALERTING_EXAMPLE_APP_ID,
addFlyoutVisible: alertFlyoutVisible,
setAddFlyoutVisibility: setAlertFlyoutVisibility,
onClose: onCloseAlertFlyout,
}),
// eslint-disable-next-line react-hooks/exhaustive-deps
[alertFlyoutVisible]
[onCloseAlertFlyout]
);

return (
Expand All @@ -37,7 +40,7 @@ export const CreateAlert = ({
onClick={() => setAlertFlyoutVisibility(true)}
/>
</EuiFlexItem>
<EuiFlexItem>{AddAlertFlyout}</EuiFlexItem>
<EuiFlexItem>{alertFlyoutVisible && AddAlertFlyout}</EuiFlexItem>
</EuiFlexGroup>
);
};
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* 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, { useMemo } from 'react';
import React, { useCallback, useMemo } from 'react';
import { useKibana } from '../../../../../../../src/plugins/kibana_react/public';
import { AlertType } from '../../../../common/alert_types';
import { TriggersAndActionsUIPublicPluginStart } from '../../../../../triggers_actions_ui/public';
Expand All @@ -23,17 +23,21 @@ export function AlertingFlyout(props: Props) {
const {
services: { triggersActionsUi },
} = useKibana<KibanaDeps>();

const onCloseAddFlyout = useCallback(() => setAddFlyoutVisibility(false), [
setAddFlyoutVisibility,
]);

const addAlertFlyout = useMemo(
() =>
alertType &&
triggersActionsUi.getAddAlertFlyout({
consumer: 'apm',
addFlyoutVisible,
setAddFlyoutVisibility,
onClose: onCloseAddFlyout,
alertTypeId: alertType,
canChangeTrigger: false,
}),
[addFlyoutVisible, alertType, setAddFlyoutVisibility, triggersActionsUi]
[alertType, onCloseAddFlyout, triggersActionsUi]
);
return <>{addAlertFlyout}</>;
return <>{addFlyoutVisible && addAlertFlyout}</>;
}
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,9 @@ export function ServiceOverviewThroughputChart({
type: 'linemark',
color: theme.eui.euiColorVis0,
title: i18n.translate(
'xpack.apm.serviceOverview.throughputChart.currentPeriodLabel',
'xpack.apm.serviceOverview.throughputChart.traffic',
{
defaultMessage: 'Current period',
defaultMessage: 'Traffic',
}
),
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ export function SparkPlot({
const defaultChartTheme = useChartTheme();

const sparkplotChartTheme = merge({}, defaultChartTheme, {
chartMargins: { left: 0, right: 0, top: 0, bottom: 0 },
lineSeriesStyle: {
point: { opacity: 0 },
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,6 @@ function yLabelFormat(y?: number | null) {
return asPercent(y || 0, 1);
}

function yTickFormat(y?: number | null) {
return i18n.translate('xpack.apm.chart.averagePercentLabel', {
defaultMessage: '{y} (avg.)',
values: { y: yLabelFormat(y) },
});
}

interface Props {
height?: number;
showAnnotations?: boolean;
Expand Down Expand Up @@ -84,13 +77,12 @@ export function TransactionErrorRateChart({
type: 'linemark',
color: theme.eui.euiColorVis7,
hideLegend: true,
title: i18n.translate('xpack.apm.errorRate.currentPeriodLabel', {
defaultMessage: 'Current period',
title: i18n.translate('xpack.apm.errorRate.chart.errorRate', {
defaultMessage: 'Error rate (avg.)',
}),
},
]}
yLabelFormat={yLabelFormat}
yTickFormat={yTickFormat}
yDomain={{ min: 0, max: 1 }}
/>
</EuiPanel>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,11 @@ import { Paging, ResultsPerPage } from '@elastic/react-search-ui';
import { PagingView, ResultsPerPageView } from './views';

export const Pagination: React.FC<{ 'aria-label': string }> = ({ 'aria-label': ariaLabel }) => (
<EuiFlexGroup alignItems="center" className="documentsSearchExperience__pagingInfo">
<EuiFlexGroup
alignItems="center"
responsive={false}
className="documentsSearchExperience__pagingInfo"
>
<EuiFlexItem>
<Paging view={PagingView} aria-label={ariaLabel} />
</EuiFlexItem>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export const SearchBoxView: React.FC<Props> = ({ onChange, value, inputProps })
<EuiFieldSearch
value={value}
onChange={(event) => onChange(event.target.value)}
fullWidth={true}
fullWidth
{...inputProps}
/>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,9 @@ export const SortingView: React.FC<Props> = ({ onChange, options, value }) => {
const selectedValue = value && !valuesFromOptions.includes(value) ? undefined : value;

return (
<div>
<>
<EuiSelect
fullWidth
options={options.map(wrapSortingOptionForEuiSelect)}
value={selectedValue}
prepend={i18n.translate('xpack.enterpriseSearch.appSearch.documents.search.sortBy', {
Expand All @@ -48,6 +49,6 @@ export const SortingView: React.FC<Props> = ({ onChange, options, value }) => {
}
)}
/>
</div>
</>
);
};
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,14 @@ import React from 'react';

import { EuiSpacer } from '@elastic/eui';

import {
PUBLIC_KEY_LABEL,
CONSUMER_KEY_LABEL,
BASE_URL_LABEL,
CLIENT_ID_LABEL,
CLIENT_SECRET_LABEL,
} from '../../../constants';

import { ApiKey } from '../api_key';
import { CredentialItem } from '../credential_item';

Expand Down Expand Up @@ -35,13 +43,13 @@ export const SourceConfigFields: React.FC<SourceConfigFieldsProps> = ({
<>
{publicKey && (
<>
<ApiKey label="Public Key" apiKey={publicKey} />
<ApiKey label={PUBLIC_KEY_LABEL} apiKey={publicKey} />
<EuiSpacer />
</>
)}
{consumerKey && (
<>
<ApiKey label="Consumer Key" apiKey={consumerKey} />
<ApiKey label={CONSUMER_KEY_LABEL} apiKey={consumerKey} />
<EuiSpacer />
</>
)}
Expand All @@ -51,11 +59,11 @@ export const SourceConfigFields: React.FC<SourceConfigFieldsProps> = ({
return (
<>
{showApiKey && keyElement}
{credentialItem('Client id', clientId)}
{credentialItem(CLIENT_ID_LABEL, clientId)}
<EuiSpacer size="s" />
{credentialItem('Client secret', clientSecret)}
{credentialItem(CLIENT_SECRET_LABEL, clientSecret)}
<EuiSpacer size="s" />
{credentialItem('Base URL', baseUrl)}
{credentialItem(BASE_URL_LABEL, baseUrl)}
</>
);
};
Original file line number Diff line number Diff line change
Expand Up @@ -260,3 +260,52 @@ export const GITHUB_LINK_TITLE = i18n.translate(
);

export const CUSTOM_SERVICE_TYPE = 'custom';

export const DOCUMENTATION_LINK_TITLE = i18n.translate(
'xpack.enterpriseSearch.workplaceSearch.sources.documentation',
{
defaultMessage: 'Documentation',
}
);

export const PUBLIC_KEY_LABEL = i18n.translate(
'xpack.enterpriseSearch.workplaceSearc.publicKey.label',
{
defaultMessage: 'Public Key',
}
);

export const CONSUMER_KEY_LABEL = i18n.translate(
'xpack.enterpriseSearch.workplaceSearc.consumerKey.label',
{
defaultMessage: 'Consumer Key',
}
);

export const BASE_URI_LABEL = i18n.translate(
'xpack.enterpriseSearch.workplaceSearc.baseUri.label',
{
defaultMessage: 'Base URI',
}
);

export const BASE_URL_LABEL = i18n.translate(
'xpack.enterpriseSearch.workplaceSearc.baseUrl.label',
{
defaultMessage: 'Base URL',
}
);

export const CLIENT_ID_LABEL = i18n.translate(
'xpack.enterpriseSearch.workplaceSearc.clientId.label',
{
defaultMessage: 'Client id',
}
);

export const CLIENT_SECRET_LABEL = i18n.translate(
'xpack.enterpriseSearch.workplaceSearc.clientSecret.label',
{
defaultMessage: 'Client secret',
}
);
Original file line number Diff line number Diff line change
Expand Up @@ -26,21 +26,22 @@ import { Loading } from '../../../../../../applications/shared/loading';
import { CUSTOM_SERVICE_TYPE } from '../../../../constants';
import { SourceDataItem } from '../../../../types';

import {
ADD_SOURCE_NEW_SOURCE_DESCRIPTION,
ADD_SOURCE_ORG_SOURCE_DESCRIPTION,
ADD_SOURCE_PRIVATE_SOURCE_DESCRIPTION,
ADD_SOURCE_NO_SOURCES_TITLE,
ADD_SOURCE_ORG_SOURCES_TITLE,
ADD_SOURCE_PRIVATE_SOURCES_TITLE,
ADD_SOURCE_PLACEHOLDER,
ADD_SOURCE_EMPTY_TITLE,
ADD_SOURCE_EMPTY_BODY,
} from './constants';

import { SourcesLogic } from '../../sources_logic';
import { AvailableSourcesList } from './available_sources_list';
import { ConfiguredSourcesList } from './configured_sources_list';

const NEW_SOURCE_DESCRIPTION =
'When configuring and connecting a source, you are creating distinct entities with searchable content synchronized from the content platform itself. A source can be added using one of the available source connectors or via Custom API Sources, for additional flexibility. ';
const ORG_SOURCE_DESCRIPTION =
'Shared content sources are available to your entire organization or can be assigned to specific user groups.';
const PRIVATE_SOURCE_DESCRIPTION =
'Connect a new source to add its content and documents to your search experience.';
const NO_SOURCES_TITLE = 'Configure and connect your first content source';
const ORG_SOURCES_TITLE = 'Add a shared content source';
const PRIVATE_SOURCES_TITLE = 'Add a new content source';
const PLACEHOLDER = 'Filter sources...';

export const AddSourceList: React.FC = () => {
const { contentSources, dataLoading, availableSources, configuredSources } = useValues(
SourcesLogic
Expand All @@ -64,14 +65,16 @@ export const AddSourceList: React.FC = () => {
({ serviceType }) => serviceType !== CUSTOM_SERVICE_TYPE
);

const BASE_DESCRIPTION = hasSources ? '' : NEW_SOURCE_DESCRIPTION;
const BASE_DESCRIPTION = hasSources ? '' : ADD_SOURCE_NEW_SOURCE_DESCRIPTION;
const PAGE_CONTEXT_DESCRIPTION = isOrganization
? ORG_SOURCE_DESCRIPTION
: PRIVATE_SOURCE_DESCRIPTION;
? ADD_SOURCE_ORG_SOURCE_DESCRIPTION
: ADD_SOURCE_PRIVATE_SOURCE_DESCRIPTION;

const PAGE_DESCRIPTION = BASE_DESCRIPTION + PAGE_CONTEXT_DESCRIPTION;
const HAS_SOURCES_TITLE = isOrganization ? ORG_SOURCES_TITLE : PRIVATE_SOURCES_TITLE;
const PAGE_TITLE = hasSources ? HAS_SOURCES_TITLE : NO_SOURCES_TITLE;
const HAS_SOURCES_TITLE = isOrganization
? ADD_SOURCE_ORG_SOURCES_TITLE
: ADD_SOURCE_PRIVATE_SOURCES_TITLE;
const PAGE_TITLE = hasSources ? HAS_SOURCES_TITLE : ADD_SOURCE_NO_SOURCES_TITLE;

const handleFilterChange = (e: ChangeEvent<HTMLInputElement>) => setFilterValue(e.target.value);

Expand Down Expand Up @@ -106,7 +109,7 @@ export const AddSourceList: React.FC = () => {
value={filterValue}
onChange={handleFilterChange}
fullWidth={true}
placeholder={PLACEHOLDER}
placeholder={ADD_SOURCE_PLACEHOLDER}
/>
</EuiFormRow>
<EuiSpacer size="xxl" />
Expand All @@ -128,13 +131,8 @@ export const AddSourceList: React.FC = () => {
<EuiSpacer size="xxl" />
<EuiEmptyPrompt
iconType={noSharedSourcesIcon}
title={<h2>No available sources</h2>}
body={
<p>
Sources will be available for search when an administrator adds them to this
organization.
</p>
}
title={<h2>{ADD_SOURCE_EMPTY_TITLE}</h2>}
body={<p>{ADD_SOURCE_EMPTY_BODY}</p>}
/>
<EuiSpacer size="xxl" />
<EuiSpacer size="m" />
Expand Down
Loading

0 comments on commit 7ba4e53

Please sign in to comment.