-
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
Fix Avatar has no tooltip in thread report header and displaying "__fake__" text in WS chat #20504
Conversation
src/pages/home/HeaderView.js
Outdated
@@ -116,7 +116,7 @@ const HeaderView = (props) => { | |||
} | |||
const shouldShowThreeDotsButton = !!threeDotMenuItems.length; | |||
|
|||
const shouldShowSubscript = isPolicyExpenseChat && !props.report.isOwnPolicyExpenseChat && !ReportUtils.isArchivedRoom(props.report) && !isTaskReport; | |||
const shouldShowSubscript = isPolicyExpenseChat && !props.report.isOwnPolicyExpenseChat && !ReportUtils.isArchivedRoom(props.report) && !isTaskReport && !isThread; |
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'm not sure should we centralize the logic to show subscript by reuse ReportUtils.shouldReportShowSubscript
, there are some differences between them so I leave as it is.
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 don't see any reason why subscript visibility of LHN avatar and report header avatar are inconsistent.
There are 4 instances where subscript avatar visibility is calculated:
Lines 2122 to 2131 in 0a947cc
function shouldReportShowSubscript(report) { | |
if (isArchivedRoom(report)) { | |
return false; | |
} | |
if (isPolicyExpenseChat(report) && !report.isOwnPolicyExpenseChat) { | |
return true; | |
} | |
return isExpenseReport(report); |
App/src/libs/OptionsListUtils.js
Line 422 in 0a947cc
result.shouldShowSubscript = result.isPolicyExpenseChat && !report.isOwnPolicyExpenseChat && !result.isArchivedRoom; |
App/src/pages/home/HeaderView.js
Line 119 in 0a947cc
const shouldShowSubscript = isPolicyExpenseChat && !props.report.isOwnPolicyExpenseChat && !ReportUtils.isArchivedRoom(props.report) && !isTaskReport; |
App/src/pages/home/report/ReportActionsList.js
Lines 134 to 137 in 0a947cc
shouldShowSubscriptAvatar={ | |
(ReportUtils.isPolicyExpenseChat(report) || ReportUtils.isExpenseReport(report)) && | |
_.contains([CONST.REPORT.ACTIONS.TYPE.IOU, CONST.REPORT.ACTIONS.TYPE.REPORTPREVIEW], reportAction.actionName) | |
} |
I think we should combine all of these into one (except last case).
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.
let me try to consolidate them
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.
So the condition to show Subscript should be:
function shouldReportShowSubscript(report) {
if (isArchivedRoom(report)) {
return false;
}
if (isPolicyExpenseChat(report) && !isThread(report) && !isTaskReport(report) && !report.isOwnPolicyExpenseChat) {
return true;
}
return isExpenseReport(report);
}
Do you agree @0xmiroslav?
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 agree. only the concern is isExpenseReport
. let's test all cases thoroughly in all pages (LHN, Search, header)
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.
@0xmiroslav I have updated PR and also add more steps to Tests. Please help to review it again. Thanks
@puneetlath @rushatgabhane One of you needs to 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] |
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.
src/pages/home/HeaderView.js
Outdated
@@ -116,7 +116,7 @@ const HeaderView = (props) => { | |||
} | |||
const shouldShowThreeDotsButton = !!threeDotMenuItems.length; | |||
|
|||
const shouldShowSubscript = isPolicyExpenseChat && !props.report.isOwnPolicyExpenseChat && !ReportUtils.isArchivedRoom(props.report) && !isTaskReport; | |||
const shouldShowSubscript = isPolicyExpenseChat && !props.report.isOwnPolicyExpenseChat && !ReportUtils.isArchivedRoom(props.report) && !isTaskReport && !isThread; |
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 don't see any reason why subscript visibility of LHN avatar and report header avatar are inconsistent.
There are 4 instances where subscript avatar visibility is calculated:
Lines 2122 to 2131 in 0a947cc
function shouldReportShowSubscript(report) { | |
if (isArchivedRoom(report)) { | |
return false; | |
} | |
if (isPolicyExpenseChat(report) && !report.isOwnPolicyExpenseChat) { | |
return true; | |
} | |
return isExpenseReport(report); |
App/src/libs/OptionsListUtils.js
Line 422 in 0a947cc
result.shouldShowSubscript = result.isPolicyExpenseChat && !report.isOwnPolicyExpenseChat && !result.isArchivedRoom; |
App/src/pages/home/HeaderView.js
Line 119 in 0a947cc
const shouldShowSubscript = isPolicyExpenseChat && !props.report.isOwnPolicyExpenseChat && !ReportUtils.isArchivedRoom(props.report) && !isTaskReport; |
App/src/pages/home/report/ReportActionsList.js
Lines 134 to 137 in 0a947cc
shouldShowSubscriptAvatar={ | |
(ReportUtils.isPolicyExpenseChat(report) || ReportUtils.isExpenseReport(report)) && | |
_.contains([CONST.REPORT.ACTIONS.TYPE.IOU, CONST.REPORT.ACTIONS.TYPE.REPORTPREVIEW], reportAction.actionName) | |
} |
I think we should combine all of these into one (except last case).
Thread chat created from workspace chat seems broken. Happening on main so out of scope __fake__.mov |
Reviewer Checklist
Screenshots/VideosWebweb1.movweb2.movMobile Web - Chromemchrome.movMobile Web - Safarimsafari.movDesktopdesktop.moviOSios.movAndroidandroid.mov |
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.
@puneetlath Looks good, tests well on all cases
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.
Nice job with this. Good use of a helper method.
🚀 Deployed to staging by https://github.com/puneetlath in version: 1.3.27-0 🚀
|
🚀 Deployed to staging by https://github.com/puneetlath in version: 1.3.27-0 🚀
|
🚀 Deployed to production by https://github.com/AndrewGable in version: 1.3.27-7 🚀
|
Details
Fixed Issues
$ #19825
PROPOSAL: #19825 (comment)
Tests
Offline tests
This tooltip is not affected by network
QA Steps
Same as Tests
PR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)myBool && <MyComponent />
.src/languages/*
files and using the translation methodWaiting for Copy
label for a copy review on the original GH to get the correct copy.STYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)/** comment above it */
this
properly so there are no scoping issues (i.e. foronClick={this.submit}
the methodthis.submit
should be bound tothis
in the constructor)this
are necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);
ifthis.submit
is never passed to a component event handler likeonClick
)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG)
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)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
Web
Screen.Recording.2023-06-09.at.22.49.23.-.web.mov
Mobile Web - Chrome
N/A
Mobile Web - Safari
N/A
Desktop
Screen.Recording.2023-06-09.at.18.41.15.-.desktop.mov
iOS
N/A
Android
N/A