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

Refactor IOUAmountPage #2203

Merged
merged 18 commits into from
Apr 14, 2021
Merged

Refactor IOUAmountPage #2203

merged 18 commits into from
Apr 14, 2021

Conversation

tugbadogan
Copy link
Contributor

@tugbadogan tugbadogan commented Apr 1, 2021

@trjExpensify @Julesssss @tgolen

Details

Fixed Issues

Fixes #1691

Tests

Manually tested on all platforms.

QA Steps

  • Go to the following URL: http://localhost:8080/iou/split
  • Make sure you can write only decimal number(unlimited digits and up to 3 decimal numbers) to input field.
  • Make sure chat compose input is working as usual.

Tested On

  • Web
  • Mobile Web
  • Desktop
  • iOS
  • Android

Screenshots

Web

Screen.Recording.2021-04-01.at.17.46.06.mov

Android

Screen.Recording.2021-04-01.at.17.44.41.mov

@tugbadogan tugbadogan requested a review from a team as a code owner April 1, 2021 20:33
@MelvinBot MelvinBot requested review from ctkochan22 and removed request for a team April 1, 2021 20:33
src/components/TextInputAutoGrow.js Outdated Show resolved Hide resolved
src/components/TextInputAutoGrow.js Outdated Show resolved Hide resolved
src/components/TextInputAutoGrow.js Outdated Show resolved Hide resolved
src/components/TextInputAutoGrow.js Outdated Show resolved Hide resolved
src/components/TextInputAutoGrow.js Outdated Show resolved Hide resolved
src/pages/iou/steps/IOUAmountPage.js Outdated Show resolved Hide resolved
src/pages/iou/steps/IOUAmountPage.js Show resolved Hide resolved
src/pages/iou/steps/IOUAmountPage.js Outdated Show resolved Hide resolved
src/pages/iou/steps/IOUAmountPage.js Outdated Show resolved Hide resolved
src/styles/styles.js Outdated Show resolved Hide resolved
tugbadogan and others added 3 commits April 2, 2021 13:40
This change makes input entry smoother by preventing TextInput to update its own value
@shawnborton
Copy link
Contributor

Couple of design comments:

  • It looks like the IOU amount is in black, but it should be in themeColors.heading
  • It looks like the background color for the number pad buttons is missing. They should just use our default button styles.

Copy link
Contributor

@tgolen tgolen left a comment

Choose a reason for hiding this comment

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

Looks like there are some conflicts

