chore: Adds a tooltip to pre-filter in native filters modal (#23481)

This commit is contained in:
Michael S. Molina
2023-03-30 10:30:32 -03:00
committed by GitHub
parent 41ad9442c0
commit 63751c6c0f
3 changed files with 12 additions and 5 deletions

View File

@@ -631,7 +631,8 @@ describe('Native filters', () => {
it('Verify setting options and tooltips for value filter', () => {
enterNativeFilterEditModal(false);
cy.contains('Filter value is required').should('be.visible').click();
checkNativeFilterTooltip(0, nativeFilterTooltips.defaultValue);
checkNativeFilterTooltip(0, nativeFilterTooltips.preFilter);
checkNativeFilterTooltip(1, nativeFilterTooltips.defaultValue);
cy.get(nativeFilters.modal.container).should('be.visible');
valueNativeFilterOptions.forEach(el => {
cy.contains(el);
@@ -640,10 +641,10 @@ describe('Native filters', () => {
cy.get(
nativeFilters.filterConfigurationSections.checkedCheckbox,
).contains('Can select multiple values');
checkNativeFilterTooltip(1, nativeFilterTooltips.required);
checkNativeFilterTooltip(2, nativeFilterTooltips.defaultToFirstItem);
checkNativeFilterTooltip(3, nativeFilterTooltips.searchAllFilterOptions);
checkNativeFilterTooltip(4, nativeFilterTooltips.inverseSelection);
checkNativeFilterTooltip(2, nativeFilterTooltips.required);
checkNativeFilterTooltip(3, nativeFilterTooltips.defaultToFirstItem);
checkNativeFilterTooltip(4, nativeFilterTooltips.searchAllFilterOptions);
checkNativeFilterTooltip(5, nativeFilterTooltips.inverseSelection);
clickOnAddFilterInModal();
cy.contains('Values are dependent on other filters').should('exist');
});

View File

@@ -85,6 +85,7 @@ export const nativeFilterTooltips = {
multipleSelect: 'Allow selecting multiple values',
defaultValue:
'Default value must be set when "Filter value is required" is checked',
preFilter: `Add filter clauses to control the filter's source query, though only in the context of the autocomplete i.e., these conditions do not impact how the filter is applied to the dashboard. This is useful when you want to improve the query's performance by only scanning a subset of the underlying data or limit the available values displayed in the filter.`,
};
export const nativeFilterOptions = [

View File

@@ -956,6 +956,11 @@ const FiltersConfigForm = (
<CollapsibleControl
initialValue={hasPreFilter}
title={t('Pre-filter available values')}
tooltip={t(`Add filter clauses to control the filter's source query,
though only in the context of the autocomplete i.e., these conditions
do not impact how the filter is applied to the dashboard. This is useful
when you want to improve the query's performance by only scanning a subset
of the underlying data or limit the available values displayed in the filter.`)}
onChange={checked => {
formChanged();
if (checked) {