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

[MDPX-8385] Preserve previous task name #1169

Merged
merged 4 commits into from
Nov 4, 2024
Merged

Conversation

canac
Copy link
Contributor

@canac canac commented Oct 31, 2024

Description

  • When creating a new task after completing a different task, default the task name to the previous task name.
  • If the user changes the new task's task phase or activity type, the task name will be overridden, which I believe is what we want.
  • If the user had a customized task name for a text message task, for example, and they make the next action a phone call, we just use the autogenerated task name. This is to prevent someone who didn't customize their task name from getting "Call to Initiate Appointment" as the initial task name for a text message task. I think this is a reasonable tradeoff, but feel free to discuss. EDIT: Now I'm just comparing the task subject with the default task subject. If they differ, this means that the user customized the task subject. This logic will break if the server changes the default task subjects, but this should be rare, so I think this is acceptable.

Testing

  • Case 1
    • Create a new task and customize the name
    • Complete the task and make sure that the next action is set
    • Check that the task name in the Add Task modal is the customized task name
  • Case 2
    • Log a new task and customize the name
    • Complete the task and make sure that the next action is set
    • Check that the task name in the Add Task modal is the customized task name
  • Case 3
    • Create a new task
    • Check that change the phase and activity type changes the task subject

MPDX-8385

Checklist:

  • I have given my PR a title with the format "MPDX-(JIRA#) (summary sentence max 80 chars)"
  • I have applied the appropriate labels. (Add the label "On Staging" to get the branch automatically merged into staging.)
  • I have requested a review from another person on the project

@canac canac added the Preview Environment Add this label to create an Amplify Preview label Oct 31, 2024
@canac canac requested a review from dr-bizz October 31, 2024 21:06
@canac canac self-assigned this Oct 31, 2024
Copy link

Copy link

github-actions bot commented Oct 31, 2024

Bundle sizes [mpdx-react]

Compared against 975d3ae

No significant changes found

Copy link
Contributor

@dr-bizz dr-bizz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work on this!! The code looks good. I know you and others have been after this for some time. This works for when you're on the partner care phase, but when you're on another phase, it doesn't.

Maybe this is working as expected, and I'm testing it wrong. This is what I have found in my testing:

task-name.mov

@canac canac force-pushed the 8385-preserve-previous-task-name branch from ae31336 to 91c491d Compare November 4, 2024 16:23
@canac
Copy link
Contributor Author

canac commented Nov 4, 2024

Great work on this!! The code looks good. I know you and others have been after this for some time. This works for when you're on the partner care phase, but when you're on another phase, it doesn't.

@dr-bizz I followed your exact steps, and I think it should work now that I'm taking a different approach for deciding whether to use the previous task name. Thanks for taking the time to test it.

Copy link
Contributor

@dr-bizz dr-bizz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great! Great work. It was a little hard to review since you did a force push, so I wasn't sure what I reviewed already, but the code looks great.

src/hooks/usePhaseData.ts Outdated Show resolved Hide resolved
src/hooks/usePhaseData.ts Outdated Show resolved Hide resolved
@canac canac force-pushed the 8385-preserve-previous-task-name branch from dceb34f to 8b8c90e Compare November 4, 2024 21:35
@canac canac enabled auto-merge November 4, 2024 21:36
@canac canac merged commit 9c904af into main Nov 4, 2024
17 checks passed
@canac canac deleted the 8385-preserve-previous-task-name branch November 4, 2024 21:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Preview Environment Add this label to create an Amplify Preview
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants