mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 17:28:26 -04:00
show empty prompts in page and don't auto-open flyout in DataViews (#134469)
* show empty prompts in page and don't auto-open flyout in DataViews * changed flow based on comments * fix for namespace issues * fix for failed checks * fixes for failed checks and tests * fix failing tests Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
This commit is contained in:
parent
f89efc7f30
commit
c8520f941a
34 changed files with 200 additions and 477 deletions
|
@ -24,8 +24,6 @@ type DataView = unknown;
|
|||
interface DataViewEditorOptions {
|
||||
/** Handler to be invoked when the Data View Editor completes a save operation. */
|
||||
onSave: (dataView: DataView) => void;
|
||||
/** If set to false, will skip empty prompt in data view editor. */
|
||||
showEmptyPrompt?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -35,8 +35,6 @@ type DataView = unknown;
|
|||
interface DataViewEditorOptions {
|
||||
/** Handler to be invoked when the Data View Editor completes a save operation. */
|
||||
onSave: (dataView: DataView) => void;
|
||||
/** If set to false, will skip empty prompt in data view editor. */
|
||||
showEmptyPrompt?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -48,7 +48,7 @@ export const NoDataViewsPrompt = ({
|
|||
onClick={onClickCreate}
|
||||
iconType="plusInCircle"
|
||||
fill={true}
|
||||
data-test-subj="createDataViewButtonFlyout"
|
||||
data-test-subj="createDataViewButton"
|
||||
>
|
||||
{createDataViewText}
|
||||
</EuiButton>
|
||||
|
|
|
@ -55,7 +55,6 @@ export const NoDataViewsPrompt = ({ onDataViewCreated }: Props) => {
|
|||
onSave: (dataView) => {
|
||||
onDataViewCreated(dataView);
|
||||
},
|
||||
showEmptyPrompt: false,
|
||||
});
|
||||
|
||||
if (setDataViewEditorRef) {
|
||||
|
|
|
@ -26,8 +26,6 @@ type DataView = unknown;
|
|||
interface DataViewEditorOptions {
|
||||
/** Handler to be invoked when the Data View Editor completes a save operation. */
|
||||
onSave: (dataView: DataView) => void;
|
||||
/** If set to false, will skip empty prompt in data view editor. */
|
||||
showEmptyPrompt?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -24,7 +24,6 @@ export const DataViewEditor = ({
|
|||
defaultTypeIsRollup = false,
|
||||
requireTimestampField = false,
|
||||
editData,
|
||||
showEmptyPrompt = true,
|
||||
}: DataViewEditorPropsWithServices) => {
|
||||
const { Provider: KibanaReactContextProvider } =
|
||||
createKibanaReactContext<DataViewEditorContext>(services);
|
||||
|
@ -38,7 +37,6 @@ export const DataViewEditor = ({
|
|||
defaultTypeIsRollup={defaultTypeIsRollup}
|
||||
requireTimestampField={requireTimestampField}
|
||||
editData={editData}
|
||||
showEmptyPrompt={showEmptyPrompt}
|
||||
/>
|
||||
</EuiFlyout>
|
||||
</KibanaReactContextProvider>
|
||||
|
|
|
@ -44,7 +44,6 @@ import {
|
|||
schema,
|
||||
Footer,
|
||||
AdvancedParamsContent,
|
||||
EmptyPrompts,
|
||||
PreviewPanel,
|
||||
RollupBetaWarning,
|
||||
} from '.';
|
||||
|
@ -62,7 +61,6 @@ export interface Props {
|
|||
defaultTypeIsRollup?: boolean;
|
||||
requireTimestampField?: boolean;
|
||||
editData?: DataView;
|
||||
showEmptyPrompt?: boolean;
|
||||
}
|
||||
|
||||
const editorTitle = i18n.translate('indexPatternEditor.title', {
|
||||
|
@ -79,7 +77,6 @@ const IndexPatternEditorFlyoutContentComponent = ({
|
|||
defaultTypeIsRollup,
|
||||
requireTimestampField = false,
|
||||
editData,
|
||||
showEmptyPrompt = true,
|
||||
}: Props) => {
|
||||
const {
|
||||
services: { http, dataViews, uiSettings, searchClient, overlays },
|
||||
|
@ -366,75 +363,68 @@ const IndexPatternEditorFlyoutContentComponent = ({
|
|||
);
|
||||
|
||||
return (
|
||||
<EmptyPrompts
|
||||
onCancel={onCancel}
|
||||
allSources={allSources}
|
||||
loadSources={loadSources}
|
||||
showEmptyPrompt={showEmptyPrompt}
|
||||
>
|
||||
<FlyoutPanels.Group flyoutClassName={'indexPatternEditorFlyout'} maxWidth={1180}>
|
||||
<FlyoutPanels.Item className="fieldEditor__mainFlyoutPanel" border="right">
|
||||
<EuiTitle data-test-subj="flyoutTitle">
|
||||
<h2>{editData ? editorTitleEditMode : editorTitle}</h2>
|
||||
</EuiTitle>
|
||||
<Form form={form} className="indexPatternEditor__form">
|
||||
{indexPatternTypeSelect}
|
||||
<EuiSpacer size="l" />
|
||||
<EuiFlexGroup>
|
||||
<EuiFlexItem>
|
||||
<NameField editData={editData} />
|
||||
</EuiFlexItem>
|
||||
</EuiFlexGroup>
|
||||
<EuiSpacer size="l" />
|
||||
<EuiFlexGroup>
|
||||
<EuiFlexItem>
|
||||
<TitleField
|
||||
isRollup={form.getFields().type?.value === INDEX_PATTERN_TYPE.ROLLUP}
|
||||
existingIndexPatterns={existingIndexPatterns}
|
||||
refreshMatchedIndices={reloadMatchedIndices}
|
||||
matchedIndices={matchedIndices.exactMatchedIndices}
|
||||
rollupIndicesCapabilities={rollupIndicesCapabilities}
|
||||
/>
|
||||
</EuiFlexItem>
|
||||
</EuiFlexGroup>
|
||||
<EuiSpacer size="l" />
|
||||
<EuiFlexGroup>
|
||||
<EuiFlexItem>
|
||||
<TimestampField
|
||||
options={timestampFieldOptions}
|
||||
isLoadingOptions={isLoadingTimestampFields}
|
||||
isExistingIndexPattern={existingIndexPatterns.includes(title)}
|
||||
isLoadingMatchedIndices={isLoadingMatchedIndices}
|
||||
hasMatchedIndices={!!matchedIndices.exactMatchedIndices.length}
|
||||
/>
|
||||
</EuiFlexItem>
|
||||
</EuiFlexGroup>
|
||||
<AdvancedParamsContent
|
||||
disableAllowHidden={type === INDEX_PATTERN_TYPE.ROLLUP}
|
||||
disableId={!!editData}
|
||||
/>
|
||||
</Form>
|
||||
<Footer
|
||||
onCancel={onCancel}
|
||||
onSubmit={() => form.submit()}
|
||||
submitDisabled={form.isSubmitted && !form.isValid}
|
||||
isEdit={!!editData}
|
||||
<FlyoutPanels.Group flyoutClassName={'indexPatternEditorFlyout'} maxWidth={1180}>
|
||||
<FlyoutPanels.Item className="fieldEditor__mainFlyoutPanel" border="right">
|
||||
<EuiTitle data-test-subj="flyoutTitle">
|
||||
<h2>{editData ? editorTitleEditMode : editorTitle}</h2>
|
||||
</EuiTitle>
|
||||
<Form form={form} className="indexPatternEditor__form">
|
||||
{indexPatternTypeSelect}
|
||||
<EuiSpacer size="l" />
|
||||
<EuiFlexGroup>
|
||||
<EuiFlexItem>
|
||||
<NameField editData={editData} />
|
||||
</EuiFlexItem>
|
||||
</EuiFlexGroup>
|
||||
<EuiSpacer size="l" />
|
||||
<EuiFlexGroup>
|
||||
<EuiFlexItem>
|
||||
<TitleField
|
||||
isRollup={form.getFields().type?.value === INDEX_PATTERN_TYPE.ROLLUP}
|
||||
existingIndexPatterns={existingIndexPatterns}
|
||||
refreshMatchedIndices={reloadMatchedIndices}
|
||||
matchedIndices={matchedIndices.exactMatchedIndices}
|
||||
rollupIndicesCapabilities={rollupIndicesCapabilities}
|
||||
/>
|
||||
</EuiFlexItem>
|
||||
</EuiFlexGroup>
|
||||
<EuiSpacer size="l" />
|
||||
<EuiFlexGroup>
|
||||
<EuiFlexItem>
|
||||
<TimestampField
|
||||
options={timestampFieldOptions}
|
||||
isLoadingOptions={isLoadingTimestampFields}
|
||||
isExistingIndexPattern={existingIndexPatterns.includes(title)}
|
||||
isLoadingMatchedIndices={isLoadingMatchedIndices}
|
||||
hasMatchedIndices={!!matchedIndices.exactMatchedIndices.length}
|
||||
/>
|
||||
</EuiFlexItem>
|
||||
</EuiFlexGroup>
|
||||
<AdvancedParamsContent
|
||||
disableAllowHidden={type === INDEX_PATTERN_TYPE.ROLLUP}
|
||||
disableId={!!editData}
|
||||
/>
|
||||
</FlyoutPanels.Item>
|
||||
<FlyoutPanels.Item>
|
||||
{isLoadingSources ? (
|
||||
<></>
|
||||
) : (
|
||||
<PreviewPanel
|
||||
type={type}
|
||||
allowHidden={allowHidden}
|
||||
title={title}
|
||||
matched={matchedIndices}
|
||||
/>
|
||||
)}
|
||||
</FlyoutPanels.Item>
|
||||
</FlyoutPanels.Group>
|
||||
</EmptyPrompts>
|
||||
</Form>
|
||||
<Footer
|
||||
onCancel={onCancel}
|
||||
onSubmit={() => form.submit()}
|
||||
submitDisabled={form.isSubmitted && !form.isValid}
|
||||
isEdit={!!editData}
|
||||
/>
|
||||
</FlyoutPanels.Item>
|
||||
<FlyoutPanels.Item>
|
||||
{isLoadingSources ? (
|
||||
<></>
|
||||
) : (
|
||||
<PreviewPanel
|
||||
type={type}
|
||||
allowHidden={allowHidden}
|
||||
title={title}
|
||||
matched={matchedIndices}
|
||||
/>
|
||||
)}
|
||||
</FlyoutPanels.Item>
|
||||
</FlyoutPanels.Group>
|
||||
);
|
||||
};
|
||||
|
||||
|
|
|
@ -19,7 +19,6 @@ const IndexPatternFlyoutContentContainer = ({
|
|||
defaultTypeIsRollup,
|
||||
requireTimestampField = false,
|
||||
editData,
|
||||
showEmptyPrompt = true,
|
||||
}: DataViewEditorProps) => {
|
||||
const {
|
||||
services: { dataViews, notifications },
|
||||
|
@ -62,7 +61,6 @@ const IndexPatternFlyoutContentContainer = ({
|
|||
defaultTypeIsRollup={defaultTypeIsRollup}
|
||||
requireTimestampField={requireTimestampField}
|
||||
editData={editData}
|
||||
showEmptyPrompt={showEmptyPrompt}
|
||||
/>
|
||||
);
|
||||
};
|
||||
|
|
|
@ -1,106 +0,0 @@
|
|||
/*
|
||||
* 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 and the Server Side Public License, v 1; you may not use this file except
|
||||
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
||||
* Side Public License, v 1.
|
||||
*/
|
||||
|
||||
import { isUserDataIndex } from './empty_prompts';
|
||||
import { MatchedItem, ResolveIndexResponseItemIndexAttrs } from '../../types';
|
||||
|
||||
describe('isUserDataIndex', () => {
|
||||
test('system index is not data index', () => {
|
||||
const systemIndexes: MatchedItem[] = [
|
||||
{
|
||||
name: '.apm-agent-configuration',
|
||||
tags: [
|
||||
{
|
||||
key: 'index',
|
||||
name: 'Index',
|
||||
color: 'default',
|
||||
},
|
||||
],
|
||||
item: {
|
||||
name: '.apm-agent-configuration',
|
||||
attributes: [ResolveIndexResponseItemIndexAttrs.OPEN],
|
||||
},
|
||||
},
|
||||
{
|
||||
name: '.kibana',
|
||||
tags: [
|
||||
{
|
||||
key: 'alias',
|
||||
name: 'Alias',
|
||||
color: 'default',
|
||||
},
|
||||
],
|
||||
item: {
|
||||
name: '.kibana',
|
||||
indices: ['.kibana_8.0.0_001'],
|
||||
},
|
||||
},
|
||||
];
|
||||
|
||||
expect(systemIndexes.some(isUserDataIndex)).toBe(false);
|
||||
});
|
||||
|
||||
test('data index is data index', () => {
|
||||
const dataIndex: MatchedItem = {
|
||||
name: 'kibana_sample_data_ecommerce',
|
||||
tags: [
|
||||
{
|
||||
key: 'index',
|
||||
name: 'Index',
|
||||
color: 'default',
|
||||
},
|
||||
],
|
||||
item: {
|
||||
name: 'kibana_sample_data_ecommerce',
|
||||
attributes: [ResolveIndexResponseItemIndexAttrs.OPEN],
|
||||
},
|
||||
};
|
||||
|
||||
expect(isUserDataIndex(dataIndex)).toBe(true);
|
||||
});
|
||||
|
||||
test('fleet asset is not data index', () => {
|
||||
const fleetAssetIndex: MatchedItem = {
|
||||
name: 'logs-elastic_agent',
|
||||
tags: [
|
||||
{
|
||||
key: 'data_stream',
|
||||
name: 'Data stream',
|
||||
color: 'primary',
|
||||
},
|
||||
],
|
||||
item: {
|
||||
name: 'logs-elastic_agent',
|
||||
backing_indices: ['.ds-logs-elastic_agent-2021.08.18-000001'],
|
||||
timestamp_field: '@timestamp',
|
||||
},
|
||||
};
|
||||
|
||||
expect(isUserDataIndex(fleetAssetIndex)).toBe(false);
|
||||
});
|
||||
|
||||
test('ent search logs not data index', () => {
|
||||
const fleetAssetIndex: MatchedItem = {
|
||||
name: 'logs-enterprise_search.api-default',
|
||||
tags: [
|
||||
{
|
||||
key: 'data_stream',
|
||||
name: 'Data stream',
|
||||
color: 'primary',
|
||||
},
|
||||
],
|
||||
item: {
|
||||
name: 'logs-enterprise_search.api-default',
|
||||
backing_indices: ['.ds-logs-enterprise_search.api-default-2022.03.07-000001'],
|
||||
timestamp_field: '@timestamp',
|
||||
},
|
||||
};
|
||||
|
||||
expect(isUserDataIndex(fleetAssetIndex)).toBe(false);
|
||||
});
|
||||
});
|
|
@ -1,119 +0,0 @@
|
|||
/*
|
||||
* 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 and the Server Side Public License, v 1; you may not use this file except
|
||||
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
||||
* Side Public License, v 1.
|
||||
*/
|
||||
|
||||
import React, { useState, FC, useEffect } from 'react';
|
||||
import useAsync from 'react-use/lib/useAsync';
|
||||
|
||||
import { EuiFlyoutBody } from '@elastic/eui';
|
||||
import { DEFAULT_ASSETS_TO_IGNORE } from '@kbn/data-plugin/common';
|
||||
import { NoDataViewsPromptComponent } from '@kbn/shared-ux-prompt-no-data-views';
|
||||
import { useKibana } from '../../shared_imports';
|
||||
|
||||
import { MatchedItem, DataViewEditorContext } from '../../types';
|
||||
|
||||
import { getIndices } from '../../lib';
|
||||
|
||||
import { EmptyIndexListPrompt } from './empty_index_list_prompt';
|
||||
import { PromptFooter } from './prompt_footer';
|
||||
|
||||
const removeAliases = (mItem: MatchedItem) => !mItem.item.indices;
|
||||
|
||||
interface Props {
|
||||
onCancel: () => void;
|
||||
allSources: MatchedItem[];
|
||||
loadSources: () => void;
|
||||
showEmptyPrompt?: boolean;
|
||||
}
|
||||
|
||||
export function isUserDataIndex(source: MatchedItem) {
|
||||
// filter out indices that start with `.`
|
||||
if (source.name.startsWith('.')) return false;
|
||||
|
||||
// filter out sources from DEFAULT_ASSETS_TO_IGNORE
|
||||
if (source.name === DEFAULT_ASSETS_TO_IGNORE.LOGS_DATA_STREAM_TO_IGNORE) return false;
|
||||
if (source.name === DEFAULT_ASSETS_TO_IGNORE.ENT_SEARCH_LOGS_DATA_STREAM_TO_IGNORE) return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
export const EmptyPrompts: FC<Props> = ({
|
||||
allSources,
|
||||
onCancel,
|
||||
children,
|
||||
loadSources,
|
||||
showEmptyPrompt,
|
||||
}) => {
|
||||
const {
|
||||
services: { docLinks, application, http, searchClient, dataViews },
|
||||
} = useKibana<DataViewEditorContext>();
|
||||
|
||||
const [remoteClustersExist, setRemoteClustersExist] = useState<boolean>(false);
|
||||
const [hasCheckedRemoteClusters, setHasCheckedRemoteClusters] = useState<boolean>(false);
|
||||
|
||||
const [goToForm, setGoToForm] = useState<boolean>(false);
|
||||
|
||||
const hasDataIndices = allSources.some(isUserDataIndex);
|
||||
const hasUserIndexPattern = useAsync(() => dataViews.hasUserDataView().catch(() => true));
|
||||
|
||||
useEffect(() => {
|
||||
if (!hasDataIndices && !hasCheckedRemoteClusters) {
|
||||
setHasCheckedRemoteClusters(true);
|
||||
|
||||
getIndices({
|
||||
http,
|
||||
isRollupIndex: () => false,
|
||||
pattern: '*:*',
|
||||
showAllIndices: false,
|
||||
}).then((dataSources) => {
|
||||
setRemoteClustersExist(!!dataSources.filter(removeAliases).length);
|
||||
});
|
||||
}
|
||||
}, [http, hasDataIndices, searchClient, hasCheckedRemoteClusters]);
|
||||
|
||||
if (hasUserIndexPattern.loading) return null; // return null to prevent UI flickering while loading
|
||||
|
||||
if (!hasUserIndexPattern.value && !goToForm) {
|
||||
if (!hasDataIndices && !remoteClustersExist) {
|
||||
// load data
|
||||
return (
|
||||
<>
|
||||
<EuiFlyoutBody>
|
||||
<EmptyIndexListPrompt
|
||||
onRefresh={loadSources}
|
||||
closeFlyout={onCancel}
|
||||
createAnyway={() => setGoToForm(true)}
|
||||
canSaveIndexPattern={!!application.capabilities.indexPatterns.save}
|
||||
navigateToApp={application.navigateToApp}
|
||||
addDataUrl={docLinks.links.indexPatterns.introduction}
|
||||
/>
|
||||
</EuiFlyoutBody>
|
||||
<PromptFooter onCancel={onCancel} />
|
||||
</>
|
||||
);
|
||||
} else if (showEmptyPrompt) {
|
||||
// first time
|
||||
return (
|
||||
<>
|
||||
<EuiFlyoutBody>
|
||||
<NoDataViewsPromptComponent
|
||||
onClickCreate={() => setGoToForm(true)}
|
||||
canCreateNewDataView={application.capabilities.indexPatterns.save as boolean}
|
||||
dataViewsDocLink={docLinks.links.indexPatterns.introduction}
|
||||
emptyPromptColor={'subdued'}
|
||||
/>
|
||||
</EuiFlyoutBody>
|
||||
<PromptFooter onCancel={onCancel} />
|
||||
</>
|
||||
);
|
||||
} else {
|
||||
setGoToForm(true);
|
||||
}
|
||||
}
|
||||
|
||||
return <>{children}</>;
|
||||
};
|
|
@ -1,9 +0,0 @@
|
|||
/*
|
||||
* 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 and the Server Side Public License, v 1; you may not use this file except
|
||||
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
||||
* Side Public License, v 1.
|
||||
*/
|
||||
|
||||
export { EmptyPrompts } from './empty_prompts';
|
|
@ -1,9 +0,0 @@
|
|||
/*
|
||||
* 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 and the Server Side Public License, v 1; you may not use this file except
|
||||
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
||||
* Side Public License, v 1.
|
||||
*/
|
||||
|
||||
export { PromptFooter } from './prompt_footer';
|
|
@ -1,42 +0,0 @@
|
|||
/*
|
||||
* 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 and the Server Side Public License, v 1; you may not use this file except
|
||||
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
||||
* Side Public License, v 1.
|
||||
*/
|
||||
|
||||
import React from 'react';
|
||||
import { i18n } from '@kbn/i18n';
|
||||
|
||||
import { EuiFlyoutFooter, EuiFlexGroup, EuiFlexItem, EuiButtonEmpty } from '@elastic/eui';
|
||||
|
||||
const closeButtonLabel = i18n.translate(
|
||||
'indexPatternEditor.editor.emptyPrompt.flyoutCloseButtonLabel',
|
||||
{
|
||||
defaultMessage: 'Close',
|
||||
}
|
||||
);
|
||||
|
||||
interface PromptFooterProps {
|
||||
onCancel: () => void;
|
||||
}
|
||||
|
||||
export const PromptFooter = ({ onCancel }: PromptFooterProps) => {
|
||||
return (
|
||||
<EuiFlyoutFooter>
|
||||
<EuiFlexGroup justifyContent="spaceBetween" alignItems="center">
|
||||
<EuiFlexItem grow={false}>
|
||||
<EuiButtonEmpty
|
||||
iconType="cross"
|
||||
flush="left"
|
||||
onClick={onCancel}
|
||||
data-test-subj="closeFlyoutButton"
|
||||
>
|
||||
{closeButtonLabel}
|
||||
</EuiButtonEmpty>
|
||||
</EuiFlexItem>
|
||||
</EuiFlexGroup>
|
||||
</EuiFlyoutFooter>
|
||||
);
|
||||
};
|
|
@ -13,7 +13,6 @@ export { DataViewEditor } from './data_view_editor';
|
|||
|
||||
export { schema } from './form_schema';
|
||||
export { NameField, TimestampField, TypeField, TitleField } from './form_fields';
|
||||
export { EmptyPrompts } from './empty_prompts';
|
||||
export { PreviewPanel } from './preview_panel';
|
||||
export { LoadingIndices } from './loading_indices';
|
||||
export { Footer } from './footer';
|
||||
|
|
|
@ -45,7 +45,6 @@ export const getEditorOpener =
|
|||
onCancel = () => {},
|
||||
defaultTypeIsRollup = false,
|
||||
requireTimestampField = false,
|
||||
showEmptyPrompt = true,
|
||||
}: DataViewEditorProps): CloseEditor => {
|
||||
const closeEditor = () => {
|
||||
if (overlayRef) {
|
||||
|
@ -74,7 +73,6 @@ export const getEditorOpener =
|
|||
}}
|
||||
defaultTypeIsRollup={defaultTypeIsRollup}
|
||||
requireTimestampField={requireTimestampField}
|
||||
showEmptyPrompt={showEmptyPrompt}
|
||||
/>
|
||||
</I18nProvider>
|
||||
</KibanaReactContextProvider>,
|
||||
|
|
|
@ -53,11 +53,6 @@ export interface DataViewEditorProps {
|
|||
* Pass the data view to be edited.
|
||||
*/
|
||||
editData?: DataView;
|
||||
/**
|
||||
* If set to false, the screen for prompting a user to create a data view will be skipped, and the user will be taken directly
|
||||
* to data view creation.
|
||||
*/
|
||||
showEmptyPrompt?: boolean;
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-empty-interface
|
||||
|
|
|
@ -16,7 +16,7 @@ exports[`EmptyIndexListPrompt should render normally 1`] = `
|
|||
<h2>
|
||||
<FormattedMessage
|
||||
defaultMessage="Ready to try Kibana? First, you need data."
|
||||
id="indexPatternEditor.createIndexPattern.emptyState.noDataTitle"
|
||||
id="indexPatternManagement.createDataView.emptyState.noDataTitle"
|
||||
values={Object {}}
|
||||
/>
|
||||
</h2>
|
||||
|
@ -38,7 +38,7 @@ exports[`EmptyIndexListPrompt should render normally 1`] = `
|
|||
description={
|
||||
<FormattedMessage
|
||||
defaultMessage="Add data from a variety of sources."
|
||||
id="indexPatternEditor.createIndexPattern.emptyState.integrationCardDescription"
|
||||
id="indexPatternManagement.createDataView.emptyState.integrationCardDescription"
|
||||
values={Object {}}
|
||||
/>
|
||||
}
|
||||
|
@ -53,7 +53,7 @@ exports[`EmptyIndexListPrompt should render normally 1`] = `
|
|||
title={
|
||||
<FormattedMessage
|
||||
defaultMessage="Add integration"
|
||||
id="indexPatternEditor.createIndexPattern.emptyState.integrationCardTitle"
|
||||
id="indexPatternManagement.createDataView.emptyState.integrationCardTitle"
|
||||
values={Object {}}
|
||||
/>
|
||||
}
|
||||
|
@ -65,7 +65,7 @@ exports[`EmptyIndexListPrompt should render normally 1`] = `
|
|||
description={
|
||||
<FormattedMessage
|
||||
defaultMessage="Import a CSV, NDJSON, or log file."
|
||||
id="indexPatternEditor.createIndexPattern.emptyState.uploadCardDescription"
|
||||
id="indexPatternManagement.createDataView.emptyState.uploadCardDescription"
|
||||
values={Object {}}
|
||||
/>
|
||||
}
|
||||
|
@ -80,7 +80,7 @@ exports[`EmptyIndexListPrompt should render normally 1`] = `
|
|||
title={
|
||||
<FormattedMessage
|
||||
defaultMessage="Upload a file"
|
||||
id="indexPatternEditor.createIndexPattern.emptyState.uploadCardTitle"
|
||||
id="indexPatternManagement.createDataView.emptyState.uploadCardTitle"
|
||||
values={Object {}}
|
||||
/>
|
||||
}
|
||||
|
@ -92,7 +92,7 @@ exports[`EmptyIndexListPrompt should render normally 1`] = `
|
|||
description={
|
||||
<FormattedMessage
|
||||
defaultMessage="Load a data set and a Kibana dashboard."
|
||||
id="indexPatternEditor.createIndexPattern.emptyState.sampleDataCardDescription"
|
||||
id="indexPatternManagement.createDataView.emptyState.sampleDataCardDescription"
|
||||
values={Object {}}
|
||||
/>
|
||||
}
|
||||
|
@ -107,7 +107,7 @@ exports[`EmptyIndexListPrompt should render normally 1`] = `
|
|||
title={
|
||||
<FormattedMessage
|
||||
defaultMessage="Add sample data"
|
||||
id="indexPatternEditor.createIndexPattern.emptyState.sampleDataCardTitle"
|
||||
id="indexPatternManagement.createDataView.emptyState.sampleDataCardTitle"
|
||||
values={Object {}}
|
||||
/>
|
||||
}
|
||||
|
@ -138,13 +138,13 @@ exports[`EmptyIndexListPrompt should render normally 1`] = `
|
|||
>
|
||||
<FormattedMessage
|
||||
defaultMessage="Read documentation"
|
||||
id="indexPatternEditor.createIndexPattern.emptyState.readDocs"
|
||||
id="indexPatternManagement.createDataView.emptyState.readDocs"
|
||||
values={Object {}}
|
||||
/>
|
||||
</EuiLink>,
|
||||
"title": <FormattedMessage
|
||||
defaultMessage="Want to learn more?"
|
||||
id="indexPatternEditor.createIndexPattern.emptyState.learnMore"
|
||||
id="indexPatternManagement.createDataView.emptyState.learnMore"
|
||||
values={Object {}}
|
||||
/>,
|
||||
},
|
||||
|
@ -166,7 +166,7 @@ exports[`EmptyIndexListPrompt should render normally 1`] = `
|
|||
>
|
||||
<FormattedMessage
|
||||
defaultMessage="Check for new data"
|
||||
id="indexPatternEditor.createIndexPattern.emptyState.checkDataButton"
|
||||
id="indexPatternManagement.createDataView.emptyState.checkDataButton"
|
||||
values={Object {}}
|
||||
/>
|
||||
|
||||
|
@ -177,7 +177,7 @@ exports[`EmptyIndexListPrompt should render normally 1`] = `
|
|||
</EuiLink>,
|
||||
"title": <FormattedMessage
|
||||
defaultMessage="Think you already have data?"
|
||||
id="indexPatternEditor.createIndexPattern.emptyState.haveData"
|
||||
id="indexPatternManagement.createDataView.emptyState.haveData"
|
||||
values={Object {}}
|
||||
/>,
|
||||
},
|
||||
|
@ -194,7 +194,7 @@ exports[`EmptyIndexListPrompt should render normally 1`] = `
|
|||
>
|
||||
<FormattedMessage
|
||||
defaultMessage="You can also {link}"
|
||||
id="indexPatternEditor.createIndexPattern.emptyState.createAnywayTxt"
|
||||
id="indexPatternManagement.createDataView.emptyState.createAnywayTxt"
|
||||
values={
|
||||
Object {
|
||||
"link": <EuiLink
|
||||
|
@ -203,7 +203,7 @@ exports[`EmptyIndexListPrompt should render normally 1`] = `
|
|||
>
|
||||
<FormattedMessage
|
||||
defaultMessage="create a data view against hidden, system or default indices."
|
||||
id="indexPatternEditor.createDataView.emptyState.createAnywayLink"
|
||||
id="indexPatternManagement.createDataView.emptyState.createAnywayLink"
|
||||
values={Object {}}
|
||||
/>
|
||||
</EuiLink>,
|
|
@ -25,7 +25,6 @@ describe('EmptyIndexListPrompt', () => {
|
|||
<EmptyIndexListPrompt
|
||||
onRefresh={() => {}}
|
||||
createAnyway={() => {}}
|
||||
closeFlyout={() => {}}
|
||||
addDataUrl={'http://elastic.co'}
|
||||
navigateToApp={async (appId) => {}}
|
||||
canSaveIndexPattern={true}
|
||||
|
@ -44,7 +43,6 @@ describe('EmptyIndexListPrompt', () => {
|
|||
<EmptyIndexListPrompt
|
||||
onRefresh={onRefreshHandler}
|
||||
createAnyway={() => {}}
|
||||
closeFlyout={() => {}}
|
||||
addDataUrl={'http://elastic.co'}
|
||||
navigateToApp={async (appId) => {}}
|
||||
canSaveIndexPattern={true}
|
|
@ -30,14 +30,12 @@ import { ApplicationStart } from '@kbn/core/public';
|
|||
|
||||
export const EmptyIndexListPrompt = ({
|
||||
onRefresh,
|
||||
closeFlyout,
|
||||
createAnyway,
|
||||
canSaveIndexPattern,
|
||||
addDataUrl,
|
||||
navigateToApp,
|
||||
}: {
|
||||
onRefresh: () => void;
|
||||
closeFlyout: () => void;
|
||||
createAnyway: () => void;
|
||||
canSaveIndexPattern: boolean;
|
||||
addDataUrl: string;
|
||||
|
@ -46,13 +44,13 @@ export const EmptyIndexListPrompt = ({
|
|||
const createAnywayLink = (
|
||||
<EuiText color="subdued" textAlign="center" size="xs">
|
||||
<FormattedMessage
|
||||
id="indexPatternEditor.createIndexPattern.emptyState.createAnywayTxt"
|
||||
id="indexPatternManagement.createDataView.emptyState.createAnywayTxt"
|
||||
defaultMessage="You can also {link}"
|
||||
values={{
|
||||
link: (
|
||||
<EuiLink onClick={() => createAnyway()} data-test-subj="createAnyway">
|
||||
<FormattedMessage
|
||||
id="indexPatternEditor.createDataView.emptyState.createAnywayLink"
|
||||
id="indexPatternManagement.createDataView.emptyState.createAnywayLink"
|
||||
defaultMessage="create a data view against hidden, system or default indices."
|
||||
/>
|
||||
</EuiLink>
|
||||
|
@ -77,7 +75,7 @@ export const EmptyIndexListPrompt = ({
|
|||
<EuiTitle>
|
||||
<h2>
|
||||
<FormattedMessage
|
||||
id="indexPatternEditor.createIndexPattern.emptyState.noDataTitle"
|
||||
id="indexPatternManagement.createDataView.emptyState.noDataTitle"
|
||||
defaultMessage="Ready to try Kibana? First, you need data."
|
||||
/>
|
||||
</h2>
|
||||
|
@ -92,18 +90,17 @@ export const EmptyIndexListPrompt = ({
|
|||
className="inpEmptyState__card"
|
||||
onClick={() => {
|
||||
navigateToApp('integrations', { path: '/browse' });
|
||||
closeFlyout();
|
||||
}}
|
||||
icon={<EuiIcon size="xl" type="database" color="subdued" />}
|
||||
title={
|
||||
<FormattedMessage
|
||||
id="indexPatternEditor.createIndexPattern.emptyState.integrationCardTitle"
|
||||
id="indexPatternManagement.createDataView.emptyState.integrationCardTitle"
|
||||
defaultMessage="Add integration"
|
||||
/>
|
||||
}
|
||||
description={
|
||||
<FormattedMessage
|
||||
id="indexPatternEditor.createIndexPattern.emptyState.integrationCardDescription"
|
||||
id="indexPatternManagement.createDataView.emptyState.integrationCardDescription"
|
||||
defaultMessage="Add data from a variety of sources."
|
||||
/>
|
||||
}
|
||||
|
@ -116,13 +113,13 @@ export const EmptyIndexListPrompt = ({
|
|||
icon={<EuiIcon size="xl" type="document" color="subdued" />}
|
||||
title={
|
||||
<FormattedMessage
|
||||
id="indexPatternEditor.createIndexPattern.emptyState.uploadCardTitle"
|
||||
id="indexPatternManagement.createDataView.emptyState.uploadCardTitle"
|
||||
defaultMessage="Upload a file"
|
||||
/>
|
||||
}
|
||||
description={
|
||||
<FormattedMessage
|
||||
id="indexPatternEditor.createIndexPattern.emptyState.uploadCardDescription"
|
||||
id="indexPatternManagement.createDataView.emptyState.uploadCardDescription"
|
||||
defaultMessage="Import a CSV, NDJSON, or log file."
|
||||
/>
|
||||
}
|
||||
|
@ -133,18 +130,17 @@ export const EmptyIndexListPrompt = ({
|
|||
className="inpEmptyState__card"
|
||||
onClick={() => {
|
||||
navigateToApp('home', { path: '#/tutorial_directory/sampleData' });
|
||||
closeFlyout();
|
||||
}}
|
||||
icon={<EuiIcon size="xl" type="heatmap" color="subdued" />}
|
||||
title={
|
||||
<FormattedMessage
|
||||
id="indexPatternEditor.createIndexPattern.emptyState.sampleDataCardTitle"
|
||||
id="indexPatternManagement.createDataView.emptyState.sampleDataCardTitle"
|
||||
defaultMessage="Add sample data"
|
||||
/>
|
||||
}
|
||||
description={
|
||||
<FormattedMessage
|
||||
id="indexPatternEditor.createIndexPattern.emptyState.sampleDataCardDescription"
|
||||
id="indexPatternManagement.createDataView.emptyState.sampleDataCardDescription"
|
||||
defaultMessage="Load a data set and a Kibana dashboard."
|
||||
/>
|
||||
}
|
||||
|
@ -160,14 +156,14 @@ export const EmptyIndexListPrompt = ({
|
|||
{
|
||||
title: (
|
||||
<FormattedMessage
|
||||
id="indexPatternEditor.createIndexPattern.emptyState.learnMore"
|
||||
id="indexPatternManagement.createDataView.emptyState.learnMore"
|
||||
defaultMessage="Want to learn more?"
|
||||
/>
|
||||
),
|
||||
description: (
|
||||
<EuiLink href={addDataUrl} target="_blank" external>
|
||||
<FormattedMessage
|
||||
id="indexPatternEditor.createIndexPattern.emptyState.readDocs"
|
||||
id="indexPatternManagement.createDataView.emptyState.readDocs"
|
||||
defaultMessage="Read documentation"
|
||||
/>
|
||||
</EuiLink>
|
||||
|
@ -182,14 +178,14 @@ export const EmptyIndexListPrompt = ({
|
|||
{
|
||||
title: (
|
||||
<FormattedMessage
|
||||
id="indexPatternEditor.createIndexPattern.emptyState.haveData"
|
||||
id="indexPatternManagement.createDataView.emptyState.haveData"
|
||||
defaultMessage="Think you already have data?"
|
||||
/>
|
||||
),
|
||||
description: (
|
||||
<EuiLink onClick={onRefresh} data-test-subj="refreshIndicesButton">
|
||||
<FormattedMessage
|
||||
id="indexPatternEditor.createIndexPattern.emptyState.checkDataButton"
|
||||
id="indexPatternManagement.createDataView.emptyState.checkDataButton"
|
||||
defaultMessage="Check for new data"
|
||||
/>{' '}
|
||||
<EuiIcon type="refresh" size="s" />
|
|
@ -15,6 +15,7 @@ import {
|
|||
EuiSpacer,
|
||||
EuiIconTip,
|
||||
EuiBasicTableColumn,
|
||||
EuiLoadingSpinner,
|
||||
} from '@elastic/eui';
|
||||
import { FormattedMessage } from '@kbn/i18n-react';
|
||||
import { RouteComponentProps, withRouter, useLocation } from 'react-router-dom';
|
||||
|
@ -22,6 +23,8 @@ import React, { useEffect, useState, useCallback, useMemo } from 'react';
|
|||
import { i18n } from '@kbn/i18n';
|
||||
import { reactRouterNavigate, useKibana } from '@kbn/kibana-react-plugin/public';
|
||||
import type { SpacesContextProps } from '@kbn/spaces-plugin/public';
|
||||
import { NoDataViewsPromptComponent } from '@kbn/shared-ux-prompt-no-data-views';
|
||||
import { EmptyIndexListPrompt } from '../empty_index_list_prompt';
|
||||
import { IndexPatternManagmentContext } from '../../types';
|
||||
import { IndexPatternTableItem } from '../types';
|
||||
import { getIndexPatterns } from '../utils';
|
||||
|
@ -60,6 +63,11 @@ interface Props extends RouteComponentProps {
|
|||
showCreateDialog?: boolean;
|
||||
}
|
||||
|
||||
interface DataState {
|
||||
hasDataView?: boolean;
|
||||
hasESData?: boolean;
|
||||
}
|
||||
|
||||
const getEmptyFunctionComponent: React.FC<SpacesContextProps> = ({ children }) => <>{children}</>;
|
||||
|
||||
export const IndexPatternTable = ({
|
||||
|
@ -77,12 +85,15 @@ export const IndexPatternTable = ({
|
|||
IndexPatternEditor,
|
||||
spaces,
|
||||
overlays,
|
||||
docLinks,
|
||||
} = useKibana<IndexPatternManagmentContext>().services;
|
||||
const [query, setQuery] = useState('');
|
||||
const [indexPatterns, setIndexPatterns] = useState<IndexPatternTableItem[]>([]);
|
||||
const [isLoadingIndexPatterns, setIsLoadingIndexPatterns] = useState<boolean>(true);
|
||||
const [showCreateDialog, setShowCreateDialog] = useState<boolean>(showCreateDialogProp);
|
||||
const [selectedItems, setSelectedItems] = useState<IndexPatternTableItem[]>([]);
|
||||
const [isLoadingDataState, setIsLoadingDataState] = useState<boolean>(true);
|
||||
const [dataState, setDataState] = useState<DataState>({});
|
||||
|
||||
const handleOnChange = ({ queryText, error }: { queryText: string; error: unknown }) => {
|
||||
if (!error) {
|
||||
|
@ -90,6 +101,8 @@ export const IndexPatternTable = ({
|
|||
}
|
||||
};
|
||||
|
||||
const { hasDataView, hasESData } = dataState;
|
||||
|
||||
const renderDeleteButton = () => {
|
||||
const clickHandler = removeDataView({
|
||||
dataViews,
|
||||
|
@ -137,6 +150,11 @@ export const IndexPatternTable = ({
|
|||
|
||||
const loadDataViews = useCallback(async () => {
|
||||
setIsLoadingIndexPatterns(true);
|
||||
setDataState({
|
||||
hasDataView: await dataViews.hasData.hasDataView(),
|
||||
hasESData: await dataViews.hasData.hasESData(),
|
||||
});
|
||||
setIsLoadingDataState(false);
|
||||
const gettedIndexPatterns: IndexPatternTableItem[] = await getIndexPatterns(
|
||||
uiSettings.get('defaultIndex'),
|
||||
dataViews
|
||||
|
@ -147,17 +165,12 @@ export const IndexPatternTable = ({
|
|||
}, [dataViews, uiSettings]);
|
||||
|
||||
setBreadcrumbs(getListBreadcrumbs());
|
||||
|
||||
useEffect(() => {
|
||||
(async function () {
|
||||
const gettedIndexPatterns = await loadDataViews();
|
||||
if (
|
||||
gettedIndexPatterns.length === 0 ||
|
||||
!(await dataViews.hasUserDataView().catch(() => false))
|
||||
) {
|
||||
setShowCreateDialog(true);
|
||||
}
|
||||
await loadDataViews();
|
||||
})();
|
||||
}, [indexPatternManagementStart, uiSettings, dataViews, loadDataViews]);
|
||||
}, [indexPatternManagementStart, uiSettings, loadDataViews]);
|
||||
|
||||
chrome.docTitle.change(title);
|
||||
|
||||
|
@ -305,8 +318,8 @@ export const IndexPatternTable = ({
|
|||
onSelectionChange: setSelectedItems,
|
||||
};
|
||||
|
||||
return (
|
||||
<div data-test-subj="indexPatternTable" role="region" aria-label={title}>
|
||||
let displayIndexPatternSection = (
|
||||
<>
|
||||
<EuiPageHeader
|
||||
pageTitle={title}
|
||||
description={
|
||||
|
@ -333,6 +346,43 @@ export const IndexPatternTable = ({
|
|||
selection={dataViews.getCanSaveSync() ? selection : undefined}
|
||||
/>
|
||||
</ContextWrapper>
|
||||
</>
|
||||
);
|
||||
if (!hasDataView)
|
||||
displayIndexPatternSection = (
|
||||
<>
|
||||
<EuiSpacer size="xxl" />
|
||||
<NoDataViewsPromptComponent
|
||||
onClickCreate={() => setShowCreateDialog(true)}
|
||||
canCreateNewDataView={application.capabilities.indexPatterns.save as boolean}
|
||||
dataViewsDocLink={docLinks.links.indexPatterns.introduction}
|
||||
emptyPromptColor={'subdued'}
|
||||
/>
|
||||
</>
|
||||
);
|
||||
if (!hasDataView && !hasESData)
|
||||
displayIndexPatternSection = (
|
||||
<>
|
||||
<EuiSpacer size="xxl" />
|
||||
<EmptyIndexListPrompt
|
||||
onRefresh={loadDataViews}
|
||||
createAnyway={() => setShowCreateDialog(true)}
|
||||
canSaveIndexPattern={!!application.capabilities.indexPatterns.save}
|
||||
navigateToApp={application.navigateToApp}
|
||||
addDataUrl={docLinks.links.indexPatterns.introduction}
|
||||
/>
|
||||
</>
|
||||
);
|
||||
|
||||
return (
|
||||
<div data-test-subj="indexPatternTable" role="region" aria-label={title}>
|
||||
{isLoadingDataState ? (
|
||||
<div style={{ display: 'flex', justifyContent: 'center' }}>
|
||||
<EuiLoadingSpinner size="xxl" />
|
||||
</div>
|
||||
) : (
|
||||
displayIndexPatternSection
|
||||
)}
|
||||
{displayIndexPatternEditor}
|
||||
</div>
|
||||
);
|
||||
|
|
|
@ -56,7 +56,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
|||
// create the new data view from the dashboards/create route in order to test that the dashboard is loaded properly as soon as the data view is created...
|
||||
await PageObjects.common.navigateToUrl('dashboard', '/create');
|
||||
|
||||
const button = await testSubjects.find('createDataViewButtonFlyout');
|
||||
const button = await testSubjects.find('createDataViewButton');
|
||||
button.click();
|
||||
await retry.waitForWithTimeout('index pattern editor form to be visible', 15000, async () => {
|
||||
return await (await find.byClassName('indexPatternEditor__form')).isDisplayed();
|
||||
|
|
|
@ -53,7 +53,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
|||
await kibanaServer.savedObjects.clean({ types: ['search', 'index-pattern'] });
|
||||
await PageObjects.common.navigateToApp('discover');
|
||||
|
||||
const button = await testSubjects.find('createDataViewButtonFlyout');
|
||||
const button = await testSubjects.find('createDataViewButton');
|
||||
button.click();
|
||||
await retry.waitForWithTimeout('data view editor form to be visible', 15000, async () => {
|
||||
return await (await find.byClassName('indexPatternEditor__form')).isDisplayed();
|
||||
|
|
|
@ -32,7 +32,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
|||
await PageObjects.settings.clickKibanaIndexPatterns();
|
||||
await PageObjects.settings.clickAddNewIndexPatternButton();
|
||||
await testSubjects.click('closeFlyoutButton');
|
||||
await testSubjects.find('createIndexPatternButton');
|
||||
await testSubjects.find('createDataViewButton');
|
||||
});
|
||||
});
|
||||
|
||||
|
|
|
@ -55,7 +55,7 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) {
|
|||
body: { user: 'matt', message: 20 },
|
||||
});
|
||||
await testSubjects.click('refreshIndicesButton');
|
||||
await testSubjects.existOrFail('createIndexPatternButton', { timeout: 5000 });
|
||||
await testSubjects.existOrFail('createDataViewButton', { timeout: 5000 });
|
||||
await PageObjects.settings.createIndexPattern('logstash-*', '');
|
||||
});
|
||||
|
||||
|
|
|
@ -43,7 +43,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
|||
await kibanaServer.savedObjects.clean({ types: ['search', 'index-pattern'] });
|
||||
await PageObjects.common.navigateToApp('visualize');
|
||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
||||
const button = await testSubjects.find('createDataViewButtonFlyout');
|
||||
const button = await testSubjects.find('createDataViewButton');
|
||||
button.click();
|
||||
await retry.waitForWithTimeout('index pattern editor form to be visible', 15000, async () => {
|
||||
return await (await find.byClassName('indexPatternEditor__form')).isDisplayed();
|
||||
|
|
|
@ -550,10 +550,10 @@ export class SettingsPageObject extends FtrService {
|
|||
async clickAddNewIndexPatternButton() {
|
||||
await this.common.scrollKibanaBodyTop();
|
||||
|
||||
// if flyout is open
|
||||
const flyoutView = await this.testSubjects.exists('createDataViewButtonFlyout');
|
||||
if (flyoutView) {
|
||||
await this.testSubjects.click('createDataViewButtonFlyout');
|
||||
// if showing no data view prompt
|
||||
const noDataView = await this.testSubjects.exists('createDataViewButton');
|
||||
if (noDataView) {
|
||||
await this.testSubjects.click('createDataViewButton');
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -561,10 +561,6 @@ export class SettingsPageObject extends FtrService {
|
|||
if (tableView) {
|
||||
await this.testSubjects.click('createIndexPatternButton');
|
||||
}
|
||||
const flyoutView2 = await this.testSubjects.exists('createDataViewButtonFlyout');
|
||||
if (flyoutView2) {
|
||||
await this.testSubjects.click('createDataViewButtonFlyout');
|
||||
}
|
||||
}
|
||||
|
||||
async selectRollupIndexPatternType() {
|
||||
|
|
|
@ -4358,25 +4358,24 @@
|
|||
"home.tutorials.zscalerLogs.shortDescription": "Collectez et analysez les logs à partir de Zscaler NSS avec Filebeat.",
|
||||
"home.welcomeTitle": "Bienvenue dans Elastic",
|
||||
"indexPatternEditor.aliasLabel": "Alias",
|
||||
"indexPatternEditor.createDataView.emptyState.createAnywayLink": "créer une vue de données par rapport à des index masqués, système ou par défaut.",
|
||||
"indexPatternManagement.createDataView.emptyState.createAnywayLink": "créer une vue de données par rapport à des index masqués, système ou par défaut.",
|
||||
"indexPatternEditor.createIndex.noMatch": "Le nom doit correspondre à au moins un flux de données, index ou alias d'index.",
|
||||
"indexPatternEditor.createIndexPattern.emptyState.checkDataButton": "Rechercher de nouvelles données",
|
||||
"indexPatternEditor.createIndexPattern.emptyState.createAnywayTxt": "Vous pouvez également {link}",
|
||||
"indexPatternEditor.createIndexPattern.emptyState.haveData": "Vous pensez avoir déjà des données ?",
|
||||
"indexPatternEditor.createIndexPattern.emptyState.integrationCardDescription": "Ajoutez des données depuis diverses sources.",
|
||||
"indexPatternEditor.createIndexPattern.emptyState.integrationCardTitle": "Ajouter une intégration",
|
||||
"indexPatternEditor.createIndexPattern.emptyState.learnMore": "Envie d'en savoir plus ?",
|
||||
"indexPatternEditor.createIndexPattern.emptyState.noDataTitle": "Vous êtes prêt à essayer Kibana ? Tout d'abord, vous avez besoin de données.",
|
||||
"indexPatternEditor.createIndexPattern.emptyState.readDocs": "Lire la documentation",
|
||||
"indexPatternEditor.createIndexPattern.emptyState.sampleDataCardDescription": "Chargez un ensemble de données et un tableau de bord Kibana.",
|
||||
"indexPatternEditor.createIndexPattern.emptyState.sampleDataCardTitle": "Ajouter un exemple de données",
|
||||
"indexPatternEditor.createIndexPattern.emptyState.uploadCardDescription": "Importez un fichier CSV, NDJSON ou log.",
|
||||
"indexPatternEditor.createIndexPattern.emptyState.uploadCardTitle": "Charger un fichier",
|
||||
"indexPatternManagement.createDataView.emptyState.checkDataButton": "Rechercher de nouvelles données",
|
||||
"indexPatternManagement.createDataView.emptyState.createAnywayTxt": "Vous pouvez également {link}",
|
||||
"indexPatternManagement.createDataView.emptyState.haveData": "Vous pensez avoir déjà des données ?",
|
||||
"indexPatternManagement.createDataView.emptyState.integrationCardDescription": "Ajoutez des données depuis diverses sources.",
|
||||
"indexPatternManagement.createDataView.emptyState.integrationCardTitle": "Ajouter une intégration",
|
||||
"indexPatternManagement.createDataView.emptyState.learnMore": "Envie d'en savoir plus ?",
|
||||
"indexPatternManagement.createDataView.emptyState.noDataTitle": "Vous êtes prêt à essayer Kibana ? Tout d'abord, vous avez besoin de données.",
|
||||
"indexPatternManagement.createDataView.emptyState.readDocs": "Lire la documentation",
|
||||
"indexPatternManagement.createDataView.emptyState.sampleDataCardDescription": "Chargez un ensemble de données et un tableau de bord Kibana.",
|
||||
"indexPatternManagement.createDataView.emptyState.sampleDataCardTitle": "Ajouter un exemple de données",
|
||||
"indexPatternManagement.createDataView.emptyState.uploadCardDescription": "Importez un fichier CSV, NDJSON ou log.",
|
||||
"indexPatternManagement.createDataView.emptyState.uploadCardTitle": "Charger un fichier",
|
||||
"indexPatternEditor.createIndexPattern.stepTime.noTimeFieldOptionLabel": "--- Je ne souhaite pas utiliser le filtre temporel ---",
|
||||
"indexPatternEditor.dataStreamLabel": "Flux de données",
|
||||
"indexPatternEditor.dataView.unableSaveLabel": "Échec de l’enregistrement de la vue de données.",
|
||||
"indexPatternEditor.dataViewExists.ValidationErrorMessage": "Une vue de données avec ce titre existe déjà.",
|
||||
"indexPatternEditor.editor.emptyPrompt.flyoutCloseButtonLabel": "Fermer",
|
||||
"indexPatternEditor.editor.flyoutCloseButtonLabel": "Fermer",
|
||||
"indexPatternEditor.editor.flyoutSaveButtonLabel": "Créer une vue de données",
|
||||
"indexPatternEditor.editor.form.advancedSettings.hideButtonLabel": "Masquer les paramètres avancés",
|
||||
|
|
|
@ -4456,25 +4456,24 @@
|
|||
"home.tutorials.zscalerLogs.shortDescription": "Filebeatを使用してZscaler NSSからログを収集して解析します。",
|
||||
"home.welcomeTitle": "Elasticへようこそ",
|
||||
"indexPatternEditor.aliasLabel": "エイリアス",
|
||||
"indexPatternEditor.createDataView.emptyState.createAnywayLink": "非表示のシステムまたはデフォルトインデックスに対してデータビューを作成します。",
|
||||
"indexPatternManagement.createDataView.emptyState.createAnywayLink": "非表示のシステムまたはデフォルトインデックスに対してデータビューを作成します。",
|
||||
"indexPatternEditor.createIndex.noMatch": "名前は1つ以上のデータストリーム、インデックス、またはインデックスエイリアスと一致する必要があります。",
|
||||
"indexPatternEditor.createIndexPattern.emptyState.checkDataButton": "新規データを確認",
|
||||
"indexPatternEditor.createIndexPattern.emptyState.createAnywayTxt": "{link}もできます。",
|
||||
"indexPatternEditor.createIndexPattern.emptyState.haveData": "すでにデータがある場合",
|
||||
"indexPatternEditor.createIndexPattern.emptyState.integrationCardDescription": "さまざまなソースからデータを追加します。",
|
||||
"indexPatternEditor.createIndexPattern.emptyState.integrationCardTitle": "統合の追加",
|
||||
"indexPatternEditor.createIndexPattern.emptyState.learnMore": "詳細について",
|
||||
"indexPatternEditor.createIndexPattern.emptyState.noDataTitle": "Kibanaを試しますか?まずデータが必要です。",
|
||||
"indexPatternEditor.createIndexPattern.emptyState.readDocs": "ドキュメンテーションを表示",
|
||||
"indexPatternEditor.createIndexPattern.emptyState.sampleDataCardDescription": "データセットとKibanaダッシュボードを読み込みます。",
|
||||
"indexPatternEditor.createIndexPattern.emptyState.sampleDataCardTitle": "サンプルデータの追加",
|
||||
"indexPatternEditor.createIndexPattern.emptyState.uploadCardDescription": "CSV、NDJSON、またはログファイルをインポートします。",
|
||||
"indexPatternEditor.createIndexPattern.emptyState.uploadCardTitle": "ファイルをアップロード",
|
||||
"indexPatternManagement.createDataView.emptyState.checkDataButton": "新規データを確認",
|
||||
"indexPatternManagement.createDataView.emptyState.createAnywayTxt": "{link}もできます。",
|
||||
"indexPatternManagement.createDataView.emptyState.haveData": "すでにデータがある場合",
|
||||
"indexPatternManagement.createDataView.emptyState.integrationCardDescription": "さまざまなソースからデータを追加します。",
|
||||
"indexPatternManagement.createDataView.emptyState.integrationCardTitle": "統合の追加",
|
||||
"indexPatternManagement.createDataView.emptyState.learnMore": "詳細について",
|
||||
"indexPatternManagement.createDataView.emptyState.noDataTitle": "Kibanaを試しますか?まずデータが必要です。",
|
||||
"indexPatternManagement.createDataView.emptyState.readDocs": "ドキュメンテーションを表示",
|
||||
"indexPatternManagement.createDataView.emptyState.sampleDataCardDescription": "データセットとKibanaダッシュボードを読み込みます。",
|
||||
"indexPatternManagement.createDataView.emptyState.sampleDataCardTitle": "サンプルデータの追加",
|
||||
"indexPatternManagement.createDataView.emptyState.uploadCardDescription": "CSV、NDJSON、またはログファイルをインポートします。",
|
||||
"indexPatternManagement.createDataView.emptyState.uploadCardTitle": "ファイルをアップロード",
|
||||
"indexPatternEditor.createIndexPattern.stepTime.noTimeFieldOptionLabel": "--- 時間フィルターを使用しない ---",
|
||||
"indexPatternEditor.dataStreamLabel": "データストリーム",
|
||||
"indexPatternEditor.dataView.unableSaveLabel": "データビューの保存に失敗しました。",
|
||||
"indexPatternEditor.dataViewExists.ValidationErrorMessage": "このタイトルのデータビューはすでに存在します。",
|
||||
"indexPatternEditor.editor.emptyPrompt.flyoutCloseButtonLabel": "閉じる",
|
||||
"indexPatternEditor.editor.flyoutCloseButtonLabel": "閉じる",
|
||||
"indexPatternEditor.editor.flyoutSaveButtonLabel": "データビューを作成",
|
||||
"indexPatternEditor.editor.form.advancedSettings.hideButtonLabel": "高度な SIEM 設定の非表示化",
|
||||
|
|
|
@ -4462,25 +4462,24 @@
|
|||
"home.tutorials.zscalerLogs.shortDescription": "使用 Filebeat 从 Zscaler NSS 收集并解析日志。",
|
||||
"home.welcomeTitle": "欢迎使用 Elastic",
|
||||
"indexPatternEditor.aliasLabel": "别名",
|
||||
"indexPatternEditor.createDataView.emptyState.createAnywayLink": "根据隐藏、系统或默认索引创建数据视图。",
|
||||
"indexPatternManagement.createDataView.emptyState.createAnywayLink": "根据隐藏、系统或默认索引创建数据视图。",
|
||||
"indexPatternEditor.createIndex.noMatch": "名称必须匹配一个或多个数据流、索引或索引别名。",
|
||||
"indexPatternEditor.createIndexPattern.emptyState.checkDataButton": "检查新数据",
|
||||
"indexPatternEditor.createIndexPattern.emptyState.createAnywayTxt": "您还可以{link}",
|
||||
"indexPatternEditor.createIndexPattern.emptyState.haveData": "假设您已有数据?",
|
||||
"indexPatternEditor.createIndexPattern.emptyState.integrationCardDescription": "从各种源添加数据。",
|
||||
"indexPatternEditor.createIndexPattern.emptyState.integrationCardTitle": "添加集成",
|
||||
"indexPatternEditor.createIndexPattern.emptyState.learnMore": "希望了解详情?",
|
||||
"indexPatternEditor.createIndexPattern.emptyState.noDataTitle": "准备试用 Kibana?首先,您需要数据。",
|
||||
"indexPatternEditor.createIndexPattern.emptyState.readDocs": "阅读文档",
|
||||
"indexPatternEditor.createIndexPattern.emptyState.sampleDataCardDescription": "加载数据集和 Kibana 仪表板。",
|
||||
"indexPatternEditor.createIndexPattern.emptyState.sampleDataCardTitle": "添加样例数据",
|
||||
"indexPatternEditor.createIndexPattern.emptyState.uploadCardDescription": "导入 CSV、NDJSON 或日志文件。",
|
||||
"indexPatternEditor.createIndexPattern.emptyState.uploadCardTitle": "上传文件",
|
||||
"indexPatternManagement.createDataView.emptyState.checkDataButton": "检查新数据",
|
||||
"indexPatternManagement.createDataView.emptyState.createAnywayTxt": "您还可以{link}",
|
||||
"indexPatternManagement.createDataView.emptyState.haveData": "假设您已有数据?",
|
||||
"indexPatternManagement.createDataView.emptyState.integrationCardDescription": "从各种源添加数据。",
|
||||
"indexPatternManagement.createDataView.emptyState.integrationCardTitle": "添加集成",
|
||||
"indexPatternManagement.createDataView.emptyState.learnMore": "希望了解详情?",
|
||||
"indexPatternManagement.createDataView.emptyState.noDataTitle": "准备试用 Kibana?首先,您需要数据。",
|
||||
"indexPatternManagement.createDataView.emptyState.readDocs": "阅读文档",
|
||||
"indexPatternManagement.createDataView.emptyState.sampleDataCardDescription": "加载数据集和 Kibana 仪表板。",
|
||||
"indexPatternManagement.createDataView.emptyState.sampleDataCardTitle": "添加样例数据",
|
||||
"indexPatternManagement.createDataView.emptyState.uploadCardDescription": "导入 CSV、NDJSON 或日志文件。",
|
||||
"indexPatternManagement.createDataView.emptyState.uploadCardTitle": "上传文件",
|
||||
"indexPatternEditor.createIndexPattern.stepTime.noTimeFieldOptionLabel": "--- 我不想使用时间筛选 ---",
|
||||
"indexPatternEditor.dataStreamLabel": "数据流",
|
||||
"indexPatternEditor.dataView.unableSaveLabel": "无法保存数据视图。",
|
||||
"indexPatternEditor.dataViewExists.ValidationErrorMessage": "具有此名称的数据视图已存在。",
|
||||
"indexPatternEditor.editor.emptyPrompt.flyoutCloseButtonLabel": "关闭",
|
||||
"indexPatternEditor.editor.flyoutCloseButtonLabel": "关闭",
|
||||
"indexPatternEditor.editor.flyoutSaveButtonLabel": "创建数据视图",
|
||||
"indexPatternEditor.editor.form.advancedSettings.hideButtonLabel": "隐藏高级设置",
|
||||
|
|
|
@ -79,7 +79,7 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) {
|
|||
|
||||
it(`index pattern listing shows create button`, async () => {
|
||||
await PageObjects.settings.clickKibanaIndexPatterns();
|
||||
await testSubjects.existOrFail('createIndexPatternButton');
|
||||
await testSubjects.existOrFail('createDataViewButton');
|
||||
});
|
||||
|
||||
it(`doesn't show read-only badge`, async () => {
|
||||
|
@ -134,7 +134,7 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) {
|
|||
it(`index pattern listing doesn't show create button`, async () => {
|
||||
await PageObjects.settings.clickKibanaIndexPatterns();
|
||||
await testSubjects.existOrFail('noDataViewsPrompt');
|
||||
await testSubjects.missingOrFail('createDataViewButtonFlyout');
|
||||
await testSubjects.missingOrFail('createDataViewButton');
|
||||
});
|
||||
|
||||
it(`shows read-only badge`, async () => {
|
||||
|
|
|
@ -50,7 +50,7 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) {
|
|||
it(`data views listing shows create button`, async () => {
|
||||
await PageObjects.settings.navigateTo();
|
||||
await PageObjects.settings.clickKibanaIndexPatterns();
|
||||
await testSubjects.existOrFail('createIndexPatternButton');
|
||||
await testSubjects.existOrFail('createDataViewButton');
|
||||
});
|
||||
});
|
||||
|
||||
|
|
|
@ -51,7 +51,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
|||
await kibanaServer.savedObjects.clean({ types: ['index-pattern'] });
|
||||
await PageObjects.common.navigateToApp('lens');
|
||||
|
||||
const button = await testSubjects.find('createDataViewButtonFlyout');
|
||||
const button = await testSubjects.find('createDataViewButton');
|
||||
button.click();
|
||||
await retry.waitForWithTimeout('index pattern editor form to be visible', 15000, async () => {
|
||||
return await (await find.byClassName('indexPatternEditor__form')).isDisplayed();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue