+ return showActionsPanel ? (
+
+
+
+
+
+
+
{discoverLink && (
<>
-
-
-
-
-
-
= ({
>
))}
- );
+ ) : null;
};
diff --git a/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/components/index_data_visualizer_view/_index.scss b/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/components/index_data_visualizer_view/_index.scss
deleted file mode 100644
index c9b1d78320aee..0000000000000
--- a/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/components/index_data_visualizer_view/_index.scss
+++ /dev/null
@@ -1 +0,0 @@
-@import 'index_data_visualizer_view';
diff --git a/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/components/index_data_visualizer_view/_index_data_visualizer_view.scss b/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/components/index_data_visualizer_view/_index_data_visualizer_view.scss
deleted file mode 100644
index 2a9488da966ea..0000000000000
--- a/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/components/index_data_visualizer_view/_index_data_visualizer_view.scss
+++ /dev/null
@@ -1,14 +0,0 @@
-.dataViewTitleHeader {
- min-width: 300px;
- padding: $euiSizeS 0;
- display: flex;
- flex-direction: row;
- align-items: center;
-}
-
-@include euiBreakpoint('xs', 's', 'm', 'l') {
- .dataVisualizerPageHeader {
- flex-direction: column;
- align-items: flex-start;
- }
-}
diff --git a/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/components/index_data_visualizer_view/index_data_visualizer_view.tsx b/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/components/index_data_visualizer_view/index_data_visualizer_view.tsx
index bb9095bc6f269..238ceb960de36 100644
--- a/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/components/index_data_visualizer_view/index_data_visualizer_view.tsx
+++ b/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/components/index_data_visualizer_view/index_data_visualizer_view.tsx
@@ -5,7 +5,7 @@
* 2.0.
*/
-import React, { FC, Fragment, useEffect, useMemo, useState, useCallback, useRef } from 'react';
+import React, { FC, useEffect, useMemo, useState, useCallback, useRef } from 'react';
import {
EuiFlexGroup,
EuiFlexItem,
@@ -23,6 +23,7 @@ import { i18n } from '@kbn/i18n';
import { Filter, FilterStateStore, Query } from '@kbn/es-query';
import { generateFilters } from '@kbn/data-plugin/public';
import { DataView, DataViewField } from '@kbn/data-views-plugin/public';
+import { useCurrentEuiTheme } from '../../../common/hooks/use_current_eui_theme';
import { DV_RANDOM_SAMPLER_PREFERENCE, useStorage } from '../../hooks/use_storage';
import { FullTimeRangeSelector } from '../full_time_range_selector';
import { usePageUrlState, useUrlState } from '../../../common/util/url_state';
@@ -46,14 +47,11 @@ import { kbnTypeToJobType } from '../../../common/util/field_types_utils';
import { SearchPanel } from '../search_panel';
import { ActionsPanel } from '../actions_panel';
import { DatePickerWrapper } from '../../../common/components/date_picker_wrapper';
-import { HelpMenu } from '../../../common/components/help_menu';
import { createMergedEsQuery } from '../../utils/saved_search_utils';
import { DataVisualizerDataViewManagement } from '../data_view_management';
import { GetAdditionalLinks } from '../../../common/components/results_links';
import { useDataVisualizerGridData } from '../../hooks/use_data_visualizer_grid_data';
import { DataVisualizerGridInput } from '../../embeddables/grid_embeddable/grid_embeddable';
-// TODO port to `@emotion/react` once `useEuiBreakpoint` is available https://github.com/elastic/eui/pull/6057
-import './_index.scss';
import { RANDOM_SAMPLER_OPTION, RandomSamplerOption } from '../../constants/random_sampler';
interface DataVisualizerPageState {
@@ -116,9 +114,12 @@ export interface IndexDataVisualizerViewProps {
currentSavedSearch: SavedSearchSavedObject | null;
currentSessionId?: string;
getAdditionalLinks?: GetAdditionalLinks;
+ compact?: boolean;
}
export const IndexDataVisualizerView: FC
= (dataVisualizerProps) => {
+ const euiTheme = useCurrentEuiTheme();
+
const [savedRandomSamplerPreference, saveRandomSamplerPreference] =
useStorage(
DV_RANDOM_SAMPLER_PREFERENCE,
@@ -136,7 +137,7 @@ export const IndexDataVisualizerView: FC = (dataVi
);
const { services } = useDataVisualizerKibana();
- const { docLinks, notifications, uiSettings, data } = services;
+ const { notifications, uiSettings, data } = services;
const { toasts } = notifications;
const [dataVisualizerListState, setDataVisualizerListState] = usePageUrlState(
@@ -149,7 +150,7 @@ export const IndexDataVisualizerView: FC = (dataVi
dataVisualizerProps.currentSavedSearch
);
- const { currentDataView, currentSessionId, getAdditionalLinks } = dataVisualizerProps;
+ const { currentDataView, currentSessionId, getAdditionalLinks, compact } = dataVisualizerProps;
useEffect(() => {
if (dataVisualizerProps?.currentSavedSearch !== undefined) {
@@ -200,7 +201,7 @@ export const IndexDataVisualizerView: FC = (dataVi
queryLanguage: SearchQueryLanguage;
filters: Filter[];
}) => {
- // When the user loads saved search and then clear or modify the query
+ // When the user loads saved search and then clears or modifies the query
// we should remove the saved search and replace it with the index pattern id
if (currentSavedSearch !== null) {
setCurrentSavedSearch(null);
@@ -217,12 +218,6 @@ export const IndexDataVisualizerView: FC = (dataVi
[currentSavedSearch, dataVisualizerListState, setDataVisualizerListState]
);
- const samplerShardSize =
- dataVisualizerListState.samplerShardSize ?? restorableDefaults.samplerShardSize;
- const setSamplerShardSize = (value: number) => {
- setDataVisualizerListState({ ...dataVisualizerListState, samplerShardSize: value });
- };
-
const visibleFieldTypes =
dataVisualizerListState.visibleFieldTypes ?? restorableDefaults.visibleFieldTypes;
const setVisibleFieldTypes = (values: string[]) => {
@@ -386,8 +381,6 @@ export const IndexDataVisualizerView: FC = (dataVi
]
);
- const wizardPanelWidth = '280px';
-
const fieldsCountStats: TotalFieldsStats | undefined = useMemo(() => {
let _visibleFieldsCount = 0;
let _totalFieldsCount = 0;
@@ -454,131 +447,136 @@ export const IndexDataVisualizerView: FC = (dataVi
() => currentDataView.timeFieldName !== undefined && currentDataView.timeFieldName !== '',
[currentDataView.timeFieldName]
);
- const helpLink = docLinks.links.ml.guide;
-
return (
-
-
-
-
-
-
-
-
- {currentDataView.getName()}
-
-
-
-
-
+
+
+
+
+
- {hasValidTimeField ? (
-
-
-
- ) : null}
+
+ {currentDataView.getName()}
+
+
+
+
+
+ {compact ? : null}
+
+ {hasValidTimeField ? (
-
-
-
-
-
-
-
-
-
-
-
+
-
- {overallStats?.totalCount !== undefined && (
- <>
-
-
-
-
- >
- )}
-
-
-
-
-
- items={configs}
- pageState={dataVisualizerListState}
- updatePageState={setDataVisualizerListState}
- getItemIdToExpandedRowMap={getItemIdToExpandedRowMap}
- extendedColumns={extendedColumns}
- loading={progress < 100}
- overallStatsRunning={overallStatsProgress.isRunning}
- showPreviewByDefault={dataVisualizerListState.showDistributions ?? true}
- onChange={setDataVisualizerListState}
- totalCount={overallStats.totalCount}
- />
-
-
-
-
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
+ {overallStats?.totalCount !== undefined && (
+ <>
+
+
+
+
+ >
+ )}
+
+
+
+
+
+ items={configs}
+ pageState={dataVisualizerListState}
+ updatePageState={setDataVisualizerListState}
+ getItemIdToExpandedRowMap={getItemIdToExpandedRowMap}
+ extendedColumns={extendedColumns}
+ loading={progress < 100}
+ overallStatsRunning={overallStatsProgress.isRunning}
+ showPreviewByDefault={dataVisualizerListState.showDistributions ?? true}
+ onChange={setDataVisualizerListState}
+ totalCount={overallStats.totalCount}
+ />
+
+
+ {compact ? : null}
+
+
+
+
+
+
);
};
diff --git a/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/components/search_panel/field_type_filter.tsx b/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/components/search_panel/field_type_filter.tsx
index f438780e8dbe4..697aecf2bb2f6 100644
--- a/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/components/search_panel/field_type_filter.tsx
+++ b/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/components/search_panel/field_type_filter.tsx
@@ -8,6 +8,8 @@
import React, { FC, useMemo } from 'react';
import { EuiFlexGroup, EuiFlexItem } from '@elastic/eui';
import { i18n } from '@kbn/i18n';
+import { css } from '@emotion/react';
+import { useCurrentEuiTheme } from '../../../common/hooks/use_current_eui_theme';
import { FieldTypesHelpPopover } from '../../../common/components/field_types_filter/field_types_help_popover';
import type { SupportedFieldType } from '../../../../../common/types';
import { FieldTypeIcon } from '../../../common/components/field_type_icon';
@@ -19,6 +21,7 @@ export const DataVisualizerFieldTypeFilter: FC<{
setVisibleFieldTypes(q: string[]): void;
visibleFieldTypes: string[];
}> = ({ indexedFieldTypes, setVisibleFieldTypes, visibleFieldTypes }) => {
+ const euiTheme = useCurrentEuiTheme();
const options: Option[] = useMemo(() => {
return indexedFieldTypes.map((indexedFieldName) => {
const label = jobTypeLabels[indexedFieldName] ?? '';
@@ -55,6 +58,11 @@ export const DataVisualizerFieldTypeFilter: FC<{
checkedOptions={visibleFieldTypes}
dataTestSubj={'dataVisualizerFieldTypeSelect'}
postfix={}
+ cssStyles={{
+ filterGroup: css`
+ margin-left: ${euiTheme.euiSizeS};
+ `,
+ }}
/>
>
);
diff --git a/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/components/search_panel/search_panel.scss b/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/components/search_panel/search_panel.scss
index 6b0624fae2757..699e76a9c58fb 100644
--- a/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/components/search_panel/search_panel.scss
+++ b/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/components/search_panel/search_panel.scss
@@ -1,6 +1,5 @@
.dvSearchPanel__controls {
flex-direction: row;
- padding: $euiSizeS;
}
.dvSearchPanel__container {
@@ -12,7 +11,7 @@
flex-direction: column;
}
.dvSearchBar {
- min-width: #{'max(100%, 500px)'};
+ min-width: #{'max(100%, 300px)'};
}
.dvSearchPanel__controls {
padding: 0;
diff --git a/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/components/search_panel/search_panel.tsx b/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/components/search_panel/search_panel.tsx
index 5b47bb820b9ab..df11ab8dd5cd1 100644
--- a/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/components/search_panel/search_panel.tsx
+++ b/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/components/search_panel/search_panel.tsx
@@ -6,12 +6,11 @@
*/
import React, { FC, useEffect, useState } from 'react';
-import { EuiFlexItem, EuiFlexGroup } from '@elastic/eui';
+import { EuiFlexItem, EuiFlexGroup, EuiSpacer } from '@elastic/eui';
import { i18n } from '@kbn/i18n';
import { Query, Filter } from '@kbn/es-query';
import type { TimeRange } from '@kbn/es-query';
import { DataView, DataViewField } from '@kbn/data-views-plugin/public';
-import { css } from '@emotion/react';
import { isDefined } from '../../../common/util/is_defined';
import { DataVisualizerFieldNamesFilter } from './field_name_filter';
import { DataVisualizerFieldTypeFilter } from './field_type_filter';
@@ -26,8 +25,6 @@ interface Props {
searchString: Query['query'];
searchQuery: Query['query'];
searchQueryLanguage: SearchQueryLanguage;
- samplerShardSize: number;
- setSamplerShardSize(s: number): void;
overallStats: OverallStats;
indexedFieldTypes: SupportedFieldType[];
setVisibleFieldTypes(q: string[]): void;
@@ -47,14 +44,13 @@ interface Props {
}): void;
showEmptyFields: boolean;
onAddFilter?: (field: DataViewField | string, value: string, type: '+' | '-') => void;
+ compact?: boolean;
}
export const SearchPanel: FC = ({
dataView,
searchString,
searchQueryLanguage,
- samplerShardSize,
- setSamplerShardSize,
overallStats,
indexedFieldTypes,
setVisibleFieldTypes,
@@ -63,6 +59,7 @@ export const SearchPanel: FC = ({
visibleFieldNames,
setSearchParams,
showEmptyFields,
+ compact,
}) => {
const {
services: {
@@ -120,7 +117,7 @@ export const SearchPanel: FC = ({
return (
= ({
/>
+ {compact ? : null}
;
getAdditionalLinks?: GetAdditionalLinks;
}
@@ -70,9 +71,10 @@ export const getLocatorParams = (params: {
return locatorParams;
};
-export const DataVisualizerUrlStateContextProvider: FC<
- DataVisualizerUrlStateContextProviderProps
-> = ({ IndexDataVisualizerComponent, getAdditionalLinks }) => {
+export const DataVisualizerStateContextProvider: FC = ({
+ IndexDataVisualizerComponent,
+ getAdditionalLinks,
+}) => {
const { services } = useDataVisualizerKibana();
const {
data: { dataViews, search },
@@ -240,15 +242,36 @@ export const DataVisualizerUrlStateContextProvider: FC<
[history, urlSearchString]
);
+ const [panelWidth, setPanelWidth] = useState(1600);
+
+ // eslint-disable-next-line react-hooks/exhaustive-deps
+ const resizeHandler = useCallback(
+ throttle((e: { width: number; height: number }) => {
+ // When window or table is resized,
+ // update the page body width
+ setPanelWidth(e.width);
+ }, 500),
+ []
+ );
+ const compact = useMemo(() => panelWidth <= 1024, [panelWidth]);
+
return (
{currentDataView ? (
-
+ // Needs ResizeObserver to measure window width - side bar navigation
+
+ {(resizeRef) => (
+
+
+
+ )}
+
) : (
)}
@@ -293,7 +316,7 @@ export const IndexDataVisualizer: FC<{
return (
-
diff --git a/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/search_strategy/requests/get_document_stats.ts b/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/search_strategy/requests/get_document_stats.ts
index 7607dc30c8130..f74a8800d2bd0 100644
--- a/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/search_strategy/requests/get_document_stats.ts
+++ b/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/search_strategy/requests/get_document_stats.ts
@@ -21,52 +21,6 @@ import type {
const MINIMUM_RANDOM_SAMPLER_DOC_COUNT = 100000;
const DEFAULT_INITIAL_RANDOM_SAMPLER_PROBABILITY = 0.000001;
-export const getDocumentCountStatsRequest = (params: OverallStatsSearchStrategyParams) => {
- const {
- index,
- timeFieldName,
- earliest: earliestMs,
- latest: latestMs,
- runtimeFieldMap,
- searchQuery,
- intervalMs,
- fieldsToFetch,
- } = params;
-
- const size = 0;
- const filterCriteria = buildBaseFilterCriteria(timeFieldName, earliestMs, latestMs, searchQuery);
-
- // Don't use the sampler aggregation as this can lead to some potentially
- // confusing date histogram results depending on the date range of data amongst shards.
- const aggs = {
- eventRate: {
- date_histogram: {
- field: timeFieldName,
- fixed_interval: `${intervalMs}ms`,
- min_doc_count: 1,
- },
- },
- };
-
- const searchBody = {
- query: {
- bool: {
- filter: filterCriteria,
- },
- },
- ...(!fieldsToFetch && timeFieldName !== undefined && intervalMs !== undefined && intervalMs > 0
- ? { aggs }
- : {}),
- ...(isPopulatedObject(runtimeFieldMap) ? { runtime_mappings: runtimeFieldMap } : {}),
- track_total_hits: true,
- size,
- };
- return {
- index,
- body: searchBody,
- };
-};
-
export const getDocumentCountStats = async (
search: DataPublicPluginStart['search'],
params: OverallStatsSearchStrategyParams,
@@ -104,7 +58,11 @@ export const getDocumentCountStats = async (
date_histogram: {
field: timeFieldName,
fixed_interval: `${intervalMs}ms`,
- min_doc_count: 1,
+ min_doc_count: 0,
+ extended_bounds: {
+ min: earliestMs,
+ max: latestMs,
+ },
},
},
};
diff --git a/x-pack/plugins/fleet/server/types/rest_spec/agent.test.ts b/x-pack/plugins/fleet/server/types/rest_spec/agent.test.ts
new file mode 100644
index 0000000000000..a978c2ffe9479
--- /dev/null
+++ b/x-pack/plugins/fleet/server/types/rest_spec/agent.test.ts
@@ -0,0 +1,27 @@
+/*
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
+ * or more contributor license agreements. Licensed under the Elastic License
+ * 2.0; you may not use this file except in compliance with the Elastic License
+ * 2.0.
+ */
+
+import { GetAgentsRequestSchema } from './agent';
+
+describe('GetAgentsRequestSchema', () => {
+ it('should allow pagination with less than 10000 agents', () => {
+ expect(() =>
+ GetAgentsRequestSchema.query.validate({
+ page: 500,
+ perPage: 20,
+ })
+ ).not.toThrow();
+ });
+ it('should not allow pagination to go over 10000 agents', () => {
+ expect(() =>
+ GetAgentsRequestSchema.query.validate({
+ page: 501,
+ perPage: 20,
+ })
+ ).toThrowError(/You cannot use page and perPage page over 10000 agents/);
+ });
+});
diff --git a/x-pack/plugins/fleet/server/types/rest_spec/agent.ts b/x-pack/plugins/fleet/server/types/rest_spec/agent.ts
index 709e8e8d27159..305b6f16f90d6 100644
--- a/x-pack/plugins/fleet/server/types/rest_spec/agent.ts
+++ b/x-pack/plugins/fleet/server/types/rest_spec/agent.ts
@@ -9,18 +9,29 @@ import { schema } from '@kbn/config-schema';
import moment from 'moment';
import semverIsValid from 'semver/functions/valid';
+import { SO_SEARCH_LIMIT } from '../../constants';
+
import { NewAgentActionSchema } from '../models';
export const GetAgentsRequestSchema = {
- query: schema.object({
- page: schema.number({ defaultValue: 1 }),
- perPage: schema.number({ defaultValue: 20 }),
- kuery: schema.maybe(schema.string()),
- showInactive: schema.boolean({ defaultValue: false }),
- showUpgradeable: schema.boolean({ defaultValue: false }),
- sortField: schema.maybe(schema.string()),
- sortOrder: schema.maybe(schema.oneOf([schema.literal('asc'), schema.literal('desc')])),
- }),
+ query: schema.object(
+ {
+ page: schema.number({ defaultValue: 1 }),
+ perPage: schema.number({ defaultValue: 20 }),
+ kuery: schema.maybe(schema.string()),
+ showInactive: schema.boolean({ defaultValue: false }),
+ showUpgradeable: schema.boolean({ defaultValue: false }),
+ sortField: schema.maybe(schema.string()),
+ sortOrder: schema.maybe(schema.oneOf([schema.literal('asc'), schema.literal('desc')])),
+ },
+ {
+ validate: (request) => {
+ if (request.page * request.perPage > SO_SEARCH_LIMIT) {
+ return `You cannot use page and perPage page over ${SO_SEARCH_LIMIT} agents`;
+ }
+ },
+ }
+ ),
};
export const GetOneAgentRequestSchema = {
diff --git a/x-pack/plugins/graph/public/components/field_manager/field_manager.test.tsx b/x-pack/plugins/graph/public/components/field_manager/field_manager.test.tsx
index 61682f0a8cc8c..f84822129c7c3 100644
--- a/x-pack/plugins/graph/public/components/field_manager/field_manager.test.tsx
+++ b/x-pack/plugins/graph/public/components/field_manager/field_manager.test.tsx
@@ -111,7 +111,8 @@ describe('field_manager', () => {
act(() => {
getInstance().find(FieldPicker).dive().find(EuiSelectable).prop('onChange')!(
[{ checked: 'on', label: 'field3' }],
- event
+ event,
+ { checked: 'on', label: 'field3' }
);
});
diff --git a/x-pack/plugins/lens/public/datasources/form_based/layerpanel.test.tsx b/x-pack/plugins/lens/public/datasources/form_based/layerpanel.test.tsx
index 86fd5490f383b..2b4fc7f740524 100644
--- a/x-pack/plugins/lens/public/datasources/form_based/layerpanel.test.tsx
+++ b/x-pack/plugins/lens/public/datasources/form_based/layerpanel.test.tsx
@@ -236,7 +236,8 @@ describe('Layer Data Panel', () => {
? { ...option, checked: 'on' }
: { ...option, checked: undefined }
);
- return getIndexPatternPickerList(instance).prop('onChange')!(options, event);
+ const selectedOption = { label: selectedLabel };
+ return getIndexPatternPickerList(instance).prop('onChange')!(options, event, selectedOption);
}
function getIndexPatternPickerOptions(instance: ShallowWrapper) {
diff --git a/x-pack/plugins/license_management/__jest__/__snapshots__/upload_license.test.tsx.snap b/x-pack/plugins/license_management/__jest__/__snapshots__/upload_license.test.tsx.snap
index c3b0dc07f67ab..f58b60de5fb02 100644
--- a/x-pack/plugins/license_management/__jest__/__snapshots__/upload_license.test.tsx.snap
+++ b/x-pack/plugins/license_management/__jest__/__snapshots__/upload_license.test.tsx.snap
@@ -53,6 +53,7 @@ exports[`UploadLicense should display a modal when license requires acknowledgem
{
const secondKey = getByText(/second-api-key/).closest('td');
const secondKeyEuiLink = secondKey!.querySelector('button');
expect(secondKeyEuiLink).not.toBeNull();
- expect(secondKeyEuiLink!.getAttribute('data-test-subj')).toBe('roleRowName-second-api-key');
+ expect(secondKeyEuiLink!.getAttribute('data-test-subj')).toBe('apiKeyRowName-second-api-key');
});
afterAll(() => {
diff --git a/x-pack/plugins/security/public/management/api_keys/api_keys_grid/api_keys_grid_page.tsx b/x-pack/plugins/security/public/management/api_keys/api_keys_grid/api_keys_grid_page.tsx
index 0993e88e7ab16..49b606c7b34cd 100644
--- a/x-pack/plugins/security/public/management/api_keys/api_keys_grid/api_keys_grid_page.tsx
+++ b/x-pack/plugins/security/public/management/api_keys/api_keys_grid/api_keys_grid_page.tsx
@@ -518,7 +518,7 @@ export class APIKeysGridPage extends Component
{
return (
{
this.setState({ selectedApiKey: recordAP, isUpdateFlyoutVisible: true });
}}
diff --git a/x-pack/plugins/security_solution/public/common/components/import_data_modal/__snapshots__/index.test.tsx.snap b/x-pack/plugins/security_solution/public/common/components/import_data_modal/__snapshots__/index.test.tsx.snap
index 6d3605f16e741..47dd897f71ffb 100644
--- a/x-pack/plugins/security_solution/public/common/components/import_data_modal/__snapshots__/index.test.tsx.snap
+++ b/x-pack/plugins/security_solution/public/common/components/import_data_modal/__snapshots__/index.test.tsx.snap
@@ -76,6 +76,7 @@ Object {
-
+
`;
exports[`ChartWrapper component renders the component with loading true 1`] = `
-<_EuiErrorBoundary>
+
-
+
`;
diff --git a/x-pack/test/functional/apps/api_keys/home_page.ts b/x-pack/test/functional/apps/api_keys/home_page.ts
index c984f58dc6cc1..dee8f2af4a58a 100644
--- a/x-pack/test/functional/apps/api_keys/home_page.ts
+++ b/x-pack/test/functional/apps/api_keys/home_page.ts
@@ -17,6 +17,7 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => {
const testSubjects = getService('testSubjects');
const find = getService('find');
const browser = getService('browser');
+ const retry = getService('retry');
const testRoles: Record = {
viewer: {
@@ -37,8 +38,17 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => {
},
};
- // Failing: See https://github.com/elastic/kibana/issues/141868
- describe.skip('Home page', function () {
+ async function ensureApiKeysExist(apiKeysNames: string[]) {
+ await retry.try(async () => {
+ for (const apiKeyName of apiKeysNames) {
+ log.debug(`Checking if API key ("${apiKeyName}") exists.`);
+ await pageObjects.apiKeys.ensureApiKeyExists(apiKeyName);
+ log.debug(`API key ("${apiKeyName}") exists.`);
+ }
+ });
+ }
+
+ describe('Home page', function () {
before(async () => {
await clearAllApiKeys(es, log);
await security.testUser.setRoles(['kibana_admin']);
@@ -392,6 +402,7 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => {
await pageObjects.apiKeys.clickOnPromptCreateApiKey();
await pageObjects.apiKeys.setApiKeyName('api key 1');
await pageObjects.apiKeys.clickSubmitButtonOnApiKeyFlyout();
+ await ensureApiKeysExist(['api key 1']);
});
it('one by one', async () => {
@@ -406,6 +417,9 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => {
await pageObjects.apiKeys.setApiKeyName('api key 2');
await pageObjects.apiKeys.clickSubmitButtonOnApiKeyFlyout();
+ // Make sure all API keys we want to delete are created and rendered.
+ await ensureApiKeysExist(['api key 1', 'api key 2']);
+
await pageObjects.apiKeys.bulkDeleteApiKeys();
expect(await pageObjects.apiKeys.getApiKeysFirstPromptTitle()).to.be(
'Create your first API key'
diff --git a/x-pack/test/functional/page_objects/api_keys_page.ts b/x-pack/test/functional/page_objects/api_keys_page.ts
index 6f5bfb5078133..85e8188ee747a 100644
--- a/x-pack/test/functional/page_objects/api_keys_page.ts
+++ b/x-pack/test/functional/page_objects/api_keys_page.ts
@@ -103,7 +103,11 @@ export function ApiKeysPageProvider({ getService }: FtrProviderContext) {
},
async clickExistingApiKeyToOpenFlyout(apiKeyName: string) {
- await testSubjects.click(`roleRowName-${apiKeyName}`);
+ await testSubjects.click(`apiKeyRowName-${apiKeyName}`);
+ },
+
+ async ensureApiKeyExists(apiKeyName: string) {
+ await testSubjects.existOrFail(`apiKeyRowName-${apiKeyName}`);
},
async getMetadataSwitch() {
diff --git a/yarn.lock b/yarn.lock
index d713ca0b3bc10..42cd55a3d964b 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -1527,10 +1527,10 @@
resolved "https://registry.yarnpkg.com/@elastic/eslint-plugin-eui/-/eslint-plugin-eui-0.0.2.tgz#56b9ef03984a05cc213772ae3713ea8ef47b0314"
integrity sha512-IoxURM5zraoQ7C8f+mJb9HYSENiZGgRVcG4tLQxE61yHNNRDXtGDWTZh8N1KIHcsqN1CEPETjuzBXkJYF/fDiQ==
-"@elastic/eui@71.0.0":
- version "71.0.0"
- resolved "https://registry.yarnpkg.com/@elastic/eui/-/eui-71.0.0.tgz#0d77ca3e513ebd59fee0be49abd7acf4b04206aa"
- integrity sha512-5iHvGSJCJjin/VPHBT0RdHVKUCClH5PqXnygsr6LCkyQzj+frKiK0w28dK5EBReDp5+SRoF+VYSVse4Ia2DkLQ==
+"@elastic/eui@72.0.0":
+ version "72.0.0"
+ resolved "https://registry.yarnpkg.com/@elastic/eui/-/eui-72.0.0.tgz#ba001d694c0c944143b11e5e2b756476c6a6a924"
+ integrity sha512-XMIyARp5tI5PymDT1OeYoNnto+d0NtrnRCwHUIOtwDAQamkqmfyNNt+bMzj2ii+HBA/BII5+NKCmb6HNCUBq1A==
dependencies:
"@types/chroma-js" "^2.0.0"
"@types/lodash" "^4.14.160"
@@ -1562,7 +1562,7 @@
rehype-stringify "^8.0.0"
remark-breaks "^2.0.2"
remark-emoji "^2.1.0"
- remark-parse "^8.0.3"
+ remark-parse-no-trim "^8.0.4"
remark-rehype "^8.0.0"
tabbable "^5.2.1"
text-diff "^1.0.1"
@@ -23688,6 +23688,27 @@ remark-mdx@1.6.22:
remark-parse "8.0.3"
unified "9.2.0"
+remark-parse-no-trim@^8.0.4:
+ version "8.0.4"
+ resolved "https://registry.yarnpkg.com/remark-parse-no-trim/-/remark-parse-no-trim-8.0.4.tgz#f5c9531644284071d4a57a49e19a42ad4e8040bd"
+ integrity sha512-WtqeHNTZ0LSdyemmY1/G6y9WoEFblTtgckfKF5/NUnri919/0/dEu8RCDfvXtJvu96soMvT+mLWWgYVUaiHoag==
+ dependencies:
+ ccount "^1.0.0"
+ collapse-white-space "^1.0.2"
+ is-alphabetical "^1.0.0"
+ is-decimal "^1.0.0"
+ is-whitespace-character "^1.0.0"
+ is-word-character "^1.0.0"
+ markdown-escapes "^1.0.0"
+ parse-entities "^2.0.0"
+ repeat-string "^1.5.4"
+ state-toggle "^1.0.0"
+ trim-trailing-lines "^1.0.0"
+ unherit "^1.0.4"
+ unist-util-remove-position "^2.0.0"
+ vfile-location "^3.0.0"
+ xtend "^4.0.1"
+
remark-parse@8.0.3, remark-parse@^8.0.3:
version "8.0.3"
resolved "https://registry.yarnpkg.com/remark-parse/-/remark-parse-8.0.3.tgz#9c62aa3b35b79a486454c690472906075f40c7e1"