Expensify / App

Welcome to New Expensify: a complete re-imagination of financial collaboration, centered around chat. Help us build the next generation of Expensify by sharing feedback and contributing to the code.
https://new.expensify.com
MIT License
2.99k stars 2.5k forks source link

Feat: Invoice collection account selector page #41511

Closed hungvu193 closed 1 week ago

hungvu193 commented 2 weeks ago

Details

Fixed Issues

$ https://github.com/Expensify/App/issues/39752 PROPOSAL: N/A

Tests

Precondition: User connected to Xero and had bank accounts.

  1. Go to Workspace => Accounting => Advance => Xero Invoice Collections Account
  2. Click any bank account
  3. Verify that it's selected
  4. Verify It displays the correct bank account name under Xero Invoice Collections Account in Advance page.
    • [x] Verify that no errors appear in the JS console

Offline tests

Same as Tests.

QA Steps

Same as Tests.

PR Author Checklist

Screenshots/Videos

Android: Native https://github.com/Expensify/App/assets/16502320/79070bd8-59d0-4a93-a3fc-e6b9ee0a4d91
Android: mWeb Chrome Screenshot 2024-05-03 at 23 23 23
iOS: Native https://github.com/Expensify/App/assets/16502320/f66a1f6e-6ecf-488d-b9ee-73c5e995b681
iOS: mWeb Safari https://github.com/Expensify/App/assets/16502320/367f7e03-f0e0-4373-961a-a0988b25d297
MacOS: Chrome / Safari https://github.com/Expensify/App/assets/16502320/373ead5b-c49e-4505-a9af-cbbf84934b10
MacOS: Desktop https://github.com/Expensify/App/assets/16502320/742ecbc3-0d07-4a60-9ae7-9bac68ee1b6b
rushatgabhane commented 2 weeks ago

Hold can be lifted. PR merged

rushatgabhane commented 2 weeks ago

please merge latest main

hungvu193 commented 2 weeks ago

please merge latest main

Sure things. I'm finishing SelectionScreen before merging with main

melvin-bot[bot] commented 2 weeks ago

@rojiphil Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button]

hungvu193 commented 2 weeks ago

Will be ready for another review @rushatgabhane

rojiphil commented 2 weeks ago

Are there two C+ reviewers required here? If not, please remove me as a reviewer here.

hungvu193 commented 2 weeks ago

Are there two C+ reviewers required here? If not, please remove me as a reviewer here.

Ah , thanks @rojiphil. @rushatgabhane will handle it

hungvu193 commented 2 weeks ago

If we can prioritize this PR, that would be awesome because it has the share component that will be using across Advance page.

mananjadhav commented 2 weeks ago

@hungvu193 The screenshots are missing for all platforms, can you add those please?

hungvu193 commented 2 weeks ago

I addressed the comments and added videos @mananjadhav

mananjadhav commented 2 weeks ago

Thanks the code changes look fine, will work on the checklist.

mananjadhav commented 2 weeks ago

@hungvu193 I see two problems when testing.

  1. This view should only be visible if Sync reimbursed reports is enabled. While the menu item visibility works fine, https://dev.new.expensify.com:8082/settings/workspaces/76A10AB364F95DA0/accounting/xero/advanced/invoice-account-selector if I hit the URL with the sync disabled, I can still see the page and able to update the setting as well.

  2. I am not sure if it's a navigation issue/related to this PR, but at times I don't see /invoice-account-selector in the URL. The page loads on click but ends at /xero/advanced or /import if I have navigated to import earlier.

Screenshot 2024-05-04 at 11 23 50β€―PM
hungvu193 commented 1 week ago

@hungvu193 I see two problems when testing.

  1. This view should only be visible if Sync reimbursed reports is enabled. While the menu item visibility works fine, https://dev.new.expensify.com:8082/settings/workspaces/76A10AB364F95DA0/accounting/xero/advanced/invoice-account-selector if I hit the URL with the sync disabled, I can still see the page and able to update the setting as well.
  2. I am not sure if it's a navigation issue/related to this PR, but at times I don't see /invoice-account-selector in the URL. The page loads on click but ends at /xero/advanced or /import if I have navigated to import earlier.

