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
3.47k stars 2.82k forks source link

[HOLD for Payment 2024-10-07][$250] Import categories - Import spreadsheet option is available when workspace is connected to QBO #48913

Closed IuliiaHerets closed 6 days ago

IuliiaHerets commented 1 month ago

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


Version Number: 9.0.31-14 Reproducible in staging?: Y Reproducible in production?: Y Email or phone of affected tester (no customers): applausetester+kh010901@applause.expensifail.com Issue reported by: Applause Internal Team

Action Performed:

Precondition:

  1. Go to staging.new.expensify.com
  2. Go to workspace settings > Categories.
  3. Click 3-dot menu.
  4. Click Import spreadsheet.

Expected Result:

Import spreadsheet option should be hidden when there is connection in the workspace, as the categories are imported from the connection.

Actual Result:

Import spreadsheet option is available when workspace is connected to QBO

Workaround:

Unknown

Platforms:

Screenshots/Videos

https://github.com/user-attachments/assets/fcc5a939-5393-4521-82b1-bf6faff293dd

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021834239004653240865
  • Upwork Job ID: 1834239004653240865
  • Last Price Increase: 2024-09-12
  • Automatic offers:
    • Nodebrute | Contributor | 104026058
Issue OwnerCurrent Issue Owner: @thesahindia
melvin-bot[bot] commented 1 month ago

