-
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
Adjust IOUPreview height based on description availability #18774
Adjust IOUPreview height based on description availability #18774
Conversation
@Julesssss @aimane-chnaif 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] |
@@ -143,6 +143,7 @@ const IOUPreview = (props) => { | |||
const sessionEmail = lodashGet(props.session, 'email', null); | |||
const managerEmail = props.iouReport.managerEmail || ''; | |||
const ownerEmail = props.iouReport.ownerEmail || ''; | |||
const requestDescription = Str.htmlDecode(lodashGet(props.action, 'originalMessage.comment', '')); |
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.
const requestDescription = Str.htmlDecode(lodashGet(props.action, 'originalMessage.comment', '')); | |
const comment = Str.htmlDecode(lodashGet(props.action, 'originalMessage.comment', '')).trim(); |
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.
@@ -240,7 +241,7 @@ const IOUPreview = (props) => { | |||
<Text style={[styles.textLabel, styles.colorMuted]}>{props.translate('iou.pendingConversionMessage')}</Text> | |||
)} | |||
|
|||
<Text style={[styles.colorMuted]}>{Str.htmlDecode(lodashGet(props.action, 'originalMessage.comment', ''))}</Text> | |||
{requestDescription ? <Text style={[styles.colorMuted]}>{requestDescription}</Text> : ''} |
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.
{requestDescription ? <Text style={[styles.colorMuted]}>{requestDescription}</Text> : ''} | |
{!_.isEmpty(comment) && <Text style={[styles.colorMuted]}>{comment}</Text>} |
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.
@@ -240,7 +241,7 @@ const IOUPreview = (props) => { | |||
<Text style={[styles.textLabel, styles.colorMuted]}>{props.translate('iou.pendingConversionMessage')}</Text> | |||
)} | |||
|
|||
<Text style={[styles.colorMuted]}>{Str.htmlDecode(lodashGet(props.action, 'originalMessage.comment', ''))}</Text> | |||
{_.isEmpty(comment) ? <Text style={[styles.colorMuted]}>{comment}</Text> : ''} |
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 ''
? it should be null
. also condition is wrong
This was my suggestion:
{_.isEmpty(comment) ? <Text style={[styles.colorMuted]}>{comment}</Text> : ''} | |
{!_.isEmpty(comment) && <Text style={[styles.colorMuted]}>{comment}</Text>} |
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.
Apologies, this is fixed now
@@ -143,6 +143,7 @@ const IOUPreview = (props) => { | |||
const sessionEmail = lodashGet(props.session, 'email', null); | |||
const managerEmail = props.iouReport.managerEmail || ''; | |||
const ownerEmail = props.iouReport.ownerEmail || ''; | |||
const comment = Str.htmlDecode(lodashGet(props.action, 'originalMessage.comment', '')); |
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.
trim value:
const comment = Str.htmlDecode(lodashGet(props.action, 'originalMessage.comment', '')); | |
const comment = Str.htmlDecode(lodashGet(props.action, 'originalMessage.comment', '')).trim(); |
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.
Looking good! Would you mind just adding another test?
Test Bill Split
- Create a Bill Split with 3+ users
- An IOUPreview should display within the group chat
- // Same as the other test, no space should appear
Let's give @shawnborton an opp to review this as well. |
@Julesssss sure, will add those tests as well |
Looks good to me. Where are we addressing the other IOU preview card changes, like getting rid of the avatars and adding a right caret in the top right? |
Actually, good point. That was done here. Why does the OP tests have avatars still? 🤔 |
Good point Tom. @huzaifa-99 is this PR branching from the latest |
@Julesssss its actually a little before the last 8 hours. I probably forgot to pull. Adding fresh tests... Apologies guys. |
No worries, thank you! |
Was testing with main and Splitting bill creates an empty chat like this (an unrelated bug). Should I ignore this in the tests? @Julesssss |
This happens on main so out of scope.. I reported here - https://expensify.slack.com/archives/C049HHMV9SM/p1683816514449429 |
Thank you @aimane-chnaif. Will ignore the bug in tests |
Please raise that bug in expensify-bugs to claim the bug bounty. Agree it's a separate issue. |
Thank you @Julesssss. I just tried with latest HEAD and this issue is not there anymore |
@huzaifa-99 please merge |
@aimane-chnaif done! |
Reviewer Checklist
Screenshots/Videos |
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.
@Julesssss LGTM 🎉
@huzaifa-99 could you fix the conflicts please? |
@trjExpensify Thanks for the ping. Fixed merge conflicts! |
@@ -282,4 +283,4 @@ export default compose( | |||
key: ONYXKEYS.WALLET_TERMS, | |||
}, | |||
}), | |||
)(IOUPreview); | |||
)(IOUPreview); |
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.
@huzaifa-99 can you add an empty line at the end of the file please?
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.
@luacmartins Thanks for pointing out. Fixed
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.
Thank you @huzaifa-99
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
Pleasure to contribute guys. Thank you all! |
Thank you! @huzaifa-99 Hope to see many more PRs from you 🚀 |
Thanks @mountiny. I plan to contribute more, already have proposals underway. |
🚀 Deployed to staging by https://github.com/luacmartins in version: 1.3.14-0 🚀
|
🚀 Deployed to production by https://github.com/yuwenmemon in version: 1.3.14-14 🚀
|
Details
Fixed Issues
$ #18770
PROPOSAL: #18770 (comment)
Tests
Offline tests
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
Safari
1-1 Chat
3+ user chat
Chrome
1-1 Chat
3+ user chat
Mobile Web - Chrome
1-1 Chat
3+ User chat
Mobile Web - Safari
1-1 Chat
3+ User chat
Desktop
1-1 Chat
3+ User chat
iOS
1-1 Chat
3+ User chat
Android
1-1 Chat
3+ User chat