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

Remove Category and Tag Tasks when direct accounting selection in the onboarding intent #51591

Open
davidcardoza opened this issue Oct 28, 2024 · 2 comments
Assignees
Labels
Daily KSv2 External Added to denote the issue can be worked on by a contributor Help Wanted Apply this label when an issue is open to proposals by contributors

Comments

@davidcardoza
Copy link
Contributor

davidcardoza commented Oct 28, 2024

Problem

In the onboarding process, when a user selects a direct connection (such as QuickBooks Online) during signup, they are presented with tasks to setup categories and tags, respectively. Categories and tags are automatically handled by the accounting integration. This results in redundant tasks, such as "Setup Categories" and "Setup Tags," which are irrelevant for users who have already selected direct connections like QBO.

Solution

Remove Tasks for Direct Connections: If the user selects a direct accounting connection (such as QBO), the tasks to manually set up categories and tags should be automatically removed or hidden, as they are redundant.

Issue OwnerCurrent Issue Owner: @dukenv0307
@davidcardoza davidcardoza added External Added to denote the issue can be worked on by a contributor Daily KSv2 Help Wanted Apply this label when an issue is open to proposals by contributors labels Oct 28, 2024
Copy link

melvin-bot bot commented Oct 28, 2024

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

@jaydamani
Copy link
Contributor

jaydamani commented Oct 28, 2024

Edited by proposal-police: This proposal was edited at 2024-10-28 18:54:41 UTC.

Proposal

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

Remove Category and Tag Tasks when direct accounting selection in the onboarding intent

What is the root cause of that problem?

Enhancement

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

The default tasks come from here and are created here

Option 1

We can hide the tasks so the user will not see them if they select an integration. To implemt this, we can update here to filter out the tasks

Current code:

const tasksData = data.tasks.map((task, index) => {

New code:

const tasksData = data.tasks.filter(task => userReportedIntegration && (task.type == 'setupCategories' || task.type == 'setupTags')).map((task, index) => {
    ...
}

Note: This code is just for explaination purposes. Code quality can be improved during PR.

Option 2

We can show the tasks as already completed similar to what we do for 'Create a workspace'. To do this, we can update the autoCompleted property in tasks for categories and tags to be a function that takes userReportedIntegration as parameter and returns true if it exists. Then we can update here to handle autoCompleted property being function.

The tasks will look like:

[{
    type: 'createWorkspace',
    autoCompleted: (userReportedIntegration) => !!userReportedIntegration,
    title: 'Create a workspace',
    description: '',
}]

The autoCompleted property will be handled by this change:
Current:

App/src/libs/actions/Report.ts

Lines 3435 to 3437 in 2a3095e

const completedTaskReportAction = task.autoCompleted
? ReportUtils.buildOptimisticTaskReportAction(currentTask.reportID, CONST.REPORT.ACTIONS.TYPE.TASK_COMPLETED, 'marked as complete', actorAccountID, 2)
: null;

New:

const canAutoComplete = typeof task.autoCompleted === 'function' ? task.autoCompleted(userReportedIntegration) : task.autoCompleted
const completedTaskReportAction = canAutoComplete
    ? ReportUtils.buildOptimisticTaskReportAction(currentTask.reportID, CONST.REPORT.ACTIONS.TYPE.TASK_COMPLETED, 'marked as complete', actorAccountID, 2)
    : null;

Note: This code is just for explaination purposes. Code quality can be improved during PR.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Daily KSv2 External Added to denote the issue can be worked on by a contributor Help Wanted Apply this label when an issue is open to proposals by contributors
Projects
Development

No branches or pull requests

3 participants