diff --git a/packages/rocketchat-lib/i18n/en.i18n.json b/packages/rocketchat-lib/i18n/en.i18n.json index 9da5a9290c4..a73824eb00a 100644 --- a/packages/rocketchat-lib/i18n/en.i18n.json +++ b/packages/rocketchat-lib/i18n/en.i18n.json @@ -629,6 +629,11 @@ "Livechat_title" : "Livechat Title", "Livechat_title_color" : "Livechat Title Background Color", "Livechat_Users" : "Livechat Users", + "Livechat_Routing_Method" : "Livechat Routing Method", + "Livechat_Take_Confirm" : "Do you want to take this client?", + "Livechat_Inquiry_Already_Taken" : "Livechat inquiry already taken", + "Least_Amount" : "Least Amount", + "Guest_Pool" : "Guest Pool", "Load_more" : "Load more", "Loading..." : "Loading...", "Loading_more_from_history" : "Loading more from history", @@ -892,6 +897,7 @@ "Reset_password" : "Reset password", "Restart" : "Restart", "Restart_the_server" : "Restart the server", + "Would_you_like_to_return_the_inquiry" : "Would you like to return the inquiry?", "Role" : "Role", "Role_Editing" : "Role Editing", "Role_removed" : "Role removed", diff --git a/packages/rocketchat-livechat/client/collections/LivechatInquiry.js b/packages/rocketchat-livechat/client/collections/LivechatInquiry.js new file mode 100644 index 00000000000..9bfd938f2db --- /dev/null +++ b/packages/rocketchat-livechat/client/collections/LivechatInquiry.js @@ -0,0 +1 @@ +this.LivechatInquiry = new Mongo.Collection('rocketchat_livechat_inquiry'); diff --git a/packages/rocketchat-livechat/client/views/app/tabbar/visitorInfo.html b/packages/rocketchat-livechat/client/views/app/tabbar/visitorInfo.html index c498804fff8..a8d6ae721e5 100644 --- a/packages/rocketchat-livechat/client/views/app/tabbar/visitorInfo.html +++ b/packages/rocketchat-livechat/client/views/app/tabbar/visitorInfo.html @@ -45,6 +45,10 @@ {{#if roomOpen}} {{/if}} + + {{#if guestPool}} + + {{/if}} diff --git a/packages/rocketchat-livechat/client/views/app/tabbar/visitorInfo.js b/packages/rocketchat-livechat/client/views/app/tabbar/visitorInfo.js index b168d44f5e3..e69075a46fc 100644 --- a/packages/rocketchat-livechat/client/views/app/tabbar/visitorInfo.js +++ b/packages/rocketchat-livechat/client/views/app/tabbar/visitorInfo.js @@ -95,6 +95,10 @@ Template.visitorInfo.helpers({ const room = ChatRoom.findOne({ _id: this.rid }); return room.open; + }, + + guestPool() { + return RocketChat.settings.get('Livechat_Routing_Method') === 'Guest_Pool'; } }); @@ -137,6 +141,26 @@ Template.visitorInfo.events({ }); }); }); + }, + 'click .return-inquiry'(event) { + event.preventDefault(); + + swal({ + title: t('Would_you_like_to_return_the_inquiry'), + type: 'warning', + showCancelButton: true, + confirmButtonColor: '#3085d6', + cancelButtonColor: '#d33', + confirmButtonText: t('yes') + }, () => { + Meteor.call('livechat:returnAsInquiry', this.rid, function(error/*, result*/) { + if (error) { + console.log(error); + } else { + FlowRouter.go('/home'); + } + }); + }); } }); diff --git a/packages/rocketchat-livechat/client/views/sideNav/livechat.html b/packages/rocketchat-livechat/client/views/sideNav/livechat.html index 2ab2e9b3cda..2bb28bf4c4e 100644 --- a/packages/rocketchat-livechat/client/views/sideNav/livechat.html +++ b/packages/rocketchat-livechat/client/views/sideNav/livechat.html @@ -2,11 +2,29 @@

{{_ "Livechat"}} - {{#with available}} {{/with}}

+ + {{#if guestPool}} +

+ {{_ "Incoming Livechats"}} +

+ + +

+ {{_ "Open Livechats"}} +

+ {{/if}} + +