-
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
Disable thread in archived room #38251
Conversation
@akinwale PR ready for your review 👍 |
It looks like this PR will also fix this issue. See this comment for details. I edited the PR description to include this issue in the list of issues that will be fixed by this PR. Happy coding! 🧑💻 |
src/libs/ReportUtils.ts
Outdated
* - The action is a whisper action and it's neither a report preview nor IOU action | ||
* - The action is the thread's first chat | ||
*/ | ||
function shouldDisableThread(reportAction: OnyxEntry<ReportAction>, reportID: string): boolean { | ||
function shouldDisableThread(reportAction: OnyxEntry<ReportAction>, reportID: string, isArchivedReport = false): boolean { |
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.
You don't need to add a new method parameter for isArchivedReport
. You can check if the report is archived in the shouldDisableThread
method using the following code:
+const report = getReport(reportID);
+const isArchivedReport = isArchivedRoom(report);
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.
Initially I intended to do as your above suggestions but I spotted in ContextMenuAction
, we already handle the isArchivedRoom
check outside so I don't want to do the extra redundant work again
App/src/pages/home/report/ContextMenu/ContextMenuActions.tsx
Lines 193 to 198 in aca0f8c
shouldShow: (type, reportAction, isArchivedRoom, betas, menuTarget, isChronosReport, reportID) => { | |
if (type !== CONST.CONTEXT_MENU_TYPES.REPORT_ACTION) { | |
return false; | |
} | |
return !ReportUtils.shouldDisableThread(reportAction, reportID); | |
}, |
But I can update according to what you prefer anw.
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.
Since it's a utility method, let's keep it self-contained. You will also notice that the getReport
method is used by other methods in the file.
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.
I updated!
Reviewer Checklist
Screenshots/VideosAndroid: NativeAndroid: mWeb Chrome38251-android-chrome.mp4iOS: Native38251-ios-native.mp4iOS: mWeb Safari38251-ios-safari.mp4MacOS: Chrome / Safari38251-web.mp4MacOS: Desktop38251-desktop.mp4 |
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.
LGTM.
@blimpich Waiting for your feedback. |
Oh Ben was OOO. Let me ask on Slack if any one can help approving this. |
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.
LGTM, approving and merging since @blimpich is OOO. I do wonder if archiving a room should archive all child threads as well, but it seems like that could be a separate concern
Reassure is failing on SignInPage, which is most certainly unaffected by these changes. going to ignore and merge 🚀 |
@roryabraham looks like this was merged without a test passing. Please add a note explaining why this was done and remove the |
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
Details
Disable reply in thread with messages in an archived room and have no reply.
Fixed Issues
$ #37551
$ #38183
PROPOSAL: #37551 (comment)
Tests
#announce
room#announce
room from step 2Reply in thread
option shows#announce
room aboveReply in thread
option does not showOffline tests
Same as Tests
QA Steps
#announce
room#announce
room from step 2Reply in thread
option shows#announce
room aboveReply in thread
option does not showPR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)myBool && <MyComponent />
.src/languages/*
files and using the translation methodSTYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG)
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)Design
label and/or tagged@Expensify/design
so the design team can review the changes.ScrollView
component to make it scrollable when more elements are added to the page.main
branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTest
steps.Screenshots/Videos
Android: Native
Screen.Recording.2024-03-14.at.02.22.45-compressed.mov
Android: mWeb Chrome
Screen.Recording.2024-03-14.at.02.24.07-compressed.mov
iOS: Native
Screen.Recording.2024-03-14.at.02.16.36-compressed.mov
iOS: mWeb Safari
Screen.Recording.2024-03-14.at.02.18.56-compressed.mov
MacOS: Chrome / Safari
Screen.Recording.2024-03-14.at.02.17.05-compressed.mov
Offline
Screen.Recording.2024-03-14.at.02.25.31-compressed.mov
MacOS: Desktop
Screen.Recording.2024-03-14.at.02.19.45-compressed.mov