Skip to content
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

Viacheslav first names #2724

Merged
merged 6 commits into from
May 13, 2021
Merged

Conversation

Viacheslav80
Copy link
Contributor

@Viacheslav80 Viacheslav80 commented May 6, 2021

Details

show first names instead of fullNames in the Header for group, if has't firstName showed login

Fixed Issues

Fixes #2664

Tests

  1. Click the "+" button
  2. Click "new group"
  3. Start a group with multiple people
  4. Notice the way the group names are listed in the Header

QA Steps

Same as above

Tested

  • Web
  • Mobile Web
  • Desktop
  • iOS
  • Android

Screenshots

Web

web

Mobile Web

web

Desktop

desktop

iOS

Android

android android

@Viacheslav80 Viacheslav80 requested a review from a team as a code owner May 6, 2021 21:00
@github-actions
Copy link
Contributor

github-actions bot commented May 6, 2021

CLA Assistant Lite bot All contributors have signed the CLA ✍️ ✅

@MelvinBot MelvinBot requested review from pecanoro and removed request for a team May 6, 2021 21:01
@Viacheslav80
Copy link
Contributor Author

Viacheslav80 commented May 6, 2021

I have read the CLA Document and I hereby sign the CLA

@pecanoro
Copy link
Contributor

pecanoro commented May 7, 2021

@puneetlath Did we want to change the first names only in the chat title or also the left navigation menu under "Chats"?

@puneetlath
Copy link
Contributor

In both.

@Viacheslav80
Copy link
Contributor Author

Viacheslav80 commented May 10, 2021

ok. I'll do it in both cases

@Viacheslav80
Copy link
Contributor Author

Updated

@pecanoro
Copy link
Contributor

Awesome! Could you update the tests and the screenshots as well, please?

@Viacheslav80
Copy link
Contributor Author

Updated

@Viacheslav80
Copy link
Contributor Author

I fix bug empty displayName if empty firstName and lastName. if this happens we show login

@Viacheslav80
Copy link
Contributor Author

Updated

@pecanoro pecanoro merged commit 9b443c5 into Expensify:main May 13, 2021
@OSBotify
Copy link
Contributor

🚀 Deployed to staging in version: 1.0.43-2🚀

platform result
🤖 android 🤖 success ✅
🖥 desktop 🖥 success ✅
🍎 iOS 🍎 success ✅
🕸 web 🕸 success ✅

@OSBotify
Copy link
Contributor

🚀 Deployed to production in version: 1.0.44-0🚀

platform result
🤖 android 🤖 failure ❌
🖥 desktop 🖥 success ✅
🍎 iOS 🍎 success ✅
🕸 web 🕸 success ✅

@roryabraham
Copy link
Contributor

It looks like this PR most likely caused a regression

@@ -110,11 +110,14 @@ const OptionRow = ({
? hoverStyle.backgroundColor
: backgroundColor;
const focusedBackgroundColor = styles.sidebarLinkActive.backgroundColor;
const isMultipleParticipant = option.participantsList.length > 1;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line in particular caused a regression, because the option.participantsList may be undefined per the prop-types here

Copy link
Contributor Author

@Viacheslav80 Viacheslav80 May 18, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can i move part of the code from OptionRow in OptionsListUtils.js ?

98   const tooltipText = getReportParticipantsTitle(lodashGet(report, ['participants'], []));
+    const displayNamesWithTooltips = _.map(
       personalDetailList,
       ({displayname, firstname, login}) => (
           {displayname: (hasMultipleParticipants ? firstname : displayname) || login, tooltip: login}
       ),
     );
+    const fullTitle = displayNamesWithTooltips.map(({displayName}) => displayName).join(', ');
-    return {
       text: report ? report.reportName : personalDetail.displayName,
+    return {
       displayNamesWithTooltips,
       text: hasMultipleParticipants ? fullTitle : personalDetail.displayName,

Copy link
Contributor

@marcaaron marcaaron left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we left some opportunity to clean up this code on the table.

If we aren't going to use the reportName anymore then we should see if we can stop generating it here:

https://github.com/Expensify/Expensify.cash/blob/16a570fab5f9ba95dd96c6cc36c0b5e166416f03/src/libs/actions/Report.js#L123-L136

and we also do it here (no idea why we aren't reusing the logic):

https://github.com/Expensify/Expensify.cash/blob/16a570fab5f9ba95dd96c6cc36c0b5e166416f03/src/libs/actions/PersonalDetails.js#L184-L192

and we use it in the option it here (now unused it would seem - though I am not 100% sure):

https://github.com/Expensify/Expensify.cash/blob/16a570fab5f9ba95dd96c6cc36c0b5e166416f03/src/libs/OptionsListUtils.js#L101-L102

@Viacheslav80 is this something you can look into?

@@ -159,7 +162,7 @@ const OptionRow = ({
}
<View style={contentContainerStyles}>
<DisplayNames
fullTitle={option.text}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm is the option.text being used or not? Did we stop using it and then not remove it from the option object? I'm confused. This component is meant to be fairly generic so I'm not sure this is the correct place to implement the logic we've done.

Copy link
Contributor Author

@Viacheslav80 Viacheslav80 May 18, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can move part of the code from OptionRow in OptionsListUtils.js ?

98   const tooltipText = getReportParticipantsTitle(lodashGet(report, ['participants'], []));
+    const displayNamesWithTooltips = _.map(
       personalDetailList,
       ({displayname, firstname, login}) => (
           {displayname: (hasMultipleParticipants ? firstname : displayname) || login, tooltip: login}
       ),
     );
+    const fullTitle = displayNamesWithTooltips.map(({displayName}) => displayName).join(', ');
-    return {
       text: report ? report.reportName : personalDetail.displayName,
+    return {
       displayNamesWithTooltips,
       text: hasMultipleParticipants ? fullTitle : personalDetail.displayName,

);

const fullTitle = displayNamesWithTooltips.map(({displayName}) => displayName).join(', ');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not a big deal, but I think this should maybe be moved to OptionsListUtils and happen for option.text

@marcaaron
Copy link
Contributor

@puneetlath to clarify, did we also want this change to extend to Search? Maybe kind of edge case but it impairs chat filtering in cases like this:

Screen Shot 2021-05-17 at 5 13 25 PM

@Julesssss
Copy link
Contributor

Hi, I think this PR introduced this regression. Here's the line that throws an error.

@Julesssss
Copy link
Contributor

It looks like this PR has caused a separate regression: 'Name is not visible in the IOU request page'

@puneetlath
Copy link
Contributor

Hi @Viacheslav80. I just want to make sure that you saw the regressions that were caused by your PR. You'll need to address those in order for us to pay you out for this PR. Thanks!

@Viacheslav80
Copy link
Contributor Author

Viacheslav80 commented May 22, 2021

Hi @Viacheslav80. I just want to make sure that you saw the regressions that were caused by your PR. You'll need to address those in order for us to pay you out for this PR. Thanks!

Hi! PR with fix has already been created: #3027

@puneetlath
Copy link
Contributor

Ok great!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Only display First Name in the LHN chat row for Group DMs [Pay June 1st]
7 participants