Skip to content

Commit 6205beb

Browse files
committed
hide groupBy filter in RHP + hide groupCurrency if groupBy is not from/card
1 parent 8137436 commit 6205beb

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

src/pages/Search/AdvancedSearchFilters.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -632,7 +632,8 @@ function AdvancedSearchFilters() {
632632
const shouldDisplayCardFilter = shouldDisplayFilter(Object.keys(allCards).length, areCardsEnabled);
633633
const shouldDisplayTaxFilter = shouldDisplayFilter(Object.keys(taxRates).length, areTaxEnabled);
634634
const shouldDisplayWorkspaceFilter = workspaces.some((section) => section.data.length !== 0);
635-
const shouldDisplayGroupCurrencyFilter = !!groupBy;
635+
const shouldDisplayGroupByFilter = !!groupBy;
636+
const shouldDisplayGroupCurrencyFilter = groupBy === CONST.SEARCH.GROUP_BY.FROM || groupBy === CONST.SEARCH.GROUP_BY.CARD;
636637

637638
let currentType = searchAdvancedFilters?.type ?? CONST.SEARCH.DATA_TYPES.EXPENSE;
638639
if (!Object.keys(typeFiltersKeys).includes(currentType)) {
@@ -733,6 +734,9 @@ function AdvancedSearchFilters() {
733734
} else if (key === CONST.SEARCH.SYNTAX_FILTER_KEYS.STATUS) {
734735
filterTitle = baseFilterConfig[key].getTitle(searchAdvancedFilters, currentType, groupBy, translate);
735736
} else if (key === CONST.SEARCH.SYNTAX_ROOT_KEYS.GROUP_BY) {
737+
if (!shouldDisplayGroupByFilter) {
738+
return;
739+
}
736740
filterTitle = baseFilterConfig[key].getTitle(searchAdvancedFilters, key, translate, localeCompare);
737741
} else if (key === CONST.SEARCH.SYNTAX_FILTER_KEYS.GROUP_CURRENCY) {
738742
if (!shouldDisplayGroupCurrencyFilter) {

0 commit comments

Comments
 (0)