-
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
Fix header/lhn for threads #18880
Fix header/lhn for threads #18880
Conversation
@@ -45,7 +45,7 @@ const defaultProps = { | |||
|
|||
const AvatarWithDisplayName = (props) => { | |||
const title = ReportUtils.getDisplayNameForParticipant(props.report.ownerEmail, true); | |||
const subtitle = ReportUtils.getChatRoomSubtitle(props.report, props.policies); |
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 second param wasn't doing anything because the method only had one parameter. Now that I added a second, this could cause problems, so I removed it
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 added another parameter to the method, and this call of the method was already sending a second parameter but it wasn't doing anything. I had to remove it because otherwise the code would think the props.policies
is a parentReport when it isn't
@rushatgabhane @jasperhuangg 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] |
@@ -75,9 +75,9 @@ const HeaderView = (props) => { | |||
const isChatRoom = ReportUtils.isChatRoom(props.report); | |||
const isPolicyExpenseChat = ReportUtils.isPolicyExpenseChat(props.report); | |||
const isTaskReport = ReportUtils.isTaskReport(props.report); | |||
const reportHeaderData = isTaskReport && !_.isEmpty(props.parentReport) && (!isThread || isTaskReport) ? props.parentReport : props.report; | |||
const reportHeaderData = (isTaskReport || !isThread) && !_.isEmpty(props.parentReport) ? props.parentReport : props.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.
@stitesExpensify bug: header data is empty for all workspace rooms
steps:
- Click +
- Create a new workspace room
OR
- Go to any existing workspace room
- Notice that there is no room avatar and room name
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.
good find, looking now
if (isThread(report)) { | ||
if (!getChatType(report)) { | ||
return ''; | ||
} | ||
|
||
// If thread is not from a DM or group chat, the subtitle will follow the pattern 'Workspace Name • #roomName' | ||
const workspaceName = getPolicyName(report); | ||
const roomName = isChatRoom(report) ? lodashGet(report, 'displayName') : ''; | ||
let roomName = ''; |
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.
we also have some uncommited prettier changes
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 seeing these?
@rushatgabhane are there console logs? I'm not seeing that error |
@stitesExpensify there are no related console errors I can consistently repro the bug
Screen.Recording.2023-05-16.at.02.26.52.mov |
Is your app connected to production or staging API endpoint. Because the issue you mentioned sounds like a bug that's addressed on staging but not on production. Also we've had some auth reverts so i don't know how well this would work on staging either. Tthe PR seems to work well for me on dev. |
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.
Code LGTM, and works well on dev.
This comment was marked as resolved.
This comment was marked as resolved.
It works well on staging API!! |
@stitesExpensify @chiragsalian sorry, let me know if you can help me get access to an account that's on the threads beta (or get In any case, everything looks good to me! |
@stitesExpensify because my account isn't on the beta, I thought I could test it all offline. But there is no subtitle and room name in the header while offline. I'm guessing offline support isn't of a priority yet |
Correct, offline is not required at this time due to the urgency of the project |
Reviewer Checklist
Screenshots/VideosWebMobile Web - ChromeMobile Web - SafariDesktopiOSAndroid |
Ah yes, we should remember to add reviewers to the threads beta. In the interest of time since there are no code concerns I'll be moving ahead and merging this. The testing of threads is not very stable on staging so i wouldn't want to add anyone to the beta just yet. |
🚀 Deployed to staging by https://github.com/chiragsalian in version: 1.3.15-0 🚀
|
Hi! @stitesExpensify this PR is a pass in workspace #rooms but a fail in workspace individual chats. Not sure if this is known atm. Let us know if we should raise an issue for this. |
🚀 Deployed to production by https://github.com/yuwenmemon in version: 1.3.15-12 🚀
|
Details
We were showing the name of the current report in the lhn/header:
We wanted to show the name of the parent report:
Fixed Issues
$ #18863
PROPOSAL:n/a
Tests
Offline tests
n/a
QA Steps
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
Mobile Web - Chrome
Mobile Web - Safari
Desktop
iOS
Android