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

Add the Recents and Contacts headers to the single-user participants page used in the Request Money and New Chat flows #2818

Merged
merged 13 commits into from
May 24, 2021
Merged

Add the Recents and Contacts headers to the single-user participants page used in the Request Money and New Chat flows #2818

merged 13 commits into from
May 24, 2021

Conversation

kakajann
Copy link
Contributor

@kakajann kakajann commented May 12, 2021

Details

We are now consistently show the recents and contacts headers on the participant selector pages across all four of these flows: Request Money, Split Bill, New Chat and New Group.

Fixed Issues

Fixed #2760

Tests

  1. Click the + icon on the home screen to access the CreateMenu
  2. Select Request Money 3. Enter an amount and click next to access the single-user picker on the IOUParticipants page

OR

  1. Click the + icon on the home screen to access the CreateMenu
  2. Select New Chat to access the single-user picker on the Participants page

QA Steps

See above

Tested On

  • Web
  • Mobile Web
  • Desktop
  • iOS
  • Android

Screenshots

Web

Screen Shot 2021-05-13 at 4 59 02 PM

Mobile Web

Screen Shot 2021-05-13 at 5 11 34 PM

Desktop

Screen Shot 2021-05-13 at 5 11 49 PM

iOS

Screen Shot 2021-05-13 at 5 05 00 PM

Android

Screen Shot 2021-05-13 at 5 10 30 PM

…page used in the Request Money and New Chat flows
@kakajann kakajann requested a review from a team as a code owner May 12, 2021 14:43
@github-actions
Copy link
Contributor

github-actions bot commented May 12, 2021

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

@MelvinBot MelvinBot requested review from sketchydroide and removed request for a team May 12, 2021 14:43
Comment on lines 31 to 33
return _.contains(betas, CONST.BETAS.IOU) || canUseAllBetas();
// return _.contains(betas, CONST.BETAS.IOU) || canUseAllBetas();
return true;
}
Copy link
Contributor

@Julesssss Julesssss May 17, 2021

Choose a reason for hiding this comment

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

Please revert this

Copy link
Contributor Author

Choose a reason for hiding this comment

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

reverted

sections.push({
title: this.props.translate('iou.recents'),
data: this.state.recentReports,
shouldShow: this.state.recentReports.length > 0,
Copy link
Contributor

Choose a reason for hiding this comment

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

!_.isEmpty would be preferred here (example)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I just changed the code.

And I noticed that OptionsSelector ignores shouldShow condition but it requires it as prop.

Comment on lines 202 to 203
// We should expect maxmimum of 5 recent reports to be returned
// minus the currently logged in user and recent reports count
Copy link
Contributor

Choose a reason for hiding this comment

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

Not sure that this is correct.

We should expect maxmimum of 5 recent reports to be returned minus the currently logged in user and recent reports count

Copy link
Contributor

Choose a reason for hiding this comment

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

I think this is two different things, no?

  • Recent reports should have a max of 5
  • personalDetails --> all the personalDetails should be returned minus the currently logged in user and recent reports count

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I got inspired by getNewGroupOptions() test and I think this is correct

Copy link
Contributor

Choose a reason for hiding this comment

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

I think it was previously two different comments that have been merged into one?

Copy link
Contributor

Choose a reason for hiding this comment

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

The code is fine

Copy link
Contributor

Choose a reason for hiding this comment

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

What I meant here is that there should be two separate comments, but I think you have combined them into one.

// We should expect maxmimum of 5 recent reports to be returned --> this is referring to `recentReports`
// minus the currently logged in user and recent reports count --> why would the `recentReports` count be `X - 5 - logged in user`? 

I think it should say this:

// We should expect maxmimum of 5 recent reports to be returned
// We should expect all personalDetails to be returned, minus the currently logged in user and recent reports count

Does that make sense?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, I refactored the commenting

Comment on lines 224 to 226
expect(results.personalDetails.length).toBe(1);
expect(results.personalDetails[0].text).toBe('Spider-Man');
expect(results.recentReports.length).toBe(1);
expect(results.recentReports[0].text).toBe('Spider-Man');

Copy link
Contributor

Choose a reason for hiding this comment

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

We should test both instead of replacing the old personalDetails test

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Now I expect personalDetails to be empty

Copy link
Contributor

Choose a reason for hiding this comment

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

Now I expect personalDetails to be empty

Could we add that as a test case then?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, here it is.

Comment on lines 253 to 254
expect(results.personalDetails.length).toBe(_.size(PERSONAL_DETAILS_WITH_CONCIERGE) - 2);
expect(results.personalDetails.length).toBe(_.size(PERSONAL_DETAILS_WITH_CONCIERGE) - 2 - 5);
Copy link
Contributor

Choose a reason for hiding this comment

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

5 is used quite a lot, can we add a test that returns less than 5 recentReports?

Copy link
Contributor

Choose a reason for hiding this comment

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

@kakajann can you create a var for 5, something like let maxRecentReports = 5;

Copy link
Contributor Author

Choose a reason for hiding this comment

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

5 is used quite a lot, can we add a test that returns less than 5 recentReports?

In this line, we are testing recentReports that returns less than 5.

@kakajann can you create a var for 5, something like let maxRecentReports = 5;

Of course, I did add a file-level constant variable for maxRecentReports in my last push

@Julesssss
Copy link
Contributor

Hi @kakajann, some of the automated tests are failing. I'll take another look at the PR once these are passing.

@kakajann
Copy link
Contributor Author

Hi @kakajann, some of the automated tests are failing. I'll take another look at the PR once these are passing.

Hello. I fixed the issue that failing

@kakajann kakajann requested a review from Julesssss May 18, 2021 11:17
@Julesssss
Copy link
Contributor

@kakajann please resolve the final check by following this comment: #2818 (comment)

@kakajann
Copy link
Contributor Author

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

@Julesssss
Copy link
Contributor

@kakajann the CI checks are still failing

@kakajann
Copy link
Contributor Author

@kakajann the CI checks are still failing

Sorry, I don't wanna keep bothering you but I tested everything in local and found no issue.
To trigger checks again I pushed an empty commit. If this won't work I don't have an idea how to pass the checks.

Also, my another PR is somehow passes every checks.

@Julesssss
Copy link
Contributor

Looks like your last push resolved the checks somehow. there's just a few additional comments to resolve.

@@ -77,10 +80,17 @@ class NewChatPage extends Component {
getSections() {
const sections = [];

sections.push({
title: this.props.translate('iou.recents'),
Copy link
Contributor

Choose a reason for hiding this comment

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

Now that we're using this String for non-IOU pages, I think it should be refactored to a different group. Could you move the iou.contacts and iou.recents to common.contacts and common.recents please.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes I moved

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