-
Notifications
You must be signed in to change notification settings - Fork 3.2k
fix: update parent action for assignee report as well #24110
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
Changes from 11 commits
313d2e5
9728aa2
574c144
24a3870
1e380ae
abff057
a5eac40
688217f
d4dd964
fbed766
6a977fd
fafcfa9
99018a5
c474825
e87bed8
a5f4dfb
2e3f28e
5152ef3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -547,6 +547,17 @@ function getIOUReportIDFromReportActionPreview(reportAction) { | |
return lodashGet(reportAction, 'originalMessage.linkedReportID', ''); | ||
} | ||
|
||
/** | ||
* Find the reportAction whose childReportID is taskReportID in reportActions with reportID | ||
* | ||
* @param {String} taskReportID | ||
* @param {String} reportID | ||
* @returns {Object} | ||
*/ | ||
function getParentReportActionForTask(taskReportID, reportID) { | ||
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. This function is not exclusive to tasks. Can we rename it to something else? 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. Renamed to |
||
return _.find(allReportActions[reportID], (reportAction) => reportAction && `${reportAction.childReportID}` === `${taskReportID}`); | ||
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.
Got it. But if we don't convert them to string, comparison would return false and can't find the parent action in assignee report. I think we need to convert them to string unless the backend is fixed. What do you think? 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. Indeed. We may need to wait for an outcome from that slack thread. But for now let's write the right code. |
||
} | ||
|
||
function isCreatedTaskReportAction(reportAction) { | ||
return reportAction.actionName === CONST.REPORT.ACTIONS.TYPE.ADDCOMMENT && _.has(reportAction.originalMessage, 'taskReportID'); | ||
} | ||
|
@@ -593,4 +604,5 @@ export { | |
isWhisperAction, | ||
isPendingRemove, | ||
getReportAction, | ||
getParentReportActionForTask, | ||
}; |
Uh oh!
There was an error while loading. Please reload this page.