I can't reproduce the 2. With the first one, we need to implement a new props for our AccessOrNotFoundWrapperProps, currently it's only showing NotFoundPage bases on accessVariants and featureName.

mananjadhav commented 1 week ago

About 2, even I don't have proper reproduction steps. For 1, do we have any workaround? I implemented it by not passing the policyID in the categories page. But we can let @lakchote @mountiny confirm if we need it in this PR. I'll continue with the checklist in the current state.

hungvu193 commented 1 week ago

For 1, do we have any workaround?

I'm trying to update AccessOrNotFoundWrapper but I'm facing the hard issue "naming the variable" πŸ˜‚

mananjadhav commented 1 week ago

For 1, do we have any workaround?

I'm trying to update AccessOrNotFoundWrapper but I'm facing the hard issue "naming the variable" πŸ˜‚

But are you like adding a boolean prop, which will show the NotFound if it's true? along with feature names and variants? We'll need it to be generic as the conditions would be different for some of the pages.

hungvu193 commented 1 week ago

For 1, do we have any workaround?

I'm trying to update AccessOrNotFoundWrapper but I'm facing the hard issue "naming the variable" πŸ˜‚

But are you like adding a boolean prop, which will show the NotFound if it's true? along with feature names and variants? We'll need it to be generic as the conditions would be different for some of the pages.

Yeah, I want to add a new boolean props, ie: shouldBeBlocked and update this condition:

const shouldShowNotFoundPage = isEmptyObject(policy) || (Object.keys(policy).length === 1 && !isEmptyObject(policy.errors)) || !policy?.id || !isPageAccessible || !isFeatureEnabled;

to

const shouldShowNotFoundPage = isEmptyObject(policy) || (Object.keys(policy).length === 1 && !isEmptyObject(policy.errors)) || !policy?.id || !isPageAccessible || !isFeatureEnabled || shouldBeBlocked;
mananjadhav commented 1 week ago

I think shouldBeBlocked should be okay as showShowNotFound is already used in the component and it would lead to confusion.

hungvu193 commented 1 week ago

OK, let me update it then

mananjadhav commented 1 week ago

Reviewer Checklist

Screenshots/Videos

Android: Native https://github.com/Expensify/App/assets/3069065/60b6851c-c0c7-460a-bc38-5dfa1eed202e
Android: mWeb Chrome https://github.com/Expensify/App/assets/3069065/e415cd95-1ede-409a-98e3-151166281176
iOS: Native https://github.com/Expensify/App/assets/3069065/f1414318-7dde-41b0-b8c5-20ca0f17ca82
iOS: mWeb Safari https://github.com/Expensify/App/assets/3069065/71bb965d-79a1-43dd-8e1f-83a9428f7888
MacOS: Chrome / Safari https://github.com/Expensify/App/assets/3069065/5c2dce82-3df6-455d-b0eb-8a42137e24f6 https://github.com/Expensify/App/assets/3069065/abe890f7-bd79-4c79-9d65-aab6a2fe75ab
MacOS: Desktop https://github.com/Expensify/App/assets/3069065/43ead238-e0eb-4d34-a0f1-dd32f97ab62d
hungvu193 commented 1 week ago

It should be working now.

https://github.com/Expensify/App/assets/16502320/8cfe7911-57fd-4e3a-a37d-b7350b6bac5d

mananjadhav commented 1 week ago

Tested the block access change. Added the screencast for Web.

melvin-bot[bot] commented 1 week ago

We did not find an internal engineer to review this PR, trying to assign a random engineer to #39752 as well as to this PR... Please reach out for help on Slack if no one gets assigned!

lakchote commented 1 week ago

@Expensify/design could you please give it a look before merging?

lakchote commented 1 week ago

Unassigning other reviewers as reviews have already been done by 2 C+ contributors.

shawnborton commented 1 week ago

Design-wise I think this is looking good.

OSBotify commented 1 week ago

:hand: This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release.

OSBotify commented 1 week ago

πŸš€ Deployed to production by https://github.com/marcaaron in version: 1.4.71-6 πŸš€

platform result
πŸ€– android πŸ€– success βœ…
πŸ–₯ desktop πŸ–₯ success βœ…
🍎 iOS 🍎 success βœ…
πŸ•Έ web πŸ•Έ success βœ