-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Fix member option appear in transaction thread report detail page #42036
Merged
Merged
Changes from 1 commit
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
a1bd7f1
Fix member option appear in transaction thread report detail page
nkdengineer bff2d4a
Merge branch 'main' into fix/41832
nkdengineer e7a2eda
remove unnecessary change
nkdengineer 5164bdb
remove another change
nkdengineer ce931c7
Merge branch 'main' into fix/41832
nkdengineer 70ec215
Fix issue for iou report
nkdengineer 0843cb6
Merge branch 'main' into fix/41832
nkdengineer File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1051,6 +1051,14 @@ function isSystemChat(report: OnyxEntry<Report>): boolean { | |
return getChatType(report) === CONST.REPORT.CHAT_TYPE.SYSTEM; | ||
} | ||
|
||
/** | ||
* Checks if a report is an IOU or expense report. | ||
*/ | ||
function isMoneyRequestReport(reportOrID: OnyxEntry<Report> | EmptyObject | string): boolean { | ||
const report = typeof reportOrID === 'object' ? reportOrID : allReports?.[`${ONYXKEYS.COLLECTION.REPORT}${reportOrID}`] ?? null; | ||
return isIOUReport(report) || isExpenseReport(report); | ||
} | ||
|
||
/** | ||
* Only returns true if this is our main 1:1 DM report with Concierge | ||
*/ | ||
|
@@ -1217,7 +1225,7 @@ function hasExpenses(reportID?: string): boolean { | |
* Whether the provided report is a closed expense report with no expenses | ||
*/ | ||
function isClosedExpenseReportWithNoExpenses(report: OnyxEntry<Report>): boolean { | ||
return report?.statusNum === CONST.REPORT.STATUS_NUM.CLOSED && isExpenseReport(report) && !hasExpenses(report.reportID); | ||
return report?.statusNum === CONST.REPORT.STATUS_NUM.CLOSED && isMoneyRequestReport(report) && !hasExpenses(report.reportID); | ||
} | ||
|
||
/** | ||
|
@@ -1394,14 +1402,6 @@ function isMoneyRequest(reportOrID: OnyxEntry<Report> | string): boolean { | |
return isIOURequest(report) || isExpenseRequest(report); | ||
} | ||
|
||
/** | ||
* Checks if a report is an IOU or expense report. | ||
*/ | ||
function isMoneyRequestReport(reportOrID: OnyxEntry<Report> | EmptyObject | string): boolean { | ||
const report = typeof reportOrID === 'object' ? reportOrID : allReports?.[`${ONYXKEYS.COLLECTION.REPORT}${reportOrID}`] ?? null; | ||
return isIOUReport(report) || isExpenseReport(report); | ||
} | ||
|
||
/** | ||
* Checks if a report has only one transaction associated with it | ||
*/ | ||
|
@@ -1499,6 +1499,10 @@ function canAddOrDeleteTransactions(moneyRequestReport: OnyxEntry<Report>): bool | |
return false; | ||
} | ||
|
||
if (moneyRequestReport?.statusNum === CONST.REPORT.STATUS_NUM.CLOSED) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @nkdengineer Why do we need this change? |
||
return false; | ||
} | ||
|
||
if (isReportApproved(moneyRequestReport) || isSettled(moneyRequestReport?.reportID)) { | ||
return false; | ||
} | ||
|
@@ -4309,10 +4313,11 @@ function buildOptimisticChatReport( | |
description = '', | ||
avatarUrl = '', | ||
optimisticReportID = '', | ||
shouldShowParticipants = true, | ||
): OptimisticChatReport { | ||
const participants = participantList.reduce((reportParticipants: Participants, accountID: number) => { | ||
const participant: ReportParticipant = { | ||
hidden: false, | ||
hidden: !shouldShowParticipants, | ||
role: accountID === currentUserAccountID ? CONST.REPORT.ROLE.ADMIN : CONST.REPORT.ROLE.MEMBER, | ||
}; | ||
// eslint-disable-next-line no-param-reassign | ||
|
@@ -4859,6 +4864,8 @@ function buildTransactionThread( | |
moneyRequestReport?.reportID, | ||
'', | ||
'', | ||
'', | ||
false, | ||
); | ||
} | ||
|
||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same doubt, why this change?