App icon indicating copy to clipboard operation
App copied to clipboard

[$250] Report fields - Feature can be enabled in collect workspace

Open IuliiaHerets opened this issue 1 year ago β€’ 55 comments

If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!


Version Number: v9.0.46-1 Reproducible in staging?: Y Reproducible in production?: Y Issue reported by: Applause Internal Team

Action Performed:

Precondition: user has Collect workspace.

  1. Go ws settings > More features
  2. Enable Accounting
  3. Go to Accounting > Connect QBO integration
  4. Disconnect QBO integration

Expected Result:

Report fields, as feature, available in Control workspace, disappeared from LHN.

Actual Result:

Report fields stays in LHN. User can access tab and add report filed to a collect workspace.

Workaround:

Unknown

Platforms:

  • [ ] Android: Native
  • [ ] Android: mWeb Chrome
  • [ ] iOS: Native
  • [ ] iOS: mWeb Safari
  • [x] MacOS: Chrome / Safari
  • [x] MacOS: Desktop

Screenshots/Videos

https://github.com/user-attachments/assets/cbbe90ce-9229-4bc8-bd13-f8097e24a664

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021844128989949063152
  • Upwork Job ID: 1844128989949063152
  • Last Price Increase: 2024-10-23
  • Automatic offers:
    • allgandalf | Reviewer | 104633600
    • mkzie2 | Contributor | 104633601
Issue OwnerCurrent Issue Owner: @allgandalf

IuliiaHerets avatar Oct 08 '24 19:10 IuliiaHerets

