-
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
Display blocking view and remove download button when user have no access to the report #42312
Changes from 2 commits
0315738
5d90f64
e692ac1
a9352da
bc863c6
f7fbbe6
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 |
---|---|---|
|
@@ -451,7 +451,7 @@ function AttachmentModal({ | |
let shouldShowThreeDotsButton = false; | ||
if (!isEmptyObject(report)) { | ||
headerTitleNew = translate(isReceiptAttachment ? 'common.receipt' : 'common.attachment'); | ||
shouldShowDownloadButton = allowDownload && isDownloadButtonReadyToBeShown && !isReceiptAttachment && !isOffline; | ||
shouldShowDownloadButton = allowDownload && isDownloadButtonReadyToBeShown && !shouldShowNotFoundPage && !isReceiptAttachment && !isOffline; | ||
shouldShowThreeDotsButton = isReceiptAttachment && isModalOpen && threeDotsMenuItems.length !== 0; | ||
} | ||
const context = useMemo( | ||
|
@@ -515,7 +515,7 @@ function AttachmentModal({ | |
onLinkPress={() => Navigation.dismissModal()} | ||
/> | ||
)} | ||
{!isEmptyObject(report) && !isReceiptAttachment ? ( | ||
{!shouldShowNotFoundPage && (!isEmptyObject(report) && !isReceiptAttachment ? ( | ||
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. Could you please format this a little differently? It is hard to see the |
||
<AttachmentCarousel | ||
report={report} | ||
onNavigate={onNavigate} | ||
|
@@ -527,7 +527,7 @@ function AttachmentModal({ | |
!!sourceForAttachmentView && | ||
shouldLoadAttachment && | ||
!isLoading && | ||
!shouldShowNotFoundPage && ( | ||
( | ||
<AttachmentCarouselPagerContext.Provider value={context}> | ||
<AttachmentView | ||
containerStyles={[styles.mh5]} | ||
|
@@ -543,7 +543,7 @@ function AttachmentModal({ | |
/> | ||
</AttachmentCarouselPagerContext.Provider> | ||
) | ||
)} | ||
))} | ||
</View> | ||
{/* If we have an onConfirm method show a confirmation button */} | ||
{!!onConfirm && ( | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -38,6 +38,7 @@ function ReportAttachments({route}: ReportAttachmentsProps) { | |
ComposerFocusManager.setReadyToFocus(); | ||
}} | ||
onCarouselAttachmentChange={onCarouselAttachmentChange} | ||
shouldShowNotFoundPage={!report?.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. As suggested please use data from
We can subscribe to that key in this component. 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. Subscriping will be through the 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. May be hook is better. |
||
/> | ||
); | ||
} | ||
|
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 is now wrong.
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.
could you please tell me what is exactly wrong about it, I tested it and it works just fine, like before wrapping. The whole view now is wrapped inside
(
after!shouldShowNotFoundPage
.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.
Oh, missed the
()
. All good here.