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

Make AddPaymentMenu dynamic #7385

Closed
kevinksullivan opened this issue Jan 25, 2022 · 34 comments
Closed

Make AddPaymentMenu dynamic #7385

kevinksullivan opened this issue Jan 25, 2022 · 34 comments
Assignees
Labels
Engineering External Added to denote the issue can be worked on by a contributor Monthly KSv2 Reviewing Has a PR in review

Comments

@kevinksullivan
Copy link
Contributor

kevinksullivan commented Jan 25, 2022

If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!


Action Performed:

  1. Login to NewDot on web
  2. Select profile > payments
  3. Select add payment method
  4. Change screen width

Expected Result:

The payment method dropdown should show move along with the rest of the screen

Actual Result:

The payment method dropdown is in a fixed position on the screen.

Platform:

Web

Reproducible in staging?: Yes
Reproducible in production?: Tes

Notes/Photos/Videos:

http://g.recordit.co/PSG52y2iA6.gif

image

Expensify/Expensify Issue URL: https://github.com/Expensify/Expensify/issues/191203

View all open jobs on GitHub

@kevinksullivan kevinksullivan added AutoAssignerTriage Auto assign issues for triage to an available triage team member Daily KSv2 labels Jan 25, 2022
@MelvinBot
Copy link

Triggered auto assignment to @alexpensify (AutoAssignerTriage), see https://stackoverflow.com/c/expensify/questions/4749 for more details.

@MelvinBot MelvinBot removed the AutoAssignerTriage Auto assign issues for triage to an available triage team member label Jan 25, 2022
@alexpensify alexpensify added Engineering and removed Daily KSv2 labels Jan 25, 2022
@MelvinBot
Copy link

Triggered auto assignment to @MariaHCD (Engineering), see https://stackoverflow.com/c/expensify/questions/4319 for more details.

@alexpensify alexpensify removed their assignment Jan 25, 2022
@MariaHCD MariaHCD added the External Added to denote the issue can be worked on by a contributor label Jan 26, 2022
@MelvinBot
Copy link

Triggered auto assignment to @laurenreidexpensify (External), see https://stackoverflow.com/c/expensify/questions/8582 for more details.

@MelvinBot MelvinBot added the Daily KSv2 label Jan 26, 2022
@MariaHCD MariaHCD removed their assignment Jan 26, 2022
@parasharrajat
Copy link
Member

cc: @mateusbra

@mateusbra
Copy link
Contributor

mateusbra commented Jan 26, 2022

@parasharrajat working on that, I'll try to post proposal soon thank you!

@laurenreidexpensify
Copy link
Contributor

@MelvinBot
Copy link

Triggered auto assignment to Contributor-plus team member for initial proposal review - @rushatgabhane (Exported)

@MelvinBot MelvinBot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Jan 27, 2022
@MelvinBot
Copy link

Triggered auto assignment to @deetergp (Exported), see https://stackoverflow.com/c/expensify/questions/7972 for more details.

@phivh
Copy link
Contributor

phivh commented Jan 28, 2022

Proposal
Local at src/pages/settings/Payments/PaymentsPage.js - line 104

  1. Add window event resize to re-calculate position of Add Payment Button
paymentMethodPressed(nativeEvent, accountType, account) {
        window.addEventListener('resize', () => {
            const resizePosition = getClickedElementLocation(nativeEvent);
            this.setState({
                shouldShowAddPaymentMenu: true,
                anchorPositionTop: resizePosition.bottom,

                // We want the position to be 13px to the right of the left border
                anchorPositionLeft: resizePosition.left + 13,
            });
        });
}
  1. Remove event when method list close

  2. The issue also affects to Transfer Balance of Payment page, so i will apply this solution to it as well if the proposal acceptable.

Demo:

2022-01-28_17-38-58.mp4

@rushatgabhane
Copy link
Member

rushatgabhane commented Jan 29, 2022

@phivh thanks for your proposal, but can you help me test this out as I'm getting an error on Chrome.

let resizePosition = getClickedElementLocation(nativeEvent);

window.addEventListener('resize', () => {
    resizePosition = getClickedElementLocation(nativeEvent); // error here
});

error: Cannot read properties of null (reading 'getBoundingClientRect') at getClickedElementLocation

@phivh
Copy link
Contributor

phivh commented Jan 29, 2022

@rushatgabhane not sure why you got this. The event should call right after the button click action then it will assign nativeEvent element right after that. It should not null. You can check the video attached.

2022-01-29_10-29-11.mp4

Maybe we need to remove listener event after closing the modal as the second point on my proposal.

/**
     * Hide the add payment modal
     */
    hideAddPaymentMenu() {
        window.removeEventListener('resize', null); <===== Add this 
        this.setState({shouldShowAddPaymentMenu: false});
    }

