[Lens] change name of custom query to filters (#77725)

This commit is contained in:
Marta Bondyra 2020-09-18 08:43:12 +02:00 committed by GitHub
parent 6122610374
commit eb825db09e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 12 additions and 12 deletions

View file

@ -69,7 +69,7 @@ export function BucketNestingEditor({
values: { field: fieldName },
}),
filters: i18n.translate('xpack.lens.indexPattern.groupingOverallFilters', {
defaultMessage: 'Top values for each custom query',
defaultMessage: 'Top values for each filter',
}),
date_histogram: i18n.translate('xpack.lens.indexPattern.groupingOverallDateHistogram', {
defaultMessage: 'Top values for each {field}',

View file

@ -54,7 +54,7 @@ describe('filters', () => {
columnOrder: ['col1', 'col2'],
columns: {
col1: {
label: 'Custom query',
label: 'filters',
dataType: 'document',
operationType: 'filters',
scale: 'ordinal',
@ -209,7 +209,7 @@ describe('filters', () => {
});
});
describe('Modify custom query', () => {
describe('Modify filters', () => {
it('should correctly show existing filters ', () => {
const setStateSpy = jest.fn();
const instance = mount(
@ -236,7 +236,7 @@ describe('filters', () => {
).toEqual('src : 2');
});
it('should remove custom query', () => {
it('should remove filter', () => {
const setStateSpy = jest.fn();
const instance = mount(
<InlineOptions

View file

@ -31,8 +31,8 @@ export interface FilterValue {
label: string;
}
const customQueryLabel = i18n.translate('xpack.lens.indexPattern.customQuery', {
defaultMessage: 'Custom query',
const filtersLabel = i18n.translate('xpack.lens.indexPattern.filters', {
defaultMessage: 'Filters',
});
export const defaultLabel = i18n.translate('xpack.lens.indexPattern.filters.label.placeholder', {
@ -70,7 +70,7 @@ export interface FiltersIndexPatternColumn extends FieldBasedIndexPatternColumn
export const filtersOperation: OperationDefinition<FiltersIndexPatternColumn> = {
type: 'filters',
displayName: customQueryLabel,
displayName: filtersLabel,
priority: 3, // Higher than any metric
getPossibleOperationForField: ({ type }) => {
if (type === 'document') {
@ -102,7 +102,7 @@ export const filtersOperation: OperationDefinition<FiltersIndexPatternColumn> =
}
return {
label: customQueryLabel,
label: filtersLabel,
dataType: 'string',
operationType: 'filters',
scale: 'ordinal',
@ -223,8 +223,8 @@ export const FilterList = ({
defaultMessage: 'This query is invalid',
})}
onRemoveClick={() => onRemoveFilter(filter.id)}
removeTitle={i18n.translate('xpack.lens.indexPattern.filters.removeCustomQuery', {
defaultMessage: 'Remove custom query',
removeTitle={i18n.translate('xpack.lens.indexPattern.filters.removeFilter', {
defaultMessage: 'Remove a filter',
})}
>
<FilterPopover
@ -259,8 +259,8 @@ export const FilterList = ({
onAddFilter();
setIsOpenByCreation(true);
}}
label={i18n.translate('xpack.lens.indexPattern.filters.addCustomQuery', {
defaultMessage: 'Add a custom query',
label={i18n.translate('xpack.lens.indexPattern.filters.addaFilter', {
defaultMessage: 'Add a filter',
})}
/>
</>