Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .docker/Dockerfile.rhel
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM registry.access.redhat.com/ubi8/nodejs-12

ENV RC_VERSION 3.14.0
ENV RC_VERSION 3.14.1

MAINTAINER [email protected]

Expand Down
117 changes: 116 additions & 1 deletion .github/history.json
Original file line number Diff line number Diff line change
Expand Up @@ -59497,6 +59497,121 @@
"4.0"
],
"pull_requests": []
},
"3.14.1": {
"node_version": "12.22.1",
"npm_version": "6.14.1",
"apps_engine_version": "1.25.0",
"mongo_versions": [
"3.4",
"3.6",
"4.0"
],
"pull_requests": [
{
"pr": "22077",
"title": "[Patch] [EE] Improve Forwarding Department behaviour with Waiting queue feature",
"userLogin": "murtaza98",
"contributors": [
"murtaza98",
"renatobecker",
"tiagoevanp"
]
},
{
"pr": "22068",
"title": "regression: fix departments with empty ancestors not being returned",
"userLogin": "MartinSchoeler",
"milestone": "3.14.1",
"contributors": [
"MartinSchoeler"
]
},
{
"pr": "22052",
"title": "[NEW] Paginated and Filtered selects on new/edit unit",
"userLogin": "MartinSchoeler",
"description": "REQUIRES https://github.com/RocketChat/Rocket.Chat.Fuselage/pull/447\r\n\r\nAdds infinite scrolling selects to the units edit/create with the ability to be filtered by text as well\r\n\r\n![Screen Shot 2021-05-17 at 9 24 19 AM](https://user-images.githubusercontent.com/20868078/118487999-abc32a80-b6f1-11eb-8d58-d031111ea0fb.png)\r\n\r\nThis Affects the monitors and departments inputs",
"milestone": "3.14.1",
"contributors": [
"rafaelblink",
"MartinSchoeler",
"web-flow"
]
},
{
"pr": "21969",
"title": "[FIX] Notify with sound first message in queue list",
"userLogin": "tiagoevanp",
"milestone": "3.14.1",
"contributors": [
"tiagoevanp",
"web-flow",
"renatobecker"
]
},
{
"pr": "22048",
"title": "[EE] Omnichannel monitors not authorized to view departments",
"userLogin": "renatobecker",
"milestone": "3.14.1",
"contributors": [
"renatobecker",
"web-flow"
]
},
{
"pr": "22015",
"title": "[FIX] Close stream properly at Omnichannel room when move to queue",
"userLogin": "tiagoevanp",
"milestone": "3.14.1",
"contributors": [
"ggazzo",
"tiagoevanp"
]
},
{
"pr": "21893",
"title": "[FIX] IE11 support",
"userLogin": "dougfabris",
"milestone": "3.14.1",
"contributors": [
"ggazzo",
"dougfabris"
]
},
{
"pr": "21947",
"title": "[FIX] When closing chats a comment is always required",
"userLogin": "MartinSchoeler",
"description": "Fixes issue with the setting `Livechat_request_comment_when_closing_conversation` not working as intended",
"milestone": "3.14.1",
"contributors": [
"MartinSchoeler"
]
},
{
"pr": "21688",
"title": "[IMPROVE] Omnichannel Room Information panel flow when user save or close on form page.",
"userLogin": "rafaelblink",
"milestone": "3.14.1",
"contributors": [
"rafaelblink",
"web-flow",
"renatobecker",
"MartinSchoeler"
]
},
{
"pr": "22043",
"title": "[ENTERPRISE][IMPROVE] Forwarding Department behaviour with Waiting queue feature",
"userLogin": "murtaza98",
"milestone": "3.14.1",
"contributors": [
"murtaza98"
]
}
]
}
}
}
}
2 changes: 1 addition & 1 deletion .snapcraft/resources/prepareRocketChat
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

