fix: Onboarding task report has "Room description" field which opens not here page #57975
Conversation
|
@ikevin127 Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
This comment was marked as resolved.
This comment was marked as resolved.
Reviewer Checklist
Screenshots/VideosAndroid: Nativeandroid.webmAndroid: mWeb Chromeandroid-mweb.mp4iOS: Nativeios.mp4iOS: mWeb Safariios-mweb.mp4MacOS: Chrome / Safariweb.movMacOS: Desktopdesktop.mov |
src/pages/ReportDetailsPage.tsx
Outdated
| const isCanceledTaskReport = isCanceledTaskReportUtil(report, parentReportAction); | ||
| const canEditReportDescription = useMemo(() => canEditReportDescriptionUtil(report, policy), [report, policy]); | ||
| const shouldShowReportDescription = isChatRoom && (canEditReportDescription || report.description !== ''); | ||
| const shouldShowReportDescription = isChatRoom && !isTaskReport && (canEditReportDescription || report.description !== ''); |
There was a problem hiding this comment.
| const shouldShowReportDescription = isChatRoom && !isTaskReport && (canEditReportDescription || report.description !== ''); | |
| const canModifyTask = canModifyTaskAction(report, session?.accountID ?? CONST.DEFAULT_NUMBER_ID); | |
| const shouldShowReportDescription = isChatRoom && (canEditReportDescription || report.description !== '') && (isTaskReport ? canModifyTask : true); |
@etCoderDysto We should improve the check like this because there are cases in which simply checking !isTaskReport would break working functionality by hiding report description in cases in which it shouldn't be hidden, example:
- ❌ create a chat room and inside the room create a task with custom description: the task report description wouldn't show up when it should because we removed it for all task reports (
!isTaskReport)
🟢 The suggested change ensures the following:
- would show report description only for tasks where
canModifyTaskistrue - would show report description for all other report types (
isChatRoom) where condition(canEditReportDescription || report.description !== '')evaluates totrue - would not show report description in our issue's case where
canModifyTaskevaluates tofalsefor the workspace #admin task reports
web.mov
♻️ Once you update this logic, please make sure to add the test case mentioned above (chat room - task report) to the PRs Tests section to make sure the other cases are still showing report description field 👍
Important
Also please make sure you add Explanation of Change in the PRs description with a short explanation of what the PR does / changes and why, as this is an important section for all PRs for debugging / logging reasons.
There was a problem hiding this comment.
Hi @ikevin127, thanks for the feedback. I have made the suggested changes.
ikevin127
left a comment
There was a problem hiding this comment.
LGTM 🚀 Thanks for adding the additional tests!
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🚀 Deployed to staging by https://github.com/thienlnam in version: 9.1.11-1 🚀
|
|
🚀 Deployed to production by https://github.com/mountiny in version: 9.1.12-7 🚀
|
Explanation of Change
Fixed Issues
$ #56652
PROPOSAL: #56652 (comment)
Tests
Same as QA steps
Offline tests
Same as QA steps
QA Steps
// TODO: These must be filled out, or the issue title must include "[No QA]."
Test 1
Test 2
Test 3
Test 4
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.ScrollViewcomponent to make it scrollable when more elements are added to the page.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari
MacOS: Desktop