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

Create IOU participant selection step. #1738

Merged
merged 6 commits into from
Mar 17, 2021

Conversation

barun1997
Copy link
Contributor

@barun1997 barun1997 commented Mar 12, 2021

Fixes: #1694

<If necessary, assign reviewers that know the area or changes well. Feel free to tag any additional reviewers you see fit.>

Details

  • Added request page for requesting funds from users.
  • Added split page for splitting bill amount.
  • Managed steps for the communication.

Tests

  • Performed UI tests on each of the platforms.
  • The search works well on each.
  • On selecting the options the logic for Next button to appear or the request amount page is well rendered.

Tested On

  • Web
  • Mobile Web
  • Desktop
  • iOS
  • Android

Screenshots

Web

Screen Shot 2021-03-12 at 8 25 23 AM

Screen Shot 2021-03-12 at 8 38 36 AM

Screen Shot 2021-03-12 at 8 39 21 AM

Screen Shot 2021-03-12 at 8 39 28 AM

Screen Shot 2021-03-12 at 8 40 18 AM

Mobile Web

Screen Shot 2021-03-12 at 9 04 20 AM

Screen Shot 2021-03-12 at 9 04 28 AM

Screen Shot 2021-03-12 at 9 04 41 AM

Desktop

Screen Shot 2021-03-12 at 8 59 26 AM

Screen Shot 2021-03-12 at 8 59 50 AM

Screen Shot 2021-03-12 at 9 00 54 AM

Screen Shot 2021-03-12 at 9 01 00 AM

Screen Shot 2021-03-12 at 9 01 21 AM

iOS

Simulator Screen Shot - iPhone 11 - 2021-03-12 at 08 54 16
Simulator Screen Shot - iPhone 11 - 2021-03-12 at 08 54 37
Simulator Screen Shot - iPhone 11 - 2021-03-12 at 08 54 50
Simulator Screen Shot - iPhone 11 - 2021-03-12 at 08 56 19
Simulator Screen Shot - iPhone 11 - 2021-03-12 at 08 56 39

Android

Screenshot_1615520007 copy
Screenshot_1615520007
Screenshot_1615520036 copy
Screenshot_1615520041 copy

@barun1997 barun1997 requested a review from a team as a code owner March 12, 2021 03:49
@github-actions
Copy link
Contributor

github-actions bot commented Mar 12, 2021

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

@botify botify requested review from bondydaa and removed request for a team March 12, 2021 03:50
@barun1997
Copy link
Contributor Author

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

@barun1997
Copy link
Contributor Author

recheck

