Skip to content
This repository has been archived by the owner on Nov 3, 2023. It is now read-only.

Commit

Permalink
chore: Adds a tooltip to pre-filter in native filters modal (apache#2…
Browse files Browse the repository at this point in the history
…3481)

(cherry picked from commit 63751c6)
  • Loading branch information
michael-s-molina committed Apr 7, 2023
1 parent 9c87e44 commit e0bbfee
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -628,7 +628,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);
Expand All @@ -637,10 +638,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');
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -913,6 +913,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) {
Expand Down

0 comments on commit e0bbfee

Please sign in to comment.