Skip to content

Commit

Permalink
Revert "[Lens] Rename Index pattern to Data view (#110252)" (#114277)
Browse files Browse the repository at this point in the history
This reverts commit 93522e5.
  • Loading branch information
DianaDerevyankina authored Oct 7, 2021
1 parent 87e6fb4 commit f945ccf
Show file tree
Hide file tree
Showing 17 changed files with 75 additions and 38 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ export function AddLayerButton({
})}
content={i18n.translate('xpack.lens.xyChart.addLayerTooltip', {
defaultMessage:
'Use multiple layers to combine visualization types or visualize different data views.',
'Use multiple layers to combine visualization types or visualize different index patterns.',
})}
position="bottom"
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,9 +151,9 @@ export const InnerWorkspacePanel = React.memo(function InnerWorkspacePanel({
? [
{
shortMessage: '',
longMessage: i18n.translate('xpack.lens.indexPattern.missingDataView', {
longMessage: i18n.translate('xpack.lens.indexPattern.missingIndexPattern', {
defaultMessage:
'The {count, plural, one {data view} other {data views}} ({count, plural, one {id} other {ids}}: {indexpatterns}) cannot be found',
'The {count, plural, one {index pattern} other {index patterns}} ({count, plural, one {id} other {ids}}: {indexpatterns}) cannot be found',
values: {
count: missingIndexPatterns.length,
indexpatterns: missingIndexPatterns.join(', '),
Expand Down Expand Up @@ -569,8 +569,8 @@ export const VisualizationWrapper = ({
})}
data-test-subj="configuration-failure-reconfigure-indexpatterns"
>
{i18n.translate('xpack.lens.editorFrame.dataViewReconfigure', {
defaultMessage: `Recreate it in the data view management page`,
{i18n.translate('xpack.lens.editorFrame.indexPatternReconfigure', {
defaultMessage: `Recreate it in the index pattern management page`,
})}
</a>
</RedirectAppLinks>
Expand All @@ -580,8 +580,8 @@ export const VisualizationWrapper = ({
<>
<p className="eui-textBreakWord" data-test-subj="missing-refs-failure">
<FormattedMessage
id="xpack.lens.editorFrame.dataViewNotFound"
defaultMessage="Data view not found"
id="xpack.lens.editorFrame.indexPatternNotFound"
defaultMessage="Index pattern not found"
/>
</p>
<p className="eui-textBreakWord lnsSelectableErrorMessage">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,8 +160,9 @@ export function getMissingCurrentDatasource() {
}

export function getMissingIndexPatterns(indexPatternIds: string[]) {
return i18n.translate('xpack.lens.editorFrame.expressionMissingDataView', {
defaultMessage: 'Could not find the {count, plural, one {data view} other {data views}}: {ids}',
return i18n.translate('xpack.lens.editorFrame.expressionMissingIndexPattern', {
defaultMessage:
'Could not find the {count, plural, one {index pattern} other {index pattern}}: {ids}',
values: { count: indexPatternIds.length, ids: indexPatternIds.join(', ') },
});
}
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ export function ChangeIndexPattern({
>
<div>
<EuiPopoverTitle>
{i18n.translate('xpack.lens.indexPattern.changeDataViewTitle', {
defaultMessage: 'Data view',
{i18n.translate('xpack.lens.indexPattern.changeIndexPatternTitle', {
defaultMessage: 'Index pattern',
})}
</EuiPopoverTitle>
<EuiSelectable<{
Expand Down
18 changes: 9 additions & 9 deletions x-pack/plugins/lens/public/indexpattern_datasource/datapanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -208,16 +208,16 @@ export function IndexPatternDataPanel({
<EuiFlexItem grow={null}>
<EuiCallOut
data-test-subj="indexPattern-no-indexpatterns"
title={i18n.translate('xpack.lens.indexPattern.noDataViewsLabel', {
defaultMessage: 'No data views',
title={i18n.translate('xpack.lens.indexPattern.noPatternsLabel', {
defaultMessage: 'No index patterns',
})}
color="warning"
iconType="alert"
>
<p>
<FormattedMessage
id="xpack.lens.indexPattern.noDataViewDescription"
defaultMessage="Please create a data view or switch to another data source"
id="xpack.lens.indexPattern.noPatternsDescription"
defaultMessage="Please create an index pattern or switch to another data source"
/>
</p>
</EuiCallOut>
Expand Down Expand Up @@ -642,7 +642,7 @@ export const InnerIndexPatternDataPanel = function InnerIndexPatternDataPanel({
iconType="boxesHorizontal"
data-test-subj="lnsIndexPatternActions"
aria-label={i18n.translate('xpack.lens.indexPatterns.actionsPopoverLabel', {
defaultMessage: 'Data view settings',
defaultMessage: 'Index pattern settings',
})}
onClick={() => {
setPopoverOpen(!popoverOpen);
Expand All @@ -663,7 +663,7 @@ export const InnerIndexPatternDataPanel = function InnerIndexPatternDataPanel({
}}
>
{i18n.translate('xpack.lens.indexPatterns.addFieldButton', {
defaultMessage: 'Add field to data view',
defaultMessage: 'Add field to index pattern',
})}
</EuiContextMenuItem>,
<EuiContextMenuItem
Expand All @@ -677,7 +677,7 @@ export const InnerIndexPatternDataPanel = function InnerIndexPatternDataPanel({
}}
>
{i18n.translate('xpack.lens.indexPatterns.manageFieldButton', {
defaultMessage: 'Manage data view fields',
defaultMessage: 'Manage index pattern fields',
})}
</EuiContextMenuItem>,
]}
Expand Down Expand Up @@ -709,15 +709,15 @@ export const InnerIndexPatternDataPanel = function InnerIndexPatternDataPanel({
data-test-subj="lnsIndexPatternFieldSearch"
placeholder={i18n.translate('xpack.lens.indexPatterns.filterByNameLabel', {
defaultMessage: 'Search field names',
description: 'Search the list of fields in the data view for the provided text',
description: 'Search the list of fields in the index pattern for the provided text',
})}
value={localState.nameFilter}
onChange={(e) => {
setLocalState({ ...localState, nameFilter: e.target.value });
}}
aria-label={i18n.translate('xpack.lens.indexPatterns.filterByNameLabel', {
defaultMessage: 'Search field names',
description: 'Search the list of fields in the data view for the provided text',
description: 'Search the list of fields in the index pattern for the provided text',
})}
aria-describedby={fieldSearchDescriptionId}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ export function getErrorMessage(
}
if (fieldInvalid) {
return i18n.translate('xpack.lens.indexPattern.invalidFieldLabel', {
defaultMessage: 'Invalid field. Check your data view or pick another field.',
defaultMessage: 'Invalid field. Check your index pattern or pick another field.',
});
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -348,15 +348,15 @@ function FieldPanelHeader({
<EuiFlexItem grow={false}>
<EuiToolTip
content={i18n.translate('xpack.lens.indexPattern.editFieldLabel', {
defaultMessage: 'Edit data view field',
defaultMessage: 'Edit index pattern field',
})}
>
<EuiButtonIcon
onClick={() => editField(field.name)}
iconType="pencil"
data-test-subj="lnsFieldListPanelEdit"
aria-label={i18n.translate('xpack.lens.indexPattern.editFieldLabel', {
defaultMessage: 'Edit data view field',
defaultMessage: 'Edit index pattern field',
})}
/>
</EuiToolTip>
Expand All @@ -366,7 +366,7 @@ function FieldPanelHeader({
<EuiFlexItem grow={false}>
<EuiToolTip
content={i18n.translate('xpack.lens.indexPattern.removeFieldLabel', {
defaultMessage: 'Remove data view field',
defaultMessage: 'Remove index pattern field',
})}
>
<EuiButtonIcon
Expand All @@ -375,7 +375,7 @@ function FieldPanelHeader({
data-test-subj="lnsFieldListPanelRemove"
color="danger"
aria-label={i18n.translate('xpack.lens.indexPattern.removeFieldLabel', {
defaultMessage: 'Remove data view field',
defaultMessage: 'Remove index pattern field',
})}
/>
</EuiToolTip>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,8 @@ export function getIndexPatternDatasource({
const uiSettings = core.uiSettings;
const onIndexPatternLoadError = (err: Error) =>
core.notifications.toasts.addError(err, {
title: i18n.translate('xpack.lens.indexPattern.dataViewLoadError', {
defaultMessage: 'Error loading data view',
title: i18n.translate('xpack.lens.indexPattern.indexPatternLoadError', {
defaultMessage: 'Error loading index pattern',
}),
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ export function LayerPanel({ state, layerId, onChangeIndexPattern }: IndexPatter

const indexPattern = state.indexPatterns[layer.indexPatternId];

const notFoundTitleLabel = i18n.translate('xpack.lens.layerPanel.missingDataView', {
defaultMessage: 'Data view not found',
const notFoundTitleLabel = i18n.translate('xpack.lens.layerPanel.missingIndexPattern', {
defaultMessage: 'Index pattern not found',
});

return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ describe('NoFieldCallout', () => {
<EuiCallOut
color="warning"
size="s"
title="No fields exist in this data view."
title="No fields exist in this index pattern."
/>
`);
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export const NoFieldsCallout = ({
size="s"
color="warning"
title={i18n.translate('xpack.lens.indexPatterns.noFieldsLabel', {
defaultMessage: 'No fields exist in this data view.',
defaultMessage: 'No fields exist in this index pattern.',
})}
/>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,7 @@ describe('last_value', () => {
'data'
);
expect(disabledStatus).toEqual(
'This function requires the presence of a date field in your data view'
'This function requires the presence of a date field in your index'
);
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ export const lastValueOperation: OperationDefinition<LastValueIndexPatternColumn
const hasDateFields = indexPattern && getDateFields(indexPattern).length;
if (!hasDateFields) {
return i18n.translate('xpack.lens.indexPattern.lastValue.disabled', {
defaultMessage: 'This function requires the presence of a date field in your data view',
defaultMessage: 'This function requires the presence of a date field in your index',
});
}
},
Expand Down Expand Up @@ -162,7 +162,7 @@ export const lastValueOperation: OperationDefinition<LastValueIndexPatternColumn
if (!sortField) {
throw new Error(
i18n.translate('xpack.lens.functions.lastValue.missingSortField', {
defaultMessage: 'This data view does not contain any date fields',
defaultMessage: 'This index pattern does not contain any date fields',
})
);
}
Expand Down Expand Up @@ -225,7 +225,7 @@ export const lastValueOperation: OperationDefinition<LastValueIndexPatternColumn
display="columnCompressed"
fullWidth
error={i18n.translate('xpack.lens.indexPattern.sortField.invalid', {
defaultMessage: 'Invalid field. Check your data view or pick another field.',
defaultMessage: 'Invalid field. Check your index pattern or pick another field.',
})}
isInvalid={isSortFieldInvalid}
>
Expand Down Expand Up @@ -284,7 +284,7 @@ export const lastValueOperation: OperationDefinition<LastValueIndexPatternColumn
}),
description: i18n.translate('xpack.lens.indexPattern.lastValue.documentation.markdown', {
defaultMessage: `
Returns the value of a field from the last document, ordered by the default time field of the data view.
Returns the value of a field from the last document, ordered by the default time field of the index pattern.
This function is usefull the retrieve the latest state of an entity.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,9 @@ export function insertNewColumn({

const possibleOperation = operationDefinition.getPossibleOperation(indexPattern);
if (!possibleOperation) {
throw new Error(`Can't create operation ${op} because it's incompatible with the data view`);
throw new Error(
`Can't create operation ${op} because it's incompatible with the index pattern`
);
}
const isBucketed = Boolean(possibleOperation.isBucketed);

Expand Down
2 changes: 1 addition & 1 deletion x-pack/plugins/lens/server/routes/field_stats.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export async function initFieldsRoute(setup: CoreSetup<PluginStartContract>) {
const field = indexPattern.fields.find((f) => f.name === fieldName);

if (!field) {
throw new Error(`Field {fieldName} not found in data view ${indexPattern.title}`);
throw new Error(`Field {fieldName} not found in index pattern ${indexPattern.title}`);
}

const filter = timeFieldName
Expand Down
Loading

0 comments on commit f945ccf

Please sign in to comment.