@barun1997 barun1997 changed the title Create IOU particiapnt selection step. Create IOU participant selection step. Mar 12, 2021
return (
<View style={[styles.flex1, styles.w100]}>
<Text style={[styles.headerText, styles.pt3, styles.ph5]}>
TO
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's just make this To for now and use the style styles.formLabel

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thank you! will implement the change

@Julesssss
Copy link
Contributor

Hey @barun1997, thanks for the submission! Unfortunately I completely missed this today, but look forward to reviewing first thing Monday.

Copy link
Contributor

@AndrewGable AndrewGable left a comment

Choose a reason for hiding this comment

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

Just on my initial read, here are some style changes I'd recommend

Copy link
Contributor

@roryabraham roryabraham left a comment

Choose a reason for hiding this comment

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

Didn't get all the way through this, but had just a few comments.

src/pages/iou/IOUModal.js Outdated Show resolved Hide resolved
src/pages/iou/IOUModal.js Outdated Show resolved Hide resolved
src/pages/iou/IOUModal.js Outdated Show resolved Hide resolved
src/pages/iou/IOUModal.js Outdated Show resolved Hide resolved
personalDetails: PropTypes.objectOf(personalDetailsPropTypes).isRequired,

// All reports shared with the user
reports: PropTypes.shape({
Copy link
Contributor

Choose a reason for hiding this comment

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

Should this be PropTypes.arrayOf(PropTypes.shape({...})) ?

Copy link
Contributor Author

@barun1997 barun1997 Mar 16, 2021

Choose a reason for hiding this comment

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

@roryabraham The prop (props.reports), in this case, is an object with the given shape. The getNewGroupOptions function maps it into an array.

@barun1997
Copy link
Contributor Author

Thank you @roryabraham for the comments. I will look into it and resolve the issues.

@barun1997
Copy link
Contributor Author

recheck

@barun1997
Copy link
Contributor Author

Hey @Julesssss, before the weekend, the file /libs/actions/Sidebar was in place, but looks like it was removed, should I implement the requirement on my own, or is there an alternative that we prefer over those functions?
That is the reason the tests are failing!

@roryabraham
Copy link
Contributor

cc @marcaaron I think this might be related to the react-navigation switch?

Copy link
Contributor

@Julesssss Julesssss left a comment

Choose a reason for hiding this comment

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

Looking good!

The only other change I'd like suggest is that we keep the isLoading logic. The idea is that we'll reuse the IOU {loading} Onyx key for each page. Setting it to true via an Onyx Action. Please let me know if you have any questions or concerns about this.

@barun1997 barun1997 force-pushed the feature/participants-select branch from 8905fe2 to 0edbd6c Compare March 16, 2021 06:58
@barun1997
Copy link
Contributor Author

@Julesssss I re-implemented the loading logic. Please kindly take a look into it, and let me know if you have any suggestions.

Copy link
Contributor

@Julesssss Julesssss left a comment

Choose a reason for hiding this comment

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

Thanks for addressing the feedback, I think there are a few more comments to work through.

As a final change, would it be possible to pass the participants back to IOUModal every time the selection changes, rather than on the button press? Then pass them back down to IOUParticipantsRequest|IOUParticipantsSplit via a participants prop. This would allow us to remember the selection if the user navigates back to the amount page from the participants selection.

Sorry for not making this clear in the initial issue!

@barun1997
Copy link
Contributor Author

@Julesssss Sure, no worries! I will implement the change first thing tomorrow.

@barun1997
Copy link
Contributor Author

barun1997 commented Mar 17, 2021

As a final change, would it be possible to pass the participants back to IOUModal every time the selection changes, rather than on the button press? Then pass them back down to IOUParticipantsRequest|IOUParticipantsSplit via a participants prop. This would allow us to remember the selection if the user navigates back to the amount page from the participants selection.

Hi @Julesssss, I implemented the change as you requested. But I am a bit not sure how the UI for IOUParticipantsRequest will look in this case. For instance, when the user selects a participant, the current implementation navigates them immediately to the confirmation screen. If they navigate back to IOUParticipantsRequest, should we show a tick mark beside the previously selected participant? Or allow them to select a new participant (while holding the current participant state in IOUModal)?

If we don't have to show a tick mark beside the selected participant, in that case, perhaps it's not necessary to pass the participants prop onto IOUParticipantsRequest. We could only send a callback prop to add a participant to the state in IOUModal when an option is selected.

@barun1997 barun1997 force-pushed the feature/participants-select branch from 0edbd6c to b27309a Compare March 17, 2021 05:46
@Julesssss
Copy link
Contributor

If they navigate back to IOUParticipantsRequest, should we show a tick mark beside the previously selected participant? Or allow them to select a new participant (while holding the current participant state in IOUModal)?

If we don't have to show a tick mark beside the selected participant, in that case, perhaps it's not necessary to pass the participants prop onto IOUParticipantsRequest. We could only send a callback prop to add a participant to the state in IOUModal when an option is selected.

Good point, I agree that we should not pass the prop into IOUParticipantsRequest, but only for IOUParticipantsSplit.

Copy link
Contributor

@Julesssss Julesssss left a comment

Choose a reason for hiding this comment

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

The rest of the PR looks good to me. Happy to approve once you remove the prop from IOUParticipantsRequest and add the missing comment.

@Julesssss
Copy link
Contributor

@roryabraham there are some responses to your original comments, would you mind reviewing them?

@barun1997 barun1997 force-pushed the feature/participants-select branch from e3e5087 to f085f11 Compare March 17, 2021 12:39
@Julesssss Julesssss dismissed AndrewGable’s stale review March 17, 2021 16:36

Changes have been made to address your comments

@Julesssss Julesssss merged commit 6c556f0 into Expensify:master Mar 17, 2021
@github-actions github-actions bot locked and limited conversation to collaborators Mar 17, 2021
@AndrewGable
Copy link
Contributor

Looks great! 👍


if (this.state.userToInvite) {
sections.push(({
undefined,
Copy link
Contributor

Choose a reason for hiding this comment

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

What's this doing here? :D

Copy link
Contributor

Choose a reason for hiding this comment

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

:ohnothing:

Copy link
Contributor

Choose a reason for hiding this comment

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

Perhaps this was how we were hiding the title back then?

Copy link
Contributor

Choose a reason for hiding this comment

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

Perhaps? Idk why we'd want a property undefined set to undefined though 😅

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

Successfully merging this pull request may close these issues.

[Chat] [IOU] Create IOU Participant selection step
7 participants