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

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

Merged
merged 1 commit into from
Sep 18, 2020
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 @@ -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