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

CHI-2763 Resolve In-Progress Contacts: Close Tasks and Finalize Contacts #2543

Merged
merged 19 commits into from
Oct 4, 2024

Conversation

mythilytm
Copy link
Collaborator

@mythilytm mythilytm commented Sep 24, 2024

Description

  • This PR introduces Save and End button, responsible for saving unresolved contacts left in progress.
  • A new permission canEditInProgressContact permission is added to control the Save and End button
  • Refactor the In-Progress Banner with the 'Save and End' Button and display a dialog for saving the completing active calls and saving contacts
  • Resolved Banner: Displays a blue banner when the contact is saved.

Checklist

  • Corresponding issue has been opened
  • New tests added
  • Feature flags added
  • Strings are localized
  • Tested for chat contacts
  • Tested for call contacts

Other Related Issues

None

Verification steps

  • Ensure that this branch is deployed: CHI-2763 Check for an active contact & complete task serverless#698
  • Start Flex(as a supervisor or owner) and start a call / chat in any of the channels
  • Once the task is assigned, access the unfinalized contact via search with the In Progress banner
  • You should see Save and End. Click on it and check that the behavior is aligned with the acceptance criteria.

AFTER YOU MERGE

  1. Cut a release tag using the Github workflow. Wait for it to complete and notify in the #aselo-deploys Slack channel.
  2. Comment on the ticket with the release tag version AND any additional instructions required to configure an environment to test the changes.
  3. Only then move the ticket into the QA column in JIRA

You are responsible for ensuring the above steps are completed. If you move a ticket into QA without advising what version to test, the QA team will assume the latest tag has the changes. If it does not, the following confusion is on you! :-P

@mythilytm mythilytm changed the title Chi 2763 resolve contacts CHI-2763 Resolve In Progress contacts by closing tasks and finalizing contacts Oct 2, 2024
@mythilytm mythilytm requested review from stephenhand and GPaoloni and removed request for stephenhand October 2, 2024 16:18
@mythilytm mythilytm changed the title CHI-2763 Resolve In Progress contacts by closing tasks and finalizing contacts CHI-2763 Resolve In-Progress Contacts: Close Tasks and Finalize Contacts Oct 2, 2024
@mythilytm mythilytm marked this pull request as ready for review October 2, 2024 18:36
Copy link
Collaborator

@GPaoloni GPaoloni left a comment

Choose a reason for hiding this comment

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

Code looks great to me! Thanks for organizing things better while in here 🙌

Leaving a couple of questions, shouldn't be anything blocking but is just to confirm I understand things.

Comment on lines 74 to 76
const status = await checkTaskAssignment(savedContact.taskId);

if (status === true) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
const status = await checkTaskAssignment(savedContact.taskId);
if (status === true) {
const isTaskAssigned = await checkTaskAssignment(savedContact.taskId);
if (isTaskAssigned === true) {

Copy link
Collaborator

Choose a reason for hiding this comment

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

Also a question here: What happens if the task is in wrapup? 🤔

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Good point. I realized I should include wrapup tasks in my first serverless function that checks the task status

Comment on lines +78 to +80
} else {
await updateAndSaveContact();
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

How can anybody reach this? If dialog is open, you have to "click confirm", if it's not then this opens it.. Maybe this else statement is redundant? Or what am I missing?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The dialog only opens when there is an active task (assigned task). In some cases, if the task is completed (triggered only End button in the agent-desktop by the owner) already, there is no need to show to dialog and we save directly.

@@ -83,6 +83,8 @@ const BottomBar: React.FC<
const handleSubmit = async () => {
if (contactIsSaving || !hasTaskControl(task)) return;

console.log('>>> Submitting contact form', { task, contact, metadata, caseState });
Copy link
Collaborator

Choose a reason for hiding this comment

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

🧹

Comment on lines 89 to 90
// eslint-disable-next-line camelcase
featureFlagsFromServiceConfig.enable_generalized_search = false;
Copy link
Collaborator

Choose a reason for hiding this comment

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

🧹

// const worker = Manager.getInstance().workerClient
console.log('>>> getCanEditInProgressContact', { workerRoles });
if (!contact.finalizedAt) {
// If the contact is a draft, we use the hardcoded rule that only its owner or creator can edit it
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why is this needed? 🤔 I mean why can't we use the same edit contact rules as for non-drafts?

@mythilytm mythilytm merged commit 678d8e2 into master Oct 4, 2024
8 checks passed
@mythilytm mythilytm deleted the CHI-2763-resolve-contacts branch October 4, 2024 19:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants