-
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
[VIP-Travel] Create Trip Room Preview #38808
[VIP-Travel] Create Trip Room Preview #38808
Conversation
src/CONST.ts
Outdated
@@ -613,6 +614,7 @@ const CONST = { | |||
LIMIT: 50, | |||
// OldDot Actions render getMessage from Web-Expensify/lib/Report/Action PHP files via getMessageOfOldDotReportAction in ReportActionsUtils.ts | |||
TYPE: { | |||
ACTION_TRIPPREVIEW: 'ACTION_TRIPPREVIEW', |
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.
NAB
ACTION_TRIPPREVIEW: 'ACTION_TRIPPREVIEW', | |
ACTION_TRIP_PREVIEW: 'ACTION_TRIP_PREVIEW', |
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'll adjust it once the backend is ready to be sure that this value is correct
|
||
const dateInfo = DateUtils.getFormattedDateRange(new Date(basicTripInfo.startDate.iso8601), new Date(basicTripInfo.endDate.iso8601)); | ||
|
||
const getDisplayAmount = (): string => { |
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 would use useMemo
here.
// pendingAction={iouReport?.pendingFields?.preview} | ||
shouldDisableOpacity={!!(action.pendingAction ?? action.isOptimisticAction)} |
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.
Why the pendingAction
is commented out here?
onLongPress={(event) => showContextMenuForReport(event, contextMenuAnchor, chatReportID, action, checkIfContextMenuActive)} | ||
shouldUseHapticsOnLongPress | ||
style={[styles.flexRow, styles.justifyContentBetween, styles.reportPreviewBox, styles.cursorDefault]} | ||
role="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.
role="button" | |
role={CONST.ROLE.BUTTON} |
|
||
const reservations: Reservation[] = TripReservationUtils.getReservationsFromTripTransactions(tripTransactions); | ||
|
||
const dateInfo = DateUtils.getFormattedDateRange(new Date(basicTripInfo.startDate.iso8601), new Date(basicTripInfo.endDate.iso8601)); |
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 might be worth putting into useMemo
.
src/styles/index.ts
Outdated
tripDescriptionMargin: { | ||
marginBottom: 2, | ||
}, |
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.
Is this value valid? We usually have multiples of 4.
NAB: Do we need to create a new style with only one value? Shouldn't we just use styles.mb1
or something like 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.
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 think I would be fine using a gap of 4px since that technically adheres to the system better. And then this way we don't need to write a super specific style.
src/types/onyx/Transaction.ts
Outdated
@@ -209,6 +244,8 @@ type Transaction = OnyxCommon.OnyxValueWithOfflineFeedback< | |||
|
|||
/** Indicates transaction loading */ | |||
isLoading?: 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.
Missing comment
src/libs/DateUtils.ts
Outdated
} | ||
if (isSameMonth(date1, date2)) { | ||
// Dates in the same month and year, differ by days | ||
return `${format(date1, 'MMM d')} - ${format(date2, 'd')}`; |
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.
In designs, we don't have spaces between the days. We should confirm the other formats as well.
return `${format(date1, 'MMM d')} - ${format(date2, 'd')}`; | |
return `${format(date1, 'MMM d')}-${format(date2, 'd')}`; |
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.
Looks great! Think that we can remove the TODO-related code and then this is ready to go
src/libs/ReportActionsUtils.ts
Outdated
// @TODO: isTripRoomPreview condition has been added to make the TripRoomPreview component visible. | ||
// Remove it when the reportAction.message array is not empty for this type, then !isDeleted will be true. |
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 think that it should always be visible
Done :) |
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!
@WojtekBoman is it possible for our team to QA this? I noticed that section is not filled out |
|
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.
Changes LGTM
@shubham1206agra could you please take a quick look / retest since there's been commits since your final review |
@grgia You are good to merge here. |
✋ 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/grgia in version: 1.4.86-0 🚀
|
1 similar comment
🚀 Deployed to staging by https://github.com/grgia in version: 1.4.86-0 🚀
|
🚀 Deployed to staging by https://github.com/grgia in version: 1.4.86-0 🚀
|
@grgia The QA team is encountering issues with this PR. Should we log the issue for the error message? Recording.6251.mp4 |
@AndrewGable @stitesExpensify we tried with travel beta account and see the same issue we had in this PR Recording.1999.mp4 |
🚀 Deployed to production by https://github.com/AndrewGable in version: 9.0.0-9 🚀
|
Details
This PR introduces a new component
TripRoomPreview
. It's available for testing only for accounts with thespotnanaTravel
betaDesigns: https://www.figma.com/file/rOyUSHbLLyp64emz6WeoPW/Travel?type=design&node-id=154-14373&mode=design&t=xqcJ31MMIiDxsY0J-4
Fixed Issues
$ #37826
PROPOSAL: N/A
Tests
If some data is not loaded, please open the linked report first, this problem will be fixed on the backend side.
Offline tests
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 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-05-29.at.17.35.27.mov
Android: mWeb Chrome
Screen.Recording.2024-05-29.at.17.49.04.mov
iOS: Native
Screen.Recording.2024-05-29.at.17.58.26.mov
iOS: mWeb Safari
Screen.Recording.2024-05-29.at.18.03.22.mov
MacOS: Chrome / Safari
Screen.Recording.2024-05-29.at.17.36.32.mov
MacOS: Desktop
Screen.Recording.2024-05-29.at.17.29.22.mov