@rushatgabhane
Copy link
Member

@phivh Really appreciate it! I followed the steps, but the menu isn't dynamic :(

Here is my diff - https://github.com/rushatgabhane/Expensify-App/commit/3f4c1e946edad6c8b14ffc088e4af32ef93f9293 please let me know what I'm doing wrong :)

@deetergp
Copy link
Contributor

Thanks @rushatgabhane, @phivh's proposal looks good to me as well.

@phivh
Copy link
Contributor

phivh commented Feb 1, 2022

Thanks you both. I will submit the PR soon.

@laurenreidexpensify
Copy link
Contributor

@phivh can you apply to the post in Upwork so I can hire you? Thanks! (https://www.upwork.com/ab/applicants/1486714447462305792/job-details)

@MelvinBot MelvinBot removed the Help Wanted Apply this label when an issue is open to proposals by contributors label Feb 1, 2022
@MelvinBot
Copy link

📣 @phivh You have been assigned to this job by @laurenreidexpensify!
Please apply to this job in Upwork and leave a comment on the Github issue letting us know when we can expect a PR to be ready for review 🧑‍💻
Keep in mind: Code of Conduct | Contributing 📖

@phivh
Copy link
Contributor

phivh commented Feb 1, 2022

@laurenreidexpensify applied for the job on Upwork. (https://www.upwork.com/jobs/~014fa34661ee0b416d)
The PR will be submitted before 02/05.

@phivh
Copy link
Contributor

phivh commented Feb 3, 2022

Hi @deetergp @rushatgabhane I'm going to submit the PR, just want to make sure if we are able to wrap the condition by using Platform below instead of creating a new .native. file.

if(Platform.OS === 'web') {
    window.addEventListener('resize', () => {
        ....
    });
}

@rushatgabhane
Copy link
Member

@phivh let's create seperate files. That's the standard we follow https://github.com/Expensify/App#platform-specific-file-extensions

@phivh phivh mentioned this issue Feb 4, 2022
11 tasks
@phivh
Copy link
Contributor

phivh commented Feb 4, 2022

Hi @rushatgabhane @deetergp The PR just submitted.

Hi @laurenreidexpensify , I applied for the Upwork job. Could you please re-check if there is something wrong?

@phivh
Copy link
Contributor

phivh commented Feb 9, 2022

@deetergp @laurenreidexpensify The PR nearly merge. I'm still have not got hired on Upwork. Could you please check?

Job applied: https://www.upwork.com/jobs/~014fa34661ee0b416d

@ghost
Copy link

ghost commented Feb 9, 2022

I do not know. I didn't get any news from Upwork.

@laurenreidexpensify
Copy link
Contributor

@phivh all sorted 👍🏽 hired in upwork

@deetergp
Copy link
Contributor

Not overdue, code review is ongoing. Should have added the label to ward off @MelvinBot's passive aggression.

@MelvinBot MelvinBot removed the Overdue label Feb 17, 2022
@deetergp deetergp added the Reviewing Has a PR in review label Feb 17, 2022
@phivh phivh mentioned this issue Feb 20, 2022
11 tasks
@MelvinBot MelvinBot removed the Weekly KSv2 label Mar 14, 2022
@MelvinBot
Copy link

This issue has not been updated in over 15 days. @deetergp, @phivh, @rushatgabhane, @laurenreidexpensify eroding to Monthly issue.

P.S. Is everyone reading this sure this is really a near-term priority? Be brave: if you disagree, go ahead and close it out. If someone disagrees, they'll reopen it, and if they don't: one less thing to do!

@MelvinBot MelvinBot added the Monthly KSv2 label Mar 14, 2022
@rushatgabhane
Copy link
Member

PR in staging

@phivh
Copy link
Contributor

phivh commented Mar 23, 2022

@laurenreidexpensify do we need to wait for regression on this? it seems deployed to production 8 days.
#7847 (comment)

@phivh
Copy link
Contributor

phivh commented Mar 28, 2022

@deetergp @laurenreidexpensify is there anything we need to wait for the payment? It seems we missing around 13 days for this task.

@rushatgabhane
Copy link
Member

@laurenreidexpensify bump ^^ #7385 (comment)

@laurenreidexpensify
Copy link
Contributor

oh weird some of the automation didn'tn take effect on this so I missed it. Looking into it now.

@laurenreidexpensify
Copy link
Contributor

Sorry @rushatgabhane @phivh something went really wrong here in the automation alerts for our team. I've paid this now. Thanks for your patience!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Engineering External Added to denote the issue can be worked on by a contributor Monthly KSv2 Reviewing Has a PR in review
Projects
None yet
Development

No branches or pull requests