Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ML] Data Visualizer: index pattern to data view in user facing copy #114258

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -62,16 +62,16 @@ export function getActions(
});
}

// Allow to edit index pattern field
// Allow to edit data view field
if (services.indexPatternFieldEditor?.userPermissions.editIndexPattern()) {
actions.push({
name: i18n.translate('xpack.dataVisualizer.index.dataGrid.editIndexPatternFieldTitle', {
defaultMessage: 'Edit index pattern field',
name: i18n.translate('xpack.dataVisualizer.index.dataGrid.editDataViewFieldTitle', {
defaultMessage: 'Edit data view field',
}),
description: i18n.translate(
'xpack.dataVisualizer.index.dataGrid.editIndexPatternFieldDescription',
'xpack.dataVisualizer.index.dataGrid.editDataViewFieldDescription',
{
defaultMessage: 'Edit index pattern field',
defaultMessage: 'Edit data view field',
}
),
type: 'icon',
Expand All @@ -86,13 +86,13 @@ export function getActions(
'data-test-subj': 'dataVisualizerActionEditIndexPatternFieldButton',
});
actions.push({
name: i18n.translate('xpack.dataVisualizer.index.dataGrid.deleteIndexPatternFieldTitle', {
defaultMessage: 'Delete index pattern field',
name: i18n.translate('xpack.dataVisualizer.index.dataGrid.deleteDataViewFieldTitle', {
defaultMessage: 'Delete data view field',
}),
description: i18n.translate(
'xpack.dataVisualizer.index.dataGrid.deleteIndexPatternFieldDescription',
{
defaultMessage: 'Delete index pattern field',
defaultMessage: 'Delete data view field',
}
),
type: 'icon',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ const defaultIcon = { iconType: 'questionInCircle', color: 'gray' };
// Extended & modified version of src/plugins/kibana_react/public/field_icon/field_icon.tsx
export const typeToEuiIconMap: Record<string, { iconType: string; color?: string }> = {
boolean: { iconType: 'tokenBoolean' },
// icon for an index pattern mapping conflict in discover
// icon for a data view mapping conflict in discover
conflict: { iconType: 'alert', color: 'euiColorVis9' },
date: { iconType: 'tokenDate' },
date_range: { iconType: 'tokenDate' },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -241,8 +241,8 @@ export const ResultsLinks: FC<Props> = ({
icon={<EuiIcon size="xxl" type={`managementApp`} />}
title={
<FormattedMessage
id="xpack.dataVisualizer.file.resultsLinks.indexPatternManagementTitle"
defaultMessage="Index Pattern Management"
id="xpack.dataVisualizer.file.resultsLinks.dataViewManagementTitle"
defaultMessage="Data View Management"
/>
}
description=""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*/

/*
* Formatter which uses the fieldFormat object of a Kibana index pattern
* Formatter which uses the fieldFormat object of a Kibana data view
* field to format the value of a field.
*/

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@ function title(statuses: Statuses) {
case statuses.indexPatternCreatedStatus:
return (
<FormattedMessage
id="xpack.dataVisualizer.file.importErrors.creatingIndexPatternErrorMessage"
defaultMessage="Error creating index pattern"
id="xpack.dataVisualizer.file.importErrors.creatingDataViewErrorMessage"
defaultMessage="Error creating data view"
/>
);
case statuses.permissionCheckStatus:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,10 +103,10 @@ export const ImportProgress: FC<{ statuses: Statuses }> = ({ statuses }) => {
defaultMessage: 'Upload data',
}
);
let createIndexPatternTitle = i18n.translate(
'xpack.dataVisualizer.file.importProgress.createIndexPatternTitle',
let createDataViewTitle = i18n.translate(
'xpack.dataVisualizer.file.importProgress.createDataViewTitle',
{
defaultMessage: 'Create index pattern',
defaultMessage: 'Create data view',
}
);

Expand Down Expand Up @@ -199,17 +199,17 @@ export const ImportProgress: FC<{ statuses: Statuses }> = ({ statuses }) => {
}
);
if (createIndexPattern === true) {
createIndexPatternTitle = i18n.translate(
'xpack.dataVisualizer.file.importProgress.creatingIndexPatternTitle',
createDataViewTitle = i18n.translate(
'xpack.dataVisualizer.file.importProgress.creatingDataViewTitle',
{
defaultMessage: 'Creating index pattern',
defaultMessage: 'Creating data view',
}
);
statusInfo = (
<p>
<FormattedMessage
id="xpack.dataVisualizer.file.importProgress.creatingIndexPatternDescription"
defaultMessage="Creating index pattern"
id="xpack.dataVisualizer.file.importProgress.creatingDataViewDescription"
defaultMessage="Creating data view"
/>
</p>
);
Expand All @@ -218,10 +218,10 @@ export const ImportProgress: FC<{ statuses: Statuses }> = ({ statuses }) => {
}
}
if (completedStep >= 5) {
createIndexPatternTitle = i18n.translate(
'xpack.dataVisualizer.file.importProgress.indexPatternCreatedTitle',
createDataViewTitle = i18n.translate(
'xpack.dataVisualizer.file.importProgress.dataViewCreatedTitle',
{
defaultMessage: 'Index pattern created',
defaultMessage: 'Data view created',
}
);
statusInfo = null;
Expand Down Expand Up @@ -267,7 +267,7 @@ export const ImportProgress: FC<{ statuses: Statuses }> = ({ statuses }) => {

if (createIndexPattern === true) {
steps.push({
title: createIndexPatternTitle,
title: createDataViewTitle,
isSelected: uploadStatus === IMPORT_STATUS.COMPLETE,
isComplete: indexPatternCreatedStatus === IMPORT_STATUS.COMPLETE,
status: indexPatternCreatedStatus,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,8 @@ export const AdvancedSettings: FC<Props> = ({
id="createIndexPattern"
label={
<FormattedMessage
id="xpack.dataVisualizer.file.advancedImportSettings.createIndexPatternLabel"
defaultMessage="Create index pattern"
id="xpack.dataVisualizer.file.advancedImportSettings.createDataViewLabel"
defaultMessage="Create data view"
/>
}
checked={createIndexPattern === true}
Expand All @@ -116,8 +116,8 @@ export const AdvancedSettings: FC<Props> = ({
<EuiFormRow
label={
<FormattedMessage
id="xpack.dataVisualizer.file.advancedImportSettings.indexPatternNameLabel"
defaultMessage="Index pattern name"
id="xpack.dataVisualizer.file.advancedImportSettings.dataViewNameLabel"
defaultMessage="Data view name"
/>
}
isInvalid={indexPatternNameError !== ''}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@ export const SimpleSettings: FC<Props> = ({
id="createIndexPattern"
label={
<FormattedMessage
id="xpack.dataVisualizer.file.simpleImportSettings.createIndexPatternLabel"
defaultMessage="Create index pattern"
id="xpack.dataVisualizer.file.simpleImportSettings.createDataViewLabel"
defaultMessage="Create data view"
/>
}
checked={createIndexPattern === true}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,8 @@ function createDisplayItems(
items.splice(1, 0, {
title: (
<FormattedMessage
id="xpack.dataVisualizer.file.importSummary.indexPatternTitle"
defaultMessage="Index pattern"
id="xpack.dataVisualizer.file.importSummary.dataViewTitle"
defaultMessage="Data view"
/>
),
description: indexPattern,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,7 @@ export class ImportView extends Component {

this.setState({ indexPatternNames });
} catch (error) {
console.error('failed to load index patterns', error);
console.error('failed to load data views', error);
}
}

Expand Down Expand Up @@ -704,8 +704,8 @@ function isIndexPatternNameValid(name, indexPatternNames, index) {
if (indexPatternNames.find((i) => i === name)) {
return (
<FormattedMessage
id="xpack.dataVisualizer.file.importView.indexPatternNameAlreadyExistsErrorMessage"
defaultMessage="Index pattern name already exists"
id="xpack.dataVisualizer.file.importView.dataViewNameAlreadyExistsErrorMessage"
defaultMessage="Data view name already exists"
/>
);
}
Expand All @@ -720,8 +720,8 @@ function isIndexPatternNameValid(name, indexPatternNames, index) {
// name should match index
return (
<FormattedMessage
id="xpack.dataVisualizer.file.importView.indexPatternDoesNotMatchIndexNameErrorMessage"
defaultMessage="Index pattern does not match index name"
id="xpack.dataVisualizer.file.importView.indexPatternDoesNotMatchDataViewErrorMessage"
defaultMessage="Data view does not match index name"
/>
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ interface Props {
}

// Component for rendering a button which automatically sets the range of the time filter
// to the time range of data in the index(es) mapped to the supplied Kibana index pattern or query.
// to the time range of data in the index(es) mapped to the supplied Kibana data view or query.
export const FullTimeRangeSelector: FC<Props> = ({
timefilter,
indexPattern,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ export const IndexDataVisualizerView: FC<IndexDataVisualizerViewProps> = (dataVi

useEffect(() => {
return () => {
// When navigating away from the index pattern
// When navigating away from the data view
// Reset all previously set filters
// to make sure new page doesn't have unrelated filters
data.query.filterManager.removeAll();
Expand Down Expand Up @@ -206,10 +206,10 @@ export const IndexDataVisualizerView: FC<IndexDataVisualizerViewProps> = (dataVi
if (!currentIndexPattern.isTimeBased()) {
toasts.addWarning({
title: i18n.translate(
'xpack.dataVisualizer.index.indexPatternNotBasedOnTimeSeriesNotificationTitle',
'xpack.dataVisualizer.index.dataViewNotBasedOnTimeSeriesNotificationTitle',
{
defaultMessage: 'The index pattern {indexPatternTitle} is not based on a time series',
values: { indexPatternTitle: currentIndexPattern.title },
defaultMessage: 'The data view {dataViewTitle} is not based on a time series',
values: { dataViewTitle: currentIndexPattern.title },
}
),
text: i18n.translate(
Expand All @@ -225,7 +225,7 @@ export const IndexDataVisualizerView: FC<IndexDataVisualizerViewProps> = (dataVi
const indexPatternFields: IndexPatternField[] = currentIndexPattern.fields;

const fieldTypes = useMemo(() => {
// Obtain the list of non metric field types which appear in the index pattern.
// Obtain the list of non metric field types which appear in the data view.
const indexedFieldTypes: JobFieldType[] = [];
indexPatternFields.forEach((field) => {
if (!OMIT_FIELDS.includes(field.name) && field.scripted !== true) {
Expand Down Expand Up @@ -275,7 +275,7 @@ export const IndexDataVisualizerView: FC<IndexDataVisualizerViewProps> = (dataVi
filters: Filter[];
}) => {
// When the user loads saved search and then clear or modify the query
// we should remove the saved search and replace it with the index pattern id
// we should remove the saved search and replace it with the data view id
if (currentSavedSearch !== null) {
setCurrentSavedSearch(null);
}
Expand Down Expand Up @@ -689,7 +689,7 @@ export const IndexDataVisualizerView: FC<IndexDataVisualizerViewProps> = (dataVi
});
// Obtain the list of all non-metric fields which appear in documents
// (aggregatable or not aggregatable).
const populatedNonMetricFields: any[] = []; // Kibana index pattern non metric fields.
const populatedNonMetricFields: any[] = []; // Kibana data view non metric fields.
let nonMetricFieldData: any[] = []; // Basic non metric field data loaded from requesting overall stats.
const aggregatableExistsFields: any[] = overallStats.aggregatableExistsFields || [];
const nonAggregatableExistsFields: any[] = overallStats.nonAggregatableExistsFields || [];
Expand Down Expand Up @@ -743,7 +743,7 @@ export const IndexDataVisualizerView: FC<IndexDataVisualizerViewProps> = (dataVi
deletable: field.runtimeField !== undefined,
};

// Map the field type from the Kibana index pattern to the field type
// Map the field type from the Kibana data view to the field type
// used in the data visualizer.
const dataVisualizerType = kbnTypeToJobType(field);
if (dataVisualizerType !== undefined) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import { dataVisualizerRefresh$, Refresh } from '../../services/timefilter_refre

export interface DataVisualizerIndexPatternManagementProps {
/**
* Currently selected index pattern
* Currently selected data view
*/
currentIndexPattern?: IndexPattern;
/**
Expand Down Expand Up @@ -79,9 +79,9 @@ export function DataVisualizerIndexPatternManagement(
iconType="boxesHorizontal"
data-test-subj="dataVisualizerIndexPatternManagementButton"
aria-label={i18n.translate(
'xpack.dataVisualizer.index.indexPatternManagement.actionsPopoverLabel',
'xpack.dataVisualizer.index.dataViewManagement.actionsPopoverLabel',
{
defaultMessage: 'Index pattern settings',
defaultMessage: 'Data view settings',
}
)}
onClick={() => {
Expand All @@ -103,8 +103,8 @@ export function DataVisualizerIndexPatternManagement(
addField();
}}
>
{i18n.translate('xpack.dataVisualizer.index.indexPatternManagement.addFieldButton', {
defaultMessage: 'Add field to index pattern',
{i18n.translate('xpack.dataVisualizer.index.dataViewManagement.addFieldButton', {
defaultMessage: 'Add field to data view',
})}
</EuiContextMenuItem>,
<EuiContextMenuItem
Expand All @@ -118,8 +118,8 @@ export function DataVisualizerIndexPatternManagement(
});
}}
>
{i18n.translate('xpack.dataVisualizer.index.indexPatternManagement.manageFieldButton', {
defaultMessage: 'Manage index pattern fields',
{i18n.translate('xpack.dataVisualizer.index.dataViewManagement.manageFieldButton', {
defaultMessage: 'Manage data view fields',
})}
</EuiContextMenuItem>,
]}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,8 @@ export const DataVisualizerUrlStateContextProvider: FC<DataVisualizerUrlStateCon
setCurrentIndexPattern(indexPattern);
} catch (e) {
toasts.addError(e, {
title: i18n.translate('xpack.dataVisualizer.index.indexPatternErrorMessage', {
defaultMessage: 'Error finding index pattern',
title: i18n.translate('xpack.dataVisualizer.index.dataViewErrorMessage', {
defaultMessage: 'Error finding data view',
}),
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ describe('Index data visualizer locator', () => {
});
});

it('should prioritize savedSearchId even when index pattern id is available', async () => {
it('should prioritize savedSearchId even when data view id is available', async () => {
const location = await definition.getLocation({
indexPatternId: '3da93760-e0af-11ea-9ad3-3bcfc330e42a',
savedSearchId: '45014020-dffa-11eb-b120-a105fbbe93b3',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import { IndexPattern } from '../../../../../../../src/plugins/data/common';
import { fieldFormatsMock } from '../../../../../../../src/plugins/field_formats/common/mocks';
import { uiSettingsServiceMock } from 'src/core/public/mocks';

// helper function to create index patterns
// helper function to create data views
function createMockDataView(id: string) {
const {
type,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export const checkAggregatableFieldsExist = async (
// filter aggregation with exists query.
const aggs: Aggs = datafeedAggregations !== undefined ? { ...datafeedAggregations } : {};

// Combine runtime fields from the index pattern as well as the datafeed
// Combine runtime fields from the data view as well as the datafeed
const combinedRuntimeMappings: estypes.MappingRuntimeFields = {
...(isPopulatedObject(runtimeMappings) ? runtimeMappings : {}),
...(isPopulatedObject(datafeedConfig) && isPopulatedObject(datafeedConfig.runtime_mappings)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export class DataVisualizer {
this._client = client;
}

// Obtains overall stats on the fields in the supplied index pattern, returning an object
// Obtains overall stats on the fields in the supplied data view, returning an object
// containing the total document count, and four arrays showing which of the supplied
// aggregatable and non-aggregatable fields do or do not exist in documents.
// Sampling will be used if supplied samplerShardSize > 0.
Expand Down
Loading