curl -SLf "https://releases.rocket.chat/3.14.0/download/" -o rocket.chat.tgz
curl -SLf "https://releases.rocket.chat/3.14.1/download/" -o rocket.chat.tgz

tar xf rocket.chat.tgz --strip 1

Expand Down
2 changes: 1 addition & 1 deletion .snapcraft/snap/snapcraft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
# 5. `snapcraft snap`

name: rocketchat-server
version: 3.14.0
version: 3.14.1
summary: Rocket.Chat server
description: Have your own Slack like online chat, built with Meteor. https://rocket.chat/
confinement: strict
Expand Down
66 changes: 65 additions & 1 deletion HISTORY.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,70 @@

# 3.14.1
`2021-05-19 · 1 🎉 · 2 🚀 · 4 🐛 · 3 🔍 · 7 👩‍💻👨‍💻`

### Engine versions
- Node: `12.22.1`
- NPM: `6.14.1`
- MongoDB: `3.4, 3.6, 4.0`
- Apps-Engine: `1.25.0`

### 🎉 New features


- Paginated and Filtered selects on new/edit unit ([#22052](https://github.com/RocketChat/Rocket.Chat/pull/22052))

REQUIRES https://github.com/RocketChat/Rocket.Chat.Fuselage/pull/447

Adds infinite scrolling selects to the units edit/create with the ability to be filtered by text as well

![Screen Shot 2021-05-17 at 9 24 19 AM](https://user-images.githubusercontent.com/20868078/118487999-abc32a80-b6f1-11eb-8d58-d031111ea0fb.png)

This Affects the monitors and departments inputs

### 🚀 Improvements


- Forwarding Department behaviour with Waiting queue feature ([#22043](https://github.com/RocketChat/Rocket.Chat/pull/22043))

- Omnichannel Room Information panel flow when user save or close on form page. ([#21688](https://github.com/RocketChat/Rocket.Chat/pull/21688))

### 🐛 Bug fixes


- Close stream properly at Omnichannel room when move to queue ([#22015](https://github.com/RocketChat/Rocket.Chat/pull/22015))

- IE11 support ([#21893](https://github.com/RocketChat/Rocket.Chat/pull/21893))

- Notify with sound first message in queue list ([#21969](https://github.com/RocketChat/Rocket.Chat/pull/21969))

- When closing chats a comment is always required ([#21947](https://github.com/RocketChat/Rocket.Chat/pull/21947))

Fixes issue with the setting `Livechat_request_comment_when_closing_conversation` not working as intended

<details>
<summary>🔍 Minor changes</summary>


- [EE] Omnichannel monitors not authorized to view departments ([#22048](https://github.com/RocketChat/Rocket.Chat/pull/22048))

- [Patch] [EE] Improve Forwarding Department behaviour with Waiting queue feature ([#22077](https://github.com/RocketChat/Rocket.Chat/pull/22077))

- regression: fix departments with empty ancestors not being returned ([#22068](https://github.com/RocketChat/Rocket.Chat/pull/22068))

</details>

### 👩‍💻👨‍💻 Core Team 🤓

- [@MartinSchoeler](https://github.com/MartinSchoeler)
- [@dougfabris](https://github.com/dougfabris)
- [@ggazzo](https://github.com/ggazzo)
- [@murtaza98](https://github.com/murtaza98)
- [@rafaelblink](https://github.com/rafaelblink)
- [@renatobecker](https://github.com/renatobecker)
- [@tiagoevanp](https://github.com/tiagoevanp)

# 3.14.0
`2021-04-27 · 9 🎉 · 9 🚀 · 55 🐛 · 38 🔍 · 30 👩‍💻👨‍💻`
`2021-04-28 · 9 🎉 · 9 🚀 · 55 🐛 · 38 🔍 · 30 👩‍💻👨‍💻`

### Engine versions
- Node: `12.22.1`
Expand Down
18 changes: 18 additions & 0 deletions app/livechat/client/lib/stream/queueManager.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,32 @@
import { Meteor } from 'meteor/meteor';

import { APIClient } from '../../../../utils/client';
import { LivechatInquiry } from '../../collections/LivechatInquiry';
import { inquiryDataStream } from './inquiry';
import { call } from '../../../../ui-utils/client';
import { getUserPreference } from '../../../../utils';
import { CustomSounds } from '../../../../custom-sounds/client/lib/CustomSounds';

const departments = new Set();

const newInquirySound = () => {
const userId = Meteor.userId();
const audioVolume = getUserPreference(userId, 'notificationsSoundVolume');
const newRoomNotification = getUserPreference(userId, 'newRoomNotification');
const audioNotificationValue = getUserPreference(userId, 'audioNotifications');

if (audioNotificationValue !== 'none') {
CustomSounds.play(newRoomNotification, {
volume: Number((audioVolume / 100).toPrecision(2)),
});
}
};

const events = {
added: (inquiry) => {
delete inquiry.type;
departments.has(inquiry.department) && LivechatInquiry.insert({ ...inquiry, alert: true, _updatedAt: new Date(inquiry._updatedAt) });
newInquirySound();
},
changed: (inquiry) => {
if (inquiry.status !== 'queued' || (inquiry.department && !departments.has(inquiry.department))) {
Expand Down
1 change: 1 addition & 0 deletions app/livechat/client/views/app/tabbar/visitorForward.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ Template.visitorForward.events({
const transferData = {
roomId: instance.room.get()._id,
comment: event.target.comment.value,
clientAction: true,
};

const [user] = instance.selectedAgents.get();
Expand Down
25 changes: 17 additions & 8 deletions app/livechat/server/lib/Helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import { Apps, AppEvents } from '../../../apps/server';
import notifications from '../../../notifications/server/lib/Notifications';
import { sendNotification } from '../../../lib/server';
import { sendMessage } from '../../../lib/server/functions/sendMessage';
import { queueInquiry } from './QueueManager';

export const allowAgentSkipQueue = (agent) => {
check(agent, Match.ObjectIncluding({
Expand Down Expand Up @@ -273,7 +274,7 @@ export const forwardRoomToAgent = async (room, transferData) => {
return false;
}

const { userId: agentId } = transferData;
const { userId: agentId, clientAction } = transferData;
const user = Users.findOneOnlineAgentById(agentId);
if (!user) {
throw new Meteor.Error('error-user-is-offline', 'User is offline', { function: 'forwardRoomToAgent' });
Expand All @@ -291,9 +292,11 @@ export const forwardRoomToAgent = async (room, transferData) => {

const { username } = user;
const agent = { agentId, username };
// There are some Enterprise features that may interrupt the fowarding process
// Remove department from inquiry to make sure the routing algorithm treat this as forwarding to agent and not as forwarding to department
inquiry.department = undefined;
// There are some Enterprise features that may interrupt the forwarding process
// Due to that we need to check whether the agent has been changed or not
const roomTaken = await RoutingManager.takeInquiry(inquiry, agent);
const roomTaken = await RoutingManager.takeInquiry(inquiry, agent, { ...clientAction && { clientAction } });
if (!roomTaken) {
return false;
}
Expand Down Expand Up @@ -356,7 +359,7 @@ export const forwardRoomToDepartment = async (room, guest, transferData) => {
throw new Meteor.Error('error-forwarding-chat-same-department', 'The selected department and the current room department are the same', { function: 'forwardRoomToDepartment' });
}

const { userId: agentId } = transferData;
const { userId: agentId, clientAction } = transferData;
if (agentId) {
let user = Users.findOneOnlineAgentById(agentId);
if (!user) {
Expand All @@ -378,26 +381,32 @@ export const forwardRoomToDepartment = async (room, guest, transferData) => {
// Fake the department to forward the inquiry - Case the forward process does not success
// the inquiry will stay in the same original department
inquiry.department = departmentId;
const roomTaken = await RoutingManager.delegateInquiry(inquiry, agent);
const roomTaken = await RoutingManager.delegateInquiry(inquiry, agent, { forwardingToDepartment: { oldDepartmentId }, ...clientAction && { clientAction } });
if (!roomTaken) {
return false;
}

const { servedBy } = roomTaken;
if (oldServedBy && servedBy && oldServedBy._id === servedBy._id) {
const { servedBy, chatQueued } = roomTaken;
if (!chatQueued && oldServedBy && servedBy && oldServedBy._id === servedBy._id) {
return false;
}

Livechat.saveTransferHistory(room, transferData);
if (oldServedBy) {
removeAgentFromSubscription(rid, oldServedBy);
}
if (servedBy) {
if (!chatQueued && servedBy) {
Messages.createUserJoinWithRoomIdAndUser(rid, servedBy);
}

updateChatDepartment({ rid, newDepartmentId: departmentId, oldDepartmentId });

if (chatQueued) {
LivechatInquiry.readyInquiry(inquiry._id);
const newInquiry = LivechatInquiry.findOneById(inquiry._id);
await queueInquiry(room, newInquiry);
}

const { token } = guest;
Livechat.setDepartmentForGuest({ token, department: departmentId });

Expand Down
7 changes: 3 additions & 4 deletions app/livechat/server/lib/RoutingManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export const RoutingManager = {
return this.getMethod().getNextAgent(department, ignoreAgentId);
},

async delegateInquiry(inquiry, agent) {
async delegateInquiry(inquiry, agent, options = {}) {
const { department, rid } = inquiry;
if (!agent || (agent.username && !Users.findOneOnlineAgentByUsername(agent.username) && !allowAgentSkipQueue(agent))) {
agent = await this.getNextAgent(department);
Expand All @@ -53,7 +53,7 @@ export const RoutingManager = {
return LivechatRooms.findOneById(rid);
}

return this.takeInquiry(inquiry, agent);
return this.takeInquiry(inquiry, agent, options);
},

assignAgent(inquiry, agent) {
Expand Down Expand Up @@ -134,8 +134,7 @@ export const RoutingManager = {

agent = await callbacks.run('livechat.checkAgentBeforeTakeInquiry', { agent, inquiry, options });
if (!agent) {
await callbacks.run('livechat.onAgentAssignmentFailed', { inquiry, room, options });
return null;
return callbacks.run('livechat.onAgentAssignmentFailed', { inquiry, room, options });
}

if (room.onHold) {
Expand Down
1 change: 1 addition & 0 deletions app/livechat/server/methods/transfer.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ Meteor.methods({
userId: Match.Optional(String),
departmentId: Match.Optional(String),
comment: Match.Optional(String),
clientAction: Match.Optional(Boolean),
});

const room = LivechatRooms.findOneById(transferData.roomId);
Expand Down
3 changes: 2 additions & 1 deletion app/ui-cached-collection/client/models/CachedCollection.js
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,8 @@ export class CachedCollection extends Emitter {
});
}
if (room) {
RoomManager.close(room.t + room.name);
room.name && RoomManager.close(room.t + room.name);
!room.name && RoomManager.close(room.t + room._id);
}
this.collection.remove(record._id);
} else {
Expand Down
4 changes: 1 addition & 3 deletions app/ui-sidenav/client/sideNav.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,7 @@
</div>
</div>
<div class="rooms-list sidebar--custom-colors" aria-label="{{_ "Channels"}}" role="region">
<div style="display: flex; flex: 1 1 auto;">
{{> sidebarChats }}
</div>
{{> sidebarChats }}
</div>
<div class="wrapper-unread">
<div class="unread-rooms background-primary-action-color color-primary-action-contrast bottom-unread-rooms hidden">
Expand Down
Loading