-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
Remove sideloading of Onyx data for attachment modal #30866
Merged
Merged
Changes from 4 commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
34e3fa2
Remove sideloading of Onyx data for attachment modal
tgolen 6df3088
Merge branch 'main' into tgolen-improve-proploading
tgolen d0b5968
Remove nested withOnyx
tgolen 00d73e2
Update comment to be accurate
tgolen efcfe07
Fix proptypes, remove unused parameter
tgolen 285f16f
Improve accuracy of attachment header title
tgolen 2e403d0
Don't show the buttons until the file type is known
tgolen 6dfa2c9
Merge branch 'main' into tgolen-improve-proploading
tgolen 603c396
Merge branch 'main' into tgolen-improve-proploading
tgolen e5edd85
Use multiple withOnyx
tgolen a5495e0
Merge branch 'main' into tgolen-improve-proploading
tgolen 00879f5
disable eslint for multiple onyx
tgolen 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
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 |
---|---|---|
|
@@ -10,11 +10,13 @@ import CONST from '@src/CONST'; | |
/** | ||
* Constructs the initial component state from report actions | ||
* @param {Object} report | ||
* @param {Object} parentReportAction | ||
* @param {Array} reportActions | ||
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. I am not sure why this is array |
||
* @param {Object} transaction | ||
* @returns {Array} | ||
*/ | ||
function extractAttachmentsFromReport(report, reportActions) { | ||
const actions = [ReportActionsUtils.getParentReportAction(report), ...ReportActionsUtils.getSortedReportActions(_.values(reportActions))]; | ||
function extractAttachmentsFromReport(report, parentReportAction, reportActions, transaction) { | ||
const actions = [parentReportAction, ...ReportActionsUtils.getSortedReportActions(_.values(reportActions))]; | ||
const attachments = []; | ||
|
||
const htmlParser = new HtmlParser({ | ||
|
@@ -51,7 +53,6 @@ function extractAttachmentsFromReport(report, reportActions) { | |
return; | ||
} | ||
|
||
const transaction = TransactionUtils.getTransaction(transactionID); | ||
if (TransactionUtils.hasReceipt(transaction)) { | ||
const {image} = ReceiptUtils.getThumbnailAndImageURIs(transaction); | ||
const isLocalFile = typeof image === 'string' && (image.startsWith('blob:') || image.startsWith('file:')); | ||
|
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
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
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.
This kind of mistake is easy to miss
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.
Yes, thank you. I went back and forth on
parentReportAction
andparentReportActions
and forgot to update this.