Skip to content

[HOLD for payment 2024-01-18] [$500] Add markdown syntax for creating a new task #32864

Closed

Description

@thienlnam

We want to create some syntax that will create a task when the following message is added to the composer

[] @jack This is the task name

Should create a task in the current room that:

  • Is assigned to jack
  • Has the title 'This is the task name'
  • The share destination would be the current report where this comment is posted

The assignee can be optional, in which case the command would look something like this

[] This is the task name

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~013d0a874d62f021b7
  • Upwork Job ID: 1734321392740421632
  • Last Price Increase: 2023-12-18
  • Automatic offers:
    • Ollyws | Reviewer | 28066406
    • suneox | Contributor | 28066407
Issue OwnerCurrent Issue Owner: @anmurali

Activity

  1. added
    ExternalAdded to denote the issue can be worked on by a contributor
    NewFeatureSomething to build that is a new item.
    on Dec 11, 2023
  2. changed the title [-]Add markdown syntax for creating a new task[/-] [+][$500] Add markdown syntax for creating a new task[/+] on Dec 11, 2023
  3. melvin-bot commented on Dec 11, 2023

    @melvin-bot
  4. melvin-bot commented on Dec 11, 2023

    @melvin-bot
  5. added
    Help WantedApply this label when an issue is open to proposals by contributors
    on Dec 11, 2023
  6. melvin-bot commented on Dec 11, 2023

    @melvin-bot

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

  7. suneox commented on Dec 12, 2023

    @suneox
    Contributor

    Proposal

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

    Add markdown syntax for creating a new task

    What is the root cause of that problem?

    New feature

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

    At function onSubmitComment on ReportScreen we will check if content match with task regex we will create a new task otherwise keep current behavior

        const allPersonalDetails = usePersonalDetails();
        const onSubmitComment = useCallback(
            (text) => {
                const taskRegex = /^\[\](?:\s+@([^\s@]+@[\w.-]+))?\s+(.+)/;
                const match = text.match(taskRegex);
                if (match) {
                    const email = match[1] ? match[1].trim() : undefined; // Email might be undefined if not captured
                    const title = match[2];
                    let assignee = {};
                    if (email) {
                        assignee = _.find(_.values(allPersonalDetails), (p) => p.login === email) || {};
                    }
                    Task.createTaskAndNavigate(getReportID(route), title, '', assignee.login, assignee.accountID, assignee.assigneeChatReport, report.policyID);
                } else {
                    Report.addComment(getReportID(route), text);
                }
    
    
    
                // We need to scroll to the bottom of the list after the comment is added
                const refID = setTimeout(() => {
                    flatListRef.current.scrollToOffset({animated: false, offset: 0});
                }, 10);
    
                return () => clearTimeout(refID);
            },
            [route],
        );

    POC

    32864_POC.mp4

    What alternative solutions did you explore? (Optional)

  8. 47 remaining items

  9. Ollyws commented on Jan 22, 2024

    @Ollyws
    Contributor

    Regression Test Proposal

    1. Open any chat
    2. Send a message in the format `[] @exampleemail@address.com exampletitle` replacing the email with a user email.
    3. Verify a task is created and assigned to the entered user, with the entered task title.
    

    Do we agree 👍 or 👎

  10. iwiznia commented on Jan 22, 2024

    @iwiznia
    Contributor

    Looks good to me

  11. anmurali commented on Jan 22, 2024

    @anmurali

    @Ollyws - the previously issued offer expired. So I had to reissue an offer to pay you. It is here
    @suneox is paid

  12. iwiznia commented on Jan 29, 2024

    @iwiznia
    Contributor

    @anmurali can we close this then?

  13. Ollyws commented on Jan 29, 2024

    @Ollyws
    Contributor

    Still awaiting payment on this one.

  14. iwiznia commented on Jan 29, 2024

    @iwiznia
    Contributor

    @anmurali can you pay then?

  15. anmurali commented on Jan 30, 2024

    @anmurali

    Paid @Ollyws now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Awaiting PaymentAuto-added when associated PR is deployed to productionDailyKSv2ExternalAdded to denote the issue can be worked on by a contributorNewFeatureSomething to build that is a new item.

Type

No type

Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions