Skip to content

Commit

Permalink
[Lens] change name of custom query to filters (#77725) (#77845)
Browse files Browse the repository at this point in the history
  • Loading branch information
mbondyra authored Sep 18, 2020
1 parent 3a65925 commit 668316b
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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}',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ describe('filters', () => {
columnOrder: ['col1', 'col2'],
columns: {
col1: {
label: 'Custom query',
label: 'filters',
dataType: 'document',
operationType: 'filters',
scale: 'ordinal',
Expand Down Expand Up @@ -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(
Expand All @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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', {
Expand Down Expand Up @@ -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') {
Expand Down Expand Up @@ -102,7 +102,7 @@ export const filtersOperation: OperationDefinition<FiltersIndexPatternColumn> =
}

return {
label: customQueryLabel,
label: filtersLabel,
dataType: 'string',
operationType: 'filters',
scale: 'ordinal',
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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',
})}
/>
</>
Expand Down

0 comments on commit 668316b

Please sign in to comment.