src/components/TextInputAutoGrow.js Outdated Show resolved Hide resolved
src/components/TextInputFocusable/index.js Outdated Show resolved Hide resolved
src/pages/iou/steps/IOUAmountPage.js Outdated Show resolved Hide resolved
src/pages/iou/steps/IOUAmountPage.js Outdated Show resolved Hide resolved
Comment on lines 1427 to 1433
function getHiddenElementOutsideOfWindow(windowWidth) {
return {
position: 'absolute',
opacity: 0,
left: windowWidth,
};
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Are there any alternatives to 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.

I wanted to move this hidden element out of the screen so it doesn't block any visible component. Maybe we can try using z-index and move this component background.

Copy link
Contributor

Choose a reason for hiding this comment

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

I'd be interested in seeing if a negative z-index gives us a slightly simpler solution, but I don't think it should block the PR.

Copy link
Contributor

Choose a reason for hiding this comment

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

there is also transform: translateX() as an option

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 used transform solution to hide the element like this:

hiddenElementOutsideOfWindow: {
        position: 'fixed',
        top: 0,
        left: 0,
        opacity: 0,
        transform: 'translateX(-100%)',
    }, 

@tugbadogan
Copy link
Contributor Author

@shawnborton

Couple of design comments:

  • It looks like the IOU amount is in black, but it should be in themeColors.heading

I updated IOU Amount color.

  • It looks like the background color for the number pad buttons is missing. They should just use our default button styles.

I'm already using styles.button style for number pad buttons. Am I missing something here? They look like design screenshots in the issue.

https://github.com/Expensify/Expensify.cash/blob/d3f1d28478357e2a66b155e660def191d6ed79a8/src/components/BigNumberPad.js#L49-L53

@shawnborton
Copy link
Contributor

From the video you posted, it looks like the buttons do not have a background color:
image

But perhaps that's just the video not showing all of the colors.

@tgolen
Copy link
Contributor

tgolen commented Apr 12, 2021

Can you please fix the conflicts before I take another look at this?

@tugbadogan
Copy link
Contributor Author

Can you please fix the conflicts before I take another look at this?

@tgolen
I resolved the conflicts. Can you review again?

tgolen
tgolen previously approved these changes Apr 13, 2021
Julesssss
Julesssss previously approved these changes Apr 13, 2021
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.

Mostly looks good. Only have some small comments about naming conventions.

src/components/TextInputAutoGrow.js Outdated Show resolved Hide resolved
src/components/TextInputAutoGrow.js Outdated Show resolved Hide resolved
src/pages/iou/steps/IOUAmountPage.js Outdated Show resolved Hide resolved
@tugbadogan tugbadogan dismissed stale reviews from Julesssss and tgolen via a8e4b14 April 14, 2021 13:53
@tugbadogan
Copy link
Contributor Author

@tgolen I updated the PR. Can you review again?

@marcaaron marcaaron merged commit 4f9da28 into Expensify:master Apr 14, 2021
@marcaaron
Copy link
Contributor

I believe this PR may have caused a regression related to many text inputs.
In some cases, they become completely unresponsive... cc @stitesExpensify

@marcaaron
Copy link
Contributor

The problem is that if we have no value or defaultValue passed then it will pass a prop of value: "" to a TextInput

@tugbadogan
Copy link
Contributor Author

Thanks for the flag @marcaaron , creating a PR now.

@tugbadogan tugbadogan deleted the tugbadogan-refactor-iou-amount-page branch April 14, 2021 18:38
@isagoico
Copy link

I don't think we're able to QA this PR since it requires changing some code. Can you guys assign someone to QA and let me know once it's done so we can check it off the list? Thanks in advance. CC @marcaaron @tgolen @Julesssss @ctkochan22

@marcaaron
Copy link
Contributor

@isagoico Seems testable by using a deep link or entering url in web? Which code changes are you referring to?

@isagoico
Copy link

isagoico commented Apr 14, 2021

Oh idk why I thought there was a code change needed here 🤦 my apologies.

Go to the following URL: http://localhost:8080/iou/split

Can you share the deeplink or URL that we can use to test this?

@marcaaron
Copy link
Contributor

marcaaron commented Apr 14, 2021

I believe https://staging.expensify.cash/iou/split should work.

@isagoico
Copy link

I think that worked.
image

Should we test this only on web and mWeb? Not sure if we're able to navigate to that URL or feature in the apps (android, iOS, dekstop)

@marcaaron
Copy link
Contributor

It should work on all platforms except desktop I think?

@isagoico
Copy link

isagoico commented Apr 14, 2021

Do you have steps on how can we reach this "Split bill" page on android and iOS apps? Ignore me :) I figured it out with the comment in the other PR. Thanks!

@isagoico
Copy link

Split - Able to enter more than 8 decimals and LHN/conversation area is blank

Expected Result

Make sure you can write only decimal number(max 6 digit and 2 decimal) to input field.

Actual Result

Able to enter 3 decimal inputs

Action performed

  1. Launch the url and login
  2. Add iou/split to the URL
  3. Input decimal in the field

Platform

Issue is confirmed in:

Android ✔️
Web ✔️

Build version: 1.0.21-0

Notes/Images/Video
image

@marcaaron
Copy link
Contributor

I think this test step is out of date and needed to be updated.

@tugbadogan
Copy link
Contributor Author

Sorry, I forgot to update the test plan. Fixed it now.

@OSBotify
Copy link
Contributor

🚀 [Deployed](https://github.com/Expensify/Expensify.cash
/actions/runs/765130740) 🚀 to
staging on Mon Apr 19 2021 at 22:41:56 GMT+0000 (Coordinated Universal Time)

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

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.

[Chat] [IOU] Create IOU Amount step
7 participants