Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds optimistic data for transaction threads with violations #35449

Merged
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
7315ae8
Add originalMessage to reportAction in reportActionsSelector for LHN
cdanwards Jan 29, 2024
33da1f4
Add optimistic transaction thread logic for iou functions
cdanwards Jan 29, 2024
d1325b3
Update LHN logic to allow Transaction Threads with Violations to be s…
cdanwards Jan 29, 2024
076b27a
Merge branch 'main' of github.com:Expensify/App into violations/cdanw…
cdanwards Jan 30, 2024
8779158
Add optimisticTransactionThread and optimisticCreatedActionForTransac…
cdanwards Jan 31, 2024
6d07a21
Add policyTags and policyCategories to createSplitsAndOnyxData and sp…
cdanwards Jan 31, 2024
46c3870
Fix undefined values for policyTags and policyCategories in createSpl…
cdanwards Jan 31, 2024
0ffaf19
Merge branch 'main' of github.com:Expensify/App into violations/cdanw…
cdanwards Jan 31, 2024
d61a4ed
Remove isNewIOUReport from getMoneyRequestInformation function
cdanwards Jan 31, 2024
e683b8f
Remove unused parameters and update function signature
cdanwards Jan 31, 2024
0bf7365
Update IOUTest to not fail with transaction threads
cdanwards Feb 1, 2024
4319da4
Merge branch 'main' of github.com:infinitered/ExpensifyApp into viola…
cdanwards Feb 1, 2024
11a63e4
Remove unneeded jest timeout
cdanwards Feb 1, 2024
c19372a
feat(Violations): reorder arguments when building onyx data, and remo…
trevor-coleman Feb 1, 2024
74beda7
Merge branch 'main' of github.com:infinitered/ExpensifyApp into viola…
cdanwards Feb 2, 2024
dd05a86
Merge branch 'main' of github.com:Expensify/App into violations/cdanw…
cdanwards Feb 6, 2024
da57979
Update optimistic transaction thread logic for typscript conversion
cdanwards Feb 6, 2024
f06d5b0
Refactor buildTransactionThread function calls in IOU.ts
cdanwards Feb 6, 2024
5d1c507
Merge branch 'main' of github.com:Expensify/App into violations/cdanw…
cdanwards Feb 7, 2024
9a5baef
Update ReportActionsUtils, ReportUtils, and TransactionUtils types
cdanwards Feb 8, 2024
3f0ac51
Merge branch 'main' of github.com:Expensify/App into violations/cdanw…
cdanwards Feb 8, 2024
acb4d71
Merge branch 'main' of github.com:Expensify/App into violations/cdanw…
cdanwards Feb 13, 2024
8b5c132
Rearrange function parameters for MoneyRequestConfirmPage
cdanwards Feb 13, 2024
e33cc23
Refactor MoneyRequestConfirmPage.js to include merchant information
cdanwards Feb 13, 2024
2e3d3da
Update onyxMethod in IOU.ts
cdanwards Feb 13, 2024
5d33d5e
Merge branch 'main' of github.com:Expensify/App into violations/cdanw…
cdanwards Feb 13, 2024
1449800
Add error handling data for transaction thread report and report actions
cdanwards Feb 13, 2024
d27e602
Merge branch 'main' of github.com:Expensify/App into violations/cdanw…
cdanwards Feb 14, 2024
8de9fb7
Merge branch 'main' of github.com:Expensify/App into violations/cdanw…
cdanwards Feb 15, 2024
7956ab4
Merge branch 'main' of github.com:Expensify/App into violations/cdanw…
cdanwards Feb 16, 2024
f9b3e54
Remove unnecessary code and fix merchant parameter in MoneyRequestCon…
cdanwards Feb 16, 2024
4dd1d7d
Remove unused variables in IOURequestStepConfirmation.js
cdanwards Feb 16, 2024
25d2b77
Refactor IOURequestStepConfirmation function parameters
cdanwards Feb 16, 2024
a8a96f8
Merge branch 'main' of github.com:Expensify/App into violations/cdanw…
cdanwards Feb 18, 2024
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
11 changes: 7 additions & 4 deletions src/components/LHNOptionsList/OptionRowLHN.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,13 @@ function OptionRowLHN({reportID, isFocused = false, onSelectRow = () => {}, opti
return null;
}

const isHidden = optionItem?.notificationPreference === CONST.REPORT.NOTIFICATION_PREFERENCE.HIDDEN;
if (isHidden && !isFocused && !optionItem?.isPinned) {
const hasBrickError = optionItem.brickRoadIndicator === CONST.BRICK_ROAD_INDICATOR_STATUS.ERROR;
const shouldShowGreenDotIndicator = !hasBrickError && ReportUtils.requiresAttentionFromCurrentUser(optionItem, optionItem.parentReportAction);

const isHidden = optionItem.notificationPreference === CONST.REPORT.NOTIFICATION_PREFERENCE.HIDDEN;

const shouldOverrideHidden = hasBrickError || isFocused || optionItem.isPinned;
if (isHidden && !shouldOverrideHidden) {
return null;
}

Expand All @@ -74,8 +79,6 @@ function OptionRowLHN({reportID, isFocused = false, onSelectRow = () => {}, opti
const hoveredBackgroundColor = !!styles.sidebarLinkHover && 'backgroundColor' in styles.sidebarLinkHover ? styles.sidebarLinkHover.backgroundColor : theme.sidebar;
const focusedBackgroundColor = styles.sidebarLinkActive.backgroundColor;

const hasBrickError = optionItem.brickRoadIndicator === CONST.BRICK_ROAD_INDICATOR_STATUS.ERROR;
const shouldShowGreenDotIndicator = !hasBrickError && ReportUtils.requiresAttentionFromCurrentUser(optionItem, optionItem.parentReportAction);
/**
* Show the ReportActionContextMenu modal popover.
*
Expand Down
12 changes: 7 additions & 5 deletions src/libs/ReportUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3647,6 +3647,13 @@ function shouldReportBeInOptionList({
return true;
}

const reportIsSettled = report.statusNum === CONST.REPORT.STATUS_NUM.REIMBURSED;
cdanwards marked this conversation as resolved.
Show resolved Hide resolved

// Always show IOU reports with violations unless they are reimbursed
if (isExpenseRequest(report) && doesReportHaveViolations && !reportIsSettled) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moving this check up to this location was discussed here: https://expensify.slack.com/archives/C01GTK53T8Q/p1706026331938069

return true;
}

// Hide only chat threads that haven't been commented on (other threads are actionable)
if (isChatThread(report) && canHideReport && isEmptyChat) {
return false;
Expand All @@ -3658,11 +3665,6 @@ function shouldReportBeInOptionList({
return true;
}

// Always show IOU reports with violations
if (isExpenseRequest(report) && doesReportHaveViolations) {
return true;
}

// All unread chats (even archived ones) in GSD mode will be shown. This is because GSD mode is specifically for focusing the user on the most relevant chats, primarily, the unread ones
if (isInGSDMode) {
return isUnread(report) && report.notificationPreference !== CONST.REPORT.NOTIFICATION_PREFERENCE.MUTE;
Expand Down
Loading
Loading