Skip to content

[FIX] LiveChat switch department not working#11011

Merged
sampaiodiego merged 19 commits intodevelopfrom
fix-changing-livechat-visitor-department
Aug 21, 2018
Merged

[FIX] LiveChat switch department not working#11011
sampaiodiego merged 19 commits intodevelopfrom
fix-changing-livechat-visitor-department

Conversation

@renatobecker-zz
Copy link
Copy Markdown

@renatobecker-zz renatobecker-zz commented Jun 5, 2018

Closes #7397

When a livechat visitor attempted to change the current department, they were staying in the same department.
This was happening because the new department data was not being updated in the visitor collection.

screen shot 2018-06-05 at 16 30 40

…he data was not being updated in the visitor collection.
@renatobecker-zz renatobecker-zz added this to the 0.66.0 milestone Jun 5, 2018
@engelgabriel engelgabriel temporarily deployed to rocket-chat-pr-11011 June 5, 2018 19:33 Inactive
Copy link
Copy Markdown
Member

@ggazzo ggazzo left a comment

Choose a reason for hiding this comment

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

@renatobecker the code looks good but I found a weird behavior:
at the first change, we can se the both options... and the popout doesnt close after the change...

ynlpwcpdlf

and just a thought but if you already started a chat and changed the department I dont think we should wait for another message to call for a new attendant

@engelgabriel engelgabriel temporarily deployed to rocket-chat-pr-11011 June 14, 2018 18:25 Inactive
@renatobecker-zz
Copy link
Copy Markdown
Author

@ggazzo:

Related to your first question, that behaviour has been fixed here:https://github.com/RocketChat/Rocket.Chat/pull/10695/files#diff-e531651dd1b362372762eb86f21419f0R76

About the second question, I changed the method called in the Livechat widget. I saw that when an agent was calling the switch department on their side, the behaviour of the process was different from when it was called by Livechat's side, but I do not know the reason for that, so I unified the method called in both sides. Now, when a visitor tries to switch departments, an agent is automatically assigned to the chat (by using Least Amount routing). In my opinion, this behaviour will provide a better experience for visitors.
Also, I've improved a few other things, such as when there are no agents available in the department selected by the visitor, in this case a warning will be displayed to the visitor.

I'll be waiting for your review.
Thanks.

@ggazzo ggazzo temporarily deployed to rocket-chat-pr-11011 June 14, 2018 19:51 Inactive
@engelgabriel engelgabriel temporarily deployed to rocket-chat-pr-11011 June 14, 2018 20:03 Inactive
@renatobecker-zz renatobecker-zz modified the milestones: 0.66.0, 0.67.0 Jul 11, 2018
# Conflicts:
#	packages/rocketchat-livechat/.app/client/views/livechatWindow.js
#	packages/rocketchat-livechat/.app/client/views/switchDepartment.js
@engelgabriel engelgabriel temporarily deployed to rocket-chat-pr-11011 July 11, 2018 20:06 Inactive
@theorenck theorenck modified the milestones: 0.67.0, 0.68.0 Jul 19, 2018
ggazzo
ggazzo previously requested changes Jul 21, 2018
Copy link
Copy Markdown
Member

@ggazzo ggazzo left a comment

Choose a reason for hiding this comment

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

@renatobecker sorry for the delay...

(I changed the promise alert) and I made more tests, the department changed, but the agent on header not..
image
just changed after a refresh page

if (!result.value) {
return;
}
}, () => {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think we updated the sweetalert and now its promise based, we should change to

}).then(() => {

@theorenck theorenck modified the milestones: 0.68.0, Short-term Jul 31, 2018
@engelgabriel engelgabriel temporarily deployed to rocket-chat-pr-11011 August 3, 2018 14:00 Inactive
@renatobecker-zz
Copy link
Copy Markdown
Author

@ggazzo, I just fixed this PR.
Yes, we have changed Livechat's swal a few weeks ago, but due to the asynchronous review process, change is needed here, but now everything is fine.
The other case, related to displaying the new agent after changing the department, is also fixed.
The bug was happening because we changed the object passed through RocketChat.Livechat.stream, so because of that the stream was no longer being emitted.

But now everything is OK!

Thanks.

# Conflicts:
#	packages/rocketchat-livechat/.app/client/views/switchDepartment.js
#	packages/rocketchat-livechat/.app/package-lock.json
#	packages/rocketchat-livechat/server/methods/getInitialData.js
#	packages/rocketchat-livechat/server/methods/setDepartmentForVisitor.js
@engelgabriel engelgabriel temporarily deployed to rocket-chat-pr-11011 August 19, 2018 20:18 Inactive
@engelgabriel engelgabriel temporarily deployed to rocket-chat-pr-11011 August 19, 2018 20:39 Inactive
@RocketChat RocketChat deleted a comment Aug 19, 2018
@RocketChat RocketChat deleted a comment Aug 19, 2018
@RocketChat RocketChat deleted a comment Aug 19, 2018
@RocketChat RocketChat deleted a comment Aug 19, 2018
@engelgabriel engelgabriel temporarily deployed to rocket-chat-pr-11011 August 19, 2018 20:48 Inactive
@engelgabriel engelgabriel temporarily deployed to rocket-chat-pr-11011 August 19, 2018 20:56 Inactive
@RocketChat RocketChat deleted a comment Aug 19, 2018
@RocketChat RocketChat deleted a comment Aug 19, 2018
@engelgabriel engelgabriel temporarily deployed to rocket-chat-pr-11011 August 19, 2018 21:03 Inactive
@sampaiodiego sampaiodiego merged commit 3a487f9 into develop Aug 21, 2018
@sampaiodiego sampaiodiego deleted the fix-changing-livechat-visitor-department branch August 21, 2018 01:27
@sampaiodiego sampaiodiego mentioned this pull request Aug 28, 2018
@theorenck theorenck removed this from the Short-term milestone Dec 12, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

LiveChat Switch Department

7 participants