-
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
Refactor/34411 lhn previews refactor #34872
Refactor/34411 lhn previews refactor #34872
Conversation
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.
@koko57 I think its looking good, great job!
src/libs/OptionsListUtils.js
Outdated
(lastReportActions[report.reportID] && lastReportActions[report.reportID].originalMessage && lastReportActions[report.reportID].originalMessage.reason) || | ||
CONST.REPORT.ARCHIVE_REASON.DEFAULT; | ||
lastMessageText = Localize.translate(preferredLocale, `reportArchiveReasons.${archiveReason}`, { | ||
displayName: archiveReason.displayName || PersonalDetailsUtils.getDisplayNameOrDefault(lastActorDetails), |
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 archiveReason.displayName
has been 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.
it should be a string, shouldn't be? Or I'm missing a case where it can be an object?
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.
Seems like you are right so it has been wrong 😄
src/libs/OptionsListUtils.js
Outdated
@@ -436,6 +451,15 @@ function getLastMessageTextForReport(report) { | |||
lastMessageTextFromReport = lodashGet(lastReportAction, 'message[0].text', ''); | |||
} else if (ReportActionUtils.isCreatedTaskReportAction(lastReportAction)) { | |||
lastMessageTextFromReport = TaskUtils.getTaskCreatedMessage(lastReportAction); | |||
} else if (ReportUtils.isArchivedRoom(report)) { | |||
const archiveReason = | |||
(lastReportActions[report.reportID] && lastReportActions[report.reportID].originalMessage && lastReportActions[report.reportID].originalMessage.reason) || |
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.
Should we also make sure the .reason is one of the 3 options?
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 mean one of these 3: CONST.REPORT.ARCHIVE_REASON.ACCOUNT_CLOSED
, CONST.REPORT.ARCHIVE_REASON.REMOVED_FROM_POLICY
, CONST.REPORT.ARCHIVE_REASON.POLICY_DELETED
? Like it was checked in SidebarUtils? Can we get another reason (apart from these ones)? Actually, now I see that we were not showing the MERGED
reason there - we would also need to pass the oldDisplayName
if so. Shou,d it be displayed or should we display DEFAULT
instead
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.
Lets focus on keeping the current behaviour in place. I think we can skip adding the merged consideration for now
@mountiny thanks! I will fill in the author's checklist shortly. I will also check what's wrong with the reassure tests, but I've noticed that this particular test is failing for other PRs as well |
@mountiny could you please take a look on these comments? 🙏🏻 |
@koko57 answered |
@eVoloshchak 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] |
ok, @mountiny so it's ready to review. It also includes the fix @trjExpensify mentioned #34411 (comment) |
This comment has been minimized.
This comment has been minimized.
@koko57 there seems to be some regression with archived workspace chat that had some requests in it On staging we correctly show that its archived, on the build you can see there is the owes message |
@mountiny ah yes, I didn't thought of that case - this logic for archived room was overwriting the last message no matter what the last action was. I will look into it if I can change the conditions (without breaking the other messages) and leave the logic in |
@mountiny fixed! I'm resolving now the conflicts after TS migration. I have one question: do we really need to check if last action was CLOSED like it was introduced here? |
@koko57 good question, there should be no other actions when it was archived. I think its safer to check for it though |
Reviewer Checklist
Screenshots/Videos |
An owner's email is displayed instead of "This workspace chat is no longer active.." until you open a report Screen.Recording.2024-01-26.at.19.23.49.movThis happens only on DEV, ad-hoc build works fine |
No i dont think that is the case |
@koko57 could you sync with main before I make another build |
@mountiny @eVoloshchak maybe if it will happen again I revert the changes for the archived rooms, leaving only the changes for displaying last actor's name and the fix for Workspace preview? |
🧪🧪 Use the links below to test this adhoc build on Android, iOS, Desktop, and Web. Happy testing! 🧪🧪
|
@eVoloshchak whats your ETA here? |
@koko57, this behavior is still present in https://34872.pr-testing.expensify.com/ Screen.Recording.2024-01-29.at.21.45.06.movIt doesn't work properly on https://new.expensify.com/ either, but instead of an email it displays "This chat room has been archived" Screen.Recording.2024-01-29.at.21.33.02.mov |
I believe the difference is that in the ad hoc build we rely on the CLOSED report action only whereas in production it seems to know the report state is closed and does not show the message. I believe we might not be loading the Closed report actions in OpenApp and that has been discussed in the past, we probably will not change anything about it. I think if the report is the in closed state/status, we should keep the same behaviour you can see in production |
@mountiny thanks for the hint! I was able to change the condition a little bit, so now we've got the same behaviour as in the production (We can think of fixing it later). Screen.Recording.2024-01-30.at.09.57.25.mov |
@eVoloshchak Can you please proceed with the checklist? Thanks! |
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!
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.
Thanks! getting better bit by bit
🚀 Cherry-picked to staging by https://github.com/francoisl in version: 1.4.33-5 🚀
@Expensify/applauseleads please QA this PR and check it off on the deploy checklist if it passes. |
🚀 Deployed to staging by https://github.com/mountiny in version: 1.4.34-0 🚀
|
🚀 Deployed to staging by https://github.com/mountiny in version: 1.4.34-0 🚀
|
🚀 Deployed to production by https://github.com/francoisl in version: 1.4.34-1 🚀
|
Details
PART OF THE REFACTOR: moved some logic to
getLastMessageTextForReport
, created a function to get last actor displayNameFixed Issues
$ #34411
PROPOSAL:
Tests
Archived Rooms
Last Actor Display Name
Offline tests
QA Steps
Archived Rooms
Last Actor Display Name
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
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)Design
label 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
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari
MacOS: Desktop