Triggered auto assignment to @abekkala (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details. Please add this bug to a GH project, as outlined in the SO.

IuliiaHerets commented 1 month ago

@abekkala FYI I haven't added the External label as I wasn't 100% sure about this issue. Please take a look and add the label if you agree it's a bug and can be handled by external contributors

IuliiaHerets commented 1 month ago

We think that this bug might be related to #wave-control

Nodebrute commented 1 month ago

Proposal

Please re-state the problem that we are trying to solve in this issue.

Import spreadsheet option is available when workspace is connected to QBO

What is the root cause of that problem?

We are not adding any condition here to check this https://github.com/Expensify/App/blob/83865b64cca258299e091cc1b5b16ac12c92e089/src/pages/workspace/categories/WorkspaceCategoriesPage.tsx#L302-L312

What changes do you think we should make in order to solve the problem?

We can conditionally push this item only if !hasAccountingConnection https://github.com/Expensify/App/blob/83865b64cca258299e091cc1b5b16ac12c92e089/src/pages/workspace/categories/WorkspaceCategoriesPage.tsx#L302-L312

What alternative solutions did you explore? (Optional)

nkdengineer commented 1 month ago

Proposal

Please re-state the problem that we are trying to solve in this issue.

What is the root cause of that problem?

We always show the import sheet option without checking we connect an accounting or not

https://github.com/Expensify/App/blob/f642361ba357e1eeb522b2cc4291a620af67cfdb/src/pages/workspace/categories/WorkspaceCategoriesPage.tsx#L300

What changes do you think we should make in order to solve the problem?

We should use the same way we display the add category button

https://github.com/Expensify/App/blob/f642361ba357e1eeb522b2cc4291a620af67cfdb/src/pages/workspace/categories/WorkspaceCategoriesPage.tsx#L248

const menuItems = [];
if (!PolicyUtils.hasAccountingConnections(policy)) {
    menuItems.push({
        icon: Expensicons.Table,
        text: translate('spreadsheet.importSpreadsheet'),
        onSelected: () => {
            if (isOffline) {
                Modal.close(() => setIsOfflineModalVisible(true));
                return;
            }
            Navigation.navigate(ROUTES.WORKSPACE_CATEGORIES_IMPORT.getRoute(policyId));
        },
    })
}
menuItems.push({
    icon: Expensicons.Download,
    text: translate('spreadsheet.downloadCSV'),
    onSelected: () => {
        if (isOffline) {
            Modal.close(() => setIsOfflineModalVisible(true));
            return;
        }
        Category.downloadCategoriesCSV(policyId);
    },
});

https://github.com/Expensify/App/blob/f642361ba357e1eeb522b2cc4291a620af67cfdb/src/pages/workspace/categories/WorkspaceCategoriesPage.tsx#L300

If we already connected an accounting, we also need to display the not found page in ImportCategoriesPage and ImportedCategoriesPage page. We can display a helpful message that help user know that they already connected an accounting and cannot import category

What alternative solutions did you explore? (Optional)

Reminder: Please use plain English, be brief and avoid jargon. Feel free to use images, charts or pseudo-code if necessary. Do not post large multi-line diffs or write walls of text. Do not create PRs unless you have been hired for this job.

melvin-bot[bot] commented 1 month ago

Job added to Upwork: https://www.upwork.com/jobs/~021834239004653240865

melvin-bot[bot] commented 1 month ago

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

thesahindia commented 1 month ago

@Nodebrute's proposal was first so I will prefer them!

🎀 👀 🎀 C+ reviewed

melvin-bot[bot] commented 1 month ago

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

nkdengineer commented 3 weeks ago

@thesahindia I think we also need to display the not found page in ImportCategoriesPage and ImportedCategoriesPage to prevent users from going to this page by deep link when we already connect an accounting.

chiragsalian commented 3 weeks ago

Yeah i believe that is correct @nkdengineer. @thesahindia, what are your thoughts?

melvin-bot[bot] commented 3 weeks ago

@abekkala, @chiragsalian, @thesahindia Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

thesahindia commented 3 weeks ago

Yeah i believe that is correct @nkdengineer. @thesahindia, what are your thoughts?

Yes, it is correct, but I wasn’t sure if I should consider it for deciding the assignment here, as these things should be addressed in the PR.

I am comfortable with either of them being assigned.

nkdengineer commented 3 weeks ago

I think this is the thing that we can miss in the PR if we don't address this in the proposal.

Nodebrute commented 3 weeks ago

The main expected result was that the 'Import Spreadsheet' option should be hidden, which I addressed correctly in my proposal. Additionally, the 'Not Here' page can be easily handled in the PR. I don’t believe I could have overlooked that in the PR. We also have a checklist that includes testing the component with a deep link. https://github.com/Expensify/App/blob/448ca57d9b7aedb7e8dd9b46ce382ec4a1b85e8a/contributingGuides/REVIEWER_CHECKLIST.md?plain=1#L53

cc: @thesahindia @chiragsalian

chiragsalian commented 3 weeks ago

Hmm okay alright, sorry @nkdengineer. @Nodebrute makes a convincing point and was first so I'll give it over to them. Feel free to create the PR @Nodebrute.

melvin-bot[bot] commented 3 weeks ago

📣 @Nodebrute 🎉 An offer has been automatically sent to your Upwork account for the Contributor role 🎉 Thanks for contributing to the Expensify app!

Offer link Upwork job Please accept the offer 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 📖

Nodebrute commented 3 weeks ago

I’ll raise a PR in a few hours.

abekkala commented 3 weeks ago

@Nodebrute can you link the PR please?

Nodebrute commented 3 weeks ago

The PR is ready for review.

Nodebrute commented 1 week ago

The production deploy automation failed: This should be on [HOLD for Payment 2024-10-07] according to https://github.com/Expensify/App/issues/49855 production deploy checklist, confirmed in https://github.com/Expensify/App/pull/49545#issuecomment-2384302822

abekkala commented 1 week ago

PAYMENT SUMMARY FOR OCT 07

abekkala commented 1 week ago

BugZero Checklist: The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:

thesahindia commented 6 days ago

It was implemented like this. We probably forgot about this case.

We should add a test case. The steps are below:

Precondition: Workspace is connected to QBO.

  1. Go to Workspace Settings > Categories.
  2. Click the three-dot menu.
  3. Verify that the "Import Spreadsheet" button is not displayed.
abekkala commented 6 days ago

PAYMENT SUMMARY FOR OCT 07

garrettmknight commented 5 days ago

$250 approved for @thesahindia