Skip to content

Commit 270d87b

Browse files
authored
Merge pull request Expensify#63706 from parasharrajat/parasharrajat/multi-workspace
Support for Multi workspace filter in search
2 parents 35a977f + 4b4db0f commit 270d87b

15 files changed

Lines changed: 211 additions & 82 deletions

src/components/Search/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ type SearchQueryAST = {
143143
sortOrder: SortOrder;
144144
groupBy?: SearchGroupBy;
145145
filters: ASTNode;
146-
policyID?: string;
146+
policyID?: string[];
147147
};
148148

149149
type SearchQueryJSON = {

src/components/SelectionList/UserListItem.tsx

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ function UserListItem<TItem extends ListItem>({
4141
shouldSyncFocus,
4242
wrapperStyle,
4343
pressableStyle,
44+
shouldUseDefaultRightHandSideCheckmark,
4445
}: UserListItemProps<TItem>) {
4546
const styles = useThemeStyles();
4647
const theme = useTheme();
@@ -87,7 +88,7 @@ function UserListItem<TItem extends ListItem>({
8788
>
8889
{(hovered?: boolean) => (
8990
<>
90-
{!!canSelectMultiple && (
91+
{!shouldUseDefaultRightHandSideCheckmark && !!canSelectMultiple && (
9192
<PressableWithFeedback
9293
accessibilityLabel={item.text ?? ''}
9394
role={CONST.ROLE.BUTTON}
@@ -156,6 +157,27 @@ function UserListItem<TItem extends ListItem>({
156157
/>
157158
</View>
158159
)}
160+
{!!shouldUseDefaultRightHandSideCheckmark && !!canSelectMultiple && (
161+
<PressableWithFeedback
162+
accessibilityLabel={item.text ?? ''}
163+
role={CONST.ROLE.BUTTON}
164+
// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
165+
disabled={isDisabled || item.isDisabledCheckbox}
166+
onPress={handleCheckboxPress}
167+
style={[styles.cursorUnset, StyleUtils.getCheckboxPressableStyle(), item.isDisabledCheckbox && styles.cursorDisabled, styles.ml3]}
168+
>
169+
<View style={[StyleUtils.getCheckboxContainerStyle(20), StyleUtils.getMultiselectListStyles(!!item.isSelected, !!item.isDisabled)]}>
170+
{!!item.isSelected && (
171+
<Icon
172+
src={Expensicons.Checkmark}
173+
fill={theme.textLight}
174+
height={14}
175+
width={14}
176+
/>
177+
)}
178+
</View>
179+
</PressableWithFeedback>
180+
)}
159181
</>
160182
)}
161183
</BaseListItem>

src/hooks/useWorkspaceList.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,12 @@ type UseWorkspaceListParams = {
2121
policies: OnyxCollection<Policy>;
2222
currentUserLogin: string | undefined;
2323
shouldShowPendingDeletePolicy: boolean;
24-
selectedPolicyID: string | undefined;
24+
selectedPolicyIDs: string[] | undefined;
2525
searchTerm: string;
2626
additionalFilter?: (policy: OnyxEntry<Policy>) => boolean;
2727
};
2828

29-
function useWorkspaceList({policies, currentUserLogin, selectedPolicyID, searchTerm, shouldShowPendingDeletePolicy, additionalFilter}: UseWorkspaceListParams) {
29+
function useWorkspaceList({policies, currentUserLogin, selectedPolicyIDs, searchTerm, shouldShowPendingDeletePolicy, additionalFilter}: UseWorkspaceListParams) {
3030
const usersWorkspaces = useMemo(() => {
3131
if (!policies || isEmptyObject(policies)) {
3232
return [];
@@ -54,16 +54,16 @@ function useWorkspaceList({policies, currentUserLogin, selectedPolicyID, searchT
5454
],
5555
keyForList: policy?.id,
5656
isPolicyAdmin: isPolicyAdmin(policy),
57-
isSelected: selectedPolicyID === policy?.id,
57+
isSelected: policy?.id && selectedPolicyIDs ? selectedPolicyIDs.includes(policy.id) : false,
5858
}));
59-
}, [policies, shouldShowPendingDeletePolicy, currentUserLogin, additionalFilter, selectedPolicyID]);
59+
}, [policies, shouldShowPendingDeletePolicy, currentUserLogin, additionalFilter, selectedPolicyIDs]);
6060

6161
const filteredAndSortedUserWorkspaces = useMemo<WorkspaceListItem[]>(
6262
() =>
6363
tokenizedSearch(usersWorkspaces, searchTerm, (policy) => [policy.text]).sort((policy1, policy2) =>
64-
sortWorkspacesBySelected({policyID: policy1.policyID, name: policy1.text}, {policyID: policy2.policyID, name: policy2.text}, selectedPolicyID),
64+
sortWorkspacesBySelected({policyID: policy1.policyID, name: policy1.text}, {policyID: policy2.policyID, name: policy2.text}, selectedPolicyIDs),
6565
),
66-
[searchTerm, usersWorkspaces, selectedPolicyID],
66+
[searchTerm, usersWorkspaces, selectedPolicyIDs],
6767
);
6868

6969
const sections = useMemo(() => {

src/libs/PolicyUtils.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1144,11 +1144,11 @@ function getSageIntacctCreditCards(policy?: Policy, selectedAccount?: string): S
11441144
* @param workspace2 Details of the second workspace to be compared.
11451145
* @param selectedWorkspaceID ID of the selected workspace which needs to be at the beginning.
11461146
*/
1147-
const sortWorkspacesBySelected = (workspace1: WorkspaceDetails, workspace2: WorkspaceDetails, selectedWorkspaceID: string | undefined): number => {
1148-
if (workspace1.policyID === selectedWorkspaceID) {
1147+
const sortWorkspacesBySelected = (workspace1: WorkspaceDetails, workspace2: WorkspaceDetails, selectedWorkspaceIDs: string[] | undefined): number => {
1148+
if (workspace1.policyID && selectedWorkspaceIDs?.includes(workspace1?.policyID)) {
11491149
return -1;
11501150
}
1151-
if (workspace2.policyID === selectedWorkspaceID) {
1151+
if (workspace2.policyID && selectedWorkspaceIDs?.includes(workspace2.policyID)) {
11521152
return 1;
11531153
}
11541154
return workspace1.name?.toLowerCase().localeCompare(workspace2.name?.toLowerCase() ?? '') ?? 0;

src/libs/SearchQueryUtils.ts

Lines changed: 31 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import type {
1515
} from '@components/Search/types';
1616
import CONST from '@src/CONST';
1717
import NAVIGATORS from '@src/NAVIGATORS';
18+
import type {OnyxCollectionKey, OnyxCollectionValuesMapping} from '@src/ONYXKEYS';
1819
import ONYXKEYS from '@src/ONYXKEYS';
1920
import SCREENS from '@src/SCREENS';
2021
import type {SearchAdvancedFiltersForm} from '@src/types/form';
@@ -295,7 +296,7 @@ function getQueryHashes(query: SearchQueryJSON): {primaryHash: number; recentSea
295296
orderedQuery += ` ${CONST.SEARCH.SYNTAX_ROOT_KEYS.SORT_BY}:${query.sortBy}`;
296297
orderedQuery += ` ${CONST.SEARCH.SYNTAX_ROOT_KEYS.SORT_ORDER}:${query.sortOrder}`;
297298
if (query.policyID) {
298-
orderedQuery += ` ${CONST.SEARCH.SYNTAX_FILTER_KEYS.POLICY_ID}:${query.policyID} `;
299+
orderedQuery += ` ${CONST.SEARCH.SYNTAX_FILTER_KEYS.POLICY_ID}:${Array.isArray(query.policyID) ? query.policyID.join(',') : query.policyID} `;
299300
}
300301
const primaryHash = hashText(orderedQuery, 2 ** 32);
301302

@@ -334,6 +335,11 @@ function buildSearchQueryJSON(query: SearchQueryString) {
334335
result.hash = primaryHash;
335336
result.recentSearchHash = recentSearchHash;
336337

338+
if (result.policyID && typeof result.policyID === 'string') {
339+
// Ensure policyID is always an array for consistency
340+
result.policyID = [result.policyID];
341+
}
342+
337343
return result;
338344
} catch (e) {
339345
console.error(`Error when parsing SearchQuery: "${query}"`, e);
@@ -364,7 +370,7 @@ function buildSearchQueryString(queryJSON?: SearchQueryJSON) {
364370
}
365371

366372
if (queryJSON?.policyID) {
367-
queryParts.push(`${CONST.SEARCH.SYNTAX_FILTER_KEYS.POLICY_ID}:${queryJSON.policyID}`);
373+
queryParts.push(`${CONST.SEARCH.SYNTAX_FILTER_KEYS.POLICY_ID}:${Array.isArray(queryJSON.policyID) ? queryJSON.policyID.join(',') : queryJSON.policyID}`);
368374
}
369375

370376
if (!queryJSON) {
@@ -431,8 +437,8 @@ function buildQueryStringFromFilterFormValues(filterValues: Partial<SearchAdvanc
431437
}
432438

433439
if (policyID) {
434-
const sanitizedPolicyID = sanitizeSearchValue(policyID);
435-
filtersString.push(`${CONST.SEARCH.SYNTAX_FILTER_KEYS.POLICY_ID}:${sanitizedPolicyID}`);
440+
const sanitizedPolicyIDs = Array.isArray(policyID) ? policyID.map((id) => sanitizeSearchValue(id)).join(',') : sanitizeSearchValue(policyID);
441+
filtersString.push(`${CONST.SEARCH.SYNTAX_FILTER_KEYS.POLICY_ID}:${sanitizedPolicyIDs}`);
436442
}
437443

438444
const mappedFilters = Object.entries(otherFilters)
@@ -481,6 +487,7 @@ function buildQueryStringFromFilterFormValues(filterValues: Partial<SearchAdvanc
481487
filterKey === FILTER_KEYS.FEED ||
482488
filterKey === FILTER_KEYS.IN ||
483489
filterKey === FILTER_KEYS.ASSIGNEE ||
490+
filterKey === FILTER_KEYS.POLICY_ID ||
484491
filterKey === FILTER_KEYS.EXPORTER) &&
485492
Array.isArray(filterValue) &&
486493
filterValue.length > 0
@@ -510,6 +517,18 @@ function buildQueryStringFromFilterFormValues(filterValues: Partial<SearchAdvanc
510517
return filtersString.filter(Boolean).join(' ').trim();
511518
}
512519

520+
function getAllPolicyValues<T extends OnyxCollectionKey>(
521+
policyID: string[] | undefined,
522+
key: T,
523+
policyData: OnyxCollection<OnyxCollectionValuesMapping[T]>,
524+
): Array<OnyxCollectionValuesMapping[T]> {
525+
if (!policyData || !policyID) {
526+
return [];
527+
}
528+
529+
return policyID.map((id) => policyData?.[`${key}${id}`]).filter((data) => !!data) as Array<OnyxCollectionValuesMapping[T]>;
530+
}
531+
513532
/**
514533
* Generates object with search filter values, in a format that can be consumed by SearchAdvancedFiltersForm.
515534
* Main usage of this is to generate the initial values for AdvancedFilters from existing query.
@@ -578,7 +597,9 @@ function buildFilterFormValuesFromQuery(
578597
}
579598
if (filterKey === CONST.SEARCH.SYNTAX_FILTER_KEYS.TAG) {
580599
const tags = policyID
581-
? getTagNamesFromTagsLists(policyTags?.[`${ONYXKEYS.COLLECTION.POLICY_TAGS}${policyID}`] ?? {})
600+
? getAllPolicyValues(policyID, ONYXKEYS.COLLECTION.POLICY_TAGS, policyTags)
601+
.map((tagList) => getTagNamesFromTagsLists(tagList ?? {}))
602+
.flat()
582603
: Object.values(policyTags ?? {})
583604
.filter((item) => !!item)
584605
.map((tagList) => getTagNamesFromTagsLists(tagList ?? {}))
@@ -589,7 +610,9 @@ function buildFilterFormValuesFromQuery(
589610
}
590611
if (filterKey === CONST.SEARCH.SYNTAX_FILTER_KEYS.CATEGORY) {
591612
const categories = policyID
592-
? Object.values(policyCategories?.[`${ONYXKEYS.COLLECTION.POLICY_CATEGORIES}${policyID}`] ?? {}).map((category) => category.name)
613+
? getAllPolicyValues(policyID, ONYXKEYS.COLLECTION.POLICY_CATEGORIES, policyCategories)
614+
.map((item) => Object.values(item ?? {}).map((category) => category.name))
615+
.flat()
593616
: Object.values(policyCategories ?? {})
594617
.map((item) => Object.values(item ?? {}).map((category) => category.name))
595618
.flat();
@@ -754,8 +777,7 @@ function buildUserReadableQueryString(
754777
}
755778

756779
if (policyID) {
757-
const workspace = policies?.[`${ONYXKEYS.COLLECTION.POLICY}${policyID}`]?.name ?? policyID;
758-
title += ` workspace:${sanitizeSearchValue(workspace)}`;
780+
title += ` workspace:${policyID.map((id) => sanitizeSearchValue(policies?.[`${ONYXKEYS.COLLECTION.POLICY}${id}`]?.name ?? id)).join(',')}`;
759781
}
760782

761783
for (const filterObject of filters) {
@@ -991,4 +1013,5 @@ export {
9911013
isDefaultExpensesQuery,
9921014
sortOptionsWithEmptyValue,
9931015
shouldHighlight,
1016+
getAllPolicyValues,
9941017
};

src/pages/ReportChangeWorkspacePage.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ function ReportChangeWorkspacePage({report, route}: ReportChangeWorkspacePagePro
6868
policies,
6969
currentUserLogin: session?.email,
7070
shouldShowPendingDeletePolicy: false,
71-
selectedPolicyID: report.policyID,
71+
selectedPolicyIDs: report.policyID ? [report.policyID] : undefined,
7272
searchTerm: debouncedSearchTerm,
7373
additionalFilter: (newPolicy) => isWorkspaceEligibleForReportChange(newPolicy, report, policies),
7474
});

src/pages/Search/AdvancedSearchFilters.tsx

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,15 @@ import Navigation from '@libs/Navigation/Navigation';
2828
import {createDisplayName} from '@libs/PersonalDetailsUtils';
2929
import {getAllTaxRates, getCleanedTagName, getTagNamesFromTagsLists, isPolicyFeatureEnabled} from '@libs/PolicyUtils';
3030
import {getReportName} from '@libs/ReportUtils';
31-
import {buildCannedSearchQuery, buildQueryStringFromFilterFormValues, buildSearchQueryJSON, isCannedSearchQuery, isSearchDatePreset, sortOptionsWithEmptyValue} from '@libs/SearchQueryUtils';
31+
import {
32+
buildCannedSearchQuery,
33+
buildQueryStringFromFilterFormValues,
34+
buildSearchQueryJSON,
35+
getAllPolicyValues,
36+
isCannedSearchQuery,
37+
isSearchDatePreset,
38+
sortOptionsWithEmptyValue,
39+
} from '@libs/SearchQueryUtils';
3240
import {getExpenseTypeTranslationKey, getStatusOptions} from '@libs/SearchUIUtils';
3341
import CONST from '@src/CONST';
3442
import type {TranslationPaths} from '@src/languages/types';
@@ -195,7 +203,10 @@ const baseFilterConfig = {
195203
};
196204

197205
function getFilterWorkspaceDisplayTitle(filters: SearchAdvancedFiltersForm, policies: WorkspaceListItem[]) {
198-
return policies.filter((value) => value.policyID === filters.policyID).at(0)?.text;
206+
return policies
207+
.filter((value) => value.policyID && filters.policyID?.includes(value.policyID))
208+
.map((value) => value.text)
209+
.join(', ');
199210
}
200211

201212
function getFilterCardDisplayTitle(filters: Partial<SearchAdvancedFiltersForm>, cards: CardList, translate: LocaleContextProps['translate']) {
@@ -434,9 +445,9 @@ function AdvancedSearchFilters() {
434445
}),
435446
),
436447
});
437-
const singlePolicyCategories = allPolicyCategories[`${ONYXKEYS.COLLECTION.POLICY_CATEGORIES}${policyID}`];
448+
const selectedPolicyCategories = getAllPolicyValues(policyID, ONYXKEYS.COLLECTION.POLICY_CATEGORIES, allPolicyCategories);
438449
const [allPolicyTagLists = {}] = useOnyx(ONYXKEYS.COLLECTION.POLICY_TAGS, {canBeMissing: false});
439-
const singlePolicyTagLists = allPolicyTagLists[`${ONYXKEYS.COLLECTION.POLICY_TAGS}${policyID}`];
450+
const selectedPolicyTagLists = getAllPolicyValues(policyID, ONYXKEYS.COLLECTION.POLICY_TAGS, allPolicyTagLists);
440451
const tagListsUnpacked = Object.values(allPolicyTagLists ?? {})
441452
.filter((item): item is NonNullable<PolicyTagLists> => !!item)
442453
.map(getTagNamesFromTagsLists)
@@ -448,7 +459,7 @@ function AdvancedSearchFilters() {
448459
policies,
449460
currentUserLogin,
450461
shouldShowPendingDeletePolicy: false,
451-
selectedPolicyID: undefined,
462+
selectedPolicyIDs: undefined,
452463
searchTerm: '',
453464
});
454465

@@ -465,8 +476,8 @@ function AdvancedSearchFilters() {
465476
isFeatureEnabledInPolicies(policies, CONST.POLICY.MORE_FEATURES.ARE_EXPENSIFY_CARDS_ENABLED);
466477
const areTaxEnabled = isFeatureEnabledInPolicies(policies, CONST.POLICY.MORE_FEATURES.ARE_TAXES_ENABLED);
467478

468-
const shouldDisplayCategoryFilter = shouldDisplayFilter(nonPersonalPolicyCategoryCount, areCategoriesEnabled, !!singlePolicyCategories);
469-
const shouldDisplayTagFilter = shouldDisplayFilter(tagListsUnpacked.length, areTagsEnabled, !!singlePolicyTagLists);
479+
const shouldDisplayCategoryFilter = shouldDisplayFilter(nonPersonalPolicyCategoryCount, areCategoriesEnabled, !!selectedPolicyCategories);
480+
const shouldDisplayTagFilter = shouldDisplayFilter(tagListsUnpacked.length, areTagsEnabled, !!selectedPolicyTagLists);
470481
const shouldDisplayCardFilter = shouldDisplayFilter(Object.keys(allCards).length, areCardsEnabled);
471482
const shouldDisplayTaxFilter = shouldDisplayFilter(Object.keys(taxRates).length, areTaxEnabled);
472483
const shouldDisplayWorkspaceFilter = workspaces.some((section) => section.data.length !== 0);

src/pages/Search/SearchAdvancedFiltersPage/SearchFiltersCategoryPage.tsx

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import {updateAdvancedFilters} from '@userActions/Search';
1111
import CONST from '@src/CONST';
1212
import ONYXKEYS from '@src/ONYXKEYS';
1313
import ROUTES from '@src/ROUTES';
14+
import type {PolicyCategory} from '@src/types/onyx';
1415

1516
function SearchFiltersCategoryPage() {
1617
const styles = useThemeStyles();
@@ -23,22 +24,25 @@ function SearchFiltersCategoryPage() {
2324
}
2425
return {name: category, value: category};
2526
});
26-
// eslint-disable-next-line rulesdir/no-default-id-values
27-
const policyID = searchAdvancedFiltersForm?.policyID ?? '-1';
27+
const policyIDs = searchAdvancedFiltersForm?.policyID ?? [];
2828
const [allPolicyCategories] = useOnyx(ONYXKEYS.COLLECTION.POLICY_CATEGORIES, {canBeMissing: true});
29-
const singlePolicyCategories = allPolicyCategories?.[`${ONYXKEYS.COLLECTION.POLICY_CATEGORIES}${policyID}`];
29+
const selectedPoliciesCategories: PolicyCategory[] = Object.keys(allPolicyCategories ?? {})
30+
.filter((key) => policyIDs?.map((policyID) => `${ONYXKEYS.COLLECTION.POLICY_CATEGORIES}${policyID}`)?.includes(key))
31+
?.map((key) => Object.values(allPolicyCategories?.[key] ?? {}))
32+
.flat();
3033

3134
const categoryItems = useMemo(() => {
3235
const items = [{name: translate('search.noCategory'), value: CONST.SEARCH.CATEGORY_EMPTY_VALUE as string}];
33-
if (!singlePolicyCategories) {
34-
const uniqueCategoryNames = new Set<string>();
36+
const uniqueCategoryNames = new Set<string>();
37+
38+
if (!selectedPoliciesCategories) {
3539
Object.values(allPolicyCategories ?? {}).map((policyCategories) => Object.values(policyCategories ?? {}).forEach((category) => uniqueCategoryNames.add(category.name)));
36-
items.push(...Array.from(uniqueCategoryNames).map((categoryName) => ({name: categoryName, value: categoryName})));
3740
} else {
38-
items.push(...Object.values(singlePolicyCategories ?? {}).map((category) => ({name: category.name, value: category.name})));
41+
selectedPoliciesCategories.forEach((category) => uniqueCategoryNames.add(category.name));
3942
}
43+
items.push(...Array.from(uniqueCategoryNames).map((categoryName) => ({name: categoryName, value: categoryName})));
4044
return items;
41-
}, [allPolicyCategories, singlePolicyCategories, translate]);
45+
}, [allPolicyCategories, selectedPoliciesCategories, translate]);
4246

4347
const onSaveSelection = useCallback((values: string[]) => updateAdvancedFilters({category: values}), []);
4448

src/pages/Search/SearchAdvancedFiltersPage/SearchFiltersTagPage.tsx

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,25 +25,30 @@ function SearchFiltersTagPage() {
2525
}
2626
return {name: getCleanedTagName(tag), value: tag};
2727
});
28-
const policyID = searchAdvancedFiltersForm?.policyID;
28+
const policyIDs = searchAdvancedFiltersForm?.policyID ?? [];
2929
const [allPolicyTagLists = {}] = useOnyx(ONYXKEYS.COLLECTION.POLICY_TAGS, {canBeMissing: true});
30-
const singlePolicyTagLists = allPolicyTagLists[`${ONYXKEYS.COLLECTION.POLICY_TAGS}${policyID}`];
30+
const selectedPoliciesTagLists = Object.keys(allPolicyTagLists ?? {})
31+
.filter((key) => policyIDs?.map((policyID) => `${ONYXKEYS.COLLECTION.POLICY_TAGS}${policyID}`)?.includes(key))
32+
?.map((key) => getTagNamesFromTagsLists(allPolicyTagLists?.[key] ?? {}))
33+
.flat();
3134

3235
const tagItems = useMemo(() => {
3336
const items = [{name: translate('search.noTag'), value: CONST.SEARCH.TAG_EMPTY_VALUE as string}];
34-
if (!singlePolicyTagLists) {
35-
const uniqueTagNames = new Set<string>();
37+
const uniqueTagNames = new Set<string>();
38+
39+
if (!selectedPoliciesTagLists) {
3640
const tagListsUnpacked = Object.values(allPolicyTagLists ?? {}).filter((item) => !!item) as PolicyTagLists[];
3741
tagListsUnpacked
3842
.map(getTagNamesFromTagsLists)
3943
.flat()
4044
.forEach((tag) => uniqueTagNames.add(tag));
41-
items.push(...Array.from(uniqueTagNames).map((tagName) => ({name: getCleanedTagName(tagName), value: tagName})));
4245
} else {
43-
items.push(...getTagNamesFromTagsLists(singlePolicyTagLists).map((name) => ({name: getCleanedTagName(name), value: name})));
46+
selectedPoliciesTagLists.forEach((tag) => uniqueTagNames.add(tag));
4447
}
48+
items.push(...Array.from(uniqueTagNames).map((tagName) => ({name: getCleanedTagName(tagName), value: tagName})));
49+
4550
return items;
46-
}, [allPolicyTagLists, singlePolicyTagLists, translate]);
51+
}, [allPolicyTagLists, selectedPoliciesTagLists, translate]);
4752

4853
const updateTagFilter = useCallback((values: string[]) => updateAdvancedFilters({tag: values}), []);
4954

0 commit comments

Comments
 (0)