-
Notifications
You must be signed in to change notification settings - Fork 13.2k
[NEW] Send LiveChat visitor navigation history as messages #10091
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
Merged
sampaiodiego
merged 21 commits into
develop
from
send-visitor-navigaton-history-as-a-message
Jun 5, 2018
Merged
Changes from all commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
2fb6d12
Fix livechat routes to allow inviting other agents to the same chat.
renatobecker 41e7cbd
Fix indentation tabs.
renatobecker 089e15e
Merge branch 'fix-invite-agents-to-livechat-rooms' into send-visitor-…
renatobecker 587ffda
Started working on send visitor navigation history as a message to ag…
renatobecker 460b76b
- Sending the navigation history of the visitor as a message;
renatobecker 221c595
Fix Ci build validations.
renatobecker bc8c03d
Fix PR review.
renatobecker 5b4ec2a
Fix filter of the navigation history subscribe.
renatobecker 57d0bf3
Fix PR review.
renatobecker d86fb7b
Merge branch 'develop' into send-visitor-navigaton-history-as-a-message
renatobecker cacc518
Merge branch 'develop' into send-visitor-navigaton-history-as-a-message
renatobecker a25f9ea
New feature added to send messages related to Livechat visitor naviga…
renatobecker 632baf1
Fix codacy-bot review issues.
renatobecker f4c62d8
Merge branch 'develop' into send-visitor-navigaton-history-as-a-message
sampaiodiego d314565
Fix coding styling
sampaiodiego 2cc736b
Do not return message on pageVisited method
sampaiodiego bf90817
Better styling for navigation history messages
sampaiodiego b2535ea
Improved livechat history migration to run faster
sampaiodiego cb2274d
Disable showing livechat navigation history as message by default
sampaiodiego c086d6c
Better visitor navigation translation
sampaiodiego b350a0b
Remove unnecessary files
sampaiodiego File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 5 additions & 4 deletions
9
packages/rocketchat-livechat/client/views/app/tabbar/visitorNavigation.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,5 @@ | ||
| Meteor.methods({ | ||
| 'livechat:pageVisited'(token, pageInfo) { | ||
| return RocketChat.Livechat.savePageHistory(token, pageInfo); | ||
| 'livechat:pageVisited'(token, room, pageInfo) { | ||
| RocketChat.Livechat.savePageHistory(token, room, pageInfo); | ||
| } | ||
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| RocketChat.models.Messages.keepHistoryForToken = function(token) { | ||
| return this.update({ | ||
| 'navigation.token': token, | ||
| expireAt: { | ||
| $exists: true | ||
| } | ||
| }, { | ||
| $unset: { | ||
| expireAt: 1 | ||
| } | ||
| }, { | ||
| multi: true | ||
| }); | ||
| }; | ||
|
|
||
| RocketChat.models.Messages.setRoomIdByToken = function(token, rid) { | ||
| return this.update({ | ||
| 'navigation.token': token, | ||
| rid: null | ||
| }, { | ||
| $set: { | ||
| rid | ||
| } | ||
| }, { | ||
| multi: true | ||
| }); | ||
| }; |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you don't need to receive
roomIdhere.. we can rely onRocketChat.models.Rooms.findOneOpenByVisitorTokento get visitor's current room.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sampaiodiego, the
RocketChat.models.Rooms.findOneOpenByVisitorTokenhas aroomIdparameter, due to this I changed thesavePageHistoryto get this parameter.How can I call the
RocketChat.models.Rooms.findOneOpenByVisitorTokenmethod if I don't pass theroomIdparameter?I'm sorry if I'm making a mistake but I think this parameter is necessary.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you're correct @renatobecker .. I didn't notice
RocketChat.models.Rooms.findOneOpenByVisitorTokenhas aroomIdparameter as well. 😉I'll give this PR a whole review to see how we could still save visitor's navigation history without a room.