Triggered auto assignment to @slafortune (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.

melvin-bot[bot] avatar Oct 08 '24 19:10 melvin-bot[bot]

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

IuliiaHerets avatar Oct 08 '24 19:10 IuliiaHerets

@slafortune 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 avatar Oct 08 '24 19:10 IuliiaHerets

Edited by proposal-police: This proposal was edited at 2024-10-09 21:40:29 UTC.

Proposal

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

  • Report fields stays in LHN. User can access tab and add report filed to a collect workspace.

What is the root cause of that problem?

  • When removing any connection, we didn't turn off report field feature if it is not control policy:

https://github.com/Expensify/App/blob/3a6676eb0b8d241cbc94e3b64424c8c9a9ae7e0a/src/libs/actions/connections/index.ts#L22

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

  • Add an additional logic to line:
const isCollectWorkspace = policy.type === 'team';
    if (isCollectWorkspace && ['quickbooksOnline', 'xero', 'quickbooksDesktop'].includes(connectionName)) {
        optimisticData.push({
            onyxMethod: Onyx.METHOD.MERGE,
            key: `${ONYXKEYS.COLLECTION.POLICY}${policyID}`,
            value: {
                areReportFieldsEnabled: false,
                pendingFields: {
                    areReportFieldsEnabled: CONST.RED_BRICK_ROAD_PENDING_ACTION.UPDATE,
                },
            },
        });

        successData.push({
            onyxMethod: Onyx.METHOD.MERGE,
            key: `${ONYXKEYS.COLLECTION.POLICY}${policyID}`,
            value: {
                pendingFields: {
                    areReportFieldsEnabled: null,
                },
            },
        });

        failureData.push({
            onyxMethod: Onyx.METHOD.MERGE,
            key: `${ONYXKEYS.COLLECTION.POLICY}${policyID}`,
            value: {
                areReportFieldsEnabled: policy?.areReportFieldsEnabled,
                pendingFields: {
                    areReportFieldsEnabled: null,
                },
            },
        });
    }
  • BE should fix it as well. In detail, when we disconnect, BE needs to turn off report field feature as well.

mkzie2 avatar Oct 08 '24 22:10 mkzie2

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

melvin-bot[bot] avatar Oct 09 '24 21:10 melvin-bot[bot]

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

melvin-bot[bot] avatar Oct 09 '24 21:10 melvin-bot[bot]

@slafortune , a thought:

  • We should never allow the toggle of report fields unless the workspace itself in on a control plan, it's a control plan only feature, can you take it to our slack #expense channel and tag me there? the expected result doesn't seem right, please tag me there too

allgandalf avatar Oct 10 '24 06:10 allgandalf

@slafortune, @allgandalf Eep! 4 days overdue now. Issues have feelings too...

melvin-bot[bot] avatar Oct 15 '24 18:10 melvin-bot[bot]

bump on ^ @slafortune

allgandalf avatar Oct 16 '24 07:10 allgandalf

Report fields are a control feature, moving this to #expense.

trjExpensify avatar Oct 16 '24 09:10 trjExpensify

Perfect since everything Collect or Control is going to the Expenses Project

Sorry for my delay @allgandalf

We should never allow the toggle of report fields unless the workspace itself in on a control plan, it's a control plan only feature, can you take it to our slack #expense channel and tag me there? the expected result doesn't seem right, please tag me there too

Report fields unrelated to any accounting integrations are not supported on the Collect workspace This bug had been related to the Collect workspace project since the QBO connection is allowed on the Collect workspace - which allows for report fields.

if connected to an accounting integration that is allowed on the collect workspace - report fields are enabled. When disconnecting - report fields should be removed.

slafortune avatar Oct 16 '24 14:10 slafortune

Sorry - some keyboard shortcut closed that 😱

slafortune avatar Oct 16 '24 14:10 slafortune

Proposal updated

mkzie2 avatar Oct 16 '24 15:10 mkzie2

πŸ“£ It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? πŸ’Έ

melvin-bot[bot] avatar Oct 16 '24 16:10 melvin-bot[bot]

@allgandalf did this clear up any questions you had? Do you still want me to start a conversation in Slack?

slafortune avatar Oct 18 '24 18:10 slafortune

oops, i missed your response, I will review your comments and get back today

allgandalf avatar Oct 21 '24 12:10 allgandalf

I agree with @mkzie2 proposal here, We should disable the report fields. @mkzie2 please use a const while checking isCollectWorkspace also we have predefined const for connection names, use that.

I also agree that BE should be updated to match the optimistic change we make on the FE.

πŸŽ€πŸ‘€πŸŽ€ C+ reviewed

allgandalf avatar Oct 22 '24 07:10 allgandalf

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

melvin-bot[bot] avatar Oct 22 '24 07:10 melvin-bot[bot]

@slafortune @stitesExpensify @allgandalf this issue was created 2 weeks ago. Are we close to approving a proposal? If not, what's blocking us from getting this issue assigned? Don't hesitate to create a thread in #expensify-open-source to align faster in real time. Thanks!

melvin-bot[bot] avatar Oct 22 '24 18:10 melvin-bot[bot]

πŸ“£ It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? πŸ’Έ

melvin-bot[bot] avatar Oct 23 '24 16:10 melvin-bot[bot]

@dangrous do you have more context about what is happening here? I'm not really sure I understand what backend changes would need to be made

stitesExpensify avatar Oct 23 '24 20:10 stitesExpensify

Not sure I know too much more than you haha - but basically, (I think) connecting New Dot to QBO will enable report fields on the policy, even if it's Collect not Control (normally report fields are Control only). When we disconnect QBO (command RemovePolicyConnection) we should therefore check if the policy is Collect, and, if it is, setReportFieldsEnabled to false. I'm guessing the best place for that is here?

Does that make sense?

Also cc @aldo-expensify

dangrous avatar Oct 24 '24 15:10 dangrous

@slafortune, @stitesExpensify, @allgandalf Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

melvin-bot[bot] avatar Oct 25 '24 18:10 melvin-bot[bot]

Waiting for assignment melv!

allgandalf avatar Oct 25 '24 21:10 allgandalf

Exactly what @dangrous said - any collect plan connected to QBO will have report fields enabled, but if the connection is gone, the report fields should also be removed since they are not available with the collect plan in a standalone way. @stitesExpensify do you agree here

slafortune avatar Oct 28 '24 16:10 slafortune

πŸ“£ @allgandalf πŸŽ‰ An offer has been automatically sent to your Upwork account for the Reviewer role πŸŽ‰ Thanks for contributing to the Expensify app!

Offer link Upwork job

melvin-bot[bot] avatar Oct 28 '24 20:10 melvin-bot[bot]

πŸ“£ @mkzie2 πŸŽ‰ 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 πŸ“–

melvin-bot[bot] avatar Oct 28 '24 20:10 melvin-bot[bot]

I do agree! I'm not sure when I will be able to prioritize this though FYI

stitesExpensify avatar Oct 28 '24 20:10 stitesExpensify

Draft PR above ^. Waiting for BE changes.

mkzie2 avatar Oct 30 '24 08:10 mkzie2

@slafortune, @stitesExpensify, @allgandalf, @mkzie2 Whoops! This issue is 2 days overdue. Let's get this updated quick!

melvin-bot[bot] avatar Oct 31 '24 18:10 melvin-bot[bot]