diff --git a/.github/workflows/build_and_test.yml b/.github/workflows/build_and_test.yml
index db3be22d5464..df5438eb29c5 100644
--- a/.github/workflows/build_and_test.yml
+++ b/.github/workflows/build_and_test.yml
@@ -485,7 +485,9 @@ jobs:
RC_DOCKER_TAG: '${{ needs.release-versions.outputs.gh-docker-tag }}.official'
DOCKER_TAG: ${{ needs.release-versions.outputs.gh-docker-tag }}
TRANSPORTER: nats://nats:4222
- ENTERPRISE_LICENSE: ${{ secrets.ENTERPRISE_LICENSE }}
+ # this is 100% intentional, secrets are not available at forks, so ee-tests will always fail
+ # to avoid this, we are using a dummy license, expiring on 2022-12-31
+ ENTERPRISE_LICENSE: GWHMQe3C3lu3if4ropk1iQ09sCKjIaQogwMymgl7pbuotLpHPhTzxvuSqJYmEtHGKX4MQsrYA+8witFF3JMOc3AswwAkxQz+TZz9+XfiBo49p7OL0xfO6f9ElhLHclptcEPFDSilQlmDI1Jjr7k+MdqXxE4XbZ4Pdeg9vdEDtroKvSvd0ngtFMkIXa6829Cg0nzTCCcWo3Jc80JPub6VMgpdZ2KnsswQt8dBz+psvztcwrqF7X5731HkPX0lTttjF6SSIs+WAIdwAY4b2VRtD3PbMWxbe0ac+2x5+ItIRH0PFRh/gVWdtiKfskQpcucU739CX/d4pQGK/OWxKifH1XH824doeyYuvjXwvCW5anPlRXKAqIn2gh6LcdGfFNIbjX9wG4/U162vDr3AtEpRYdjzfvvBW1gveYMGidIiEhQZu7h5Ie9b3tNBkNBgBcqibL9JO6K3/2pxX7gymjT+9VRZgB5+ME2pziD54SjSWCwkLcf/RByxArdDSqI3llKjyDnRXjhqzsLhmsc6UdJCJd1IiqjQ4v5QXH2C57cJlej93ZLuNRFcnb0cE0nAFHIfLSZP5CSJA/gY7mtBL0b0osUisNL/os7a74JFMoa4DDfTD2CarYV5E4+fpX3NqINzpYwFzZi9pH2wIL6oe1yuZPcn9vjRhK2jvG81tHSR/4s=
run: |
docker compose -f docker-compose-ci.yml up -d --build
diff --git a/apps/meteor/app/api/server/v1/users.ts b/apps/meteor/app/api/server/v1/users.ts
index 80775f4ca0b2..379608a210b9 100644
--- a/apps/meteor/app/api/server/v1/users.ts
+++ b/apps/meteor/app/api/server/v1/users.ts
@@ -501,8 +501,12 @@ API.v1.addRoute(
return API.v1.failure('Username is already in use');
}
+ const { secret: secretURL, ...params } = this.bodyParams;
// Register the user
- const userId = Meteor.call('registerUser', this.bodyParams);
+ const userId = Meteor.call('registerUser', {
+ ...params,
+ ...(secretURL && { secretURL }),
+ });
// Now set their username
Meteor.runAsUser(userId, () => Meteor.call('setUsername', this.bodyParams.username));
diff --git a/apps/meteor/app/authentication/server/startup/index.js b/apps/meteor/app/authentication/server/startup/index.js
index 536117e232d0..019c259d0815 100644
--- a/apps/meteor/app/authentication/server/startup/index.js
+++ b/apps/meteor/app/authentication/server/startup/index.js
@@ -205,7 +205,11 @@ Accounts.onCreateUser(function (options, user = {}) {
to: destinations,
from: settings.get('From_Email'),
subject: Accounts.emailTemplates.userToActivate.subject(),
- html: Accounts.emailTemplates.userToActivate.html(options),
+ html: Accounts.emailTemplates.userToActivate.html({
+ ...options,
+ name: options.name || options.profile?.name,
+ email: options.email || user.emails[0].address,
+ }),
};
Mailer.send(email);
diff --git a/apps/meteor/app/lib/server/startup/settings.ts b/apps/meteor/app/lib/server/startup/settings.ts
index 2362ef501984..fb97e085b020 100644
--- a/apps/meteor/app/lib/server/startup/settings.ts
+++ b/apps/meteor/app/lib/server/startup/settings.ts
@@ -431,15 +431,15 @@ settingsRegistry.addGroup('Accounts', function () {
values: [
{
key: 'default',
- i18nLabel: 'Default',
+ i18nLabel: 'Selected_first_reply_unselected_following_replies',
},
{
key: 'always',
- i18nLabel: 'Always',
+ i18nLabel: 'Selected_by_default',
},
{
key: 'never',
- i18nLabel: 'Never',
+ i18nLabel: 'Unselected_by_default',
},
],
public: true,
diff --git a/apps/meteor/app/livechat/lib/messageTypes.ts b/apps/meteor/app/livechat/lib/messageTypes.ts
index 65872433a25f..c30916d4b4c9 100644
--- a/apps/meteor/app/livechat/lib/messageTypes.ts
+++ b/apps/meteor/app/livechat/lib/messageTypes.ts
@@ -48,8 +48,20 @@ MessageTypes.registerType({
...(comment && { comment }),
}),
queue: (): string =>
- TAPi18n.__('Livechat_transfer_return_to_the_queue', {
+ TAPi18n.__(`Livechat_transfer_return_to_the_queue${commentLabel}`, {
from,
+ ...(comment && { comment }),
+ }),
+ autoTransferUnansweredChatsToAgent: (): string =>
+ TAPi18n.__(`Livechat_transfer_to_agent_auto_transfer_unanswered_chat`, {
+ from,
+ to: message?.transferData?.transferredTo?.name || message?.transferData?.transferredTo?.username || '',
+ duration: comment,
+ }),
+ autoTransferUnansweredChatsToQueue: (): string =>
+ TAPi18n.__(`Livechat_transfer_return_to_the_queue_auto_transfer_unanswered_chat`, {
+ from,
+ duration: comment,
}),
};
return {
diff --git a/apps/meteor/app/livechat/server/hooks/saveAnalyticsData.js b/apps/meteor/app/livechat/server/hooks/saveAnalyticsData.js
index 1a82c6152b3e..692040a67771 100644
--- a/apps/meteor/app/livechat/server/hooks/saveAnalyticsData.js
+++ b/apps/meteor/app/livechat/server/hooks/saveAnalyticsData.js
@@ -3,10 +3,12 @@ import { isOmnichannelRoom } from '@rocket.chat/core-typings';
import { callbacks } from '../../../../lib/callbacks';
import { LivechatRooms } from '../../../models/server';
import { normalizeMessageFileUpload } from '../../../utils/server/functions/normalizeMessageFileUpload';
+import { callbackLogger } from '../lib/callbackLogger';
callbacks.add(
'afterSaveMessage',
function (message, room) {
+ callbackLogger.debug(`Calculating Omnichannel metrics for room ${room._id}`);
// check if room is livechat
if (!isOmnichannelRoom(room)) {
return message;
@@ -19,6 +21,10 @@ callbacks.add(
// if the message has a token, it was sent by the visitor
if (message.token) {
+ // When visitor sends a mesage, most metrics wont be calculated/served.
+ // But, v.lq (last query) will be updated to the message time. This has to be done
+ // As not doing it will cause the metrics to be crazy and not have real values.
+ LivechatRooms.saveAnalyticsDataByRoomId(room, message);
return message;
}
@@ -37,6 +43,7 @@ callbacks.add(
const isResponseTotal = room.metrics && room.metrics.response && room.metrics.response.total;
if (agentLastReply === room.ts) {
+ callbackLogger.debug('Calculating: first message from agent');
// first response
const firstResponseDate = now;
const firstResponseTime = (now.getTime() - visitorLastQuery) / 1000;
@@ -58,6 +65,7 @@ callbacks.add(
reactionTime,
};
} else if (visitorLastQuery > agentLastReply) {
+ callbackLogger.debug('Calculating: visitor sent a message after agent');
// response, not first
const responseTime = (now.getTime() - visitorLastQuery) / 1000;
const avgResponseTime =
diff --git a/apps/meteor/app/livechat/server/lib/Livechat.js b/apps/meteor/app/livechat/server/lib/Livechat.js
index 9505f15c1af8..af5f779a214c 100644
--- a/apps/meteor/app/livechat/server/lib/Livechat.js
+++ b/apps/meteor/app/livechat/server/lib/Livechat.js
@@ -751,7 +751,7 @@ export const Livechat = {
return RoutingManager.transferRoom(room, guest, transferData);
},
- returnRoomAsInquiry(rid, departmentId) {
+ returnRoomAsInquiry(rid, departmentId, overrideTransferData = {}) {
Livechat.logger.debug(`Transfering room ${rid} to ${departmentId ? 'department' : ''} queue`);
const room = LivechatRooms.findOneById(rid);
if (!room) {
@@ -791,7 +791,7 @@ export const Livechat = {
const transferredBy = normalizeTransferredByData(user, room);
Livechat.logger.debug(`Transfering room ${room._id} by user ${transferredBy._id}`);
- const transferData = { roomId: rid, scope: 'queue', departmentId, transferredBy };
+ const transferData = { roomId: rid, scope: 'queue', departmentId, transferredBy, ...overrideTransferData };
try {
this.saveTransferHistory(room, transferData);
RoutingManager.unassignAgent(inquiry, departmentId);
diff --git a/apps/meteor/app/mail-messages/server/functions/sendMail.ts b/apps/meteor/app/mail-messages/server/functions/sendMail.ts
index cec6b8c6d1c2..36dd1ad5c7a9 100644
--- a/apps/meteor/app/mail-messages/server/functions/sendMail.ts
+++ b/apps/meteor/app/mail-messages/server/functions/sendMail.ts
@@ -9,7 +9,19 @@ import { placeholders } from '../../../utils/server';
import { SystemLogger } from '../../../../server/lib/logger/system';
import * as Mailer from '../../../mailer';
-export const sendMail = function (from: string, subject: string, body: string, dryrun: boolean, query: string): void {
+export const sendMail = function ({
+ from,
+ subject,
+ body,
+ dryrun,
+ query,
+}: {
+ from: string;
+ subject: string;
+ body: string;
+ dryrun?: boolean;
+ query?: string;
+}): void {
Mailer.checkAddressFormatAndThrow(from, 'Mailer.sendMail');
if (body.indexOf('[unsubscribe]') === -1) {
diff --git a/apps/meteor/app/mail-messages/server/methods/sendMail.ts b/apps/meteor/app/mail-messages/server/methods/sendMail.ts
index 80f3df8a4073..ba376e32161d 100644
--- a/apps/meteor/app/mail-messages/server/methods/sendMail.ts
+++ b/apps/meteor/app/mail-messages/server/methods/sendMail.ts
@@ -13,7 +13,7 @@ Meteor.methods({
});
}
- return Mailer.sendMail(from, subject, body, dryrun, query);
+ return Mailer.sendMail({ from, subject, body, dryrun, query });
},
});
diff --git a/apps/meteor/app/models/server/models/LivechatRooms.js b/apps/meteor/app/models/server/models/LivechatRooms.js
index cef4529b21b0..9759b85b1488 100644
--- a/apps/meteor/app/models/server/models/LivechatRooms.js
+++ b/apps/meteor/app/models/server/models/LivechatRooms.js
@@ -835,45 +835,6 @@ export class LivechatRooms extends Base {
return this.update(query, update);
}
- setAutoTransferredAtById(roomId) {
- const query = {
- _id: roomId,
- };
- const update = {
- $set: {
- autoTransferredAt: new Date(),
- },
- };
-
- return this.update(query, update);
- }
-
- setAutoTransferOngoingById(roomId) {
- const query = {
- _id: roomId,
- };
- const update = {
- $set: {
- autoTransferOngoing: true,
- },
- };
-
- return this.update(query, update);
- }
-
- unsetAutoTransferOngoingById(roomId) {
- const query = {
- _id: roomId,
- };
- const update = {
- $unset: {
- autoTransferOngoing: 1,
- },
- };
-
- return this.update(query, update);
- }
-
changeVisitorByRoomId(roomId, { _id, username, token }) {
const query = {
_id: roomId,
diff --git a/apps/meteor/app/search/client/provider/result.js b/apps/meteor/app/search/client/provider/result.js
index 03c00c69fda2..4749b5d0f684 100644
--- a/apps/meteor/app/search/client/provider/result.js
+++ b/apps/meteor/app/search/client/provider/result.js
@@ -79,7 +79,8 @@ Template.DefaultSearchResultTemplate.onCreated(function () {
// global search
this.globalSearchEnabled = this.data.settings.GlobalSearchEnabled;
- this.data.parentPayload.searchAll = this.globalSearchEnabled;
+ // default value for global search
+ this.data.parentPayload.searchAll = false;
this.hasMore = new ReactiveVar(true);
diff --git a/apps/meteor/app/theme/client/imports/general/base.css b/apps/meteor/app/theme/client/imports/general/base.css
index eb6eecd06db1..8ca927ef3378 100644
--- a/apps/meteor/app/theme/client/imports/general/base.css
+++ b/apps/meteor/app/theme/client/imports/general/base.css
@@ -35,12 +35,6 @@ body {
-moz-osx-font-smoothing: grayscale;
}
-@media (width <= 500px) {
- body {
- position: fixed;
- }
-}
-
:focus {
outline: 0 !important;
outline-style: none;
@@ -54,7 +48,7 @@ body {
display: table;
clear: both;
- content: "";
+ content: '';
}
}
@@ -136,7 +130,7 @@ button {
width: 100%;
height: 1px;
- content: "";
+ content: '';
animation-name: unread;
animation-duration: 0.2s;
diff --git a/apps/meteor/app/theme/client/imports/general/base_old.css b/apps/meteor/app/theme/client/imports/general/base_old.css
index 64a75e9a58ef..f1295db53604 100644
--- a/apps/meteor/app/theme/client/imports/general/base_old.css
+++ b/apps/meteor/app/theme/client/imports/general/base_old.css
@@ -280,40 +280,6 @@
& input[type='text'] {
display: block;
}
-
- &.double-col {
- & > label {
- width: 30%;
- margin-bottom: 0;
- padding: 10px 20px 10px 0;
-
- text-align: right;
-
- line-height: 15px;
- }
-
- & > div {
- width: 60%;
- min-height: 2.5rem;
-
- & label {
- display: inline-block;
-
- margin-right: 4px;
- padding: 10px 20px 10px 0;
-
- line-height: 15px;
-
- &:nth-last-child(1) {
- margin-right: 0;
- }
-
- & input {
- margin-right: 4px;
- }
- }
- }
- }
}
.rc-old form.inline {
@@ -365,22 +331,6 @@
content: ' *';
}
-.rc-old .btn-loading {
- cursor: not-allowed;
- pointer-events: none;
-
- border-width: 0;
- box-shadow: none !important;
-
- & i {
- display: block;
- }
-
- & div {
- display: none;
- }
-}
-
/* new layout buttons */
.rc-old .button {
@@ -552,37 +502,6 @@
}
}
-/*
-.rc-old #rocket-chat {
- position: fixed;
- top: 0;
- right: 0;
- bottom: 0;
- left: 0;
-
- display: block;
- visibility: visible;
-
- width: auto;
-
- transition: opacity 0.2s ease-out;
-
- opacity: 1;
-
- &.animated-hidden {
- visibility: hidden;
-
- opacity: 0;
- }
-
- & > .alert {
- position: absolute;
-
- margin-bottom: 0;
- padding: 5px;
- }
-} */
-
/* rooms-box */
.rc-old.flex-nav {
@@ -797,34 +716,6 @@
animation: highlight 6s infinite;
}
-.cms-page {
- display: flex;
- flex-direction: column;
-
- max-width: 800px;
- max-height: 100%;
- margin: auto;
-
- padding: 2rem;
-
- border-radius: var(--border-radius);
-
- &__content {
- overflow: auto;
-
- margin: -1rem;
- padding: 1rem;
- }
-
- & .cms-page-close {
- display: flex;
-
- margin-bottom: 10px;
-
- justify-content: flex-end;
- }
-}
-
/* MAIN CONTENT + MAIN PAGES */
.rc-old .page-settings {
@@ -2723,21 +2614,6 @@
}
}
-@media (width <= 500px) {
- .cms-page {
- padding: 0;
-
- &__content {
- margin: 0;
- padding: 0 1rem 1rem;
- }
-
- & .cms-page-close {
- margin-top: 10px;
- }
- }
-}
-
@media (height <= 480px) {
.rc-old #login-card {
margin: 10px auto;
diff --git a/apps/meteor/app/theme/client/main.css b/apps/meteor/app/theme/client/main.css
index 7d71e8a6e0f0..87a1ade5d42b 100644
--- a/apps/meteor/app/theme/client/main.css
+++ b/apps/meteor/app/theme/client/main.css
@@ -36,7 +36,6 @@
@import 'imports/components/read-receipts.css';
@import 'imports/components/contextual-bar.css';
@import 'imports/components/emojiPicker.css';
-@import 'imports/components/table.css';
/* User Info */
@import 'imports/components/userInfo.css';
diff --git a/apps/meteor/app/ui-login/README.md b/apps/meteor/app/ui-login/README.md
deleted file mode 100644
index e69de29bb2d1..000000000000
diff --git a/apps/meteor/app/ui-login/client/index.js b/apps/meteor/app/ui-login/client/index.js
deleted file mode 100644
index f78815730e02..000000000000
--- a/apps/meteor/app/ui-login/client/index.js
+++ /dev/null
@@ -1,9 +0,0 @@
-import './login/form.html';
-import './login/layout.html';
-import './login/layout';
-import './login/services.html';
-import './username/username.html';
-import './login/form';
-import './login/services';
-import './username/username';
-import './login/startup';
diff --git a/apps/meteor/app/ui-login/client/index.ts b/apps/meteor/app/ui-login/client/index.ts
new file mode 100644
index 000000000000..6197fdfb1a3f
--- /dev/null
+++ b/apps/meteor/app/ui-login/client/index.ts
@@ -0,0 +1,2 @@
+import './username/username.html';
+import './username/username';
diff --git a/apps/meteor/app/ui-login/client/login/form.html b/apps/meteor/app/ui-login/client/login/form.html
deleted file mode 100644
index 4c4a253104d9..000000000000
--- a/apps/meteor/app/ui-login/client/login/form.html
+++ /dev/null
@@ -1,156 +0,0 @@
-
-
-
{{_ noSubscriptionText }}
- {{/each}} -
+
+