Skip to content
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
5 changes: 5 additions & 0 deletions src/components/Search/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,7 @@ function Search({
const [visibleColumns] = useOnyx(ONYXKEYS.FORMS.SEARCH_ADVANCED_FILTERS_FORM, {selector: columnsSelector});
const [customCardNames] = useOnyx(ONYXKEYS.NVP_EXPENSIFY_COMPANY_CARDS_CUSTOM_NAMES);
const [cardList] = useOnyx(ONYXKEYS.CARD_LIST);
const [conciergeReportID] = useOnyx(ONYXKEYS.CONCIERGE_REPORT_ID);

const isExpenseReportType = type === CONST.SEARCH.DATA_TYPES.EXPENSE_REPORT;
const {markReportIDAsMultiTransactionExpense, unmarkReportIDAsMultiTransactionExpense} = useWideRHPActions();
Expand Down Expand Up @@ -483,6 +484,7 @@ function Search({
customCardNames,
allReportMetadata,
cardList,
conciergeReportID,
onyxPersonalDetailsList,
});
return [filteredData1, filteredData1.length, allLength];
Expand All @@ -509,6 +511,7 @@ function Search({
customCardNames,
allReportMetadata,
cardList,
conciergeReportID,
onyxPersonalDetailsList,
]);

Expand Down Expand Up @@ -546,6 +549,7 @@ function Search({
cardFeeds,
allReportMetadata,
cardList,
conciergeReportID,
});
return {
...item,
Expand All @@ -569,6 +573,7 @@ function Search({
bankAccountList,
allReportMetadata,
cardList,
conciergeReportID,
]);

const hasLoadedAllTransactions = useMemo(() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ function TransactionGroupListItem<TItem extends ListItem>({
const [bankAccountList] = useOnyx(ONYXKEYS.BANK_ACCOUNT_LIST);
const [cardFeeds] = useOnyx(ONYXKEYS.COLLECTION.SHARED_NVP_PRIVATE_DOMAIN_MEMBER);
const [cardList] = useOnyx(ONYXKEYS.CARD_LIST);
const [conciergeReportID] = useOnyx(ONYXKEYS.CONCIERGE_REPORT_ID);

let transactions: TransactionListItemType[];
if (isExpenseReportType) {
Expand All @@ -135,6 +136,7 @@ function TransactionGroupListItem<TItem extends ListItem>({
allReportMetadata,
cardFeeds,
cardList,
conciergeReportID,
}) as [TransactionListItemType[], number];
transactions = sectionData.map((transactionItem) => ({
...transactionItem,
Expand Down
2 changes: 2 additions & 0 deletions src/hooks/useSearchSections.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ function useSearchSections(): UseSearchSectionsResult {
const [cardList] = useOnyx(ONYXKEYS.CARD_LIST);

const archivedReportsIdSet = useArchivedReportsIdSet();
const [conciergeReportID] = useOnyx(ONYXKEYS.CONCIERGE_REPORT_ID);

const {type, status, sortBy, sortOrder, groupBy} = lastSearchQuery?.queryJSON ?? {};
const searchResultsData = currentSearchResults?.data;
Expand All @@ -59,6 +60,7 @@ function useSearchSections(): UseSearchSectionsResult {
cardFeeds,
allReportMetadata,
cardList,
conciergeReportID,
});
allReports = getSortedSections(type, status ?? '', searchData, localeCompare, translate, sortBy, sortOrder, groupBy).map((value) => value.reportID);
}
Expand Down
7 changes: 5 additions & 2 deletions src/libs/SearchUIUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -496,6 +496,7 @@ type GetSectionsParams = {
allTransactionViolations?: OnyxCollection<OnyxTypes.TransactionViolation[]>;
visibleReportActionsData?: OnyxTypes.VisibleReportActionsDerivedValue;
allReportMetadata: OnyxCollection<OnyxTypes.ReportMetadata>;
conciergeReportID: string | undefined;
onyxPersonalDetailsList?: OnyxTypes.PersonalDetailsList;
};

Expand Down Expand Up @@ -2025,6 +2026,7 @@ function getActions(
function getTaskSections(
data: OnyxTypes.SearchResults['data'],
formatPhoneNumber: LocaleContextProps['formatPhoneNumber'],
conciergeReportID: string | undefined,
archivedReportsIDList?: ArchivedReportsIDSet,
): [TaskListItemType[], number] {
const {shouldShowYearCreated} = shouldShowYear(data);
Expand Down Expand Up @@ -2064,7 +2066,7 @@ function getTaskSections(
const policy = data[`${ONYXKEYS.COLLECTION.POLICY}${parentReport.policyID}`];
const isParentReportArchived = archivedReportsIDList?.has(`${ONYXKEYS.COLLECTION.REPORT_NAME_VALUE_PAIRS}${parentReport?.reportID}`);
// eslint-disable-next-line @typescript-eslint/no-deprecated
const parentReportName = getReportName({report: parentReport, policy, isReportArchived: isParentReportArchived});
const parentReportName = getReportName({report: parentReport, policy, isReportArchived: isParentReportArchived, conciergeReportID});
const icons = getIcons(parentReport, formatPhoneNumber, personalDetails, null, '', -1, policy, undefined, isParentReportArchived);
const parentReportIcon = icons?.at(0);

Expand Down Expand Up @@ -2919,13 +2921,14 @@ function getSections({
visibleReportActionsData,
allReportMetadata,
cardList,
conciergeReportID,
onyxPersonalDetailsList,
}: GetSectionsParams) {
if (type === CONST.SEARCH.DATA_TYPES.CHAT) {
return getReportActionsSections(data, visibleReportActionsData);
}
if (type === CONST.SEARCH.DATA_TYPES.TASK) {
return getTaskSections(data, formatPhoneNumber, archivedReportsIDList);
return getTaskSections(data, formatPhoneNumber, conciergeReportID, archivedReportsIDList);
}

if (type === CONST.SEARCH.DATA_TYPES.EXPENSE_REPORT) {
Expand Down
Loading
Loading