From a09416ebede5a0166f8c0d5ca72a4851b12f1e75 Mon Sep 17 00:00:00 2001 From: rocketchat-github-ci Date: Wed, 28 Feb 2024 17:27:44 +0000 Subject: [PATCH 01/79] Bump 6.6.2 --- .changeset/bump-patch-1709141264352.md | 5 +++++ yarn.lock | 16 ++++++++-------- 2 files changed, 13 insertions(+), 8 deletions(-) create mode 100644 .changeset/bump-patch-1709141264352.md diff --git a/.changeset/bump-patch-1709141264352.md b/.changeset/bump-patch-1709141264352.md new file mode 100644 index 000000000000..e1eaa7980afb --- /dev/null +++ b/.changeset/bump-patch-1709141264352.md @@ -0,0 +1,5 @@ +--- +'@rocket.chat/meteor': patch +--- + +Bump @rocket.chat/meteor version. diff --git a/yarn.lock b/yarn.lock index e43d51516fe1..09e8467357b7 100644 --- a/yarn.lock +++ b/yarn.lock @@ -9348,9 +9348,9 @@ __metadata: "@rocket.chat/icons": "*" "@rocket.chat/prettier-config": "*" "@rocket.chat/styled": "*" - "@rocket.chat/ui-contexts": 4.0.0 + "@rocket.chat/ui-contexts": 4.0.1 "@rocket.chat/ui-kit": 0.33.0 - "@rocket.chat/ui-video-conf": 4.0.0 + "@rocket.chat/ui-video-conf": 4.0.1 "@tanstack/react-query": "*" react: "*" react-dom: "*" @@ -9432,14 +9432,14 @@ __metadata: ts-jest: ~29.1.1 typescript: ~5.3.2 peerDependencies: - "@rocket.chat/core-typings": 6.6.0 + "@rocket.chat/core-typings": 6.6.1 "@rocket.chat/css-in-js": "*" "@rocket.chat/fuselage": "*" "@rocket.chat/fuselage-tokens": "*" "@rocket.chat/message-parser": "*" "@rocket.chat/styled": "*" - "@rocket.chat/ui-client": 4.0.0 - "@rocket.chat/ui-contexts": 4.0.0 + "@rocket.chat/ui-client": 4.0.1 + "@rocket.chat/ui-contexts": 4.0.1 katex: "*" react: "*" languageName: unknown @@ -10621,7 +10621,7 @@ __metadata: "@rocket.chat/fuselage": "*" "@rocket.chat/fuselage-hooks": "*" "@rocket.chat/icons": "*" - "@rocket.chat/ui-contexts": 4.0.0 + "@rocket.chat/ui-contexts": 4.0.1 react: ~17.0.2 languageName: unknown linkType: soft @@ -10796,7 +10796,7 @@ __metadata: "@rocket.chat/fuselage-hooks": "*" "@rocket.chat/icons": "*" "@rocket.chat/styled": "*" - "@rocket.chat/ui-contexts": 4.0.0 + "@rocket.chat/ui-contexts": 4.0.1 react: ^17.0.2 react-dom: ^17.0.2 languageName: unknown @@ -10885,7 +10885,7 @@ __metadata: peerDependencies: "@rocket.chat/layout": "*" "@rocket.chat/tools": 0.2.1 - "@rocket.chat/ui-contexts": 4.0.0 + "@rocket.chat/ui-contexts": 4.0.1 "@tanstack/react-query": "*" react: "*" react-hook-form: "*" From 329ae41d2735f5e149d3384cd8ebe32103f76dbf Mon Sep 17 00:00:00 2001 From: Debdut Chakraborty Date: Wed, 28 Feb 2024 19:03:16 +0530 Subject: [PATCH 02/79] fix: make lifecycle methods part of inherited class in federation services (#31844) --- .changeset/shy-bananas-repeat.md | 5 +++++ .../meteor/ee/server/local-services/federation/service.ts | 8 ++++++++ apps/meteor/server/services/federation/service.ts | 8 ++++++++ 3 files changed, 21 insertions(+) create mode 100644 .changeset/shy-bananas-repeat.md diff --git a/.changeset/shy-bananas-repeat.md b/.changeset/shy-bananas-repeat.md new file mode 100644 index 000000000000..8fe1388897a2 --- /dev/null +++ b/.changeset/shy-bananas-repeat.md @@ -0,0 +1,5 @@ +--- +'@rocket.chat/meteor': patch +--- + +Fixed Federation not working with Microservice deployments diff --git a/apps/meteor/ee/server/local-services/federation/service.ts b/apps/meteor/ee/server/local-services/federation/service.ts index a1272f5c8661..15f661a29e63 100644 --- a/apps/meteor/ee/server/local-services/federation/service.ts +++ b/apps/meteor/ee/server/local-services/federation/service.ts @@ -207,4 +207,12 @@ export class FederationServiceEE extends AbstractBaseFederationServiceEE impleme await federationService.initialize(); return federationService; } + + async created(): Promise { + return super.created(); + } + + async stopped(): Promise { + return super.stopped(); + } } diff --git a/apps/meteor/server/services/federation/service.ts b/apps/meteor/server/services/federation/service.ts index be154cee4a68..931cb9248e6e 100644 --- a/apps/meteor/server/services/federation/service.ts +++ b/apps/meteor/server/services/federation/service.ts @@ -330,4 +330,12 @@ export class FederationService extends AbstractBaseFederationService implements await federationService.initialize(); return federationService; } + + public async stopped(): Promise { + return super.stopped(); + } + + public async created(): Promise { + return super.created(); + } } From 5abac60f19cbe3073d605c22e6e4eac7642c4160 Mon Sep 17 00:00:00 2001 From: Diego Sampaio Date: Fri, 23 Feb 2024 18:27:19 -0300 Subject: [PATCH 03/79] fix: revert status websocket payload changes (#31823) --- .changeset/strange-lamps-taste.md | 6 ++++++ .../app/notifications/client/lib/Presence.ts | 9 +++++++-- .../server/modules/listeners/listeners.module.ts | 14 +++++++++++--- .../modules/notifications/notifications.module.ts | 4 ++-- ee/packages/ddp-client/src/types/streams.ts | 5 ++--- 5 files changed, 28 insertions(+), 10 deletions(-) create mode 100644 .changeset/strange-lamps-taste.md diff --git a/.changeset/strange-lamps-taste.md b/.changeset/strange-lamps-taste.md new file mode 100644 index 000000000000..88b61f5e5dec --- /dev/null +++ b/.changeset/strange-lamps-taste.md @@ -0,0 +1,6 @@ +--- +'@rocket.chat/ddp-client': patch +'@rocket.chat/meteor': patch +--- + +Revert unintentional changes real time presence data payload diff --git a/apps/meteor/app/notifications/client/lib/Presence.ts b/apps/meteor/app/notifications/client/lib/Presence.ts index 8cff2ed84f61..dff4ecb0392f 100644 --- a/apps/meteor/app/notifications/client/lib/Presence.ts +++ b/apps/meteor/app/notifications/client/lib/Presence.ts @@ -1,4 +1,4 @@ -import type { UserStatus } from '@rocket.chat/core-typings'; +import { UserStatus } from '@rocket.chat/core-typings'; import { Meteor } from 'meteor/meteor'; import { Presence } from '../../../../client/lib/presence'; @@ -10,6 +10,11 @@ new Meteor.Streamer('user-presence'); type args = [username: string, statusChanged?: UserStatus, statusText?: string]; +export const STATUS_MAP = [UserStatus.OFFLINE, UserStatus.ONLINE, UserStatus.AWAY, UserStatus.BUSY, UserStatus.DISABLED]; + Meteor.StreamerCentral.on('stream-user-presence', (uid: string, [username, statusChanged, statusText]: args) => { - Presence.notify({ _id: uid, username, status: statusChanged, statusText }); + if (!statusChanged) { + return; + } + Presence.notify({ _id: uid, username, status: STATUS_MAP[statusChanged as any], statusText }); }); diff --git a/apps/meteor/server/modules/listeners/listeners.module.ts b/apps/meteor/server/modules/listeners/listeners.module.ts index 49a3017af81c..ecaab84b2fac 100644 --- a/apps/meteor/server/modules/listeners/listeners.module.ts +++ b/apps/meteor/server/modules/listeners/listeners.module.ts @@ -2,7 +2,7 @@ import type { AppStatus } from '@rocket.chat/apps-engine/definition/AppStatus'; import type { ISetting as AppsSetting } from '@rocket.chat/apps-engine/definition/settings'; import type { IServiceClass } from '@rocket.chat/core-services'; import { EnterpriseSettings } from '@rocket.chat/core-services'; -import { isSettingColor, isSettingEnterprise } from '@rocket.chat/core-typings'; +import { isSettingColor, isSettingEnterprise, UserStatus } from '@rocket.chat/core-typings'; import type { IUser, IRoom, VideoConference, ISetting, IOmnichannelRoom } from '@rocket.chat/core-typings'; import { Logger } from '@rocket.chat/logger'; import { parse } from '@rocket.chat/message-parser'; @@ -12,6 +12,14 @@ import type { NotificationsModule } from '../notifications/notifications.module' const isMessageParserDisabled = process.env.DISABLE_MESSAGE_PARSER === 'true'; +const STATUS_MAP: Record = { + [UserStatus.OFFLINE]: 0, + [UserStatus.ONLINE]: 1, + [UserStatus.AWAY]: 2, + [UserStatus.BUSY]: 3, + [UserStatus.DISABLED]: 0, +} as const; + const minimongoChangeMap: Record = { inserted: 'added', updated: 'changed', @@ -145,10 +153,10 @@ export class ListenersModule { return; } - notifications.notifyLoggedInThisInstance('user-status', [_id, username, status, statusText, name, roles]); + notifications.notifyLoggedInThisInstance('user-status', [_id, username, STATUS_MAP[status], statusText, name, roles]); if (_id) { - notifications.sendPresence(_id, username, status, statusText); + notifications.sendPresence(_id, username, STATUS_MAP[status], statusText); } }); diff --git a/apps/meteor/server/modules/notifications/notifications.module.ts b/apps/meteor/server/modules/notifications/notifications.module.ts index 73cede2cd36c..75a2935d5616 100644 --- a/apps/meteor/server/modules/notifications/notifications.module.ts +++ b/apps/meteor/server/modules/notifications/notifications.module.ts @@ -1,5 +1,5 @@ import { Authorization, VideoConf } from '@rocket.chat/core-services'; -import type { ISubscription, IOmnichannelRoom, IUser, UserStatus } from '@rocket.chat/core-typings'; +import type { ISubscription, IOmnichannelRoom, IUser } from '@rocket.chat/core-typings'; import { Rooms, Subscriptions, Users, Settings } from '@rocket.chat/models'; import type { StreamerCallbackArgs, StreamKeys, StreamNames } from '@rocket.chat/ui-contexts'; import type { IStreamer, IStreamerConstructor, IPublication } from 'meteor/rocketchat:streamer'; @@ -531,7 +531,7 @@ export class NotificationsModule { return this.streamUser.emitWithoutBroadcast(`${userId}/${eventName}`, ...args); } - sendPresence(uid: string, ...args: [username: string, status?: UserStatus, statusText?: string]): void { + sendPresence(uid: string, ...args: [username: string, status?: 0 | 1 | 2 | 3, statusText?: string]): void { emit(uid, [args]); return this.streamPresence.emitWithoutBroadcast(uid, args); } diff --git a/ee/packages/ddp-client/src/types/streams.ts b/ee/packages/ddp-client/src/types/streams.ts index 806ee0c639ef..5609e707742e 100644 --- a/ee/packages/ddp-client/src/types/streams.ts +++ b/ee/packages/ddp-client/src/types/streams.ts @@ -24,7 +24,6 @@ import type { IBanner, LicenseLimitKind, ICustomUserStatus, - UserStatus, } from '@rocket.chat/core-typings'; import type * as UiKit from '@rocket.chat/ui-kit'; @@ -243,7 +242,7 @@ export interface StreamerEvents { [ uid: IUser['_id'], username: IUser['username'], - status: UserStatus, + status: 0 | 1 | 2 | 3, statusText: IUser['statusText'], name: IUser['name'], roles: IUser['roles'], @@ -325,7 +324,7 @@ export interface StreamerEvents { }, ]; - 'user-presence': [{ key: string; args: [[username: string, statusChanged?: UserStatus, statusText?: string]] }]; + 'user-presence': [{ key: string; args: [[username: string, statusChanged?: 0 | 1 | 2 | 3, statusText?: string]] }]; // TODO: rename to 'integration-history' 'integrationHistory': [ From 36a31fa395790ba85320d9c4a351f1bf34bcdf53 Mon Sep 17 00:00:00 2001 From: Diego Sampaio Date: Wed, 28 Feb 2024 10:32:26 -0300 Subject: [PATCH 04/79] fix: client ignoring offline presence updates (#31833) --- .changeset/young-doors-bathe.md | 6 ++++++ apps/meteor/app/notifications/client/lib/Presence.ts | 3 --- ee/apps/ddp-streamer/package.json | 2 +- 3 files changed, 7 insertions(+), 4 deletions(-) create mode 100644 .changeset/young-doors-bathe.md diff --git a/.changeset/young-doors-bathe.md b/.changeset/young-doors-bathe.md new file mode 100644 index 000000000000..24d004b5214e --- /dev/null +++ b/.changeset/young-doors-bathe.md @@ -0,0 +1,6 @@ +--- +'@rocket.chat/meteor': patch +'@rocket.chat/ddp-streamer': patch +--- + +Fix web UI not showing users presence updating to offline diff --git a/apps/meteor/app/notifications/client/lib/Presence.ts b/apps/meteor/app/notifications/client/lib/Presence.ts index dff4ecb0392f..09d0e3be1693 100644 --- a/apps/meteor/app/notifications/client/lib/Presence.ts +++ b/apps/meteor/app/notifications/client/lib/Presence.ts @@ -13,8 +13,5 @@ type args = [username: string, statusChanged?: UserStatus, statusText?: string]; export const STATUS_MAP = [UserStatus.OFFLINE, UserStatus.ONLINE, UserStatus.AWAY, UserStatus.BUSY, UserStatus.DISABLED]; Meteor.StreamerCentral.on('stream-user-presence', (uid: string, [username, statusChanged, statusText]: args) => { - if (!statusChanged) { - return; - } Presence.notify({ _id: uid, username, status: STATUS_MAP[statusChanged as any], statusText }); }); diff --git a/ee/apps/ddp-streamer/package.json b/ee/apps/ddp-streamer/package.json index 1a399758265c..65340aa2887e 100644 --- a/ee/apps/ddp-streamer/package.json +++ b/ee/apps/ddp-streamer/package.json @@ -1,7 +1,7 @@ { "name": "@rocket.chat/ddp-streamer", "private": true, - "version": "0.2.5", + "version": "0.2.5-next.1", "description": "Rocket.Chat DDP-Streamer service", "scripts": { "build": "tsc -p tsconfig.json", From 44b682f6bcc9e537cd80997aa5e9d55dd09ec977 Mon Sep 17 00:00:00 2001 From: rocketchat-github-ci Date: Wed, 28 Feb 2024 21:40:39 +0000 Subject: [PATCH 05/79] Release 6.6.2 [no ci] --- .changeset/bump-patch-1709141264352.md | 5 --- .changeset/shy-bananas-repeat.md | 5 --- .changeset/strange-lamps-taste.md | 6 --- .changeset/young-doors-bathe.md | 6 --- apps/meteor/CHANGELOG.md | 38 +++++++++++++++++++ apps/meteor/app/utils/rocketchat.info | 2 +- apps/meteor/ee/server/services/CHANGELOG.md | 13 +++++++ apps/meteor/ee/server/services/package.json | 2 +- apps/meteor/package.json | 2 +- ee/apps/account-service/CHANGELOG.md | 13 +++++++ ee/apps/account-service/package.json | 2 +- ee/apps/authorization-service/CHANGELOG.md | 13 +++++++ ee/apps/authorization-service/package.json | 2 +- ee/apps/ddp-streamer/CHANGELOG.md | 17 +++++++++ ee/apps/ddp-streamer/package.json | 2 +- ee/apps/omnichannel-transcript/CHANGELOG.md | 14 +++++++ ee/apps/omnichannel-transcript/package.json | 2 +- ee/apps/presence-service/CHANGELOG.md | 13 +++++++ ee/apps/presence-service/package.json | 2 +- ee/apps/queue-worker/CHANGELOG.md | 13 +++++++ ee/apps/queue-worker/package.json | 2 +- ee/apps/stream-hub-service/CHANGELOG.md | 12 ++++++ ee/apps/stream-hub-service/package.json | 2 +- ee/packages/api-client/CHANGELOG.md | 10 +++++ ee/packages/api-client/package.json | 2 +- ee/packages/ddp-client/CHANGELOG.md | 12 ++++++ ee/packages/ddp-client/package.json | 2 +- ee/packages/license/CHANGELOG.md | 9 +++++ ee/packages/license/package.json | 2 +- ee/packages/omnichannel-services/CHANGELOG.md | 14 +++++++ ee/packages/omnichannel-services/package.json | 2 +- ee/packages/pdf-worker/CHANGELOG.md | 9 +++++ ee/packages/pdf-worker/package.json | 2 +- ee/packages/presence/CHANGELOG.md | 11 ++++++ ee/packages/presence/package.json | 2 +- package.json | 2 +- packages/core-services/CHANGELOG.md | 11 ++++++ packages/core-services/package.json | 2 +- packages/core-typings/CHANGELOG.md | 2 + packages/core-typings/package.json | 2 +- packages/cron/CHANGELOG.md | 10 +++++ packages/cron/package.json | 2 +- packages/fuselage-ui-kit/CHANGELOG.md | 11 ++++++ packages/fuselage-ui-kit/package.json | 6 +-- packages/gazzodown/CHANGELOG.md | 11 ++++++ packages/gazzodown/package.json | 8 ++-- packages/instance-status/CHANGELOG.md | 9 +++++ packages/instance-status/package.json | 2 +- packages/livechat/CHANGELOG.md | 9 +++++ packages/livechat/package.json | 2 +- packages/model-typings/CHANGELOG.md | 9 +++++ packages/model-typings/package.json | 2 +- packages/models/CHANGELOG.md | 9 +++++ packages/models/package.json | 2 +- packages/rest-typings/CHANGELOG.md | 9 +++++ packages/rest-typings/package.json | 2 +- packages/ui-client/CHANGELOG.md | 9 +++++ packages/ui-client/package.json | 4 +- packages/ui-contexts/CHANGELOG.md | 11 ++++++ packages/ui-contexts/package.json | 2 +- packages/ui-video-conf/CHANGELOG.md | 9 +++++ packages/ui-video-conf/package.json | 4 +- packages/uikit-playground/CHANGELOG.md | 10 +++++ packages/uikit-playground/package.json | 2 +- packages/web-ui-registration/CHANGELOG.md | 9 +++++ packages/web-ui-registration/package.json | 4 +- 66 files changed, 389 insertions(+), 62 deletions(-) delete mode 100644 .changeset/bump-patch-1709141264352.md delete mode 100644 .changeset/shy-bananas-repeat.md delete mode 100644 .changeset/strange-lamps-taste.md delete mode 100644 .changeset/young-doors-bathe.md diff --git a/.changeset/bump-patch-1709141264352.md b/.changeset/bump-patch-1709141264352.md deleted file mode 100644 index e1eaa7980afb..000000000000 --- a/.changeset/bump-patch-1709141264352.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@rocket.chat/meteor': patch ---- - -Bump @rocket.chat/meteor version. diff --git a/.changeset/shy-bananas-repeat.md b/.changeset/shy-bananas-repeat.md deleted file mode 100644 index 8fe1388897a2..000000000000 --- a/.changeset/shy-bananas-repeat.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@rocket.chat/meteor': patch ---- - -Fixed Federation not working with Microservice deployments diff --git a/.changeset/strange-lamps-taste.md b/.changeset/strange-lamps-taste.md deleted file mode 100644 index 88b61f5e5dec..000000000000 --- a/.changeset/strange-lamps-taste.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -'@rocket.chat/ddp-client': patch -'@rocket.chat/meteor': patch ---- - -Revert unintentional changes real time presence data payload diff --git a/.changeset/young-doors-bathe.md b/.changeset/young-doors-bathe.md deleted file mode 100644 index 24d004b5214e..000000000000 --- a/.changeset/young-doors-bathe.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -'@rocket.chat/meteor': patch -'@rocket.chat/ddp-streamer': patch ---- - -Fix web UI not showing users presence updating to offline diff --git a/apps/meteor/CHANGELOG.md b/apps/meteor/CHANGELOG.md index 2ed3ce7e07a0..d041b95fa705 100644 --- a/apps/meteor/CHANGELOG.md +++ b/apps/meteor/CHANGELOG.md @@ -1,5 +1,43 @@ # @rocket.chat/meteor +## 6.6.2 + +### Patch Changes + +- Bump @rocket.chat/meteor version. + +- Bump @rocket.chat/meteor version. + +- ([#31844](https://github.com/RocketChat/Rocket.Chat/pull/31844)) Fixed Federation not working with Microservice deployments + +- ([#31823](https://github.com/RocketChat/Rocket.Chat/pull/31823)) Revert unintentional changes real time presence data payload + +- ([#31833](https://github.com/RocketChat/Rocket.Chat/pull/31833)) Fix web UI not showing users presence updating to offline + +-
Updated dependencies []: + + - @rocket.chat/ui-contexts@4.0.2 + - @rocket.chat/ui-theming@0.1.2 + - @rocket.chat/fuselage-ui-kit@4.0.2 + - @rocket.chat/gazzodown@4.0.2 + - @rocket.chat/ui-client@4.0.2 + - @rocket.chat/ui-video-conf@4.0.2 + - @rocket.chat/web-ui-registration@4.0.2 + - @rocket.chat/core-typings@6.6.2 + - @rocket.chat/rest-typings@6.6.2 + - @rocket.chat/api-client@0.1.24 + - @rocket.chat/license@0.1.6 + - @rocket.chat/omnichannel-services@0.1.6 + - @rocket.chat/pdf-worker@0.0.30 + - @rocket.chat/presence@0.1.6 + - @rocket.chat/core-services@0.3.6 + - @rocket.chat/cron@0.0.26 + - @rocket.chat/model-typings@0.3.2 + - @rocket.chat/server-cloud-communication@0.0.2 + - @rocket.chat/models@0.0.30 + - @rocket.chat/instance-status@0.0.30 +
+ ## 6.6.1 ### Patch Changes diff --git a/apps/meteor/app/utils/rocketchat.info b/apps/meteor/app/utils/rocketchat.info index 4ea445d24966..f8cc2889e485 100644 --- a/apps/meteor/app/utils/rocketchat.info +++ b/apps/meteor/app/utils/rocketchat.info @@ -1,3 +1,3 @@ { - "version": "6.6.1" + "version": "6.6.2" } diff --git a/apps/meteor/ee/server/services/CHANGELOG.md b/apps/meteor/ee/server/services/CHANGELOG.md index 834309664148..1d35bf1759c0 100644 --- a/apps/meteor/ee/server/services/CHANGELOG.md +++ b/apps/meteor/ee/server/services/CHANGELOG.md @@ -1,5 +1,18 @@ # rocketchat-services +## 1.1.24 + +### Patch Changes + +-
Updated dependencies []: + + - @rocket.chat/core-typings@6.6.2 + - @rocket.chat/rest-typings@6.6.2 + - @rocket.chat/core-services@0.3.6 + - @rocket.chat/model-typings@0.3.2 + - @rocket.chat/models@0.0.30 +
+ ## 1.1.23 ### Patch Changes diff --git a/apps/meteor/ee/server/services/package.json b/apps/meteor/ee/server/services/package.json index b8fe731d1ab5..f58686786588 100644 --- a/apps/meteor/ee/server/services/package.json +++ b/apps/meteor/ee/server/services/package.json @@ -1,7 +1,7 @@ { "name": "rocketchat-services", "private": true, - "version": "1.1.23", + "version": "1.1.24", "description": "Rocket.Chat Authorization service", "main": "index.js", "scripts": { diff --git a/apps/meteor/package.json b/apps/meteor/package.json index 53502b5c3f7c..96a97a9910fb 100644 --- a/apps/meteor/package.json +++ b/apps/meteor/package.json @@ -1,7 +1,7 @@ { "name": "@rocket.chat/meteor", "description": "The Ultimate Open Source WebChat Platform", - "version": "6.6.1", + "version": "6.6.2", "private": true, "author": { "name": "Rocket.Chat", diff --git a/ee/apps/account-service/CHANGELOG.md b/ee/apps/account-service/CHANGELOG.md index 63bffcb05637..52f7ed606faf 100644 --- a/ee/apps/account-service/CHANGELOG.md +++ b/ee/apps/account-service/CHANGELOG.md @@ -1,5 +1,18 @@ # @rocket.chat/account-service +## 0.3.6 + +### Patch Changes + +-
Updated dependencies []: + + - @rocket.chat/core-typings@6.6.2 + - @rocket.chat/rest-typings@6.6.2 + - @rocket.chat/core-services@0.3.6 + - @rocket.chat/model-typings@0.3.2 + - @rocket.chat/models@0.0.30 +
+ ## 0.3.5 ### Patch Changes diff --git a/ee/apps/account-service/package.json b/ee/apps/account-service/package.json index fc8009c40ea9..3e1fee5d96e0 100644 --- a/ee/apps/account-service/package.json +++ b/ee/apps/account-service/package.json @@ -1,7 +1,7 @@ { "name": "@rocket.chat/account-service", "private": true, - "version": "0.3.5", + "version": "0.3.6", "description": "Rocket.Chat Account service", "scripts": { "build": "tsc -p tsconfig.json", diff --git a/ee/apps/authorization-service/CHANGELOG.md b/ee/apps/authorization-service/CHANGELOG.md index 221defa5426b..881f33d1cb3d 100644 --- a/ee/apps/authorization-service/CHANGELOG.md +++ b/ee/apps/authorization-service/CHANGELOG.md @@ -1,5 +1,18 @@ # @rocket.chat/authorization-service +## 0.3.6 + +### Patch Changes + +-
Updated dependencies []: + + - @rocket.chat/core-typings@6.6.2 + - @rocket.chat/rest-typings@6.6.2 + - @rocket.chat/core-services@0.3.6 + - @rocket.chat/model-typings@0.3.2 + - @rocket.chat/models@0.0.30 +
+ ## 0.3.5 ### Patch Changes diff --git a/ee/apps/authorization-service/package.json b/ee/apps/authorization-service/package.json index 5a72761f597b..250f3e3bd2a4 100644 --- a/ee/apps/authorization-service/package.json +++ b/ee/apps/authorization-service/package.json @@ -1,7 +1,7 @@ { "name": "@rocket.chat/authorization-service", "private": true, - "version": "0.3.5", + "version": "0.3.6", "description": "Rocket.Chat Authorization service", "scripts": { "build": "tsc -p tsconfig.json", diff --git a/ee/apps/ddp-streamer/CHANGELOG.md b/ee/apps/ddp-streamer/CHANGELOG.md index 86b751f67cc3..e5a1de0ed191 100644 --- a/ee/apps/ddp-streamer/CHANGELOG.md +++ b/ee/apps/ddp-streamer/CHANGELOG.md @@ -4,6 +4,23 @@ ### Patch Changes +- ([#31833](https://github.com/RocketChat/Rocket.Chat/pull/31833)) Fix web UI not showing users presence updating to offline + +-
Updated dependencies []: + + - @rocket.chat/ui-contexts@4.0.2 + - @rocket.chat/core-typings@6.6.2 + - @rocket.chat/rest-typings@6.6.2 + - @rocket.chat/core-services@0.3.6 + - @rocket.chat/model-typings@0.3.2 + - @rocket.chat/models@0.0.30 + - @rocket.chat/instance-status@0.0.30 +
+ +## 0.2.5 + +### Patch Changes + -
Updated dependencies []: - @rocket.chat/core-typings@6.6.1 diff --git a/ee/apps/ddp-streamer/package.json b/ee/apps/ddp-streamer/package.json index 65340aa2887e..1a399758265c 100644 --- a/ee/apps/ddp-streamer/package.json +++ b/ee/apps/ddp-streamer/package.json @@ -1,7 +1,7 @@ { "name": "@rocket.chat/ddp-streamer", "private": true, - "version": "0.2.5-next.1", + "version": "0.2.5", "description": "Rocket.Chat DDP-Streamer service", "scripts": { "build": "tsc -p tsconfig.json", diff --git a/ee/apps/omnichannel-transcript/CHANGELOG.md b/ee/apps/omnichannel-transcript/CHANGELOG.md index 4f152d8d02b4..62bd6f836c33 100644 --- a/ee/apps/omnichannel-transcript/CHANGELOG.md +++ b/ee/apps/omnichannel-transcript/CHANGELOG.md @@ -1,5 +1,19 @@ # @rocket.chat/omnichannel-transcript +## 0.3.6 + +### Patch Changes + +-
Updated dependencies []: + + - @rocket.chat/core-typings@6.6.2 + - @rocket.chat/omnichannel-services@0.1.6 + - @rocket.chat/pdf-worker@0.0.30 + - @rocket.chat/core-services@0.3.6 + - @rocket.chat/model-typings@0.3.2 + - @rocket.chat/models@0.0.30 +
+ ## 0.3.5 ### Patch Changes diff --git a/ee/apps/omnichannel-transcript/package.json b/ee/apps/omnichannel-transcript/package.json index f04bc3af8b50..4d0103b45b19 100644 --- a/ee/apps/omnichannel-transcript/package.json +++ b/ee/apps/omnichannel-transcript/package.json @@ -1,7 +1,7 @@ { "name": "@rocket.chat/omnichannel-transcript", "private": true, - "version": "0.3.5", + "version": "0.3.6", "description": "Rocket.Chat service", "scripts": { "build": "tsc -p tsconfig.json", diff --git a/ee/apps/presence-service/CHANGELOG.md b/ee/apps/presence-service/CHANGELOG.md index 598d20d46bb2..4012ad8830c7 100644 --- a/ee/apps/presence-service/CHANGELOG.md +++ b/ee/apps/presence-service/CHANGELOG.md @@ -1,5 +1,18 @@ # @rocket.chat/presence-service +## 0.3.6 + +### Patch Changes + +-
Updated dependencies []: + + - @rocket.chat/core-typings@6.6.2 + - @rocket.chat/presence@0.1.6 + - @rocket.chat/core-services@0.3.6 + - @rocket.chat/model-typings@0.3.2 + - @rocket.chat/models@0.0.30 +
+ ## 0.3.5 ### Patch Changes diff --git a/ee/apps/presence-service/package.json b/ee/apps/presence-service/package.json index 955fe30be8c1..1cafa284610a 100644 --- a/ee/apps/presence-service/package.json +++ b/ee/apps/presence-service/package.json @@ -1,7 +1,7 @@ { "name": "@rocket.chat/presence-service", "private": true, - "version": "0.3.5", + "version": "0.3.6", "description": "Rocket.Chat Presence service", "scripts": { "build": "tsc -p tsconfig.json", diff --git a/ee/apps/queue-worker/CHANGELOG.md b/ee/apps/queue-worker/CHANGELOG.md index 790c9949a02b..2c1891559b8a 100644 --- a/ee/apps/queue-worker/CHANGELOG.md +++ b/ee/apps/queue-worker/CHANGELOG.md @@ -1,5 +1,18 @@ # @rocket.chat/queue-worker +## 0.3.6 + +### Patch Changes + +-
Updated dependencies []: + + - @rocket.chat/core-typings@6.6.2 + - @rocket.chat/omnichannel-services@0.1.6 + - @rocket.chat/core-services@0.3.6 + - @rocket.chat/model-typings@0.3.2 + - @rocket.chat/models@0.0.30 +
+ ## 0.3.5 ### Patch Changes diff --git a/ee/apps/queue-worker/package.json b/ee/apps/queue-worker/package.json index 1d6c7b938abe..e81cd6551747 100644 --- a/ee/apps/queue-worker/package.json +++ b/ee/apps/queue-worker/package.json @@ -1,7 +1,7 @@ { "name": "@rocket.chat/queue-worker", "private": true, - "version": "0.3.5", + "version": "0.3.6", "description": "Rocket.Chat service", "scripts": { "build": "tsc -p tsconfig.json", diff --git a/ee/apps/stream-hub-service/CHANGELOG.md b/ee/apps/stream-hub-service/CHANGELOG.md index 84bdf503ac7c..3726554ec0e3 100644 --- a/ee/apps/stream-hub-service/CHANGELOG.md +++ b/ee/apps/stream-hub-service/CHANGELOG.md @@ -1,5 +1,17 @@ # @rocket.chat/stream-hub-service +## 0.3.6 + +### Patch Changes + +-
Updated dependencies []: + + - @rocket.chat/core-typings@6.6.2 + - @rocket.chat/core-services@0.3.6 + - @rocket.chat/model-typings@0.3.2 + - @rocket.chat/models@0.0.30 +
+ ## 0.3.5 ### Patch Changes diff --git a/ee/apps/stream-hub-service/package.json b/ee/apps/stream-hub-service/package.json index d51768be9d7b..60608e0ca513 100644 --- a/ee/apps/stream-hub-service/package.json +++ b/ee/apps/stream-hub-service/package.json @@ -1,7 +1,7 @@ { "name": "@rocket.chat/stream-hub-service", "private": true, - "version": "0.3.5", + "version": "0.3.6", "description": "Rocket.Chat Stream Hub service", "scripts": { "build": "tsc -p tsconfig.json", diff --git a/ee/packages/api-client/CHANGELOG.md b/ee/packages/api-client/CHANGELOG.md index c149cd5cabf9..bc28eeb08ce5 100644 --- a/ee/packages/api-client/CHANGELOG.md +++ b/ee/packages/api-client/CHANGELOG.md @@ -1,5 +1,15 @@ # @rocket.chat/api-client +## 0.1.24 + +### Patch Changes + +-
Updated dependencies []: + + - @rocket.chat/core-typings@6.6.2 + - @rocket.chat/rest-typings@6.6.2 +
+ ## 0.1.23 ### Patch Changes diff --git a/ee/packages/api-client/package.json b/ee/packages/api-client/package.json index edbb3fa686cb..d13f932a740d 100644 --- a/ee/packages/api-client/package.json +++ b/ee/packages/api-client/package.json @@ -1,7 +1,7 @@ { "name": "@rocket.chat/api-client", "private": true, - "version": "0.1.23", + "version": "0.1.24", "devDependencies": { "@swc/core": "^1.3.95", "@swc/jest": "^0.2.29", diff --git a/ee/packages/ddp-client/CHANGELOG.md b/ee/packages/ddp-client/CHANGELOG.md index 42e11557ba86..0f20bd5f79ac 100644 --- a/ee/packages/ddp-client/CHANGELOG.md +++ b/ee/packages/ddp-client/CHANGELOG.md @@ -1,5 +1,17 @@ # @rocket.chat/ddp-client +## 0.2.15 + +### Patch Changes + +- ([#31823](https://github.com/RocketChat/Rocket.Chat/pull/31823)) Revert unintentional changes real time presence data payload + +-
Updated dependencies []: + + - @rocket.chat/rest-typings@6.6.2 + - @rocket.chat/api-client@0.1.24 +
+ ## 0.2.14 ### Patch Changes diff --git a/ee/packages/ddp-client/package.json b/ee/packages/ddp-client/package.json index b71679329f27..9192f27d8fea 100644 --- a/ee/packages/ddp-client/package.json +++ b/ee/packages/ddp-client/package.json @@ -1,7 +1,7 @@ { "name": "@rocket.chat/ddp-client", "private": true, - "version": "0.2.14", + "version": "0.2.15", "devDependencies": { "@swc/core": "^1.3.95", "@swc/jest": "^0.2.29", diff --git a/ee/packages/license/CHANGELOG.md b/ee/packages/license/CHANGELOG.md index 1059f9fd8cf4..04d7bc0e678a 100644 --- a/ee/packages/license/CHANGELOG.md +++ b/ee/packages/license/CHANGELOG.md @@ -1,5 +1,14 @@ # @rocket.chat/license +## 0.1.6 + +### Patch Changes + +-
Updated dependencies []: + + - @rocket.chat/core-typings@6.6.2 +
+ ## 0.1.5 ### Patch Changes diff --git a/ee/packages/license/package.json b/ee/packages/license/package.json index 3f65c903816e..8fb25a8c611b 100644 --- a/ee/packages/license/package.json +++ b/ee/packages/license/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/license", - "version": "0.1.5", + "version": "0.1.6", "private": true, "devDependencies": { "@swc/core": "^1.3.95", diff --git a/ee/packages/omnichannel-services/CHANGELOG.md b/ee/packages/omnichannel-services/CHANGELOG.md index a7ae2cd1e919..996f1b375077 100644 --- a/ee/packages/omnichannel-services/CHANGELOG.md +++ b/ee/packages/omnichannel-services/CHANGELOG.md @@ -1,5 +1,19 @@ # @rocket.chat/omnichannel-services +## 0.1.6 + +### Patch Changes + +-
Updated dependencies []: + + - @rocket.chat/core-typings@6.6.2 + - @rocket.chat/rest-typings@6.6.2 + - @rocket.chat/pdf-worker@0.0.30 + - @rocket.chat/core-services@0.3.6 + - @rocket.chat/model-typings@0.3.2 + - @rocket.chat/models@0.0.30 +
+ ## 0.1.5 ### Patch Changes diff --git a/ee/packages/omnichannel-services/package.json b/ee/packages/omnichannel-services/package.json index 340a008293de..869117815a41 100644 --- a/ee/packages/omnichannel-services/package.json +++ b/ee/packages/omnichannel-services/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/omnichannel-services", - "version": "0.1.5", + "version": "0.1.6", "private": true, "devDependencies": { "@rocket.chat/eslint-config": "workspace:^", diff --git a/ee/packages/pdf-worker/CHANGELOG.md b/ee/packages/pdf-worker/CHANGELOG.md index 517741f52c7f..c2a4c9ff1c7b 100644 --- a/ee/packages/pdf-worker/CHANGELOG.md +++ b/ee/packages/pdf-worker/CHANGELOG.md @@ -1,5 +1,14 @@ # @rocket.chat/pdf-worker +## 0.0.30 + +### Patch Changes + +-
Updated dependencies []: + + - @rocket.chat/core-typings@6.6.2 +
+ ## 0.0.29 ### Patch Changes diff --git a/ee/packages/pdf-worker/package.json b/ee/packages/pdf-worker/package.json index 8c51bd06fe20..167d9af95096 100644 --- a/ee/packages/pdf-worker/package.json +++ b/ee/packages/pdf-worker/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/pdf-worker", - "version": "0.0.29", + "version": "0.0.30", "private": true, "devDependencies": { "@storybook/addon-essentials": "~6.5.16", diff --git a/ee/packages/presence/CHANGELOG.md b/ee/packages/presence/CHANGELOG.md index 254c00aa2aca..09011503158e 100644 --- a/ee/packages/presence/CHANGELOG.md +++ b/ee/packages/presence/CHANGELOG.md @@ -1,5 +1,16 @@ # @rocket.chat/presence +## 0.1.6 + +### Patch Changes + +-
Updated dependencies []: + + - @rocket.chat/core-typings@6.6.2 + - @rocket.chat/core-services@0.3.6 + - @rocket.chat/models@0.0.30 +
+ ## 0.1.5 ### Patch Changes diff --git a/ee/packages/presence/package.json b/ee/packages/presence/package.json index 321906d4f76a..8ad4626705f0 100644 --- a/ee/packages/presence/package.json +++ b/ee/packages/presence/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/presence", - "version": "0.1.5", + "version": "0.1.6", "private": true, "devDependencies": { "@babel/core": "~7.22.20", diff --git a/package.json b/package.json index 1364d3507438..0db55ca23f6b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "rocket.chat", - "version": "6.6.1", + "version": "6.6.2", "description": "Rocket.Chat Monorepo", "main": "index.js", "private": true, diff --git a/packages/core-services/CHANGELOG.md b/packages/core-services/CHANGELOG.md index e7411aab1189..bb53dee42e46 100644 --- a/packages/core-services/CHANGELOG.md +++ b/packages/core-services/CHANGELOG.md @@ -1,5 +1,16 @@ # @rocket.chat/core-services +## 0.3.6 + +### Patch Changes + +-
Updated dependencies []: + + - @rocket.chat/core-typings@6.6.2 + - @rocket.chat/rest-typings@6.6.2 + - @rocket.chat/models@0.0.30 +
+ ## 0.3.5 ### Patch Changes diff --git a/packages/core-services/package.json b/packages/core-services/package.json index fbe4af901821..c95cdc18b199 100644 --- a/packages/core-services/package.json +++ b/packages/core-services/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/core-services", - "version": "0.3.5", + "version": "0.3.6", "private": true, "devDependencies": { "@babel/core": "~7.22.20", diff --git a/packages/core-typings/CHANGELOG.md b/packages/core-typings/CHANGELOG.md index 494a040d7144..e2dbf9e953fb 100644 --- a/packages/core-typings/CHANGELOG.md +++ b/packages/core-typings/CHANGELOG.md @@ -1,5 +1,7 @@ # @rocket.chat/core-typings +## 6.6.2 + ## 6.6.1 ## 6.6.0 diff --git a/packages/core-typings/package.json b/packages/core-typings/package.json index 85f0610aef04..7870acc10b67 100644 --- a/packages/core-typings/package.json +++ b/packages/core-typings/package.json @@ -2,7 +2,7 @@ "$schema": "https://json.schemastore.org/package", "name": "@rocket.chat/core-typings", "private": true, - "version": "6.6.1", + "version": "6.6.2", "devDependencies": { "@rocket.chat/eslint-config": "workspace:^", "eslint": "~8.45.0", diff --git a/packages/cron/CHANGELOG.md b/packages/cron/CHANGELOG.md index cc75d1e2a94b..ac4805ef5dd5 100644 --- a/packages/cron/CHANGELOG.md +++ b/packages/cron/CHANGELOG.md @@ -1,5 +1,15 @@ # @rocket.chat/cron +## 0.0.26 + +### Patch Changes + +-
Updated dependencies []: + + - @rocket.chat/core-typings@6.6.2 + - @rocket.chat/models@0.0.30 +
+ ## 0.0.25 ### Patch Changes diff --git a/packages/cron/package.json b/packages/cron/package.json index 9d9b2fb936f4..ba2d5c07d09c 100644 --- a/packages/cron/package.json +++ b/packages/cron/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/cron", - "version": "0.0.25", + "version": "0.0.26", "private": true, "devDependencies": { "@types/jest": "~29.5.7", diff --git a/packages/fuselage-ui-kit/CHANGELOG.md b/packages/fuselage-ui-kit/CHANGELOG.md index e910fc150ab0..cada2203c1ec 100644 --- a/packages/fuselage-ui-kit/CHANGELOG.md +++ b/packages/fuselage-ui-kit/CHANGELOG.md @@ -1,5 +1,16 @@ # Change Log +## 4.0.2 + +### Patch Changes + +-
Updated dependencies []: + + - @rocket.chat/ui-contexts@4.0.2 + - @rocket.chat/gazzodown@4.0.2 + - @rocket.chat/ui-video-conf@4.0.2 +
+ ## 4.0.1 ### Patch Changes diff --git a/packages/fuselage-ui-kit/package.json b/packages/fuselage-ui-kit/package.json index 98e994782b9c..a5db2ed5f7a9 100644 --- a/packages/fuselage-ui-kit/package.json +++ b/packages/fuselage-ui-kit/package.json @@ -1,7 +1,7 @@ { "name": "@rocket.chat/fuselage-ui-kit", "private": true, - "version": "4.0.1", + "version": "4.0.2", "description": "UiKit elements for Rocket.Chat Apps built under Fuselage design system", "homepage": "https://rocketchat.github.io/Rocket.Chat.Fuselage/", "author": { @@ -48,9 +48,9 @@ "@rocket.chat/icons": "*", "@rocket.chat/prettier-config": "*", "@rocket.chat/styled": "*", - "@rocket.chat/ui-contexts": "4.0.1", + "@rocket.chat/ui-contexts": "4.0.2", "@rocket.chat/ui-kit": "0.33.0", - "@rocket.chat/ui-video-conf": "4.0.1", + "@rocket.chat/ui-video-conf": "4.0.2", "@tanstack/react-query": "*", "react": "*", "react-dom": "*" diff --git a/packages/gazzodown/CHANGELOG.md b/packages/gazzodown/CHANGELOG.md index 50d8a2e4f60e..9300075b9b9c 100644 --- a/packages/gazzodown/CHANGELOG.md +++ b/packages/gazzodown/CHANGELOG.md @@ -1,5 +1,16 @@ # @rocket.chat/gazzodown +## 4.0.2 + +### Patch Changes + +-
Updated dependencies []: + + - @rocket.chat/ui-contexts@4.0.2 + - @rocket.chat/ui-client@4.0.2 + - @rocket.chat/core-typings@6.6.2 +
+ ## 4.0.1 ### Patch Changes diff --git a/packages/gazzodown/package.json b/packages/gazzodown/package.json index 9a499a11395b..81745c117fe9 100644 --- a/packages/gazzodown/package.json +++ b/packages/gazzodown/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/gazzodown", - "version": "4.0.1", + "version": "4.0.2", "private": true, "devDependencies": { "@babel/core": "~7.22.20", @@ -65,14 +65,14 @@ "/dist" ], "peerDependencies": { - "@rocket.chat/core-typings": "6.6.1", + "@rocket.chat/core-typings": "6.6.2", "@rocket.chat/css-in-js": "*", "@rocket.chat/fuselage": "*", "@rocket.chat/fuselage-tokens": "*", "@rocket.chat/message-parser": "*", "@rocket.chat/styled": "*", - "@rocket.chat/ui-client": "4.0.1", - "@rocket.chat/ui-contexts": "4.0.1", + "@rocket.chat/ui-client": "4.0.2", + "@rocket.chat/ui-contexts": "4.0.2", "katex": "*", "react": "*" }, diff --git a/packages/instance-status/CHANGELOG.md b/packages/instance-status/CHANGELOG.md index ca198fa25e9d..83dbe8c84996 100644 --- a/packages/instance-status/CHANGELOG.md +++ b/packages/instance-status/CHANGELOG.md @@ -1,5 +1,14 @@ # @rocket.chat/instance-status +## 0.0.30 + +### Patch Changes + +-
Updated dependencies []: + + - @rocket.chat/models@0.0.30 +
+ ## 0.0.29 ### Patch Changes diff --git a/packages/instance-status/package.json b/packages/instance-status/package.json index 362818b7e809..28fefc588cac 100644 --- a/packages/instance-status/package.json +++ b/packages/instance-status/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/instance-status", - "version": "0.0.29", + "version": "0.0.30", "private": true, "devDependencies": { "@rocket.chat/eslint-config": "workspace:^", diff --git a/packages/livechat/CHANGELOG.md b/packages/livechat/CHANGELOG.md index bfb35b426573..330530d754d9 100644 --- a/packages/livechat/CHANGELOG.md +++ b/packages/livechat/CHANGELOG.md @@ -1,5 +1,14 @@ # @rocket.chat/livechat Change Log +## 1.14.15 + +### Patch Changes + +-
Updated dependencies []: + + - @rocket.chat/gazzodown@4.0.2 +
+ ## 1.14.14 ### Patch Changes diff --git a/packages/livechat/package.json b/packages/livechat/package.json index 16fab4481639..a31ead75a61c 100644 --- a/packages/livechat/package.json +++ b/packages/livechat/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/livechat", - "version": "1.14.14", + "version": "1.14.15", "files": [ "/build" ], diff --git a/packages/model-typings/CHANGELOG.md b/packages/model-typings/CHANGELOG.md index 777055022144..61867f3c3076 100644 --- a/packages/model-typings/CHANGELOG.md +++ b/packages/model-typings/CHANGELOG.md @@ -1,5 +1,14 @@ # @rocket.chat/model-typings +## 0.3.2 + +### Patch Changes + +-
Updated dependencies []: + + - @rocket.chat/core-typings@6.6.2 +
+ ## 0.3.1 ### Patch Changes diff --git a/packages/model-typings/package.json b/packages/model-typings/package.json index 2ab3abd2d1d1..dc7160134243 100644 --- a/packages/model-typings/package.json +++ b/packages/model-typings/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/model-typings", - "version": "0.3.1", + "version": "0.3.2", "private": true, "devDependencies": { "@types/jest": "~29.5.7", diff --git a/packages/models/CHANGELOG.md b/packages/models/CHANGELOG.md index 4bc7f714220b..e4b8789c0145 100644 --- a/packages/models/CHANGELOG.md +++ b/packages/models/CHANGELOG.md @@ -1,5 +1,14 @@ # @rocket.chat/models +## 0.0.30 + +### Patch Changes + +-
Updated dependencies []: + + - @rocket.chat/model-typings@0.3.2 +
+ ## 0.0.29 ### Patch Changes diff --git a/packages/models/package.json b/packages/models/package.json index 336ad812ced7..a4e68ed1a221 100644 --- a/packages/models/package.json +++ b/packages/models/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/models", - "version": "0.0.29", + "version": "0.0.30", "private": true, "devDependencies": { "@types/jest": "~29.5.7", diff --git a/packages/rest-typings/CHANGELOG.md b/packages/rest-typings/CHANGELOG.md index 88f12c68f6ed..77412c9a3faf 100644 --- a/packages/rest-typings/CHANGELOG.md +++ b/packages/rest-typings/CHANGELOG.md @@ -1,5 +1,14 @@ # @rocket.chat/rest-typings +## 6.6.2 + +### Patch Changes + +-
Updated dependencies []: + + - @rocket.chat/core-typings@6.6.2 +
+ ## 6.6.1 ### Patch Changes diff --git a/packages/rest-typings/package.json b/packages/rest-typings/package.json index 72d384f3ac98..612b08252a59 100644 --- a/packages/rest-typings/package.json +++ b/packages/rest-typings/package.json @@ -1,7 +1,7 @@ { "name": "@rocket.chat/rest-typings", "private": true, - "version": "6.6.1", + "version": "6.6.2", "devDependencies": { "@rocket.chat/eslint-config": "workspace:^", "@types/jest": "~29.5.7", diff --git a/packages/ui-client/CHANGELOG.md b/packages/ui-client/CHANGELOG.md index ab0fb84a6e7b..87077670667f 100644 --- a/packages/ui-client/CHANGELOG.md +++ b/packages/ui-client/CHANGELOG.md @@ -1,5 +1,14 @@ # @rocket.chat/ui-client +## 4.0.2 + +### Patch Changes + +-
Updated dependencies []: + + - @rocket.chat/ui-contexts@4.0.2 +
+ ## 4.0.1 ### Patch Changes diff --git a/packages/ui-client/package.json b/packages/ui-client/package.json index 641237df571c..35bc4ca58d86 100644 --- a/packages/ui-client/package.json +++ b/packages/ui-client/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/ui-client", - "version": "4.0.1", + "version": "4.0.2", "private": true, "devDependencies": { "@babel/core": "~7.22.20", @@ -63,7 +63,7 @@ "@rocket.chat/fuselage": "*", "@rocket.chat/fuselage-hooks": "*", "@rocket.chat/icons": "*", - "@rocket.chat/ui-contexts": "4.0.1", + "@rocket.chat/ui-contexts": "4.0.2", "react": "~17.0.2" }, "volta": { diff --git a/packages/ui-contexts/CHANGELOG.md b/packages/ui-contexts/CHANGELOG.md index 9f266d773bb5..60560e0bf598 100644 --- a/packages/ui-contexts/CHANGELOG.md +++ b/packages/ui-contexts/CHANGELOG.md @@ -1,5 +1,16 @@ # @rocket.chat/ui-contexts +## 4.0.2 + +### Patch Changes + +-
Updated dependencies [5abac60f19]: + + - @rocket.chat/ddp-client@0.2.15 + - @rocket.chat/core-typings@6.6.2 + - @rocket.chat/rest-typings@6.6.2 +
+ ## 4.0.1 ### Patch Changes diff --git a/packages/ui-contexts/package.json b/packages/ui-contexts/package.json index 223de3de48de..85e813b0ff0e 100644 --- a/packages/ui-contexts/package.json +++ b/packages/ui-contexts/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/ui-contexts", - "version": "4.0.1", + "version": "4.0.2", "private": true, "devDependencies": { "@rocket.chat/core-typings": "workspace:^", diff --git a/packages/ui-video-conf/CHANGELOG.md b/packages/ui-video-conf/CHANGELOG.md index 9ec9de510887..bce197e1cefd 100644 --- a/packages/ui-video-conf/CHANGELOG.md +++ b/packages/ui-video-conf/CHANGELOG.md @@ -1,5 +1,14 @@ # @rocket.chat/ui-video-conf +## 4.0.2 + +### Patch Changes + +-
Updated dependencies []: + + - @rocket.chat/ui-contexts@4.0.2 +
+ ## 4.0.1 ### Patch Changes diff --git a/packages/ui-video-conf/package.json b/packages/ui-video-conf/package.json index 2af4f899cc24..379d06920cde 100644 --- a/packages/ui-video-conf/package.json +++ b/packages/ui-video-conf/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/ui-video-conf", - "version": "4.0.1", + "version": "4.0.2", "private": true, "devDependencies": { "@babel/core": "~7.22.20", @@ -35,7 +35,7 @@ "@rocket.chat/fuselage-hooks": "*", "@rocket.chat/icons": "*", "@rocket.chat/styled": "*", - "@rocket.chat/ui-contexts": "4.0.1", + "@rocket.chat/ui-contexts": "4.0.2", "react": "^17.0.2", "react-dom": "^17.0.2" }, diff --git a/packages/uikit-playground/CHANGELOG.md b/packages/uikit-playground/CHANGELOG.md index 9ff6175f124c..6a72359d4a3c 100644 --- a/packages/uikit-playground/CHANGELOG.md +++ b/packages/uikit-playground/CHANGELOG.md @@ -1,5 +1,15 @@ # @rocket.chat/uikit-playground +## 0.2.15 + +### Patch Changes + +-
Updated dependencies []: + + - @rocket.chat/ui-contexts@4.0.2 + - @rocket.chat/fuselage-ui-kit@4.0.2 +
+ ## 0.2.14 ### Patch Changes diff --git a/packages/uikit-playground/package.json b/packages/uikit-playground/package.json index b5f9785b3457..a1925a87be38 100644 --- a/packages/uikit-playground/package.json +++ b/packages/uikit-playground/package.json @@ -1,7 +1,7 @@ { "name": "@rocket.chat/uikit-playground", "private": true, - "version": "0.2.14", + "version": "0.2.15", "type": "module", "scripts": { "dev": "vite", diff --git a/packages/web-ui-registration/CHANGELOG.md b/packages/web-ui-registration/CHANGELOG.md index d6c837a5c365..2a3a5194f27f 100644 --- a/packages/web-ui-registration/CHANGELOG.md +++ b/packages/web-ui-registration/CHANGELOG.md @@ -1,5 +1,14 @@ # @rocket.chat/web-ui-registration +## 4.0.2 + +### Patch Changes + +-
Updated dependencies []: + + - @rocket.chat/ui-contexts@4.0.2 +
+ ## 4.0.1 ### Patch Changes diff --git a/packages/web-ui-registration/package.json b/packages/web-ui-registration/package.json index 3024d92e689f..677486e97d69 100644 --- a/packages/web-ui-registration/package.json +++ b/packages/web-ui-registration/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/web-ui-registration", - "version": "4.0.1", + "version": "4.0.2", "private": true, "homepage": "https://rocket.chat", "main": "./dist/index.js", @@ -51,7 +51,7 @@ "peerDependencies": { "@rocket.chat/layout": "*", "@rocket.chat/tools": "0.2.1", - "@rocket.chat/ui-contexts": "4.0.1", + "@rocket.chat/ui-contexts": "4.0.2", "@tanstack/react-query": "*", "react": "*", "react-hook-form": "*", From a0cc8cf118190a83d1fe3c7705271ff7b2be2b26 Mon Sep 17 00:00:00 2001 From: rocketchat-github-ci Date: Tue, 5 Mar 2024 20:07:54 +0000 Subject: [PATCH 06/79] Bump 6.6.3 --- .changeset/bump-patch-1709669273957.md | 5 +++++ yarn.lock | 16 ++++++++-------- 2 files changed, 13 insertions(+), 8 deletions(-) create mode 100644 .changeset/bump-patch-1709669273957.md diff --git a/.changeset/bump-patch-1709669273957.md b/.changeset/bump-patch-1709669273957.md new file mode 100644 index 000000000000..e1eaa7980afb --- /dev/null +++ b/.changeset/bump-patch-1709669273957.md @@ -0,0 +1,5 @@ +--- +'@rocket.chat/meteor': patch +--- + +Bump @rocket.chat/meteor version. diff --git a/yarn.lock b/yarn.lock index 09e8467357b7..af1134d87e32 100644 --- a/yarn.lock +++ b/yarn.lock @@ -9348,9 +9348,9 @@ __metadata: "@rocket.chat/icons": "*" "@rocket.chat/prettier-config": "*" "@rocket.chat/styled": "*" - "@rocket.chat/ui-contexts": 4.0.1 + "@rocket.chat/ui-contexts": 4.0.2 "@rocket.chat/ui-kit": 0.33.0 - "@rocket.chat/ui-video-conf": 4.0.1 + "@rocket.chat/ui-video-conf": 4.0.2 "@tanstack/react-query": "*" react: "*" react-dom: "*" @@ -9432,14 +9432,14 @@ __metadata: ts-jest: ~29.1.1 typescript: ~5.3.2 peerDependencies: - "@rocket.chat/core-typings": 6.6.1 + "@rocket.chat/core-typings": 6.6.2 "@rocket.chat/css-in-js": "*" "@rocket.chat/fuselage": "*" "@rocket.chat/fuselage-tokens": "*" "@rocket.chat/message-parser": "*" "@rocket.chat/styled": "*" - "@rocket.chat/ui-client": 4.0.1 - "@rocket.chat/ui-contexts": 4.0.1 + "@rocket.chat/ui-client": 4.0.2 + "@rocket.chat/ui-contexts": 4.0.2 katex: "*" react: "*" languageName: unknown @@ -10621,7 +10621,7 @@ __metadata: "@rocket.chat/fuselage": "*" "@rocket.chat/fuselage-hooks": "*" "@rocket.chat/icons": "*" - "@rocket.chat/ui-contexts": 4.0.1 + "@rocket.chat/ui-contexts": 4.0.2 react: ~17.0.2 languageName: unknown linkType: soft @@ -10796,7 +10796,7 @@ __metadata: "@rocket.chat/fuselage-hooks": "*" "@rocket.chat/icons": "*" "@rocket.chat/styled": "*" - "@rocket.chat/ui-contexts": 4.0.1 + "@rocket.chat/ui-contexts": 4.0.2 react: ^17.0.2 react-dom: ^17.0.2 languageName: unknown @@ -10885,7 +10885,7 @@ __metadata: peerDependencies: "@rocket.chat/layout": "*" "@rocket.chat/tools": 0.2.1 - "@rocket.chat/ui-contexts": 4.0.1 + "@rocket.chat/ui-contexts": 4.0.2 "@tanstack/react-query": "*" react: "*" react-hook-form: "*" From 0398ecc768b60463fe6a54a842f948935ef0a860 Mon Sep 17 00:00:00 2001 From: Diego Sampaio Date: Tue, 5 Mar 2024 17:32:08 -0300 Subject: [PATCH 07/79] fix: presence for mobiles with duplicated connections (#31895) --- .changeset/wicked-months-laugh.md | 5 +++ apps/meteor/ee/server/startup/presence.ts | 9 ++++- apps/meteor/tests/end-to-end/api/01-users.js | 35 ++++++++++++++++++++ 3 files changed, 48 insertions(+), 1 deletion(-) create mode 100644 .changeset/wicked-months-laugh.md diff --git a/.changeset/wicked-months-laugh.md b/.changeset/wicked-months-laugh.md new file mode 100644 index 000000000000..684b4180a257 --- /dev/null +++ b/.changeset/wicked-months-laugh.md @@ -0,0 +1,5 @@ +--- +'@rocket.chat/meteor': patch +--- + +Fix users presence stuck as online after connecting using mobile apps diff --git a/apps/meteor/ee/server/startup/presence.ts b/apps/meteor/ee/server/startup/presence.ts index ea3cd789f6f3..3e8daad4b259 100644 --- a/apps/meteor/ee/server/startup/presence.ts +++ b/apps/meteor/ee/server/startup/presence.ts @@ -30,9 +30,16 @@ Meteor.startup(() => { }); Accounts.onLogin((login: any): void => { - if (login.type !== 'resume') { + if (login.type !== 'resume' || !login.connection.id) { return; } + + // validate if it is a real WS connection and is still open + const session = Meteor.server.sessions.get(login.connection.id); + if (!session) { + return; + } + void (async function () { await Presence.newConnection(login.user._id, login.connection.id, nodeId); updateConns(); diff --git a/apps/meteor/tests/end-to-end/api/01-users.js b/apps/meteor/tests/end-to-end/api/01-users.js index eaafc97527a3..2f2984a2699a 100644 --- a/apps/meteor/tests/end-to-end/api/01-users.js +++ b/apps/meteor/tests/end-to-end/api/01-users.js @@ -527,6 +527,41 @@ describe('[Users]', function () { }) .end(done); }); + + describe('Logging in with type: "resume"', () => { + let user; + let userCredentials; + + before(async () => { + user = await createUser({ joinDefaultChannels: false }); + userCredentials = await login(user.username, password); + }); + + after(async () => deleteUser(user)); + + it('should return "offline" after a login type "resume" via REST', async () => { + await request + .post(api('login')) + .send({ + resume: userCredentials['X-Auth-Token'], + }) + .expect('Content-Type', 'application/json') + .expect(200); + + await request + .get(api('users.getPresence')) + .set(credentials) + .query({ + userId: user._id, + }) + .expect('Content-Type', 'application/json') + .expect(200) + .expect((res) => { + expect(res.body).to.have.property('success', true); + expect(res.body).to.have.nested.property('presence', 'offline'); + }); + }); + }); }); describe('[/users.presence]', () => { From 6098bc556cc9da8ade98310cc413edc18b49584e Mon Sep 17 00:00:00 2001 From: rocketchat-github-ci Date: Wed, 6 Mar 2024 13:55:10 +0000 Subject: [PATCH 08/79] Release 6.6.3 [no ci] --- .changeset/bump-patch-1709669273957.md | 5 --- .changeset/wicked-months-laugh.md | 5 --- apps/meteor/CHANGELOG.md | 34 +++++++++++++++++++ apps/meteor/app/utils/rocketchat.info | 2 +- apps/meteor/ee/server/services/CHANGELOG.md | 13 +++++++ apps/meteor/ee/server/services/package.json | 2 +- apps/meteor/package.json | 2 +- ee/apps/account-service/CHANGELOG.md | 13 +++++++ ee/apps/account-service/package.json | 2 +- ee/apps/authorization-service/CHANGELOG.md | 13 +++++++ ee/apps/authorization-service/package.json | 2 +- ee/apps/ddp-streamer/CHANGELOG.md | 15 ++++++++ ee/apps/ddp-streamer/package.json | 2 +- ee/apps/omnichannel-transcript/CHANGELOG.md | 14 ++++++++ ee/apps/omnichannel-transcript/package.json | 2 +- ee/apps/presence-service/CHANGELOG.md | 13 +++++++ ee/apps/presence-service/package.json | 2 +- ee/apps/queue-worker/CHANGELOG.md | 13 +++++++ ee/apps/queue-worker/package.json | 2 +- ee/apps/stream-hub-service/CHANGELOG.md | 12 +++++++ ee/apps/stream-hub-service/package.json | 2 +- ee/packages/api-client/CHANGELOG.md | 10 ++++++ ee/packages/api-client/package.json | 2 +- ee/packages/ddp-client/CHANGELOG.md | 10 ++++++ ee/packages/ddp-client/package.json | 2 +- ee/packages/license/CHANGELOG.md | 9 +++++ ee/packages/license/package.json | 2 +- ee/packages/omnichannel-services/CHANGELOG.md | 14 ++++++++ ee/packages/omnichannel-services/package.json | 2 +- ee/packages/pdf-worker/CHANGELOG.md | 9 +++++ ee/packages/pdf-worker/package.json | 2 +- ee/packages/presence/CHANGELOG.md | 11 ++++++ ee/packages/presence/package.json | 2 +- package.json | 2 +- packages/core-services/CHANGELOG.md | 11 ++++++ packages/core-services/package.json | 2 +- packages/core-typings/CHANGELOG.md | 2 ++ packages/core-typings/package.json | 2 +- packages/cron/CHANGELOG.md | 10 ++++++ packages/cron/package.json | 2 +- packages/fuselage-ui-kit/CHANGELOG.md | 11 ++++++ packages/fuselage-ui-kit/package.json | 6 ++-- packages/gazzodown/CHANGELOG.md | 11 ++++++ packages/gazzodown/package.json | 8 ++--- packages/instance-status/CHANGELOG.md | 9 +++++ packages/instance-status/package.json | 2 +- packages/livechat/CHANGELOG.md | 9 +++++ packages/livechat/package.json | 2 +- packages/model-typings/CHANGELOG.md | 9 +++++ packages/model-typings/package.json | 2 +- packages/models/CHANGELOG.md | 9 +++++ packages/models/package.json | 2 +- packages/rest-typings/CHANGELOG.md | 9 +++++ packages/rest-typings/package.json | 2 +- packages/ui-client/CHANGELOG.md | 9 +++++ packages/ui-client/package.json | 4 +-- packages/ui-contexts/CHANGELOG.md | 11 ++++++ packages/ui-contexts/package.json | 2 +- packages/ui-video-conf/CHANGELOG.md | 9 +++++ packages/ui-video-conf/package.json | 4 +-- packages/uikit-playground/CHANGELOG.md | 10 ++++++ packages/uikit-playground/package.json | 2 +- packages/web-ui-registration/CHANGELOG.md | 9 +++++ packages/web-ui-registration/package.json | 4 +-- 64 files changed, 381 insertions(+), 50 deletions(-) delete mode 100644 .changeset/bump-patch-1709669273957.md delete mode 100644 .changeset/wicked-months-laugh.md diff --git a/.changeset/bump-patch-1709669273957.md b/.changeset/bump-patch-1709669273957.md deleted file mode 100644 index e1eaa7980afb..000000000000 --- a/.changeset/bump-patch-1709669273957.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@rocket.chat/meteor': patch ---- - -Bump @rocket.chat/meteor version. diff --git a/.changeset/wicked-months-laugh.md b/.changeset/wicked-months-laugh.md deleted file mode 100644 index 684b4180a257..000000000000 --- a/.changeset/wicked-months-laugh.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@rocket.chat/meteor': patch ---- - -Fix users presence stuck as online after connecting using mobile apps diff --git a/apps/meteor/CHANGELOG.md b/apps/meteor/CHANGELOG.md index d041b95fa705..dc3f89042d72 100644 --- a/apps/meteor/CHANGELOG.md +++ b/apps/meteor/CHANGELOG.md @@ -1,5 +1,39 @@ # @rocket.chat/meteor +## 6.6.3 + +### Patch Changes + +- Bump @rocket.chat/meteor version. + +- Bump @rocket.chat/meteor version. + +- ([#31895](https://github.com/RocketChat/Rocket.Chat/pull/31895)) Fix users presence stuck as online after connecting using mobile apps + +-
Updated dependencies []: + + - @rocket.chat/core-typings@6.6.3 + - @rocket.chat/rest-typings@6.6.3 + - @rocket.chat/api-client@0.1.25 + - @rocket.chat/license@0.1.7 + - @rocket.chat/omnichannel-services@0.1.7 + - @rocket.chat/pdf-worker@0.0.31 + - @rocket.chat/presence@0.1.7 + - @rocket.chat/core-services@0.3.7 + - @rocket.chat/cron@0.0.27 + - @rocket.chat/gazzodown@4.0.3 + - @rocket.chat/model-typings@0.3.3 + - @rocket.chat/ui-contexts@4.0.3 + - @rocket.chat/server-cloud-communication@0.0.2 + - @rocket.chat/fuselage-ui-kit@4.0.3 + - @rocket.chat/models@0.0.31 + - @rocket.chat/ui-theming@0.1.2 + - @rocket.chat/ui-client@4.0.3 + - @rocket.chat/ui-video-conf@4.0.3 + - @rocket.chat/web-ui-registration@4.0.3 + - @rocket.chat/instance-status@0.0.31 +
+ ## 6.6.2 ### Patch Changes diff --git a/apps/meteor/app/utils/rocketchat.info b/apps/meteor/app/utils/rocketchat.info index f8cc2889e485..a2f39989dc57 100644 --- a/apps/meteor/app/utils/rocketchat.info +++ b/apps/meteor/app/utils/rocketchat.info @@ -1,3 +1,3 @@ { - "version": "6.6.2" + "version": "6.6.3" } diff --git a/apps/meteor/ee/server/services/CHANGELOG.md b/apps/meteor/ee/server/services/CHANGELOG.md index 1d35bf1759c0..58e1e9c1f370 100644 --- a/apps/meteor/ee/server/services/CHANGELOG.md +++ b/apps/meteor/ee/server/services/CHANGELOG.md @@ -1,5 +1,18 @@ # rocketchat-services +## 1.1.25 + +### Patch Changes + +-
Updated dependencies []: + + - @rocket.chat/core-typings@6.6.3 + - @rocket.chat/rest-typings@6.6.3 + - @rocket.chat/core-services@0.3.7 + - @rocket.chat/model-typings@0.3.3 + - @rocket.chat/models@0.0.31 +
+ ## 1.1.24 ### Patch Changes diff --git a/apps/meteor/ee/server/services/package.json b/apps/meteor/ee/server/services/package.json index f58686786588..595ab7d735e5 100644 --- a/apps/meteor/ee/server/services/package.json +++ b/apps/meteor/ee/server/services/package.json @@ -1,7 +1,7 @@ { "name": "rocketchat-services", "private": true, - "version": "1.1.24", + "version": "1.1.25", "description": "Rocket.Chat Authorization service", "main": "index.js", "scripts": { diff --git a/apps/meteor/package.json b/apps/meteor/package.json index 96a97a9910fb..3e0791093dad 100644 --- a/apps/meteor/package.json +++ b/apps/meteor/package.json @@ -1,7 +1,7 @@ { "name": "@rocket.chat/meteor", "description": "The Ultimate Open Source WebChat Platform", - "version": "6.6.2", + "version": "6.6.3", "private": true, "author": { "name": "Rocket.Chat", diff --git a/ee/apps/account-service/CHANGELOG.md b/ee/apps/account-service/CHANGELOG.md index 52f7ed606faf..b08ebfa93e40 100644 --- a/ee/apps/account-service/CHANGELOG.md +++ b/ee/apps/account-service/CHANGELOG.md @@ -1,5 +1,18 @@ # @rocket.chat/account-service +## 0.3.7 + +### Patch Changes + +-
Updated dependencies []: + + - @rocket.chat/core-typings@6.6.3 + - @rocket.chat/rest-typings@6.6.3 + - @rocket.chat/core-services@0.3.7 + - @rocket.chat/model-typings@0.3.3 + - @rocket.chat/models@0.0.31 +
+ ## 0.3.6 ### Patch Changes diff --git a/ee/apps/account-service/package.json b/ee/apps/account-service/package.json index 3e1fee5d96e0..bdf3c8dee1cc 100644 --- a/ee/apps/account-service/package.json +++ b/ee/apps/account-service/package.json @@ -1,7 +1,7 @@ { "name": "@rocket.chat/account-service", "private": true, - "version": "0.3.6", + "version": "0.3.7", "description": "Rocket.Chat Account service", "scripts": { "build": "tsc -p tsconfig.json", diff --git a/ee/apps/authorization-service/CHANGELOG.md b/ee/apps/authorization-service/CHANGELOG.md index 881f33d1cb3d..31e6163f65c7 100644 --- a/ee/apps/authorization-service/CHANGELOG.md +++ b/ee/apps/authorization-service/CHANGELOG.md @@ -1,5 +1,18 @@ # @rocket.chat/authorization-service +## 0.3.7 + +### Patch Changes + +-
Updated dependencies []: + + - @rocket.chat/core-typings@6.6.3 + - @rocket.chat/rest-typings@6.6.3 + - @rocket.chat/core-services@0.3.7 + - @rocket.chat/model-typings@0.3.3 + - @rocket.chat/models@0.0.31 +
+ ## 0.3.6 ### Patch Changes diff --git a/ee/apps/authorization-service/package.json b/ee/apps/authorization-service/package.json index 250f3e3bd2a4..c89ae3f880d4 100644 --- a/ee/apps/authorization-service/package.json +++ b/ee/apps/authorization-service/package.json @@ -1,7 +1,7 @@ { "name": "@rocket.chat/authorization-service", "private": true, - "version": "0.3.6", + "version": "0.3.7", "description": "Rocket.Chat Authorization service", "scripts": { "build": "tsc -p tsconfig.json", diff --git a/ee/apps/ddp-streamer/CHANGELOG.md b/ee/apps/ddp-streamer/CHANGELOG.md index e5a1de0ed191..6cfa8a66158a 100644 --- a/ee/apps/ddp-streamer/CHANGELOG.md +++ b/ee/apps/ddp-streamer/CHANGELOG.md @@ -1,5 +1,20 @@ # @rocket.chat/ddp-streamer +## 0.2.6 + +### Patch Changes + +-
Updated dependencies []: + + - @rocket.chat/core-typings@6.6.3 + - @rocket.chat/rest-typings@6.6.3 + - @rocket.chat/core-services@0.3.7 + - @rocket.chat/model-typings@0.3.3 + - @rocket.chat/ui-contexts@4.0.3 + - @rocket.chat/models@0.0.31 + - @rocket.chat/instance-status@0.0.31 +
+ ## 0.2.5 ### Patch Changes diff --git a/ee/apps/ddp-streamer/package.json b/ee/apps/ddp-streamer/package.json index 1a399758265c..10b6f7111722 100644 --- a/ee/apps/ddp-streamer/package.json +++ b/ee/apps/ddp-streamer/package.json @@ -1,7 +1,7 @@ { "name": "@rocket.chat/ddp-streamer", "private": true, - "version": "0.2.5", + "version": "0.2.6", "description": "Rocket.Chat DDP-Streamer service", "scripts": { "build": "tsc -p tsconfig.json", diff --git a/ee/apps/omnichannel-transcript/CHANGELOG.md b/ee/apps/omnichannel-transcript/CHANGELOG.md index 62bd6f836c33..3548c2c791df 100644 --- a/ee/apps/omnichannel-transcript/CHANGELOG.md +++ b/ee/apps/omnichannel-transcript/CHANGELOG.md @@ -1,5 +1,19 @@ # @rocket.chat/omnichannel-transcript +## 0.3.7 + +### Patch Changes + +-
Updated dependencies []: + + - @rocket.chat/core-typings@6.6.3 + - @rocket.chat/omnichannel-services@0.1.7 + - @rocket.chat/pdf-worker@0.0.31 + - @rocket.chat/core-services@0.3.7 + - @rocket.chat/model-typings@0.3.3 + - @rocket.chat/models@0.0.31 +
+ ## 0.3.6 ### Patch Changes diff --git a/ee/apps/omnichannel-transcript/package.json b/ee/apps/omnichannel-transcript/package.json index 4d0103b45b19..cb3cc3d2d945 100644 --- a/ee/apps/omnichannel-transcript/package.json +++ b/ee/apps/omnichannel-transcript/package.json @@ -1,7 +1,7 @@ { "name": "@rocket.chat/omnichannel-transcript", "private": true, - "version": "0.3.6", + "version": "0.3.7", "description": "Rocket.Chat service", "scripts": { "build": "tsc -p tsconfig.json", diff --git a/ee/apps/presence-service/CHANGELOG.md b/ee/apps/presence-service/CHANGELOG.md index 4012ad8830c7..e21cb3eda786 100644 --- a/ee/apps/presence-service/CHANGELOG.md +++ b/ee/apps/presence-service/CHANGELOG.md @@ -1,5 +1,18 @@ # @rocket.chat/presence-service +## 0.3.7 + +### Patch Changes + +-
Updated dependencies []: + + - @rocket.chat/core-typings@6.6.3 + - @rocket.chat/presence@0.1.7 + - @rocket.chat/core-services@0.3.7 + - @rocket.chat/model-typings@0.3.3 + - @rocket.chat/models@0.0.31 +
+ ## 0.3.6 ### Patch Changes diff --git a/ee/apps/presence-service/package.json b/ee/apps/presence-service/package.json index 1cafa284610a..e909f9924313 100644 --- a/ee/apps/presence-service/package.json +++ b/ee/apps/presence-service/package.json @@ -1,7 +1,7 @@ { "name": "@rocket.chat/presence-service", "private": true, - "version": "0.3.6", + "version": "0.3.7", "description": "Rocket.Chat Presence service", "scripts": { "build": "tsc -p tsconfig.json", diff --git a/ee/apps/queue-worker/CHANGELOG.md b/ee/apps/queue-worker/CHANGELOG.md index 2c1891559b8a..a24149abb17e 100644 --- a/ee/apps/queue-worker/CHANGELOG.md +++ b/ee/apps/queue-worker/CHANGELOG.md @@ -1,5 +1,18 @@ # @rocket.chat/queue-worker +## 0.3.7 + +### Patch Changes + +-
Updated dependencies []: + + - @rocket.chat/core-typings@6.6.3 + - @rocket.chat/omnichannel-services@0.1.7 + - @rocket.chat/core-services@0.3.7 + - @rocket.chat/model-typings@0.3.3 + - @rocket.chat/models@0.0.31 +
+ ## 0.3.6 ### Patch Changes diff --git a/ee/apps/queue-worker/package.json b/ee/apps/queue-worker/package.json index e81cd6551747..2c841eebefdb 100644 --- a/ee/apps/queue-worker/package.json +++ b/ee/apps/queue-worker/package.json @@ -1,7 +1,7 @@ { "name": "@rocket.chat/queue-worker", "private": true, - "version": "0.3.6", + "version": "0.3.7", "description": "Rocket.Chat service", "scripts": { "build": "tsc -p tsconfig.json", diff --git a/ee/apps/stream-hub-service/CHANGELOG.md b/ee/apps/stream-hub-service/CHANGELOG.md index 3726554ec0e3..ed62da3085e4 100644 --- a/ee/apps/stream-hub-service/CHANGELOG.md +++ b/ee/apps/stream-hub-service/CHANGELOG.md @@ -1,5 +1,17 @@ # @rocket.chat/stream-hub-service +## 0.3.7 + +### Patch Changes + +-
Updated dependencies []: + + - @rocket.chat/core-typings@6.6.3 + - @rocket.chat/core-services@0.3.7 + - @rocket.chat/model-typings@0.3.3 + - @rocket.chat/models@0.0.31 +
+ ## 0.3.6 ### Patch Changes diff --git a/ee/apps/stream-hub-service/package.json b/ee/apps/stream-hub-service/package.json index 60608e0ca513..ddb211a78e31 100644 --- a/ee/apps/stream-hub-service/package.json +++ b/ee/apps/stream-hub-service/package.json @@ -1,7 +1,7 @@ { "name": "@rocket.chat/stream-hub-service", "private": true, - "version": "0.3.6", + "version": "0.3.7", "description": "Rocket.Chat Stream Hub service", "scripts": { "build": "tsc -p tsconfig.json", diff --git a/ee/packages/api-client/CHANGELOG.md b/ee/packages/api-client/CHANGELOG.md index bc28eeb08ce5..b1a5b87f50a2 100644 --- a/ee/packages/api-client/CHANGELOG.md +++ b/ee/packages/api-client/CHANGELOG.md @@ -1,5 +1,15 @@ # @rocket.chat/api-client +## 0.1.25 + +### Patch Changes + +-
Updated dependencies []: + + - @rocket.chat/core-typings@6.6.3 + - @rocket.chat/rest-typings@6.6.3 +
+ ## 0.1.24 ### Patch Changes diff --git a/ee/packages/api-client/package.json b/ee/packages/api-client/package.json index d13f932a740d..d201b21ca85b 100644 --- a/ee/packages/api-client/package.json +++ b/ee/packages/api-client/package.json @@ -1,7 +1,7 @@ { "name": "@rocket.chat/api-client", "private": true, - "version": "0.1.24", + "version": "0.1.25", "devDependencies": { "@swc/core": "^1.3.95", "@swc/jest": "^0.2.29", diff --git a/ee/packages/ddp-client/CHANGELOG.md b/ee/packages/ddp-client/CHANGELOG.md index 0f20bd5f79ac..966ab60f0fae 100644 --- a/ee/packages/ddp-client/CHANGELOG.md +++ b/ee/packages/ddp-client/CHANGELOG.md @@ -1,5 +1,15 @@ # @rocket.chat/ddp-client +## 0.2.16 + +### Patch Changes + +-
Updated dependencies []: + + - @rocket.chat/rest-typings@6.6.3 + - @rocket.chat/api-client@0.1.25 +
+ ## 0.2.15 ### Patch Changes diff --git a/ee/packages/ddp-client/package.json b/ee/packages/ddp-client/package.json index 9192f27d8fea..5e0e62a534ae 100644 --- a/ee/packages/ddp-client/package.json +++ b/ee/packages/ddp-client/package.json @@ -1,7 +1,7 @@ { "name": "@rocket.chat/ddp-client", "private": true, - "version": "0.2.15", + "version": "0.2.16", "devDependencies": { "@swc/core": "^1.3.95", "@swc/jest": "^0.2.29", diff --git a/ee/packages/license/CHANGELOG.md b/ee/packages/license/CHANGELOG.md index 04d7bc0e678a..7f275d75262a 100644 --- a/ee/packages/license/CHANGELOG.md +++ b/ee/packages/license/CHANGELOG.md @@ -1,5 +1,14 @@ # @rocket.chat/license +## 0.1.7 + +### Patch Changes + +-
Updated dependencies []: + + - @rocket.chat/core-typings@6.6.3 +
+ ## 0.1.6 ### Patch Changes diff --git a/ee/packages/license/package.json b/ee/packages/license/package.json index 8fb25a8c611b..df8f41fa2375 100644 --- a/ee/packages/license/package.json +++ b/ee/packages/license/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/license", - "version": "0.1.6", + "version": "0.1.7", "private": true, "devDependencies": { "@swc/core": "^1.3.95", diff --git a/ee/packages/omnichannel-services/CHANGELOG.md b/ee/packages/omnichannel-services/CHANGELOG.md index 996f1b375077..e38a46de97bb 100644 --- a/ee/packages/omnichannel-services/CHANGELOG.md +++ b/ee/packages/omnichannel-services/CHANGELOG.md @@ -1,5 +1,19 @@ # @rocket.chat/omnichannel-services +## 0.1.7 + +### Patch Changes + +-
Updated dependencies []: + + - @rocket.chat/core-typings@6.6.3 + - @rocket.chat/rest-typings@6.6.3 + - @rocket.chat/pdf-worker@0.0.31 + - @rocket.chat/core-services@0.3.7 + - @rocket.chat/model-typings@0.3.3 + - @rocket.chat/models@0.0.31 +
+ ## 0.1.6 ### Patch Changes diff --git a/ee/packages/omnichannel-services/package.json b/ee/packages/omnichannel-services/package.json index 869117815a41..8e6c8dcc0161 100644 --- a/ee/packages/omnichannel-services/package.json +++ b/ee/packages/omnichannel-services/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/omnichannel-services", - "version": "0.1.6", + "version": "0.1.7", "private": true, "devDependencies": { "@rocket.chat/eslint-config": "workspace:^", diff --git a/ee/packages/pdf-worker/CHANGELOG.md b/ee/packages/pdf-worker/CHANGELOG.md index c2a4c9ff1c7b..d3ed325b0009 100644 --- a/ee/packages/pdf-worker/CHANGELOG.md +++ b/ee/packages/pdf-worker/CHANGELOG.md @@ -1,5 +1,14 @@ # @rocket.chat/pdf-worker +## 0.0.31 + +### Patch Changes + +-
Updated dependencies []: + + - @rocket.chat/core-typings@6.6.3 +
+ ## 0.0.30 ### Patch Changes diff --git a/ee/packages/pdf-worker/package.json b/ee/packages/pdf-worker/package.json index 167d9af95096..390a7a7c309d 100644 --- a/ee/packages/pdf-worker/package.json +++ b/ee/packages/pdf-worker/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/pdf-worker", - "version": "0.0.30", + "version": "0.0.31", "private": true, "devDependencies": { "@storybook/addon-essentials": "~6.5.16", diff --git a/ee/packages/presence/CHANGELOG.md b/ee/packages/presence/CHANGELOG.md index 09011503158e..10cb1b136ce0 100644 --- a/ee/packages/presence/CHANGELOG.md +++ b/ee/packages/presence/CHANGELOG.md @@ -1,5 +1,16 @@ # @rocket.chat/presence +## 0.1.7 + +### Patch Changes + +-
Updated dependencies []: + + - @rocket.chat/core-typings@6.6.3 + - @rocket.chat/core-services@0.3.7 + - @rocket.chat/models@0.0.31 +
+ ## 0.1.6 ### Patch Changes diff --git a/ee/packages/presence/package.json b/ee/packages/presence/package.json index 8ad4626705f0..545134e29c3f 100644 --- a/ee/packages/presence/package.json +++ b/ee/packages/presence/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/presence", - "version": "0.1.6", + "version": "0.1.7", "private": true, "devDependencies": { "@babel/core": "~7.22.20", diff --git a/package.json b/package.json index 0db55ca23f6b..95df38998d7a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "rocket.chat", - "version": "6.6.2", + "version": "6.6.3", "description": "Rocket.Chat Monorepo", "main": "index.js", "private": true, diff --git a/packages/core-services/CHANGELOG.md b/packages/core-services/CHANGELOG.md index bb53dee42e46..c117daeb3bf4 100644 --- a/packages/core-services/CHANGELOG.md +++ b/packages/core-services/CHANGELOG.md @@ -1,5 +1,16 @@ # @rocket.chat/core-services +## 0.3.7 + +### Patch Changes + +-
Updated dependencies []: + + - @rocket.chat/core-typings@6.6.3 + - @rocket.chat/rest-typings@6.6.3 + - @rocket.chat/models@0.0.31 +
+ ## 0.3.6 ### Patch Changes diff --git a/packages/core-services/package.json b/packages/core-services/package.json index c95cdc18b199..1326401fa8de 100644 --- a/packages/core-services/package.json +++ b/packages/core-services/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/core-services", - "version": "0.3.6", + "version": "0.3.7", "private": true, "devDependencies": { "@babel/core": "~7.22.20", diff --git a/packages/core-typings/CHANGELOG.md b/packages/core-typings/CHANGELOG.md index e2dbf9e953fb..e1a9603d35f3 100644 --- a/packages/core-typings/CHANGELOG.md +++ b/packages/core-typings/CHANGELOG.md @@ -1,5 +1,7 @@ # @rocket.chat/core-typings +## 6.6.3 + ## 6.6.2 ## 6.6.1 diff --git a/packages/core-typings/package.json b/packages/core-typings/package.json index 7870acc10b67..e6164236ae97 100644 --- a/packages/core-typings/package.json +++ b/packages/core-typings/package.json @@ -2,7 +2,7 @@ "$schema": "https://json.schemastore.org/package", "name": "@rocket.chat/core-typings", "private": true, - "version": "6.6.2", + "version": "6.6.3", "devDependencies": { "@rocket.chat/eslint-config": "workspace:^", "eslint": "~8.45.0", diff --git a/packages/cron/CHANGELOG.md b/packages/cron/CHANGELOG.md index ac4805ef5dd5..a71d40b1af86 100644 --- a/packages/cron/CHANGELOG.md +++ b/packages/cron/CHANGELOG.md @@ -1,5 +1,15 @@ # @rocket.chat/cron +## 0.0.27 + +### Patch Changes + +-
Updated dependencies []: + + - @rocket.chat/core-typings@6.6.3 + - @rocket.chat/models@0.0.31 +
+ ## 0.0.26 ### Patch Changes diff --git a/packages/cron/package.json b/packages/cron/package.json index ba2d5c07d09c..f90b9176f6a8 100644 --- a/packages/cron/package.json +++ b/packages/cron/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/cron", - "version": "0.0.26", + "version": "0.0.27", "private": true, "devDependencies": { "@types/jest": "~29.5.7", diff --git a/packages/fuselage-ui-kit/CHANGELOG.md b/packages/fuselage-ui-kit/CHANGELOG.md index cada2203c1ec..41b6eebaef5d 100644 --- a/packages/fuselage-ui-kit/CHANGELOG.md +++ b/packages/fuselage-ui-kit/CHANGELOG.md @@ -1,5 +1,16 @@ # Change Log +## 4.0.3 + +### Patch Changes + +-
Updated dependencies []: + + - @rocket.chat/gazzodown@4.0.3 + - @rocket.chat/ui-contexts@4.0.3 + - @rocket.chat/ui-video-conf@4.0.3 +
+ ## 4.0.2 ### Patch Changes diff --git a/packages/fuselage-ui-kit/package.json b/packages/fuselage-ui-kit/package.json index a5db2ed5f7a9..e9258e7afcaa 100644 --- a/packages/fuselage-ui-kit/package.json +++ b/packages/fuselage-ui-kit/package.json @@ -1,7 +1,7 @@ { "name": "@rocket.chat/fuselage-ui-kit", "private": true, - "version": "4.0.2", + "version": "4.0.3", "description": "UiKit elements for Rocket.Chat Apps built under Fuselage design system", "homepage": "https://rocketchat.github.io/Rocket.Chat.Fuselage/", "author": { @@ -48,9 +48,9 @@ "@rocket.chat/icons": "*", "@rocket.chat/prettier-config": "*", "@rocket.chat/styled": "*", - "@rocket.chat/ui-contexts": "4.0.2", + "@rocket.chat/ui-contexts": "4.0.3", "@rocket.chat/ui-kit": "0.33.0", - "@rocket.chat/ui-video-conf": "4.0.2", + "@rocket.chat/ui-video-conf": "4.0.3", "@tanstack/react-query": "*", "react": "*", "react-dom": "*" diff --git a/packages/gazzodown/CHANGELOG.md b/packages/gazzodown/CHANGELOG.md index 9300075b9b9c..1e691ce9d802 100644 --- a/packages/gazzodown/CHANGELOG.md +++ b/packages/gazzodown/CHANGELOG.md @@ -1,5 +1,16 @@ # @rocket.chat/gazzodown +## 4.0.3 + +### Patch Changes + +-
Updated dependencies []: + + - @rocket.chat/core-typings@6.6.3 + - @rocket.chat/ui-contexts@4.0.3 + - @rocket.chat/ui-client@4.0.3 +
+ ## 4.0.2 ### Patch Changes diff --git a/packages/gazzodown/package.json b/packages/gazzodown/package.json index 81745c117fe9..ea298f3ad8ae 100644 --- a/packages/gazzodown/package.json +++ b/packages/gazzodown/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/gazzodown", - "version": "4.0.2", + "version": "4.0.3", "private": true, "devDependencies": { "@babel/core": "~7.22.20", @@ -65,14 +65,14 @@ "/dist" ], "peerDependencies": { - "@rocket.chat/core-typings": "6.6.2", + "@rocket.chat/core-typings": "6.6.3", "@rocket.chat/css-in-js": "*", "@rocket.chat/fuselage": "*", "@rocket.chat/fuselage-tokens": "*", "@rocket.chat/message-parser": "*", "@rocket.chat/styled": "*", - "@rocket.chat/ui-client": "4.0.2", - "@rocket.chat/ui-contexts": "4.0.2", + "@rocket.chat/ui-client": "4.0.3", + "@rocket.chat/ui-contexts": "4.0.3", "katex": "*", "react": "*" }, diff --git a/packages/instance-status/CHANGELOG.md b/packages/instance-status/CHANGELOG.md index 83dbe8c84996..d59acff3e91d 100644 --- a/packages/instance-status/CHANGELOG.md +++ b/packages/instance-status/CHANGELOG.md @@ -1,5 +1,14 @@ # @rocket.chat/instance-status +## 0.0.31 + +### Patch Changes + +-
Updated dependencies []: + + - @rocket.chat/models@0.0.31 +
+ ## 0.0.30 ### Patch Changes diff --git a/packages/instance-status/package.json b/packages/instance-status/package.json index 28fefc588cac..820b08ad4907 100644 --- a/packages/instance-status/package.json +++ b/packages/instance-status/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/instance-status", - "version": "0.0.30", + "version": "0.0.31", "private": true, "devDependencies": { "@rocket.chat/eslint-config": "workspace:^", diff --git a/packages/livechat/CHANGELOG.md b/packages/livechat/CHANGELOG.md index 330530d754d9..bb63a6982911 100644 --- a/packages/livechat/CHANGELOG.md +++ b/packages/livechat/CHANGELOG.md @@ -1,5 +1,14 @@ # @rocket.chat/livechat Change Log +## 1.14.16 + +### Patch Changes + +-
Updated dependencies []: + + - @rocket.chat/gazzodown@4.0.3 +
+ ## 1.14.15 ### Patch Changes diff --git a/packages/livechat/package.json b/packages/livechat/package.json index a31ead75a61c..5171f150cf30 100644 --- a/packages/livechat/package.json +++ b/packages/livechat/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/livechat", - "version": "1.14.15", + "version": "1.14.16", "files": [ "/build" ], diff --git a/packages/model-typings/CHANGELOG.md b/packages/model-typings/CHANGELOG.md index 61867f3c3076..13b4db03c595 100644 --- a/packages/model-typings/CHANGELOG.md +++ b/packages/model-typings/CHANGELOG.md @@ -1,5 +1,14 @@ # @rocket.chat/model-typings +## 0.3.3 + +### Patch Changes + +-
Updated dependencies []: + + - @rocket.chat/core-typings@6.6.3 +
+ ## 0.3.2 ### Patch Changes diff --git a/packages/model-typings/package.json b/packages/model-typings/package.json index dc7160134243..81fd1d8ca421 100644 --- a/packages/model-typings/package.json +++ b/packages/model-typings/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/model-typings", - "version": "0.3.2", + "version": "0.3.3", "private": true, "devDependencies": { "@types/jest": "~29.5.7", diff --git a/packages/models/CHANGELOG.md b/packages/models/CHANGELOG.md index e4b8789c0145..c5fd37e5d58d 100644 --- a/packages/models/CHANGELOG.md +++ b/packages/models/CHANGELOG.md @@ -1,5 +1,14 @@ # @rocket.chat/models +## 0.0.31 + +### Patch Changes + +-
Updated dependencies []: + + - @rocket.chat/model-typings@0.3.3 +
+ ## 0.0.30 ### Patch Changes diff --git a/packages/models/package.json b/packages/models/package.json index a4e68ed1a221..c80ff5a23c5f 100644 --- a/packages/models/package.json +++ b/packages/models/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/models", - "version": "0.0.30", + "version": "0.0.31", "private": true, "devDependencies": { "@types/jest": "~29.5.7", diff --git a/packages/rest-typings/CHANGELOG.md b/packages/rest-typings/CHANGELOG.md index 77412c9a3faf..963c3a1ec7b5 100644 --- a/packages/rest-typings/CHANGELOG.md +++ b/packages/rest-typings/CHANGELOG.md @@ -1,5 +1,14 @@ # @rocket.chat/rest-typings +## 6.6.3 + +### Patch Changes + +-
Updated dependencies []: + + - @rocket.chat/core-typings@6.6.3 +
+ ## 6.6.2 ### Patch Changes diff --git a/packages/rest-typings/package.json b/packages/rest-typings/package.json index 612b08252a59..0927f35587e1 100644 --- a/packages/rest-typings/package.json +++ b/packages/rest-typings/package.json @@ -1,7 +1,7 @@ { "name": "@rocket.chat/rest-typings", "private": true, - "version": "6.6.2", + "version": "6.6.3", "devDependencies": { "@rocket.chat/eslint-config": "workspace:^", "@types/jest": "~29.5.7", diff --git a/packages/ui-client/CHANGELOG.md b/packages/ui-client/CHANGELOG.md index 87077670667f..73109c3a1dd7 100644 --- a/packages/ui-client/CHANGELOG.md +++ b/packages/ui-client/CHANGELOG.md @@ -1,5 +1,14 @@ # @rocket.chat/ui-client +## 4.0.3 + +### Patch Changes + +-
Updated dependencies []: + + - @rocket.chat/ui-contexts@4.0.3 +
+ ## 4.0.2 ### Patch Changes diff --git a/packages/ui-client/package.json b/packages/ui-client/package.json index 35bc4ca58d86..21aae273ee38 100644 --- a/packages/ui-client/package.json +++ b/packages/ui-client/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/ui-client", - "version": "4.0.2", + "version": "4.0.3", "private": true, "devDependencies": { "@babel/core": "~7.22.20", @@ -63,7 +63,7 @@ "@rocket.chat/fuselage": "*", "@rocket.chat/fuselage-hooks": "*", "@rocket.chat/icons": "*", - "@rocket.chat/ui-contexts": "4.0.2", + "@rocket.chat/ui-contexts": "4.0.3", "react": "~17.0.2" }, "volta": { diff --git a/packages/ui-contexts/CHANGELOG.md b/packages/ui-contexts/CHANGELOG.md index 60560e0bf598..dccc45243daf 100644 --- a/packages/ui-contexts/CHANGELOG.md +++ b/packages/ui-contexts/CHANGELOG.md @@ -1,5 +1,16 @@ # @rocket.chat/ui-contexts +## 4.0.3 + +### Patch Changes + +-
Updated dependencies []: + + - @rocket.chat/core-typings@6.6.3 + - @rocket.chat/rest-typings@6.6.3 + - @rocket.chat/ddp-client@0.2.16 +
+ ## 4.0.2 ### Patch Changes diff --git a/packages/ui-contexts/package.json b/packages/ui-contexts/package.json index 85e813b0ff0e..dddd830ddb6b 100644 --- a/packages/ui-contexts/package.json +++ b/packages/ui-contexts/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/ui-contexts", - "version": "4.0.2", + "version": "4.0.3", "private": true, "devDependencies": { "@rocket.chat/core-typings": "workspace:^", diff --git a/packages/ui-video-conf/CHANGELOG.md b/packages/ui-video-conf/CHANGELOG.md index bce197e1cefd..b402fd9e80fa 100644 --- a/packages/ui-video-conf/CHANGELOG.md +++ b/packages/ui-video-conf/CHANGELOG.md @@ -1,5 +1,14 @@ # @rocket.chat/ui-video-conf +## 4.0.3 + +### Patch Changes + +-
Updated dependencies []: + + - @rocket.chat/ui-contexts@4.0.3 +
+ ## 4.0.2 ### Patch Changes diff --git a/packages/ui-video-conf/package.json b/packages/ui-video-conf/package.json index 379d06920cde..32dcd89d6710 100644 --- a/packages/ui-video-conf/package.json +++ b/packages/ui-video-conf/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/ui-video-conf", - "version": "4.0.2", + "version": "4.0.3", "private": true, "devDependencies": { "@babel/core": "~7.22.20", @@ -35,7 +35,7 @@ "@rocket.chat/fuselage-hooks": "*", "@rocket.chat/icons": "*", "@rocket.chat/styled": "*", - "@rocket.chat/ui-contexts": "4.0.2", + "@rocket.chat/ui-contexts": "4.0.3", "react": "^17.0.2", "react-dom": "^17.0.2" }, diff --git a/packages/uikit-playground/CHANGELOG.md b/packages/uikit-playground/CHANGELOG.md index 6a72359d4a3c..1b0d78e72793 100644 --- a/packages/uikit-playground/CHANGELOG.md +++ b/packages/uikit-playground/CHANGELOG.md @@ -1,5 +1,15 @@ # @rocket.chat/uikit-playground +## 0.2.16 + +### Patch Changes + +-
Updated dependencies []: + + - @rocket.chat/ui-contexts@4.0.3 + - @rocket.chat/fuselage-ui-kit@4.0.3 +
+ ## 0.2.15 ### Patch Changes diff --git a/packages/uikit-playground/package.json b/packages/uikit-playground/package.json index a1925a87be38..afc3f5440c03 100644 --- a/packages/uikit-playground/package.json +++ b/packages/uikit-playground/package.json @@ -1,7 +1,7 @@ { "name": "@rocket.chat/uikit-playground", "private": true, - "version": "0.2.15", + "version": "0.2.16", "type": "module", "scripts": { "dev": "vite", diff --git a/packages/web-ui-registration/CHANGELOG.md b/packages/web-ui-registration/CHANGELOG.md index 2a3a5194f27f..16cac3a2a62a 100644 --- a/packages/web-ui-registration/CHANGELOG.md +++ b/packages/web-ui-registration/CHANGELOG.md @@ -1,5 +1,14 @@ # @rocket.chat/web-ui-registration +## 4.0.3 + +### Patch Changes + +-
Updated dependencies []: + + - @rocket.chat/ui-contexts@4.0.3 +
+ ## 4.0.2 ### Patch Changes diff --git a/packages/web-ui-registration/package.json b/packages/web-ui-registration/package.json index 677486e97d69..748cb2d01195 100644 --- a/packages/web-ui-registration/package.json +++ b/packages/web-ui-registration/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/web-ui-registration", - "version": "4.0.2", + "version": "4.0.3", "private": true, "homepage": "https://rocket.chat", "main": "./dist/index.js", @@ -51,7 +51,7 @@ "peerDependencies": { "@rocket.chat/layout": "*", "@rocket.chat/tools": "0.2.1", - "@rocket.chat/ui-contexts": "4.0.2", + "@rocket.chat/ui-contexts": "4.0.3", "@tanstack/react-query": "*", "react": "*", "react-hook-form": "*", From dee1465cac8aa7d9d8d3c016873f3bf338bf2767 Mon Sep 17 00:00:00 2001 From: rocketchat-github-ci Date: Mon, 18 Mar 2024 14:34:14 +0000 Subject: [PATCH 09/79] Bump 6.6.4 --- .changeset/bump-patch-1710772454766.md | 5 +++++ yarn.lock | 16 ++++++++-------- 2 files changed, 13 insertions(+), 8 deletions(-) create mode 100644 .changeset/bump-patch-1710772454766.md diff --git a/.changeset/bump-patch-1710772454766.md b/.changeset/bump-patch-1710772454766.md new file mode 100644 index 000000000000..e1eaa7980afb --- /dev/null +++ b/.changeset/bump-patch-1710772454766.md @@ -0,0 +1,5 @@ +--- +'@rocket.chat/meteor': patch +--- + +Bump @rocket.chat/meteor version. diff --git a/yarn.lock b/yarn.lock index af1134d87e32..8e65c735f6b7 100644 --- a/yarn.lock +++ b/yarn.lock @@ -9348,9 +9348,9 @@ __metadata: "@rocket.chat/icons": "*" "@rocket.chat/prettier-config": "*" "@rocket.chat/styled": "*" - "@rocket.chat/ui-contexts": 4.0.2 + "@rocket.chat/ui-contexts": 4.0.3 "@rocket.chat/ui-kit": 0.33.0 - "@rocket.chat/ui-video-conf": 4.0.2 + "@rocket.chat/ui-video-conf": 4.0.3 "@tanstack/react-query": "*" react: "*" react-dom: "*" @@ -9432,14 +9432,14 @@ __metadata: ts-jest: ~29.1.1 typescript: ~5.3.2 peerDependencies: - "@rocket.chat/core-typings": 6.6.2 + "@rocket.chat/core-typings": 6.6.3 "@rocket.chat/css-in-js": "*" "@rocket.chat/fuselage": "*" "@rocket.chat/fuselage-tokens": "*" "@rocket.chat/message-parser": "*" "@rocket.chat/styled": "*" - "@rocket.chat/ui-client": 4.0.2 - "@rocket.chat/ui-contexts": 4.0.2 + "@rocket.chat/ui-client": 4.0.3 + "@rocket.chat/ui-contexts": 4.0.3 katex: "*" react: "*" languageName: unknown @@ -10621,7 +10621,7 @@ __metadata: "@rocket.chat/fuselage": "*" "@rocket.chat/fuselage-hooks": "*" "@rocket.chat/icons": "*" - "@rocket.chat/ui-contexts": 4.0.2 + "@rocket.chat/ui-contexts": 4.0.3 react: ~17.0.2 languageName: unknown linkType: soft @@ -10796,7 +10796,7 @@ __metadata: "@rocket.chat/fuselage-hooks": "*" "@rocket.chat/icons": "*" "@rocket.chat/styled": "*" - "@rocket.chat/ui-contexts": 4.0.2 + "@rocket.chat/ui-contexts": 4.0.3 react: ^17.0.2 react-dom: ^17.0.2 languageName: unknown @@ -10885,7 +10885,7 @@ __metadata: peerDependencies: "@rocket.chat/layout": "*" "@rocket.chat/tools": 0.2.1 - "@rocket.chat/ui-contexts": 4.0.2 + "@rocket.chat/ui-contexts": 4.0.3 "@tanstack/react-query": "*" react: "*" react-hook-form: "*" From c2872a93f202ad9aa989f2048e7b478e374e995a Mon Sep 17 00:00:00 2001 From: Marcos Spessatto Defendi Date: Fri, 8 Mar 2024 18:46:02 -0300 Subject: [PATCH 10/79] fix: convert network broker stopped lifecycle method to async (#31927) Co-authored-by: Diego Sampaio <8591547+sampaiodiego@users.noreply.github.com> --- .changeset/slimy-clocks-argue.md | 6 +++ .../search/server/search.internalService.ts | 4 +- apps/meteor/ee/server/NetworkBroker.ts | 4 +- apps/meteor/ee/server/startup/services.ts | 2 +- .../tests/unit/server/NetworkBroker.tests.ts | 39 +++++++++++++++++++ .../meteor/tests/mocks/server/BrokerMocked.ts | 10 +++-- .../hooks/BeforeSaveCheckMAC.tests.ts | 2 +- packages/core-services/src/LocalBroker.ts | 4 +- packages/core-services/src/lib/Api.ts | 4 +- .../core-services/src/types/IApiService.ts | 2 +- packages/core-services/src/types/IBroker.ts | 2 +- 11 files changed, 63 insertions(+), 16 deletions(-) create mode 100644 .changeset/slimy-clocks-argue.md create mode 100644 apps/meteor/ee/tests/unit/server/NetworkBroker.tests.ts diff --git a/.changeset/slimy-clocks-argue.md b/.changeset/slimy-clocks-argue.md new file mode 100644 index 000000000000..35d4e9e3e433 --- /dev/null +++ b/.changeset/slimy-clocks-argue.md @@ -0,0 +1,6 @@ +--- +"@rocket.chat/meteor": patch +"@rocket.chat/core-services": patch +--- + +`stopped` lifecycle method was unexpectedly synchronous when using microservices, causing our code to create race conditions. diff --git a/apps/meteor/app/search/server/search.internalService.ts b/apps/meteor/app/search/server/search.internalService.ts index 97de49711284..2fbaa2e1da31 100644 --- a/apps/meteor/app/search/server/search.internalService.ts +++ b/apps/meteor/app/search/server/search.internalService.ts @@ -36,10 +36,10 @@ class Search extends ServiceClassInternal { const service = new Search(); -settings.watch('Search.Provider', () => { +settings.watch('Search.Provider', async () => { if (searchProviderService.activeProvider?.on) { api.registerService(service); } else { - api.destroyService(service); + await api.destroyService(service); } }); diff --git a/apps/meteor/ee/server/NetworkBroker.ts b/apps/meteor/ee/server/NetworkBroker.ts index 3af389e4f3e7..0fed6fca542d 100644 --- a/apps/meteor/ee/server/NetworkBroker.ts +++ b/apps/meteor/ee/server/NetworkBroker.ts @@ -71,12 +71,12 @@ export class NetworkBroker implements IBroker { return this.broker.call(method, data); } - destroyService(instance: IServiceClass): void { + async destroyService(instance: IServiceClass): Promise { const name = instance.getName(); if (!name) { return; } - void this.broker.destroyService(name); + await this.broker.destroyService(name); instance.removeAllListeners(); } diff --git a/apps/meteor/ee/server/startup/services.ts b/apps/meteor/ee/server/startup/services.ts index 86743602d1e1..2f63ddba42a8 100644 --- a/apps/meteor/ee/server/startup/services.ts +++ b/apps/meteor/ee/server/startup/services.ts @@ -33,7 +33,7 @@ if (!License.hasValidLicense()) { void License.onLicense('federation', async () => { const federationServiceEE = await FederationServiceEE.createFederationService(); if (federationService) { - api.destroyService(federationService); + await api.destroyService(federationService); } api.registerService(federationServiceEE); }); diff --git a/apps/meteor/ee/tests/unit/server/NetworkBroker.tests.ts b/apps/meteor/ee/tests/unit/server/NetworkBroker.tests.ts new file mode 100644 index 000000000000..1aac9c33fc33 --- /dev/null +++ b/apps/meteor/ee/tests/unit/server/NetworkBroker.tests.ts @@ -0,0 +1,39 @@ +import { ServiceClass } from '@rocket.chat/core-services'; +import { expect } from 'chai'; +import sinon from 'sinon'; + +import { BrokerMocked } from '../../../../tests/mocks/server/BrokerMocked'; +import { NetworkBroker } from '../../../server/NetworkBroker'; + +class DelayedStopBroker extends BrokerMocked { + async destroyService(name: string) { + const instance = this.services.get(name); + + await new Promise((resolve) => setTimeout(resolve, 1000)); + + await instance.stopped(); + + await super.destroyService(name); + } +} + +const broker = new NetworkBroker(new DelayedStopBroker() as any); + +describe('NetworkBroker', () => { + it('should wait services to be fully destroyed', async () => { + const stoppedStub = sinon.stub(); + + const instance = new (class extends ServiceClass { + name = 'test'; + + async stopped() { + stoppedStub(); + } + })(); + + broker.createService(instance); + await broker.destroyService(instance); + + expect(stoppedStub.called).to.be.true; + }); +}); diff --git a/apps/meteor/tests/mocks/server/BrokerMocked.ts b/apps/meteor/tests/mocks/server/BrokerMocked.ts index dbab825acfad..fd89044bc781 100644 --- a/apps/meteor/tests/mocks/server/BrokerMocked.ts +++ b/apps/meteor/tests/mocks/server/BrokerMocked.ts @@ -1,12 +1,14 @@ export class BrokerMocked { actions: Record Promise> = {}; - destroyService(): void { - // no op + services: Map = new Map(); + + async destroyService(name: string): Promise { + this.services.delete(name); } - createService(): void { - // no op + createService(instance: any): void { + this.services.set(instance.name, instance); } async call(method: string, data: any): Promise { diff --git a/apps/meteor/tests/unit/server/services/messages/hooks/BeforeSaveCheckMAC.tests.ts b/apps/meteor/tests/unit/server/services/messages/hooks/BeforeSaveCheckMAC.tests.ts index 2ee0604d6f81..faed1cdc1609 100644 --- a/apps/meteor/tests/unit/server/services/messages/hooks/BeforeSaveCheckMAC.tests.ts +++ b/apps/meteor/tests/unit/server/services/messages/hooks/BeforeSaveCheckMAC.tests.ts @@ -36,7 +36,7 @@ const broker = new BrokerMocked(); describe('Check MAC', () => { before(() => { - api.setBroker(broker); + api.setBroker(broker as any); }); it('should do nothing if not omnichannel room', async () => { diff --git a/packages/core-services/src/LocalBroker.ts b/packages/core-services/src/LocalBroker.ts index 47f4aaba3c80..451ced1cf39f 100644 --- a/packages/core-services/src/LocalBroker.ts +++ b/packages/core-services/src/LocalBroker.ts @@ -34,7 +34,7 @@ export class LocalBroker implements IBroker { return this.call(method, data); } - destroyService(instance: ServiceClass): void { + async destroyService(instance: ServiceClass): Promise { const namespace = instance.getName(); instance.getEvents().forEach((event) => event.listeners.forEach((listener) => this.events.removeListener(event.eventName, listener))); @@ -51,7 +51,7 @@ export class LocalBroker implements IBroker { this.methods.delete(`${namespace}.${method}`); } instance.removeAllListeners(); - instance.stopped(); + await instance.stopped(); } createService(instance: IServiceClass): void { diff --git a/packages/core-services/src/lib/Api.ts b/packages/core-services/src/lib/Api.ts index 61a58301a0cc..d02dfe1f8a56 100644 --- a/packages/core-services/src/lib/Api.ts +++ b/packages/core-services/src/lib/Api.ts @@ -15,13 +15,13 @@ export class Api implements IApiService { this.services.forEach((service) => this.broker?.createService(service)); } - destroyService(instance: IServiceClass): void { + async destroyService(instance: IServiceClass): Promise { if (!this.services.has(instance)) { return; } if (this.broker) { - this.broker.destroyService(instance); + await this.broker.destroyService(instance); } this.services.delete(instance); diff --git a/packages/core-services/src/types/IApiService.ts b/packages/core-services/src/types/IApiService.ts index ef88d57713bc..802ae04ab5e2 100644 --- a/packages/core-services/src/types/IApiService.ts +++ b/packages/core-services/src/types/IApiService.ts @@ -5,7 +5,7 @@ import type { IServiceClass } from './ServiceClass'; export interface IApiService { setBroker(broker: IBroker): void; - destroyService(instance: IServiceClass): void; + destroyService(instance: IServiceClass): Promise; registerService(instance: IServiceClass): void; diff --git a/packages/core-services/src/types/IBroker.ts b/packages/core-services/src/types/IBroker.ts index cd1e0a3ded19..d75b25de3452 100644 --- a/packages/core-services/src/types/IBroker.ts +++ b/packages/core-services/src/types/IBroker.ts @@ -48,7 +48,7 @@ export interface IServiceMetrics { export interface IBroker { metrics?: IServiceMetrics; - destroyService(service: IServiceClass): void; + destroyService(service: IServiceClass): Promise; createService(service: IServiceClass, serviceDependencies?: string[]): void; call(method: string, data: any): Promise; waitAndCall(method: string, data: any): Promise; From 428b7d7e1605ddeae42c9531b8a83438bf836b20 Mon Sep 17 00:00:00 2001 From: Debdut Chakraborty Date: Fri, 9 Feb 2024 00:33:27 +0530 Subject: [PATCH 11/79] fix: add group and section to homeserver domain setting (#31700) --- .changeset/cyan-countries-impress.md | 5 +++++ .gitignore | 2 ++ .../infrastructure/rocket-chat/adapters/Settings.ts | 2 ++ 3 files changed, 9 insertions(+) create mode 100644 .changeset/cyan-countries-impress.md diff --git a/.changeset/cyan-countries-impress.md b/.changeset/cyan-countries-impress.md new file mode 100644 index 000000000000..6bd78b6f62f8 --- /dev/null +++ b/.changeset/cyan-countries-impress.md @@ -0,0 +1,5 @@ +--- +'@rocket.chat/meteor': patch +--- + +Fixed matrix homeserver domain setting not being visible in admin panel diff --git a/.gitignore b/.gitignore index 13ee265952bb..fcf2b8cd07c7 100644 --- a/.gitignore +++ b/.gitignore @@ -48,3 +48,5 @@ yarn-error.log* .envrc *.sublime-workspace + +**/.vim/ diff --git a/apps/meteor/server/services/federation/infrastructure/rocket-chat/adapters/Settings.ts b/apps/meteor/server/services/federation/infrastructure/rocket-chat/adapters/Settings.ts index 92278549b6fc..952c2a338440 100644 --- a/apps/meteor/server/services/federation/infrastructure/rocket-chat/adapters/Settings.ts +++ b/apps/meteor/server/services/federation/infrastructure/rocket-chat/adapters/Settings.ts @@ -237,6 +237,8 @@ export class RocketChatSettingsAdapter { i18nLabel: 'Federation_Matrix_homeserver_domain', i18nDescription: 'Federation_Matrix_homeserver_domain_desc', alert: 'Federation_Matrix_homeserver_domain_alert', + group: 'Federation', + section: 'Matrix Bridge', }, ); From 28b59b5429c2820270babd4dfa199577d3a98e6c Mon Sep 17 00:00:00 2001 From: Debdut Chakraborty Date: Tue, 19 Mar 2024 19:12:37 +0530 Subject: [PATCH 12/79] chore(federation-v2): do not load registration.yaml file in container (#32012) Co-authored-by: Marcos Defendi --- .changeset/moody-ghosts-add.md | 5 + .../rocketchat-i18n/i18n/en.i18n.json | 2 + .../infrastructure/matrix/Bridge.ts | 4 +- .../rocket-chat/adapters/Settings.ts | 130 ++++++------------ 4 files changed, 49 insertions(+), 92 deletions(-) create mode 100644 .changeset/moody-ghosts-add.md diff --git a/.changeset/moody-ghosts-add.md b/.changeset/moody-ghosts-add.md new file mode 100644 index 000000000000..3b38317dcb97 --- /dev/null +++ b/.changeset/moody-ghosts-add.md @@ -0,0 +1,5 @@ +--- +'@rocket.chat/meteor': patch +--- + +Don't use the registration.yaml file to configure Matrix Federation anymore. diff --git a/apps/meteor/packages/rocketchat-i18n/i18n/en.i18n.json b/apps/meteor/packages/rocketchat-i18n/i18n/en.i18n.json index 71a34af95bed..641fae735dc8 100644 --- a/apps/meteor/packages/rocketchat-i18n/i18n/en.i18n.json +++ b/apps/meteor/packages/rocketchat-i18n/i18n/en.i18n.json @@ -2223,6 +2223,8 @@ "Federation_Description": "Federation allows an unlimited number of workspaces to communicate with each other.", "Federation_Enable": "Enable Federation", "Federation_Example_matrix_server": "Example: matrix.org", + "Federation_Matrix_enable_ephemeral_events": "Enable Matrix ephemeral events", + "Federation_Matrix_enable_ephemeral_events_Alert": "This requires a restart.
Enabling ephemeral events like user typing indicator can affect the performance of your Matrix Homeserver and Rocket.Chat server for federated communication", "Federation_Federated_room_search": "Federated room search", "Federation_Public_key": "Public Key", "Federation_Search_federated_rooms": "Search federated rooms", diff --git a/apps/meteor/server/services/federation/infrastructure/matrix/Bridge.ts b/apps/meteor/server/services/federation/infrastructure/matrix/Bridge.ts index a1015696de98..cffd8ec309a0 100644 --- a/apps/meteor/server/services/federation/infrastructure/matrix/Bridge.ts +++ b/apps/meteor/server/services/federation/infrastructure/matrix/Bridge.ts @@ -714,7 +714,7 @@ export class MatrixBridge implements IFederationBridge { // Dynamic import to prevent Rocket.Chat from loading the module until needed and then handle if that fails const { Bridge, AppServiceRegistration, MatrixUser } = await import('@rocket.chat/forked-matrix-appservice-bridge'); MatrixUserInstance = MatrixUser; - const registrationFile = this.internalSettings.generateRegistrationFileObject(); + const registrationFile = this.internalSettings.getAppServiceRegistrationObject(); this.bridgeInstance = new Bridge({ homeserverUrl: this.internalSettings.getHomeServerUrl(), @@ -730,7 +730,7 @@ export class MatrixBridge implements IFederationBridge { onLog: (line, isError) => { console.log(line, isError); }, - ...(this.internalSettings.generateRegistrationFileObject().enableEphemeralEvents + ...(this.internalSettings.getAppServiceRegistrationObject().enableEphemeralEvents ? { onEphemeralEvent: (request) => { const event = request.getData() as unknown as AbstractMatrixEvent; diff --git a/apps/meteor/server/services/federation/infrastructure/rocket-chat/adapters/Settings.ts b/apps/meteor/server/services/federation/infrastructure/rocket-chat/adapters/Settings.ts index 952c2a338440..e1eff65852f9 100644 --- a/apps/meteor/server/services/federation/infrastructure/rocket-chat/adapters/Settings.ts +++ b/apps/meteor/server/services/federation/infrastructure/rocket-chat/adapters/Settings.ts @@ -1,6 +1,4 @@ import crypto from 'crypto'; -import fs from 'fs'; -import { resolve } from 'path'; import { Settings } from '@rocket.chat/models'; import yaml from 'js-yaml'; @@ -16,7 +14,6 @@ export class RocketChatSettingsAdapter { public async initialize() { await this.addFederationSettings(); this.watchChangesAndUpdateRegistrationFile(); - await this.updateSettingsWithProvidedConfigFileIfNecessary(); } public getApplicationServiceId(): string { @@ -65,12 +62,8 @@ export class RocketChatSettingsAdapter { return settings.get('Federation_Matrix_enabled') === true; } - public areEphemeralEventsEnabled(): boolean { - return this.isTypingStatusEnabled(); - } - public isTypingStatusEnabled(): boolean { - return this.getRegistrationFileFromHomeserver()?.enableEphemeralEvents === true; + return settings.get('Federation_Matrix_enable_ephemeral_events') === true; } public onFederationEnabledStatusChanged( @@ -103,19 +96,19 @@ export class RocketChatSettingsAdapter { this.getHomeServerDomain(), this.getBridgeUrl(), this.getBridgePort(), - this.generateRegistrationFileObject(), + this.getAppServiceRegistrationObject(), ), ); } - public generateRegistrationFileObject(): IFederationBridgeRegistrationFile { + public getAppServiceRegistrationObject(): IFederationBridgeRegistrationFile { return { id: this.getApplicationServiceId(), homeserverToken: this.getApplicationHomeServerToken(), applicationServiceToken: this.getApplicationApplicationServiceToken(), bridgeUrl: this.getBridgeUrl(), botName: this.getBridgeBotUsername(), - enableEphemeralEvents: this.areEphemeralEventsEnabled(), + enableEphemeralEvents: this.isTypingStatusEnabled(), listenTo: { users: [ { @@ -140,7 +133,7 @@ export class RocketChatSettingsAdapter { } private async updateRegistrationFile(): Promise { - const registrationFile = this.generateRegistrationFileObject(); + const registrationFile = this.getAppServiceRegistrationObject(); await Settings.updateValueById( 'Federation_Matrix_registration_file', @@ -172,9 +165,7 @@ export class RocketChatSettingsAdapter { } private async addFederationSettings(): Promise { - const preExistingConfiguration = this.getRegistrationFileFromHomeserver(); - - await settingsRegistry.add('Federation_Matrix_enabled', Boolean(preExistingConfiguration), { + await settingsRegistry.add('Federation_Matrix_enabled', false, { readonly: false, type: 'boolean', i18nLabel: 'Federation_Matrix_enabled', @@ -185,11 +176,24 @@ export class RocketChatSettingsAdapter { section: 'Matrix Bridge', }); + await settingsRegistry.add('Federation_Matrix_enable_ephemeral_events', false, { + readonly: false, + type: 'boolean', + i18nLabel: 'Federation_Matrix_enable_ephemeral_events', + i18nDescription: 'Federation_Matrix_enable_ephemeral_events_desc', + alert: 'Federation_Matrix_enable_ephemeral_events_Alert', + public: true, + group: 'Federation', + section: 'Matrix Bridge', + }); + const uniqueId = settings.get('uniqueID') || uuidv4().slice(0, 15).replace(new RegExp('-', 'g'), '_'); const homeserverToken = crypto.createHash('sha256').update(`hs_${uniqueId}`).digest('hex'); const applicationServiceToken = crypto.createHash('sha256').update(`as_${uniqueId}`).digest('hex'); - await settingsRegistry.add('Federation_Matrix_id', preExistingConfiguration?.id || `rocketchat_${uniqueId}`, { + const siteUrl = settings.get('Site_Url'); + + await settingsRegistry.add('Federation_Matrix_id', `rocketchat_${uniqueId}`, { readonly: true, type: 'string', i18nLabel: 'Federation_Matrix_id', @@ -198,7 +202,7 @@ export class RocketChatSettingsAdapter { section: 'Matrix Bridge', }); - await settingsRegistry.add('Federation_Matrix_hs_token', preExistingConfiguration?.homeserverToken || homeserverToken, { + await settingsRegistry.add('Federation_Matrix_hs_token', homeserverToken, { readonly: true, type: 'string', i18nLabel: 'Federation_Matrix_hs_token', @@ -207,7 +211,7 @@ export class RocketChatSettingsAdapter { section: 'Matrix Bridge', }); - await settingsRegistry.add('Federation_Matrix_as_token', preExistingConfiguration?.applicationServiceToken || applicationServiceToken, { + await settingsRegistry.add('Federation_Matrix_as_token', applicationServiceToken, { readonly: true, type: 'string', i18nLabel: 'Federation_Matrix_as_token', @@ -216,33 +220,25 @@ export class RocketChatSettingsAdapter { section: 'Matrix Bridge', }); - await settingsRegistry.add( - 'Federation_Matrix_homeserver_url', - preExistingConfiguration?.rocketchat?.homeServerUrl || 'http://localhost:8008', - { - type: 'string', - i18nLabel: 'Federation_Matrix_homeserver_url', - i18nDescription: 'Federation_Matrix_homeserver_url_desc', - alert: 'Federation_Matrix_homeserver_url_alert', - group: 'Federation', - section: 'Matrix Bridge', - }, - ); + await settingsRegistry.add('Federation_Matrix_homeserver_url', 'http://localhost:8008', { + type: 'string', + i18nLabel: 'Federation_Matrix_homeserver_url', + i18nDescription: 'Federation_Matrix_homeserver_url_desc', + alert: 'Federation_Matrix_homeserver_url_alert', + group: 'Federation', + section: 'Matrix Bridge', + }); - await settingsRegistry.add( - 'Federation_Matrix_homeserver_domain', - preExistingConfiguration?.rocketchat?.domainName || 'local.rocket.chat', - { - type: 'string', - i18nLabel: 'Federation_Matrix_homeserver_domain', - i18nDescription: 'Federation_Matrix_homeserver_domain_desc', - alert: 'Federation_Matrix_homeserver_domain_alert', - group: 'Federation', - section: 'Matrix Bridge', - }, - ); + await settingsRegistry.add('Federation_Matrix_homeserver_domain', siteUrl, { + type: 'string', + i18nLabel: 'Federation_Matrix_homeserver_domain', + i18nDescription: 'Federation_Matrix_homeserver_domain_desc', + alert: 'Federation_Matrix_homeserver_domain_alert', + group: 'Federation', + section: 'Matrix Bridge', + }); - await settingsRegistry.add('Federation_Matrix_bridge_url', preExistingConfiguration?.bridgeUrl || 'http://host.docker.internal:3300', { + await settingsRegistry.add('Federation_Matrix_bridge_url', 'http://localhost:3300', { type: 'string', i18nLabel: 'Federation_Matrix_bridge_url', i18nDescription: 'Federation_Matrix_bridge_url_desc', @@ -250,7 +246,7 @@ export class RocketChatSettingsAdapter { section: 'Matrix Bridge', }); - await settingsRegistry.add('Federation_Matrix_bridge_localpart', preExistingConfiguration?.botName || 'rocket.cat', { + await settingsRegistry.add('Federation_Matrix_bridge_localpart', 'rocket.cat', { type: 'string', i18nLabel: 'Federation_Matrix_bridge_localpart', i18nDescription: 'Federation_Matrix_bridge_localpart_desc', @@ -260,7 +256,6 @@ export class RocketChatSettingsAdapter { await settingsRegistry.add('Federation_Matrix_registration_file', '', { readonly: true, - hidden: Boolean(preExistingConfiguration), type: 'code', i18nLabel: 'Federation_Matrix_registration_file', i18nDescription: 'Federation_Matrix_registration_file_desc', @@ -282,49 +277,4 @@ export class RocketChatSettingsAdapter { section: 'Matrix Bridge', }); } - - private getRegistrationFileFromHomeserver(): Record | undefined { - try { - const registrationYaml = fs.readFileSync(this.getFilePathForHomeserverConfig(), 'utf8'); - - const parsedFile = yaml.load(registrationYaml as string) as Record; - return { - applicationServiceToken: parsedFile.as_token, - bridgeUrl: parsedFile.url, - botName: parsedFile.sender_localpart, - homeserverToken: parsedFile.hs_token, - id: parsedFile.id, - listenTo: parsedFile.namespaces, - enableEphemeralEvents: parsedFile['de.sorunome.msc2409.push_ephemeral'], - rocketchat: { domainName: parsedFile.rocketchat?.homeserver_domain, homeServerUrl: parsedFile.rocketchat?.homeserver_url }, - }; - } catch (e) { - // no-op - } - } - - private getFilePathForHomeserverConfig(): string { - return process.env.NODE_ENV === 'development' - ? '../../../../../matrix-federation-config/registration.yaml' - : resolve(process.cwd(), '../../../matrix-federation-config/registration.yaml'); - } - - private async updateSettingsWithProvidedConfigFileIfNecessary() { - const existingConfiguration = this.getRegistrationFileFromHomeserver(); - if (!existingConfiguration) { - return; - } - - await Promise.all([ - Settings.updateValueById('Federation_Matrix_enabled', true), - Settings.updateValueById('Federation_Matrix_id', existingConfiguration.id), - Settings.updateValueById('Federation_Matrix_hs_token', existingConfiguration.homeserverToken), - Settings.updateValueById('Federation_Matrix_as_token', existingConfiguration.applicationServiceToken), - Settings.updateValueById('Federation_Matrix_homeserver_url', existingConfiguration.rocketchat?.homeServerUrl), - Settings.updateValueById('Federation_Matrix_homeserver_domain', existingConfiguration.rocketchat?.domainName), - Settings.updateValueById('Federation_Matrix_bridge_url', existingConfiguration.bridgeUrl), - Settings.updateValueById('Federation_Matrix_bridge_localpart', existingConfiguration.botName), - Settings.update({ _id: 'Federation_Matrix_registration_file' }, { $set: { hidden: Boolean(existingConfiguration) } }), - ]); - } } From c53af4ff34df6857c8a65b5fc89996db5b052c4f Mon Sep 17 00:00:00 2001 From: rocketchat-github-ci Date: Tue, 19 Mar 2024 18:24:43 +0000 Subject: [PATCH 13/79] Release 6.6.4 [no ci] --- .changeset/bump-patch-1710772454766.md | 5 --- .changeset/cyan-countries-impress.md | 5 --- .changeset/moody-ghosts-add.md | 5 --- .changeset/slimy-clocks-argue.md | 6 --- apps/meteor/CHANGELOG.md | 38 +++++++++++++++++++ apps/meteor/app/utils/rocketchat.info | 2 +- apps/meteor/ee/server/services/CHANGELOG.md | 13 +++++++ apps/meteor/ee/server/services/package.json | 2 +- apps/meteor/package.json | 2 +- ee/apps/account-service/CHANGELOG.md | 13 +++++++ ee/apps/account-service/package.json | 2 +- ee/apps/authorization-service/CHANGELOG.md | 13 +++++++ ee/apps/authorization-service/package.json | 2 +- ee/apps/ddp-streamer/CHANGELOG.md | 15 ++++++++ ee/apps/ddp-streamer/package.json | 2 +- ee/apps/omnichannel-transcript/CHANGELOG.md | 14 +++++++ ee/apps/omnichannel-transcript/package.json | 2 +- ee/apps/presence-service/CHANGELOG.md | 13 +++++++ ee/apps/presence-service/package.json | 2 +- ee/apps/queue-worker/CHANGELOG.md | 13 +++++++ ee/apps/queue-worker/package.json | 2 +- ee/apps/stream-hub-service/CHANGELOG.md | 12 ++++++ ee/apps/stream-hub-service/package.json | 2 +- ee/packages/api-client/CHANGELOG.md | 10 +++++ ee/packages/api-client/package.json | 2 +- ee/packages/ddp-client/CHANGELOG.md | 10 +++++ ee/packages/ddp-client/package.json | 2 +- ee/packages/license/CHANGELOG.md | 9 +++++ ee/packages/license/package.json | 2 +- ee/packages/omnichannel-services/CHANGELOG.md | 14 +++++++ ee/packages/omnichannel-services/package.json | 2 +- ee/packages/pdf-worker/CHANGELOG.md | 9 +++++ ee/packages/pdf-worker/package.json | 2 +- ee/packages/presence/CHANGELOG.md | 11 ++++++ ee/packages/presence/package.json | 2 +- package.json | 2 +- packages/core-services/CHANGELOG.md | 13 +++++++ packages/core-services/package.json | 2 +- packages/core-typings/CHANGELOG.md | 2 + packages/core-typings/package.json | 2 +- packages/cron/CHANGELOG.md | 10 +++++ packages/cron/package.json | 2 +- packages/fuselage-ui-kit/CHANGELOG.md | 11 ++++++ packages/fuselage-ui-kit/package.json | 6 +-- packages/gazzodown/CHANGELOG.md | 11 ++++++ packages/gazzodown/package.json | 8 ++-- packages/instance-status/CHANGELOG.md | 9 +++++ packages/instance-status/package.json | 2 +- packages/livechat/CHANGELOG.md | 9 +++++ packages/livechat/package.json | 2 +- packages/model-typings/CHANGELOG.md | 9 +++++ packages/model-typings/package.json | 2 +- packages/models/CHANGELOG.md | 9 +++++ packages/models/package.json | 2 +- packages/rest-typings/CHANGELOG.md | 9 +++++ packages/rest-typings/package.json | 2 +- packages/ui-client/CHANGELOG.md | 9 +++++ packages/ui-client/package.json | 4 +- packages/ui-contexts/CHANGELOG.md | 11 ++++++ packages/ui-contexts/package.json | 2 +- packages/ui-video-conf/CHANGELOG.md | 9 +++++ packages/ui-video-conf/package.json | 4 +- packages/uikit-playground/CHANGELOG.md | 10 +++++ packages/uikit-playground/package.json | 2 +- packages/web-ui-registration/CHANGELOG.md | 9 +++++ packages/web-ui-registration/package.json | 4 +- 66 files changed, 387 insertions(+), 61 deletions(-) delete mode 100644 .changeset/bump-patch-1710772454766.md delete mode 100644 .changeset/cyan-countries-impress.md delete mode 100644 .changeset/moody-ghosts-add.md delete mode 100644 .changeset/slimy-clocks-argue.md diff --git a/.changeset/bump-patch-1710772454766.md b/.changeset/bump-patch-1710772454766.md deleted file mode 100644 index e1eaa7980afb..000000000000 --- a/.changeset/bump-patch-1710772454766.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@rocket.chat/meteor': patch ---- - -Bump @rocket.chat/meteor version. diff --git a/.changeset/cyan-countries-impress.md b/.changeset/cyan-countries-impress.md deleted file mode 100644 index 6bd78b6f62f8..000000000000 --- a/.changeset/cyan-countries-impress.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@rocket.chat/meteor': patch ---- - -Fixed matrix homeserver domain setting not being visible in admin panel diff --git a/.changeset/moody-ghosts-add.md b/.changeset/moody-ghosts-add.md deleted file mode 100644 index 3b38317dcb97..000000000000 --- a/.changeset/moody-ghosts-add.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@rocket.chat/meteor': patch ---- - -Don't use the registration.yaml file to configure Matrix Federation anymore. diff --git a/.changeset/slimy-clocks-argue.md b/.changeset/slimy-clocks-argue.md deleted file mode 100644 index 35d4e9e3e433..000000000000 --- a/.changeset/slimy-clocks-argue.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -"@rocket.chat/meteor": patch -"@rocket.chat/core-services": patch ---- - -`stopped` lifecycle method was unexpectedly synchronous when using microservices, causing our code to create race conditions. diff --git a/apps/meteor/CHANGELOG.md b/apps/meteor/CHANGELOG.md index dc3f89042d72..51271a641dad 100644 --- a/apps/meteor/CHANGELOG.md +++ b/apps/meteor/CHANGELOG.md @@ -1,5 +1,43 @@ # @rocket.chat/meteor +## 6.6.4 + +### Patch Changes + +- Bump @rocket.chat/meteor version. + +- Bump @rocket.chat/meteor version. + +- ([#31700](https://github.com/RocketChat/Rocket.Chat/pull/31700)) Fixed matrix homeserver domain setting not being visible in admin panel + +- ([#32012](https://github.com/RocketChat/Rocket.Chat/pull/32012)) Don't use the registration.yaml file to configure Matrix Federation anymore. + +- ([#31927](https://github.com/RocketChat/Rocket.Chat/pull/31927)) `stopped` lifecycle method was unexpectedly synchronous when using microservices, causing our code to create race conditions. + +-
Updated dependencies [c2872a93f2]: + + - @rocket.chat/core-services@0.3.8 + - @rocket.chat/omnichannel-services@0.1.8 + - @rocket.chat/presence@0.1.8 + - @rocket.chat/core-typings@6.6.4 + - @rocket.chat/rest-typings@6.6.4 + - @rocket.chat/api-client@0.1.26 + - @rocket.chat/license@0.1.8 + - @rocket.chat/pdf-worker@0.0.32 + - @rocket.chat/cron@0.0.28 + - @rocket.chat/gazzodown@4.0.4 + - @rocket.chat/model-typings@0.3.4 + - @rocket.chat/ui-contexts@4.0.4 + - @rocket.chat/server-cloud-communication@0.0.2 + - @rocket.chat/fuselage-ui-kit@4.0.4 + - @rocket.chat/models@0.0.32 + - @rocket.chat/ui-theming@0.1.2 + - @rocket.chat/ui-client@4.0.4 + - @rocket.chat/ui-video-conf@4.0.4 + - @rocket.chat/web-ui-registration@4.0.4 + - @rocket.chat/instance-status@0.0.32 +
+ ## 6.6.3 ### Patch Changes diff --git a/apps/meteor/app/utils/rocketchat.info b/apps/meteor/app/utils/rocketchat.info index a2f39989dc57..803a115e25a3 100644 --- a/apps/meteor/app/utils/rocketchat.info +++ b/apps/meteor/app/utils/rocketchat.info @@ -1,3 +1,3 @@ { - "version": "6.6.3" + "version": "6.6.4" } diff --git a/apps/meteor/ee/server/services/CHANGELOG.md b/apps/meteor/ee/server/services/CHANGELOG.md index 58e1e9c1f370..6aebf0f3f502 100644 --- a/apps/meteor/ee/server/services/CHANGELOG.md +++ b/apps/meteor/ee/server/services/CHANGELOG.md @@ -1,5 +1,18 @@ # rocketchat-services +## 1.1.26 + +### Patch Changes + +-
Updated dependencies [c2872a93f2]: + + - @rocket.chat/core-services@0.3.8 + - @rocket.chat/core-typings@6.6.4 + - @rocket.chat/rest-typings@6.6.4 + - @rocket.chat/model-typings@0.3.4 + - @rocket.chat/models@0.0.32 +
+ ## 1.1.25 ### Patch Changes diff --git a/apps/meteor/ee/server/services/package.json b/apps/meteor/ee/server/services/package.json index 595ab7d735e5..1ebe3d648c6f 100644 --- a/apps/meteor/ee/server/services/package.json +++ b/apps/meteor/ee/server/services/package.json @@ -1,7 +1,7 @@ { "name": "rocketchat-services", "private": true, - "version": "1.1.25", + "version": "1.1.26", "description": "Rocket.Chat Authorization service", "main": "index.js", "scripts": { diff --git a/apps/meteor/package.json b/apps/meteor/package.json index 3e0791093dad..1384ad35044a 100644 --- a/apps/meteor/package.json +++ b/apps/meteor/package.json @@ -1,7 +1,7 @@ { "name": "@rocket.chat/meteor", "description": "The Ultimate Open Source WebChat Platform", - "version": "6.6.3", + "version": "6.6.4", "private": true, "author": { "name": "Rocket.Chat", diff --git a/ee/apps/account-service/CHANGELOG.md b/ee/apps/account-service/CHANGELOG.md index b08ebfa93e40..da77898d4d62 100644 --- a/ee/apps/account-service/CHANGELOG.md +++ b/ee/apps/account-service/CHANGELOG.md @@ -1,5 +1,18 @@ # @rocket.chat/account-service +## 0.3.8 + +### Patch Changes + +-
Updated dependencies [c2872a93f2]: + + - @rocket.chat/core-services@0.3.8 + - @rocket.chat/core-typings@6.6.4 + - @rocket.chat/rest-typings@6.6.4 + - @rocket.chat/model-typings@0.3.4 + - @rocket.chat/models@0.0.32 +
+ ## 0.3.7 ### Patch Changes diff --git a/ee/apps/account-service/package.json b/ee/apps/account-service/package.json index bdf3c8dee1cc..af7a4f455fe2 100644 --- a/ee/apps/account-service/package.json +++ b/ee/apps/account-service/package.json @@ -1,7 +1,7 @@ { "name": "@rocket.chat/account-service", "private": true, - "version": "0.3.7", + "version": "0.3.8", "description": "Rocket.Chat Account service", "scripts": { "build": "tsc -p tsconfig.json", diff --git a/ee/apps/authorization-service/CHANGELOG.md b/ee/apps/authorization-service/CHANGELOG.md index 31e6163f65c7..4517934fb510 100644 --- a/ee/apps/authorization-service/CHANGELOG.md +++ b/ee/apps/authorization-service/CHANGELOG.md @@ -1,5 +1,18 @@ # @rocket.chat/authorization-service +## 0.3.8 + +### Patch Changes + +-
Updated dependencies [c2872a93f2]: + + - @rocket.chat/core-services@0.3.8 + - @rocket.chat/core-typings@6.6.4 + - @rocket.chat/rest-typings@6.6.4 + - @rocket.chat/model-typings@0.3.4 + - @rocket.chat/models@0.0.32 +
+ ## 0.3.7 ### Patch Changes diff --git a/ee/apps/authorization-service/package.json b/ee/apps/authorization-service/package.json index c89ae3f880d4..8ceff7050118 100644 --- a/ee/apps/authorization-service/package.json +++ b/ee/apps/authorization-service/package.json @@ -1,7 +1,7 @@ { "name": "@rocket.chat/authorization-service", "private": true, - "version": "0.3.7", + "version": "0.3.8", "description": "Rocket.Chat Authorization service", "scripts": { "build": "tsc -p tsconfig.json", diff --git a/ee/apps/ddp-streamer/CHANGELOG.md b/ee/apps/ddp-streamer/CHANGELOG.md index 6cfa8a66158a..519d7e7bba0f 100644 --- a/ee/apps/ddp-streamer/CHANGELOG.md +++ b/ee/apps/ddp-streamer/CHANGELOG.md @@ -1,5 +1,20 @@ # @rocket.chat/ddp-streamer +## 0.2.7 + +### Patch Changes + +-
Updated dependencies [c2872a93f2]: + + - @rocket.chat/core-services@0.3.8 + - @rocket.chat/core-typings@6.6.4 + - @rocket.chat/rest-typings@6.6.4 + - @rocket.chat/model-typings@0.3.4 + - @rocket.chat/ui-contexts@4.0.4 + - @rocket.chat/models@0.0.32 + - @rocket.chat/instance-status@0.0.32 +
+ ## 0.2.6 ### Patch Changes diff --git a/ee/apps/ddp-streamer/package.json b/ee/apps/ddp-streamer/package.json index 10b6f7111722..2c5977778eb4 100644 --- a/ee/apps/ddp-streamer/package.json +++ b/ee/apps/ddp-streamer/package.json @@ -1,7 +1,7 @@ { "name": "@rocket.chat/ddp-streamer", "private": true, - "version": "0.2.6", + "version": "0.2.7", "description": "Rocket.Chat DDP-Streamer service", "scripts": { "build": "tsc -p tsconfig.json", diff --git a/ee/apps/omnichannel-transcript/CHANGELOG.md b/ee/apps/omnichannel-transcript/CHANGELOG.md index 3548c2c791df..20c321a0477e 100644 --- a/ee/apps/omnichannel-transcript/CHANGELOG.md +++ b/ee/apps/omnichannel-transcript/CHANGELOG.md @@ -1,5 +1,19 @@ # @rocket.chat/omnichannel-transcript +## 0.3.8 + +### Patch Changes + +-
Updated dependencies [c2872a93f2]: + + - @rocket.chat/core-services@0.3.8 + - @rocket.chat/omnichannel-services@0.1.8 + - @rocket.chat/core-typings@6.6.4 + - @rocket.chat/pdf-worker@0.0.32 + - @rocket.chat/model-typings@0.3.4 + - @rocket.chat/models@0.0.32 +
+ ## 0.3.7 ### Patch Changes diff --git a/ee/apps/omnichannel-transcript/package.json b/ee/apps/omnichannel-transcript/package.json index cb3cc3d2d945..12e00c707292 100644 --- a/ee/apps/omnichannel-transcript/package.json +++ b/ee/apps/omnichannel-transcript/package.json @@ -1,7 +1,7 @@ { "name": "@rocket.chat/omnichannel-transcript", "private": true, - "version": "0.3.7", + "version": "0.3.8", "description": "Rocket.Chat service", "scripts": { "build": "tsc -p tsconfig.json", diff --git a/ee/apps/presence-service/CHANGELOG.md b/ee/apps/presence-service/CHANGELOG.md index e21cb3eda786..975c7c9f3c93 100644 --- a/ee/apps/presence-service/CHANGELOG.md +++ b/ee/apps/presence-service/CHANGELOG.md @@ -1,5 +1,18 @@ # @rocket.chat/presence-service +## 0.3.8 + +### Patch Changes + +-
Updated dependencies [c2872a93f2]: + + - @rocket.chat/core-services@0.3.8 + - @rocket.chat/presence@0.1.8 + - @rocket.chat/core-typings@6.6.4 + - @rocket.chat/model-typings@0.3.4 + - @rocket.chat/models@0.0.32 +
+ ## 0.3.7 ### Patch Changes diff --git a/ee/apps/presence-service/package.json b/ee/apps/presence-service/package.json index e909f9924313..37d49b373b7f 100644 --- a/ee/apps/presence-service/package.json +++ b/ee/apps/presence-service/package.json @@ -1,7 +1,7 @@ { "name": "@rocket.chat/presence-service", "private": true, - "version": "0.3.7", + "version": "0.3.8", "description": "Rocket.Chat Presence service", "scripts": { "build": "tsc -p tsconfig.json", diff --git a/ee/apps/queue-worker/CHANGELOG.md b/ee/apps/queue-worker/CHANGELOG.md index a24149abb17e..889b7650dc2e 100644 --- a/ee/apps/queue-worker/CHANGELOG.md +++ b/ee/apps/queue-worker/CHANGELOG.md @@ -1,5 +1,18 @@ # @rocket.chat/queue-worker +## 0.3.8 + +### Patch Changes + +-
Updated dependencies [c2872a93f2]: + + - @rocket.chat/core-services@0.3.8 + - @rocket.chat/omnichannel-services@0.1.8 + - @rocket.chat/core-typings@6.6.4 + - @rocket.chat/model-typings@0.3.4 + - @rocket.chat/models@0.0.32 +
+ ## 0.3.7 ### Patch Changes diff --git a/ee/apps/queue-worker/package.json b/ee/apps/queue-worker/package.json index 2c841eebefdb..0dc49aef5462 100644 --- a/ee/apps/queue-worker/package.json +++ b/ee/apps/queue-worker/package.json @@ -1,7 +1,7 @@ { "name": "@rocket.chat/queue-worker", "private": true, - "version": "0.3.7", + "version": "0.3.8", "description": "Rocket.Chat service", "scripts": { "build": "tsc -p tsconfig.json", diff --git a/ee/apps/stream-hub-service/CHANGELOG.md b/ee/apps/stream-hub-service/CHANGELOG.md index ed62da3085e4..5dfe1c67445d 100644 --- a/ee/apps/stream-hub-service/CHANGELOG.md +++ b/ee/apps/stream-hub-service/CHANGELOG.md @@ -1,5 +1,17 @@ # @rocket.chat/stream-hub-service +## 0.3.8 + +### Patch Changes + +-
Updated dependencies [c2872a93f2]: + + - @rocket.chat/core-services@0.3.8 + - @rocket.chat/core-typings@6.6.4 + - @rocket.chat/model-typings@0.3.4 + - @rocket.chat/models@0.0.32 +
+ ## 0.3.7 ### Patch Changes diff --git a/ee/apps/stream-hub-service/package.json b/ee/apps/stream-hub-service/package.json index ddb211a78e31..dd6f84172dad 100644 --- a/ee/apps/stream-hub-service/package.json +++ b/ee/apps/stream-hub-service/package.json @@ -1,7 +1,7 @@ { "name": "@rocket.chat/stream-hub-service", "private": true, - "version": "0.3.7", + "version": "0.3.8", "description": "Rocket.Chat Stream Hub service", "scripts": { "build": "tsc -p tsconfig.json", diff --git a/ee/packages/api-client/CHANGELOG.md b/ee/packages/api-client/CHANGELOG.md index b1a5b87f50a2..bc0db671297a 100644 --- a/ee/packages/api-client/CHANGELOG.md +++ b/ee/packages/api-client/CHANGELOG.md @@ -1,5 +1,15 @@ # @rocket.chat/api-client +## 0.1.26 + +### Patch Changes + +-
Updated dependencies []: + + - @rocket.chat/core-typings@6.6.4 + - @rocket.chat/rest-typings@6.6.4 +
+ ## 0.1.25 ### Patch Changes diff --git a/ee/packages/api-client/package.json b/ee/packages/api-client/package.json index d201b21ca85b..13d31b0466f3 100644 --- a/ee/packages/api-client/package.json +++ b/ee/packages/api-client/package.json @@ -1,7 +1,7 @@ { "name": "@rocket.chat/api-client", "private": true, - "version": "0.1.25", + "version": "0.1.26", "devDependencies": { "@swc/core": "^1.3.95", "@swc/jest": "^0.2.29", diff --git a/ee/packages/ddp-client/CHANGELOG.md b/ee/packages/ddp-client/CHANGELOG.md index 966ab60f0fae..85c7de8449f6 100644 --- a/ee/packages/ddp-client/CHANGELOG.md +++ b/ee/packages/ddp-client/CHANGELOG.md @@ -1,5 +1,15 @@ # @rocket.chat/ddp-client +## 0.2.17 + +### Patch Changes + +-
Updated dependencies []: + + - @rocket.chat/rest-typings@6.6.4 + - @rocket.chat/api-client@0.1.26 +
+ ## 0.2.16 ### Patch Changes diff --git a/ee/packages/ddp-client/package.json b/ee/packages/ddp-client/package.json index 5e0e62a534ae..f49ff62e1f9d 100644 --- a/ee/packages/ddp-client/package.json +++ b/ee/packages/ddp-client/package.json @@ -1,7 +1,7 @@ { "name": "@rocket.chat/ddp-client", "private": true, - "version": "0.2.16", + "version": "0.2.17", "devDependencies": { "@swc/core": "^1.3.95", "@swc/jest": "^0.2.29", diff --git a/ee/packages/license/CHANGELOG.md b/ee/packages/license/CHANGELOG.md index 7f275d75262a..7bdce01990de 100644 --- a/ee/packages/license/CHANGELOG.md +++ b/ee/packages/license/CHANGELOG.md @@ -1,5 +1,14 @@ # @rocket.chat/license +## 0.1.8 + +### Patch Changes + +-
Updated dependencies []: + + - @rocket.chat/core-typings@6.6.4 +
+ ## 0.1.7 ### Patch Changes diff --git a/ee/packages/license/package.json b/ee/packages/license/package.json index df8f41fa2375..88fc2b2d4d20 100644 --- a/ee/packages/license/package.json +++ b/ee/packages/license/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/license", - "version": "0.1.7", + "version": "0.1.8", "private": true, "devDependencies": { "@swc/core": "^1.3.95", diff --git a/ee/packages/omnichannel-services/CHANGELOG.md b/ee/packages/omnichannel-services/CHANGELOG.md index e38a46de97bb..246f91f1b04e 100644 --- a/ee/packages/omnichannel-services/CHANGELOG.md +++ b/ee/packages/omnichannel-services/CHANGELOG.md @@ -1,5 +1,19 @@ # @rocket.chat/omnichannel-services +## 0.1.8 + +### Patch Changes + +-
Updated dependencies [c2872a93f2]: + + - @rocket.chat/core-services@0.3.8 + - @rocket.chat/core-typings@6.6.4 + - @rocket.chat/rest-typings@6.6.4 + - @rocket.chat/pdf-worker@0.0.32 + - @rocket.chat/model-typings@0.3.4 + - @rocket.chat/models@0.0.32 +
+ ## 0.1.7 ### Patch Changes diff --git a/ee/packages/omnichannel-services/package.json b/ee/packages/omnichannel-services/package.json index 8e6c8dcc0161..01f137c14d17 100644 --- a/ee/packages/omnichannel-services/package.json +++ b/ee/packages/omnichannel-services/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/omnichannel-services", - "version": "0.1.7", + "version": "0.1.8", "private": true, "devDependencies": { "@rocket.chat/eslint-config": "workspace:^", diff --git a/ee/packages/pdf-worker/CHANGELOG.md b/ee/packages/pdf-worker/CHANGELOG.md index d3ed325b0009..83e90f1b8b15 100644 --- a/ee/packages/pdf-worker/CHANGELOG.md +++ b/ee/packages/pdf-worker/CHANGELOG.md @@ -1,5 +1,14 @@ # @rocket.chat/pdf-worker +## 0.0.32 + +### Patch Changes + +-
Updated dependencies []: + + - @rocket.chat/core-typings@6.6.4 +
+ ## 0.0.31 ### Patch Changes diff --git a/ee/packages/pdf-worker/package.json b/ee/packages/pdf-worker/package.json index 390a7a7c309d..a71c914c6cbb 100644 --- a/ee/packages/pdf-worker/package.json +++ b/ee/packages/pdf-worker/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/pdf-worker", - "version": "0.0.31", + "version": "0.0.32", "private": true, "devDependencies": { "@storybook/addon-essentials": "~6.5.16", diff --git a/ee/packages/presence/CHANGELOG.md b/ee/packages/presence/CHANGELOG.md index 10cb1b136ce0..accd0042983e 100644 --- a/ee/packages/presence/CHANGELOG.md +++ b/ee/packages/presence/CHANGELOG.md @@ -1,5 +1,16 @@ # @rocket.chat/presence +## 0.1.8 + +### Patch Changes + +-
Updated dependencies [c2872a93f2]: + + - @rocket.chat/core-services@0.3.8 + - @rocket.chat/core-typings@6.6.4 + - @rocket.chat/models@0.0.32 +
+ ## 0.1.7 ### Patch Changes diff --git a/ee/packages/presence/package.json b/ee/packages/presence/package.json index 545134e29c3f..bc465b59ed7c 100644 --- a/ee/packages/presence/package.json +++ b/ee/packages/presence/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/presence", - "version": "0.1.7", + "version": "0.1.8", "private": true, "devDependencies": { "@babel/core": "~7.22.20", diff --git a/package.json b/package.json index 95df38998d7a..261c440f288c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "rocket.chat", - "version": "6.6.3", + "version": "6.6.4", "description": "Rocket.Chat Monorepo", "main": "index.js", "private": true, diff --git a/packages/core-services/CHANGELOG.md b/packages/core-services/CHANGELOG.md index c117daeb3bf4..f7d8e1a3f921 100644 --- a/packages/core-services/CHANGELOG.md +++ b/packages/core-services/CHANGELOG.md @@ -1,5 +1,18 @@ # @rocket.chat/core-services +## 0.3.8 + +### Patch Changes + +- ([#31927](https://github.com/RocketChat/Rocket.Chat/pull/31927)) `stopped` lifecycle method was unexpectedly synchronous when using microservices, causing our code to create race conditions. + +-
Updated dependencies []: + + - @rocket.chat/core-typings@6.6.4 + - @rocket.chat/rest-typings@6.6.4 + - @rocket.chat/models@0.0.32 +
+ ## 0.3.7 ### Patch Changes diff --git a/packages/core-services/package.json b/packages/core-services/package.json index 1326401fa8de..3cfc79f233d5 100644 --- a/packages/core-services/package.json +++ b/packages/core-services/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/core-services", - "version": "0.3.7", + "version": "0.3.8", "private": true, "devDependencies": { "@babel/core": "~7.22.20", diff --git a/packages/core-typings/CHANGELOG.md b/packages/core-typings/CHANGELOG.md index e1a9603d35f3..51c896d9d43b 100644 --- a/packages/core-typings/CHANGELOG.md +++ b/packages/core-typings/CHANGELOG.md @@ -1,5 +1,7 @@ # @rocket.chat/core-typings +## 6.6.4 + ## 6.6.3 ## 6.6.2 diff --git a/packages/core-typings/package.json b/packages/core-typings/package.json index e6164236ae97..8b0dff531cfd 100644 --- a/packages/core-typings/package.json +++ b/packages/core-typings/package.json @@ -2,7 +2,7 @@ "$schema": "https://json.schemastore.org/package", "name": "@rocket.chat/core-typings", "private": true, - "version": "6.6.3", + "version": "6.6.4", "devDependencies": { "@rocket.chat/eslint-config": "workspace:^", "eslint": "~8.45.0", diff --git a/packages/cron/CHANGELOG.md b/packages/cron/CHANGELOG.md index a71d40b1af86..4b3b0cc7c031 100644 --- a/packages/cron/CHANGELOG.md +++ b/packages/cron/CHANGELOG.md @@ -1,5 +1,15 @@ # @rocket.chat/cron +## 0.0.28 + +### Patch Changes + +-
Updated dependencies []: + + - @rocket.chat/core-typings@6.6.4 + - @rocket.chat/models@0.0.32 +
+ ## 0.0.27 ### Patch Changes diff --git a/packages/cron/package.json b/packages/cron/package.json index f90b9176f6a8..48e00eb42011 100644 --- a/packages/cron/package.json +++ b/packages/cron/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/cron", - "version": "0.0.27", + "version": "0.0.28", "private": true, "devDependencies": { "@types/jest": "~29.5.7", diff --git a/packages/fuselage-ui-kit/CHANGELOG.md b/packages/fuselage-ui-kit/CHANGELOG.md index 41b6eebaef5d..efa96f33eab2 100644 --- a/packages/fuselage-ui-kit/CHANGELOG.md +++ b/packages/fuselage-ui-kit/CHANGELOG.md @@ -1,5 +1,16 @@ # Change Log +## 4.0.4 + +### Patch Changes + +-
Updated dependencies []: + + - @rocket.chat/gazzodown@4.0.4 + - @rocket.chat/ui-contexts@4.0.4 + - @rocket.chat/ui-video-conf@4.0.4 +
+ ## 4.0.3 ### Patch Changes diff --git a/packages/fuselage-ui-kit/package.json b/packages/fuselage-ui-kit/package.json index e9258e7afcaa..37d3be23aff3 100644 --- a/packages/fuselage-ui-kit/package.json +++ b/packages/fuselage-ui-kit/package.json @@ -1,7 +1,7 @@ { "name": "@rocket.chat/fuselage-ui-kit", "private": true, - "version": "4.0.3", + "version": "4.0.4", "description": "UiKit elements for Rocket.Chat Apps built under Fuselage design system", "homepage": "https://rocketchat.github.io/Rocket.Chat.Fuselage/", "author": { @@ -48,9 +48,9 @@ "@rocket.chat/icons": "*", "@rocket.chat/prettier-config": "*", "@rocket.chat/styled": "*", - "@rocket.chat/ui-contexts": "4.0.3", + "@rocket.chat/ui-contexts": "4.0.4", "@rocket.chat/ui-kit": "0.33.0", - "@rocket.chat/ui-video-conf": "4.0.3", + "@rocket.chat/ui-video-conf": "4.0.4", "@tanstack/react-query": "*", "react": "*", "react-dom": "*" diff --git a/packages/gazzodown/CHANGELOG.md b/packages/gazzodown/CHANGELOG.md index 1e691ce9d802..dcfb8ee1c4af 100644 --- a/packages/gazzodown/CHANGELOG.md +++ b/packages/gazzodown/CHANGELOG.md @@ -1,5 +1,16 @@ # @rocket.chat/gazzodown +## 4.0.4 + +### Patch Changes + +-
Updated dependencies []: + + - @rocket.chat/core-typings@6.6.4 + - @rocket.chat/ui-contexts@4.0.4 + - @rocket.chat/ui-client@4.0.4 +
+ ## 4.0.3 ### Patch Changes diff --git a/packages/gazzodown/package.json b/packages/gazzodown/package.json index ea298f3ad8ae..c8d9cbf49336 100644 --- a/packages/gazzodown/package.json +++ b/packages/gazzodown/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/gazzodown", - "version": "4.0.3", + "version": "4.0.4", "private": true, "devDependencies": { "@babel/core": "~7.22.20", @@ -65,14 +65,14 @@ "/dist" ], "peerDependencies": { - "@rocket.chat/core-typings": "6.6.3", + "@rocket.chat/core-typings": "6.6.4", "@rocket.chat/css-in-js": "*", "@rocket.chat/fuselage": "*", "@rocket.chat/fuselage-tokens": "*", "@rocket.chat/message-parser": "*", "@rocket.chat/styled": "*", - "@rocket.chat/ui-client": "4.0.3", - "@rocket.chat/ui-contexts": "4.0.3", + "@rocket.chat/ui-client": "4.0.4", + "@rocket.chat/ui-contexts": "4.0.4", "katex": "*", "react": "*" }, diff --git a/packages/instance-status/CHANGELOG.md b/packages/instance-status/CHANGELOG.md index d59acff3e91d..b7c7dd019f36 100644 --- a/packages/instance-status/CHANGELOG.md +++ b/packages/instance-status/CHANGELOG.md @@ -1,5 +1,14 @@ # @rocket.chat/instance-status +## 0.0.32 + +### Patch Changes + +-
Updated dependencies []: + + - @rocket.chat/models@0.0.32 +
+ ## 0.0.31 ### Patch Changes diff --git a/packages/instance-status/package.json b/packages/instance-status/package.json index 820b08ad4907..6e13dd4a983a 100644 --- a/packages/instance-status/package.json +++ b/packages/instance-status/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/instance-status", - "version": "0.0.31", + "version": "0.0.32", "private": true, "devDependencies": { "@rocket.chat/eslint-config": "workspace:^", diff --git a/packages/livechat/CHANGELOG.md b/packages/livechat/CHANGELOG.md index bb63a6982911..03fe1474bf39 100644 --- a/packages/livechat/CHANGELOG.md +++ b/packages/livechat/CHANGELOG.md @@ -1,5 +1,14 @@ # @rocket.chat/livechat Change Log +## 1.14.17 + +### Patch Changes + +-
Updated dependencies []: + + - @rocket.chat/gazzodown@4.0.4 +
+ ## 1.14.16 ### Patch Changes diff --git a/packages/livechat/package.json b/packages/livechat/package.json index 5171f150cf30..da6b96d974ca 100644 --- a/packages/livechat/package.json +++ b/packages/livechat/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/livechat", - "version": "1.14.16", + "version": "1.14.17", "files": [ "/build" ], diff --git a/packages/model-typings/CHANGELOG.md b/packages/model-typings/CHANGELOG.md index 13b4db03c595..abe46dbcf09a 100644 --- a/packages/model-typings/CHANGELOG.md +++ b/packages/model-typings/CHANGELOG.md @@ -1,5 +1,14 @@ # @rocket.chat/model-typings +## 0.3.4 + +### Patch Changes + +-
Updated dependencies []: + + - @rocket.chat/core-typings@6.6.4 +
+ ## 0.3.3 ### Patch Changes diff --git a/packages/model-typings/package.json b/packages/model-typings/package.json index 81fd1d8ca421..d1ae03563adf 100644 --- a/packages/model-typings/package.json +++ b/packages/model-typings/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/model-typings", - "version": "0.3.3", + "version": "0.3.4", "private": true, "devDependencies": { "@types/jest": "~29.5.7", diff --git a/packages/models/CHANGELOG.md b/packages/models/CHANGELOG.md index c5fd37e5d58d..2a31ed572b93 100644 --- a/packages/models/CHANGELOG.md +++ b/packages/models/CHANGELOG.md @@ -1,5 +1,14 @@ # @rocket.chat/models +## 0.0.32 + +### Patch Changes + +-
Updated dependencies []: + + - @rocket.chat/model-typings@0.3.4 +
+ ## 0.0.31 ### Patch Changes diff --git a/packages/models/package.json b/packages/models/package.json index c80ff5a23c5f..9fcfe8da679d 100644 --- a/packages/models/package.json +++ b/packages/models/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/models", - "version": "0.0.31", + "version": "0.0.32", "private": true, "devDependencies": { "@types/jest": "~29.5.7", diff --git a/packages/rest-typings/CHANGELOG.md b/packages/rest-typings/CHANGELOG.md index 963c3a1ec7b5..7b4bf1abc9fb 100644 --- a/packages/rest-typings/CHANGELOG.md +++ b/packages/rest-typings/CHANGELOG.md @@ -1,5 +1,14 @@ # @rocket.chat/rest-typings +## 6.6.4 + +### Patch Changes + +-
Updated dependencies []: + + - @rocket.chat/core-typings@6.6.4 +
+ ## 6.6.3 ### Patch Changes diff --git a/packages/rest-typings/package.json b/packages/rest-typings/package.json index 0927f35587e1..011223ed27cf 100644 --- a/packages/rest-typings/package.json +++ b/packages/rest-typings/package.json @@ -1,7 +1,7 @@ { "name": "@rocket.chat/rest-typings", "private": true, - "version": "6.6.3", + "version": "6.6.4", "devDependencies": { "@rocket.chat/eslint-config": "workspace:^", "@types/jest": "~29.5.7", diff --git a/packages/ui-client/CHANGELOG.md b/packages/ui-client/CHANGELOG.md index 73109c3a1dd7..7c38755e135c 100644 --- a/packages/ui-client/CHANGELOG.md +++ b/packages/ui-client/CHANGELOG.md @@ -1,5 +1,14 @@ # @rocket.chat/ui-client +## 4.0.4 + +### Patch Changes + +-
Updated dependencies []: + + - @rocket.chat/ui-contexts@4.0.4 +
+ ## 4.0.3 ### Patch Changes diff --git a/packages/ui-client/package.json b/packages/ui-client/package.json index 21aae273ee38..079a8e9678bd 100644 --- a/packages/ui-client/package.json +++ b/packages/ui-client/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/ui-client", - "version": "4.0.3", + "version": "4.0.4", "private": true, "devDependencies": { "@babel/core": "~7.22.20", @@ -63,7 +63,7 @@ "@rocket.chat/fuselage": "*", "@rocket.chat/fuselage-hooks": "*", "@rocket.chat/icons": "*", - "@rocket.chat/ui-contexts": "4.0.3", + "@rocket.chat/ui-contexts": "4.0.4", "react": "~17.0.2" }, "volta": { diff --git a/packages/ui-contexts/CHANGELOG.md b/packages/ui-contexts/CHANGELOG.md index dccc45243daf..5bc3b573c465 100644 --- a/packages/ui-contexts/CHANGELOG.md +++ b/packages/ui-contexts/CHANGELOG.md @@ -1,5 +1,16 @@ # @rocket.chat/ui-contexts +## 4.0.4 + +### Patch Changes + +-
Updated dependencies []: + + - @rocket.chat/core-typings@6.6.4 + - @rocket.chat/rest-typings@6.6.4 + - @rocket.chat/ddp-client@0.2.17 +
+ ## 4.0.3 ### Patch Changes diff --git a/packages/ui-contexts/package.json b/packages/ui-contexts/package.json index dddd830ddb6b..8ea66e29b48e 100644 --- a/packages/ui-contexts/package.json +++ b/packages/ui-contexts/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/ui-contexts", - "version": "4.0.3", + "version": "4.0.4", "private": true, "devDependencies": { "@rocket.chat/core-typings": "workspace:^", diff --git a/packages/ui-video-conf/CHANGELOG.md b/packages/ui-video-conf/CHANGELOG.md index b402fd9e80fa..91fd3e6cdb53 100644 --- a/packages/ui-video-conf/CHANGELOG.md +++ b/packages/ui-video-conf/CHANGELOG.md @@ -1,5 +1,14 @@ # @rocket.chat/ui-video-conf +## 4.0.4 + +### Patch Changes + +-
Updated dependencies []: + + - @rocket.chat/ui-contexts@4.0.4 +
+ ## 4.0.3 ### Patch Changes diff --git a/packages/ui-video-conf/package.json b/packages/ui-video-conf/package.json index 32dcd89d6710..1c7fa6d4cbbb 100644 --- a/packages/ui-video-conf/package.json +++ b/packages/ui-video-conf/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/ui-video-conf", - "version": "4.0.3", + "version": "4.0.4", "private": true, "devDependencies": { "@babel/core": "~7.22.20", @@ -35,7 +35,7 @@ "@rocket.chat/fuselage-hooks": "*", "@rocket.chat/icons": "*", "@rocket.chat/styled": "*", - "@rocket.chat/ui-contexts": "4.0.3", + "@rocket.chat/ui-contexts": "4.0.4", "react": "^17.0.2", "react-dom": "^17.0.2" }, diff --git a/packages/uikit-playground/CHANGELOG.md b/packages/uikit-playground/CHANGELOG.md index 1b0d78e72793..6cf49f0404ed 100644 --- a/packages/uikit-playground/CHANGELOG.md +++ b/packages/uikit-playground/CHANGELOG.md @@ -1,5 +1,15 @@ # @rocket.chat/uikit-playground +## 0.2.17 + +### Patch Changes + +-
Updated dependencies []: + + - @rocket.chat/ui-contexts@4.0.4 + - @rocket.chat/fuselage-ui-kit@4.0.4 +
+ ## 0.2.16 ### Patch Changes diff --git a/packages/uikit-playground/package.json b/packages/uikit-playground/package.json index afc3f5440c03..f4578393e496 100644 --- a/packages/uikit-playground/package.json +++ b/packages/uikit-playground/package.json @@ -1,7 +1,7 @@ { "name": "@rocket.chat/uikit-playground", "private": true, - "version": "0.2.16", + "version": "0.2.17", "type": "module", "scripts": { "dev": "vite", diff --git a/packages/web-ui-registration/CHANGELOG.md b/packages/web-ui-registration/CHANGELOG.md index 16cac3a2a62a..28cc9a5d32bb 100644 --- a/packages/web-ui-registration/CHANGELOG.md +++ b/packages/web-ui-registration/CHANGELOG.md @@ -1,5 +1,14 @@ # @rocket.chat/web-ui-registration +## 4.0.4 + +### Patch Changes + +-
Updated dependencies []: + + - @rocket.chat/ui-contexts@4.0.4 +
+ ## 4.0.3 ### Patch Changes diff --git a/packages/web-ui-registration/package.json b/packages/web-ui-registration/package.json index 748cb2d01195..fa8e6d6ad523 100644 --- a/packages/web-ui-registration/package.json +++ b/packages/web-ui-registration/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/web-ui-registration", - "version": "4.0.3", + "version": "4.0.4", "private": true, "homepage": "https://rocket.chat", "main": "./dist/index.js", @@ -51,7 +51,7 @@ "peerDependencies": { "@rocket.chat/layout": "*", "@rocket.chat/tools": "0.2.1", - "@rocket.chat/ui-contexts": "4.0.3", + "@rocket.chat/ui-contexts": "4.0.4", "@tanstack/react-query": "*", "react": "*", "react-hook-form": "*", From f8244ca98d8382e74dcee4531058155925f93bc1 Mon Sep 17 00:00:00 2001 From: rocketchat-github-ci Date: Wed, 20 Mar 2024 19:47:39 +0000 Subject: [PATCH 14/79] Bump 6.6.5 --- .changeset/bump-patch-1710964059521.md | 5 +++++ yarn.lock | 16 ++++++++-------- 2 files changed, 13 insertions(+), 8 deletions(-) create mode 100644 .changeset/bump-patch-1710964059521.md diff --git a/.changeset/bump-patch-1710964059521.md b/.changeset/bump-patch-1710964059521.md new file mode 100644 index 000000000000..e1eaa7980afb --- /dev/null +++ b/.changeset/bump-patch-1710964059521.md @@ -0,0 +1,5 @@ +--- +'@rocket.chat/meteor': patch +--- + +Bump @rocket.chat/meteor version. diff --git a/yarn.lock b/yarn.lock index 8e65c735f6b7..ad4b44b6d3d5 100644 --- a/yarn.lock +++ b/yarn.lock @@ -9348,9 +9348,9 @@ __metadata: "@rocket.chat/icons": "*" "@rocket.chat/prettier-config": "*" "@rocket.chat/styled": "*" - "@rocket.chat/ui-contexts": 4.0.3 + "@rocket.chat/ui-contexts": 4.0.4 "@rocket.chat/ui-kit": 0.33.0 - "@rocket.chat/ui-video-conf": 4.0.3 + "@rocket.chat/ui-video-conf": 4.0.4 "@tanstack/react-query": "*" react: "*" react-dom: "*" @@ -9432,14 +9432,14 @@ __metadata: ts-jest: ~29.1.1 typescript: ~5.3.2 peerDependencies: - "@rocket.chat/core-typings": 6.6.3 + "@rocket.chat/core-typings": 6.6.4 "@rocket.chat/css-in-js": "*" "@rocket.chat/fuselage": "*" "@rocket.chat/fuselage-tokens": "*" "@rocket.chat/message-parser": "*" "@rocket.chat/styled": "*" - "@rocket.chat/ui-client": 4.0.3 - "@rocket.chat/ui-contexts": 4.0.3 + "@rocket.chat/ui-client": 4.0.4 + "@rocket.chat/ui-contexts": 4.0.4 katex: "*" react: "*" languageName: unknown @@ -10621,7 +10621,7 @@ __metadata: "@rocket.chat/fuselage": "*" "@rocket.chat/fuselage-hooks": "*" "@rocket.chat/icons": "*" - "@rocket.chat/ui-contexts": 4.0.3 + "@rocket.chat/ui-contexts": 4.0.4 react: ~17.0.2 languageName: unknown linkType: soft @@ -10796,7 +10796,7 @@ __metadata: "@rocket.chat/fuselage-hooks": "*" "@rocket.chat/icons": "*" "@rocket.chat/styled": "*" - "@rocket.chat/ui-contexts": 4.0.3 + "@rocket.chat/ui-contexts": 4.0.4 react: ^17.0.2 react-dom: ^17.0.2 languageName: unknown @@ -10885,7 +10885,7 @@ __metadata: peerDependencies: "@rocket.chat/layout": "*" "@rocket.chat/tools": 0.2.1 - "@rocket.chat/ui-contexts": 4.0.3 + "@rocket.chat/ui-contexts": 4.0.4 "@tanstack/react-query": "*" react: "*" react-hook-form: "*" From f39f61b2dbe6bc6569473411a36583284f79477b Mon Sep 17 00:00:00 2001 From: Kevin Aleman Date: Thu, 21 Mar 2024 07:15:40 -0600 Subject: [PATCH 15/79] fix: Allow queue to fix inquiry status when processing items (#31998) Co-authored-by: Marcos Spessatto Defendi --- .changeset/tough-doors-juggle.md | 9 + .../server/services/omnichannel/queue.ts | 74 ++- .../services/omnichannel/queue.tests.ts | 475 ++++++++++++++++++ 3 files changed, 546 insertions(+), 12 deletions(-) create mode 100644 .changeset/tough-doors-juggle.md create mode 100644 apps/meteor/tests/unit/server/services/omnichannel/queue.tests.ts diff --git a/.changeset/tough-doors-juggle.md b/.changeset/tough-doors-juggle.md new file mode 100644 index 000000000000..9da2ab1c6075 --- /dev/null +++ b/.changeset/tough-doors-juggle.md @@ -0,0 +1,9 @@ +--- +"@rocket.chat/meteor": patch +--- + +Introduced a new step to the queue worker: when an inquiry that's on an improper status is selected for processing, queue worker will first check its status and will attempt to fix it. +For example, if an inquiry points to a closed room, there's no point in processing, system will now remove the inquiry +If an inquiry is already taken, the inquiry will be updated to reflect the new status and clean the queue. + +This prevents issues where the queue worker attempted to process an inquiry _forever_ because it was in an improper state. diff --git a/apps/meteor/server/services/omnichannel/queue.ts b/apps/meteor/server/services/omnichannel/queue.ts index 8a902b75da3c..642575c06db5 100644 --- a/apps/meteor/server/services/omnichannel/queue.ts +++ b/apps/meteor/server/services/omnichannel/queue.ts @@ -1,4 +1,5 @@ -import type { InquiryWithAgentInfo, IOmnichannelQueue } from '@rocket.chat/core-typings'; +import type { IOmnichannelRoom } from '@rocket.chat/core-typings'; +import { type InquiryWithAgentInfo, type IOmnichannelQueue } from '@rocket.chat/core-typings'; import { License } from '@rocket.chat/license'; import { LivechatInquiry, LivechatRooms } from '@rocket.chat/models'; @@ -98,9 +99,11 @@ export class OmnichannelQueue implements IOmnichannelQueue { // Note: this removes the "one-shot" behavior of queue, allowing it to take a conversation again in the future // And sorting them by _updatedAt: -1 will make it so that the oldest inquiries are taken first // preventing us from playing with the same inquiry over and over again + queueLogger.debug(`Inquiry ${nextInquiry._id} not taken. Unlocking and re-queueing`); return await LivechatInquiry.unlockAndQueue(nextInquiry._id); } + queueLogger.debug(`Inquiry ${nextInquiry._id} taken successfully. Unlocking`); await LivechatInquiry.unlock(nextInquiry._id); queueLogger.debug({ msg: 'Inquiry processed', @@ -135,26 +138,74 @@ export class OmnichannelQueue implements IOmnichannelQueue { void (routingSupportsAutoAssign ? this.start() : this.stop()); } + private async reconciliation(reason: 'closed' | 'taken' | 'missing', { roomId, inquiryId }: { roomId: string; inquiryId: string }) { + switch (reason) { + case 'closed': { + queueLogger.debug({ + msg: 'Room closed. Removing inquiry', + roomId, + inquiryId, + step: 'reconciliation', + }); + await LivechatInquiry.removeByRoomId(roomId); + break; + } + case 'taken': { + queueLogger.debug({ + msg: 'Room taken. Updating inquiry status', + roomId, + inquiryId, + step: 'reconciliation', + }); + // Reconciliate served inquiries, by updating their status to taken after queue tried to pick and failed + await LivechatInquiry.takeInquiry(inquiryId); + break; + } + case 'missing': { + queueLogger.debug({ + msg: 'Room from inquiry missing. Removing inquiry', + roomId, + inquiryId, + step: 'reconciliation', + }); + await LivechatInquiry.removeByRoomId(roomId); + break; + } + default: { + return true; + } + } + + return true; + } + private async processWaitingQueue(department: string | undefined, inquiry: InquiryWithAgentInfo) { const queue = department || 'Public'; - queueLogger.debug(`Processing items on queue ${queue}`); queueLogger.debug(`Processing inquiry ${inquiry._id} from queue ${queue}`); const { defaultAgent } = inquiry; - const roomFromDb = await LivechatRooms.findOneById(inquiry.rid, { projection: { servedBy: 1 } }); + const roomFromDb = await LivechatRooms.findOneById>(inquiry.rid, { + projection: { servedBy: 1, closedAt: 1 }, + }); + + // This is a precaution to avoid taking inquiries tied to rooms that no longer exist. + // This should never happen. + if (!roomFromDb) { + return this.reconciliation('missing', { roomId: inquiry.rid, inquiryId: inquiry._id }); + } // This is a precaution to avoid taking the same inquiry multiple times. It should not happen, but it's a safety net - if (roomFromDb?.servedBy) { - queueLogger.debug(`Inquiry ${inquiry._id} already taken by agent ${roomFromDb.servedBy._id}. Skipping`); - return true; + if (roomFromDb.servedBy) { + return this.reconciliation('taken', { roomId: inquiry.rid, inquiryId: inquiry._id }); } - const room = await RoutingManager.delegateInquiry(inquiry, defaultAgent); + // This is another precaution. If the room is closed, we should not take it + if (roomFromDb.closedAt) { + return this.reconciliation('closed', { roomId: inquiry.rid, inquiryId: inquiry._id }); + } - const propagateAgentDelegated = async (rid: string, agentId: string) => { - await dispatchAgentDelegated(rid, agentId); - }; + const room = await RoutingManager.delegateInquiry(inquiry, defaultAgent); if (room?.servedBy) { const { @@ -163,13 +214,12 @@ export class OmnichannelQueue implements IOmnichannelQueue { } = room; queueLogger.debug(`Inquiry ${inquiry._id} taken successfully by agent ${agentId}. Notifying`); setTimeout(() => { - void propagateAgentDelegated(rid, agentId); + void dispatchAgentDelegated(rid, agentId); }, 1000); return true; } - queueLogger.debug(`Inquiry ${inquiry._id} not taken by any agent. Queueing again`); return false; } } diff --git a/apps/meteor/tests/unit/server/services/omnichannel/queue.tests.ts b/apps/meteor/tests/unit/server/services/omnichannel/queue.tests.ts new file mode 100644 index 000000000000..ce24b0ded64a --- /dev/null +++ b/apps/meteor/tests/unit/server/services/omnichannel/queue.tests.ts @@ -0,0 +1,475 @@ +import { expect } from 'chai'; +import { beforeEach, describe, after, it } from 'mocha'; +import p from 'proxyquire'; +import Sinon from 'sinon'; + +const dispatchAgentDelegated = Sinon.stub(); +const getConfig = Sinon.stub(); +const delegateInquiry = Sinon.stub(); +const libSettings = { getInquirySortMechanismSetting: Sinon.stub().returns('timestamp') }; +const settings = { + get: Sinon.stub(), +}; + +const queueLogger = { + info: Sinon.stub(), + debug: Sinon.stub(), + error: Sinon.stub(), +}; + +const mockedInquiry = { + _id: 'inquiryId', + rid: 'rid', + department: 'department1', + ts: new Date(), +}; + +const models = { + LivechatInquiry: { + unlockAll: Sinon.stub(), + findNextAndLock: Sinon.stub(), + getDistinctQueuedDepartments: Sinon.stub(), + unlockAndQueue: Sinon.stub(), + unlock: Sinon.stub(), + removeByRoomId: Sinon.stub(), + takeInquiry: Sinon.stub(), + }, + LivechatRooms: { + findOneById: Sinon.stub(), + }, +}; + +const license = { + shouldPreventAction: Sinon.stub(), +}; + +const { OmnichannelQueue } = p.noCallThru().load('../../../../../server/services/omnichannel/queue', { + '../../../app/livechat/server/lib/Helper': { + dispatchAgentDelegated, + }, + '../../../app/livechat/server/lib/RoutingManager': { + RoutingManager: { + getConfig, + delegateInquiry, + }, + }, + '../../../app/livechat/server/lib/settings': libSettings, + '../../../app/settings/server': { settings }, + './logger': { queueLogger }, + '@rocket.chat/models': models, + '@rocket.chat/license': { License: license }, +}); + +describe('Omnichannel Queue processor', () => { + describe('isRunning', () => { + it('should return the running status', () => { + const queue = new OmnichannelQueue(); + expect(queue.isRunning()).to.be.false; + }); + it('should return the running status', () => { + const queue = new OmnichannelQueue(); + queue.running = true; + expect(queue.isRunning()).to.be.true; + }); + }); + describe('delay', () => { + after(() => { + settings.get.reset(); + }); + it('should return 5000 if setting is not set', () => { + settings.get.returns(undefined); + + const queue = new OmnichannelQueue(); + expect(queue.delay()).to.be.equal(5000); + }); + it('should return the right value if setting has a value above 1', () => { + settings.get.returns(10); + + const queue = new OmnichannelQueue(); + expect(queue.delay()).to.be.equal(10000); + }); + }); + describe('getActiveQueues', () => { + after(() => { + models.LivechatInquiry.getDistinctQueuedDepartments.reset(); + }); + it('should return [undefined] when there is no other queues', async () => { + models.LivechatInquiry.getDistinctQueuedDepartments.returns([]); + + const queue = new OmnichannelQueue(); + expect(await queue.getActiveQueues()).to.be.eql([undefined]); + }); + it('should return [undefined, department1] when department1 is an active queue', async () => { + models.LivechatInquiry.getDistinctQueuedDepartments.returns(['department1']); + + const queue = new OmnichannelQueue(); + expect(await queue.getActiveQueues()).to.be.eql([undefined, 'department1']); + }); + }); + describe('nextQueue', () => { + after(() => { + models.LivechatInquiry.getDistinctQueuedDepartments.reset(); + }); + it('should return undefined when thats the only queue', async () => { + models.LivechatInquiry.getDistinctQueuedDepartments.returns([]); + + const queue = new OmnichannelQueue(); + queue.getActiveQueues = Sinon.stub().returns([undefined]); + expect(await queue.nextQueue()).to.be.undefined; + }); + it('should return undefined, and then the following queue', async () => { + models.LivechatInquiry.getDistinctQueuedDepartments.returns(['department1']); + + const queue = new OmnichannelQueue(); + queue.getActiveQueues = Sinon.stub().returns([undefined, 'department1']); + expect(await queue.nextQueue()).to.be.undefined; + expect(await queue.nextQueue()).to.be.equal('department1'); + }); + it('should not call getActiveQueues if there are still queues to process', async () => { + models.LivechatInquiry.getDistinctQueuedDepartments.returns(['department1']); + + const queue = new OmnichannelQueue(); + queue.queues = ['department1']; + queue.getActiveQueues = Sinon.stub(); + + expect(await queue.nextQueue()).to.be.equal('department1'); + expect(queue.getActiveQueues.notCalled).to.be.true; + }); + }); + describe('checkQueue', () => { + let clock: any; + beforeEach(() => { + models.LivechatInquiry.findNextAndLock.resetHistory(); + models.LivechatInquiry.takeInquiry.resetHistory(); + models.LivechatInquiry.unlockAndQueue.resetHistory(); + models.LivechatInquiry.unlock.resetHistory(); + queueLogger.error.resetHistory(); + queueLogger.info.resetHistory(); + clock = Sinon.useFakeTimers(); + }); + afterEach(() => { + clock.restore(); + }); + after(() => { + models.LivechatInquiry.findNextAndLock.reset(); + models.LivechatInquiry.takeInquiry.reset(); + models.LivechatInquiry.unlockAndQueue.reset(); + models.LivechatInquiry.unlock.reset(); + queueLogger.error.reset(); + queueLogger.info.reset(); + clock.reset(); + }); + + it('should return undefined when the queue is empty', async () => { + models.LivechatInquiry.findNextAndLock.returns(null); + + const queue = new OmnichannelQueue(); + queue.execute = Sinon.stub(); + expect(await queue.checkQueue()).to.be.undefined; + }); + it('should try to process the inquiry when there is one', async () => { + models.LivechatInquiry.findNextAndLock.returns(mockedInquiry); + + const queue = new OmnichannelQueue(); + queue.processWaitingQueue = Sinon.stub().throws('error'); + queue.execute = Sinon.stub(); + await queue.checkQueue(); + + expect(models.LivechatInquiry.findNextAndLock.calledOnce).to.be.true; + expect(queue.processWaitingQueue.calledOnce).to.be.true; + }); + it('should call unlockAndRequeue when the inquiry could not be processed', async () => { + models.LivechatInquiry.findNextAndLock.returns(mockedInquiry); + + const queue = new OmnichannelQueue(); + queue.processWaitingQueue = Sinon.stub().returns(false); + queue.execute = Sinon.stub(); + await queue.checkQueue(); + + expect(queue.processWaitingQueue.calledOnce).to.be.true; + expect(models.LivechatInquiry.unlockAndQueue.calledOnce).to.be.true; + }); + it('should unlock the inquiry when it was processed succesfully', async () => { + models.LivechatInquiry.findNextAndLock.returns(mockedInquiry); + + const queue = new OmnichannelQueue(); + queue.processWaitingQueue = Sinon.stub().returns(true); + queue.execute = Sinon.stub(); + await queue.checkQueue(); + + expect(queue.processWaitingQueue.calledOnce).to.be.true; + expect(models.LivechatInquiry.unlock.calledOnce).to.be.true; + }); + it('should print a log when there was an error processing inquiry', async () => { + models.LivechatInquiry.findNextAndLock.throws('error'); + + const queue = new OmnichannelQueue(); + queue.execute = Sinon.stub(); + await queue.checkQueue(); + + expect(queueLogger.error.calledOnce).to.be.true; + }); + it('should call execute after finishing', async () => { + models.LivechatInquiry.findNextAndLock.returns(mockedInquiry); + + const queue = new OmnichannelQueue(); + queue.processWaitingQueue = Sinon.stub().returns(true); + queue.execute = Sinon.stub(); + queue.delay = Sinon.stub().returns(100); + await queue.checkQueue(); + clock.tick(100); + + expect(queue.execute.calledOnce).to.be.true; + expect(models.LivechatInquiry.unlock.calledOnce).to.be.true; + expect(queue.execute.calledAfter(models.LivechatInquiry.unlock)).to.be.true; + expect(queue.execute.calledOnce).to.be.true; + }); + }); + describe('shouldStart', () => { + beforeEach(() => { + settings.get.resetHistory(); + getConfig.resetHistory(); + }); + after(() => { + settings.get.reset(); + getConfig.reset(); + }); + + it('should call stop if Livechat is not enabled', async () => { + settings.get.returns(false); + + const queue = new OmnichannelQueue(); + queue.stop = Sinon.stub(); + await queue.shouldStart(); + + expect(queue.stop.calledOnce).to.be.true; + }); + it('should call start if routing algorithm supports auto assignment', async () => { + settings.get.returns(true); + getConfig.returns({ autoAssignAgent: true }); + + const queue = new OmnichannelQueue(); + queue.start = Sinon.stub(); + await queue.shouldStart(); + + expect(queue.start.calledOnce).to.be.true; + expect(queue.start.calledAfter(getConfig)).to.be.true; + }); + it('should call stop if routing algorithm does not support auto assignment', async () => { + settings.get.returns(true); + getConfig.returns({ autoAssignAgent: false }); + + const queue = new OmnichannelQueue(); + queue.stop = Sinon.stub(); + await queue.shouldStart(); + + expect(queue.stop.calledOnce).to.be.true; + expect(queue.stop.calledAfter(getConfig)).to.be.true; + }); + }); + describe('reconciliation', () => { + beforeEach(() => { + models.LivechatInquiry.removeByRoomId.resetHistory(); + models.LivechatInquiry.takeInquiry.resetHistory(); + }); + + it('should remove inquiries from rooms that do not exist', async () => { + const queue = new OmnichannelQueue(); + await queue.reconciliation('missing', { roomId: 'rid', inquiryId: 'inquiryId' }); + + expect(models.LivechatInquiry.removeByRoomId.calledOnce).to.be.true; + }); + it('should take an inquiry if the room was taken', async () => { + const queue = new OmnichannelQueue(); + await queue.reconciliation('taken', { roomId: 'rid', inquiryId: 'inquiryId' }); + + expect(models.LivechatInquiry.takeInquiry.calledOnce).to.be.true; + }); + it('should remove inquiries from rooms that were closed', async () => { + const queue = new OmnichannelQueue(); + await queue.reconciliation('closed', { roomId: 'rid', inquiryId: 'inquiryId' }); + + expect(models.LivechatInquiry.removeByRoomId.calledOnce).to.be.true; + }); + it('should return true for any other case', async () => { + const queue = new OmnichannelQueue(); + expect(await queue.reconciliation('random', { roomId: 'rid', inquiryId: 'inquiryId' })).to.be.true; + expect(models.LivechatInquiry.removeByRoomId.notCalled).to.be.true; + expect(models.LivechatInquiry.takeInquiry.notCalled).to.be.true; + }); + }); + describe('processWaitingQueue', () => { + let clock: any; + beforeEach(() => { + models.LivechatRooms.findOneById.reset(); + models.LivechatInquiry.takeInquiry.resetHistory(); + models.LivechatInquiry.removeByRoomId.resetHistory(); + delegateInquiry.resetHistory(); + queueLogger.debug.resetHistory(); + clock = Sinon.useFakeTimers(); + }); + afterEach(() => { + clock.restore(); + }); + after(() => { + models.LivechatRooms.findOneById.reset(); + models.LivechatInquiry.takeInquiry.reset(); + delegateInquiry.reset(); + queueLogger.debug.reset(); + clock.reset(); + }); + + it('should process the public queue when department is undefined', async () => { + const queue = new OmnichannelQueue(); + + expect(await queue.processWaitingQueue(undefined, mockedInquiry)).to.be.true; + expect(queueLogger.debug.calledWith('Processing inquiry inquiryId from queue Public')); + expect(models.LivechatRooms.findOneById.calledOnce).to.be.true; + }); + it('should call removeInquiry when findOneById returns null', async () => { + models.LivechatRooms.findOneById.returns(null); + + const queue = new OmnichannelQueue(); + expect(await queue.processWaitingQueue('department1', mockedInquiry)).to.be.true; + expect( + queueLogger.debug.calledWith({ + msg: 'Room from inquiry missing. Removing inquiry', + roomId: 'rid', + inquiryId: 'inquiryId', + step: 'reconciliation', + }), + ).to.be.true; + expect(models.LivechatInquiry.removeByRoomId.calledOnce).to.be.true; + }); + it('should call takeInquiry when findOneById returns a room thats already being served', async () => { + models.LivechatRooms.findOneById.returns({ _id: 'rid', servedBy: { some: 'thing' } }); + + const queue = new OmnichannelQueue(); + queue.reconciliation = Sinon.stub().returns(true); + expect(await queue.processWaitingQueue('department1', mockedInquiry)).to.be.true; + expect(queue.reconciliation.calledOnce).to.be.true; + }); + it('should call removeInquiry when findOneById returns a room that was closed', async () => { + models.LivechatRooms.findOneById.returns({ _id: 'rid', closedAt: new Date() }); + + const queue = new OmnichannelQueue(); + queue.reconciliation = Sinon.stub().returns(true); + expect(await queue.processWaitingQueue('department1', mockedInquiry)).to.be.true; + expect(queue.reconciliation.calledOnce).to.be.true; + }); + it('should call delegateInquiry when prechecks are met and return false if inquiry was not served', async () => { + models.LivechatRooms.findOneById.returns({ _id: 'rid' }); + delegateInquiry.returns({}); + + const queue = new OmnichannelQueue(); + expect(await queue.processWaitingQueue('department1', mockedInquiry)).to.be.false; + expect(delegateInquiry.calledOnce).to.be.true; + }); + it('should call delegateInquiry and return true if inquiry was served', async () => { + models.LivechatRooms.findOneById.returns({ _id: 'rid' }); + delegateInquiry.returns({ _id: 'rid', servedBy: { _id: 'agentId' } }); + + const queue = new OmnichannelQueue(); + expect(await queue.processWaitingQueue('department1', mockedInquiry)).to.be.true; + expect(delegateInquiry.calledOnce).to.be.true; + }); + it('should call dispatchAgentDelegated if inquiry was served (after 1s)', async () => { + models.LivechatRooms.findOneById.returns({ _id: 'rid' }); + delegateInquiry.returns({ _id: 'rid', servedBy: { _id: 'agentId' } }); + + const queue = new OmnichannelQueue(); + expect(await queue.processWaitingQueue('department1', mockedInquiry)).to.be.true; + expect(delegateInquiry.calledOnce).to.be.true; + clock.tick(1000); + expect(dispatchAgentDelegated.calledOnce).to.be.true; + }); + }); + describe('execute', () => { + beforeEach(() => { + license.shouldPreventAction.reset(); + queueLogger.debug.reset(); + }); + + after(() => { + license.shouldPreventAction.reset(); + queueLogger.debug.reset(); + }); + + it('should return undefined if service is not running', async () => { + const queue = new OmnichannelQueue(); + queue.running = false; + expect(await queue.execute()).to.be.undefined; + }); + it('should return undefined if license is over mac limits', async () => { + license.shouldPreventAction.returns(true); + + const queue = new OmnichannelQueue(); + queue.running = true; + expect(await queue.execute()).to.be.undefined; + expect(license.shouldPreventAction.calledOnce).to.be.true; + expect(queue.running).to.be.false; + }); + it('should try to process a queue if license is not over mac limits', async () => { + license.shouldPreventAction.returns(false); + + const queue = new OmnichannelQueue(); + queue.running = true; + queue.nextQueue = Sinon.stub(); + await queue.execute(); + + expect(queue.nextQueue.calledOnce).to.be.true; + expect(queueLogger.debug.calledWith('Executing queue Public with timeout of 5000')).to.be.true; + }); + }); + describe('start', () => { + beforeEach(() => { + queueLogger.info.resetHistory(); + queueLogger.debug.resetHistory(); + }); + after(() => { + queueLogger.info.reset(); + queueLogger.debug.reset(); + }); + it('should do nothing if queue is already running', async () => { + const queue = new OmnichannelQueue(); + queue.running = true; + queue.execute = Sinon.stub(); + await queue.start(); + + expect(queue.execute.notCalled).to.be.true; + }); + it('should fetch active queues and set running to true', async () => { + const queue = new OmnichannelQueue(); + queue.running = false; + queue.getActiveQueues = Sinon.stub().returns(['department1']); + queue.execute = Sinon.stub(); + await queue.start(); + + expect(queue.running).to.be.true; + expect(queue.getActiveQueues.calledOnce).to.be.true; + expect(queueLogger.info.calledOnce).to.be.true; + expect(queueLogger.info.calledWith('Service started')).to.be.true; + expect(queue.execute.calledOnce).to.be.true; + }); + }); + describe('stop', () => { + beforeEach(() => { + models.LivechatInquiry.unlockAll.reset(); + queueLogger.info.resetHistory(); + }); + after(() => { + models.LivechatInquiry.unlockAll.reset(); + queueLogger.info.reset(); + }); + it('should unlock all inquiries and set running to false', async () => { + const queue = new OmnichannelQueue(); + queue.running = true; + await queue.stop(); + + expect(queue.running).to.be.false; + expect(models.LivechatInquiry.unlockAll.calledOnce).to.be.true; + expect(queueLogger.info.calledOnce).to.be.true; + expect(queueLogger.info.calledWith('Service stopped')).to.be.true; + }); + }); +}); From 61814956216f08affee2d60269e12469275f7919 Mon Sep 17 00:00:00 2001 From: Kevin Aleman Date: Thu, 21 Mar 2024 07:15:40 -0600 Subject: [PATCH 16/79] fix: Allow queue to fix inquiry status when processing items (#31998) Co-authored-by: Marcos Spessatto Defendi --- .changeset/tough-doors-juggle.md | 9 + .../server/services/omnichannel/queue.ts | 77 ++- .../services/omnichannel/queue.tests.ts | 475 ++++++++++++++++++ 3 files changed, 552 insertions(+), 9 deletions(-) create mode 100644 .changeset/tough-doors-juggle.md create mode 100644 apps/meteor/tests/unit/server/services/omnichannel/queue.tests.ts diff --git a/.changeset/tough-doors-juggle.md b/.changeset/tough-doors-juggle.md new file mode 100644 index 000000000000..9da2ab1c6075 --- /dev/null +++ b/.changeset/tough-doors-juggle.md @@ -0,0 +1,9 @@ +--- +"@rocket.chat/meteor": patch +--- + +Introduced a new step to the queue worker: when an inquiry that's on an improper status is selected for processing, queue worker will first check its status and will attempt to fix it. +For example, if an inquiry points to a closed room, there's no point in processing, system will now remove the inquiry +If an inquiry is already taken, the inquiry will be updated to reflect the new status and clean the queue. + +This prevents issues where the queue worker attempted to process an inquiry _forever_ because it was in an improper state. diff --git a/apps/meteor/server/services/omnichannel/queue.ts b/apps/meteor/server/services/omnichannel/queue.ts index 603c5197ed30..0a9a13cffad9 100644 --- a/apps/meteor/server/services/omnichannel/queue.ts +++ b/apps/meteor/server/services/omnichannel/queue.ts @@ -1,6 +1,7 @@ -import type { InquiryWithAgentInfo, IOmnichannelQueue } from '@rocket.chat/core-typings'; +import type { IOmnichannelRoom } from '@rocket.chat/core-typings'; +import { type InquiryWithAgentInfo, type IOmnichannelQueue } from '@rocket.chat/core-typings'; import { License } from '@rocket.chat/license'; -import { LivechatInquiry } from '@rocket.chat/models'; +import { LivechatInquiry, LivechatRooms } from '@rocket.chat/models'; import { dispatchAgentDelegated } from '../../../app/livechat/server/lib/Helper'; import { RoutingManager } from '../../../app/livechat/server/lib/RoutingManager'; @@ -92,9 +93,11 @@ export class OmnichannelQueue implements IOmnichannelQueue { // Note: this removes the "one-shot" behavior of queue, allowing it to take a conversation again in the future // And sorting them by _updatedAt: -1 will make it so that the oldest inquiries are taken first // preventing us from playing with the same inquiry over and over again + queueLogger.debug(`Inquiry ${nextInquiry._id} not taken. Unlocking and re-queueing`); return await LivechatInquiry.unlockAndQueue(nextInquiry._id); } + queueLogger.debug(`Inquiry ${nextInquiry._id} taken successfully. Unlocking`); await LivechatInquiry.unlock(nextInquiry._id); } catch (e) { queueLogger.error({ @@ -123,17 +126,74 @@ export class OmnichannelQueue implements IOmnichannelQueue { void (routingSupportsAutoAssign ? this.start() : this.stop()); } + private async reconciliation(reason: 'closed' | 'taken' | 'missing', { roomId, inquiryId }: { roomId: string; inquiryId: string }) { + switch (reason) { + case 'closed': { + queueLogger.debug({ + msg: 'Room closed. Removing inquiry', + roomId, + inquiryId, + step: 'reconciliation', + }); + await LivechatInquiry.removeByRoomId(roomId); + break; + } + case 'taken': { + queueLogger.debug({ + msg: 'Room taken. Updating inquiry status', + roomId, + inquiryId, + step: 'reconciliation', + }); + // Reconciliate served inquiries, by updating their status to taken after queue tried to pick and failed + await LivechatInquiry.takeInquiry(inquiryId); + break; + } + case 'missing': { + queueLogger.debug({ + msg: 'Room from inquiry missing. Removing inquiry', + roomId, + inquiryId, + step: 'reconciliation', + }); + await LivechatInquiry.removeByRoomId(roomId); + break; + } + default: { + return true; + } + } + + return true; + } + private async processWaitingQueue(department: string | undefined, inquiry: InquiryWithAgentInfo) { const queue = department || 'Public'; - queueLogger.debug(`Processing items on queue ${queue}`); queueLogger.debug(`Processing inquiry ${inquiry._id} from queue ${queue}`); const { defaultAgent } = inquiry; - const room = await RoutingManager.delegateInquiry(inquiry, defaultAgent); - const propagateAgentDelegated = async (rid: string, agentId: string) => { - await dispatchAgentDelegated(rid, agentId); - }; + const roomFromDb = await LivechatRooms.findOneById>(inquiry.rid, { + projection: { servedBy: 1, closedAt: 1 }, + }); + + // This is a precaution to avoid taking inquiries tied to rooms that no longer exist. + // This should never happen. + if (!roomFromDb) { + return this.reconciliation('missing', { roomId: inquiry.rid, inquiryId: inquiry._id }); + } + + // This is a precaution to avoid taking the same inquiry multiple times. It should not happen, but it's a safety net + if (roomFromDb.servedBy) { + return this.reconciliation('taken', { roomId: inquiry.rid, inquiryId: inquiry._id }); + } + + // This is another precaution. If the room is closed, we should not take it + if (roomFromDb.closedAt) { + return this.reconciliation('closed', { roomId: inquiry.rid, inquiryId: inquiry._id }); + } + + const room = await RoutingManager.delegateInquiry(inquiry, defaultAgent); if (room?.servedBy) { const { @@ -142,13 +202,12 @@ export class OmnichannelQueue implements IOmnichannelQueue { } = room; queueLogger.debug(`Inquiry ${inquiry._id} taken successfully by agent ${agentId}. Notifying`); setTimeout(() => { - void propagateAgentDelegated(rid, agentId); + void dispatchAgentDelegated(rid, agentId); }, 1000); return true; } - queueLogger.debug(`Inquiry ${inquiry._id} not taken by any agent. Queueing again`); return false; } } diff --git a/apps/meteor/tests/unit/server/services/omnichannel/queue.tests.ts b/apps/meteor/tests/unit/server/services/omnichannel/queue.tests.ts new file mode 100644 index 000000000000..ce24b0ded64a --- /dev/null +++ b/apps/meteor/tests/unit/server/services/omnichannel/queue.tests.ts @@ -0,0 +1,475 @@ +import { expect } from 'chai'; +import { beforeEach, describe, after, it } from 'mocha'; +import p from 'proxyquire'; +import Sinon from 'sinon'; + +const dispatchAgentDelegated = Sinon.stub(); +const getConfig = Sinon.stub(); +const delegateInquiry = Sinon.stub(); +const libSettings = { getInquirySortMechanismSetting: Sinon.stub().returns('timestamp') }; +const settings = { + get: Sinon.stub(), +}; + +const queueLogger = { + info: Sinon.stub(), + debug: Sinon.stub(), + error: Sinon.stub(), +}; + +const mockedInquiry = { + _id: 'inquiryId', + rid: 'rid', + department: 'department1', + ts: new Date(), +}; + +const models = { + LivechatInquiry: { + unlockAll: Sinon.stub(), + findNextAndLock: Sinon.stub(), + getDistinctQueuedDepartments: Sinon.stub(), + unlockAndQueue: Sinon.stub(), + unlock: Sinon.stub(), + removeByRoomId: Sinon.stub(), + takeInquiry: Sinon.stub(), + }, + LivechatRooms: { + findOneById: Sinon.stub(), + }, +}; + +const license = { + shouldPreventAction: Sinon.stub(), +}; + +const { OmnichannelQueue } = p.noCallThru().load('../../../../../server/services/omnichannel/queue', { + '../../../app/livechat/server/lib/Helper': { + dispatchAgentDelegated, + }, + '../../../app/livechat/server/lib/RoutingManager': { + RoutingManager: { + getConfig, + delegateInquiry, + }, + }, + '../../../app/livechat/server/lib/settings': libSettings, + '../../../app/settings/server': { settings }, + './logger': { queueLogger }, + '@rocket.chat/models': models, + '@rocket.chat/license': { License: license }, +}); + +describe('Omnichannel Queue processor', () => { + describe('isRunning', () => { + it('should return the running status', () => { + const queue = new OmnichannelQueue(); + expect(queue.isRunning()).to.be.false; + }); + it('should return the running status', () => { + const queue = new OmnichannelQueue(); + queue.running = true; + expect(queue.isRunning()).to.be.true; + }); + }); + describe('delay', () => { + after(() => { + settings.get.reset(); + }); + it('should return 5000 if setting is not set', () => { + settings.get.returns(undefined); + + const queue = new OmnichannelQueue(); + expect(queue.delay()).to.be.equal(5000); + }); + it('should return the right value if setting has a value above 1', () => { + settings.get.returns(10); + + const queue = new OmnichannelQueue(); + expect(queue.delay()).to.be.equal(10000); + }); + }); + describe('getActiveQueues', () => { + after(() => { + models.LivechatInquiry.getDistinctQueuedDepartments.reset(); + }); + it('should return [undefined] when there is no other queues', async () => { + models.LivechatInquiry.getDistinctQueuedDepartments.returns([]); + + const queue = new OmnichannelQueue(); + expect(await queue.getActiveQueues()).to.be.eql([undefined]); + }); + it('should return [undefined, department1] when department1 is an active queue', async () => { + models.LivechatInquiry.getDistinctQueuedDepartments.returns(['department1']); + + const queue = new OmnichannelQueue(); + expect(await queue.getActiveQueues()).to.be.eql([undefined, 'department1']); + }); + }); + describe('nextQueue', () => { + after(() => { + models.LivechatInquiry.getDistinctQueuedDepartments.reset(); + }); + it('should return undefined when thats the only queue', async () => { + models.LivechatInquiry.getDistinctQueuedDepartments.returns([]); + + const queue = new OmnichannelQueue(); + queue.getActiveQueues = Sinon.stub().returns([undefined]); + expect(await queue.nextQueue()).to.be.undefined; + }); + it('should return undefined, and then the following queue', async () => { + models.LivechatInquiry.getDistinctQueuedDepartments.returns(['department1']); + + const queue = new OmnichannelQueue(); + queue.getActiveQueues = Sinon.stub().returns([undefined, 'department1']); + expect(await queue.nextQueue()).to.be.undefined; + expect(await queue.nextQueue()).to.be.equal('department1'); + }); + it('should not call getActiveQueues if there are still queues to process', async () => { + models.LivechatInquiry.getDistinctQueuedDepartments.returns(['department1']); + + const queue = new OmnichannelQueue(); + queue.queues = ['department1']; + queue.getActiveQueues = Sinon.stub(); + + expect(await queue.nextQueue()).to.be.equal('department1'); + expect(queue.getActiveQueues.notCalled).to.be.true; + }); + }); + describe('checkQueue', () => { + let clock: any; + beforeEach(() => { + models.LivechatInquiry.findNextAndLock.resetHistory(); + models.LivechatInquiry.takeInquiry.resetHistory(); + models.LivechatInquiry.unlockAndQueue.resetHistory(); + models.LivechatInquiry.unlock.resetHistory(); + queueLogger.error.resetHistory(); + queueLogger.info.resetHistory(); + clock = Sinon.useFakeTimers(); + }); + afterEach(() => { + clock.restore(); + }); + after(() => { + models.LivechatInquiry.findNextAndLock.reset(); + models.LivechatInquiry.takeInquiry.reset(); + models.LivechatInquiry.unlockAndQueue.reset(); + models.LivechatInquiry.unlock.reset(); + queueLogger.error.reset(); + queueLogger.info.reset(); + clock.reset(); + }); + + it('should return undefined when the queue is empty', async () => { + models.LivechatInquiry.findNextAndLock.returns(null); + + const queue = new OmnichannelQueue(); + queue.execute = Sinon.stub(); + expect(await queue.checkQueue()).to.be.undefined; + }); + it('should try to process the inquiry when there is one', async () => { + models.LivechatInquiry.findNextAndLock.returns(mockedInquiry); + + const queue = new OmnichannelQueue(); + queue.processWaitingQueue = Sinon.stub().throws('error'); + queue.execute = Sinon.stub(); + await queue.checkQueue(); + + expect(models.LivechatInquiry.findNextAndLock.calledOnce).to.be.true; + expect(queue.processWaitingQueue.calledOnce).to.be.true; + }); + it('should call unlockAndRequeue when the inquiry could not be processed', async () => { + models.LivechatInquiry.findNextAndLock.returns(mockedInquiry); + + const queue = new OmnichannelQueue(); + queue.processWaitingQueue = Sinon.stub().returns(false); + queue.execute = Sinon.stub(); + await queue.checkQueue(); + + expect(queue.processWaitingQueue.calledOnce).to.be.true; + expect(models.LivechatInquiry.unlockAndQueue.calledOnce).to.be.true; + }); + it('should unlock the inquiry when it was processed succesfully', async () => { + models.LivechatInquiry.findNextAndLock.returns(mockedInquiry); + + const queue = new OmnichannelQueue(); + queue.processWaitingQueue = Sinon.stub().returns(true); + queue.execute = Sinon.stub(); + await queue.checkQueue(); + + expect(queue.processWaitingQueue.calledOnce).to.be.true; + expect(models.LivechatInquiry.unlock.calledOnce).to.be.true; + }); + it('should print a log when there was an error processing inquiry', async () => { + models.LivechatInquiry.findNextAndLock.throws('error'); + + const queue = new OmnichannelQueue(); + queue.execute = Sinon.stub(); + await queue.checkQueue(); + + expect(queueLogger.error.calledOnce).to.be.true; + }); + it('should call execute after finishing', async () => { + models.LivechatInquiry.findNextAndLock.returns(mockedInquiry); + + const queue = new OmnichannelQueue(); + queue.processWaitingQueue = Sinon.stub().returns(true); + queue.execute = Sinon.stub(); + queue.delay = Sinon.stub().returns(100); + await queue.checkQueue(); + clock.tick(100); + + expect(queue.execute.calledOnce).to.be.true; + expect(models.LivechatInquiry.unlock.calledOnce).to.be.true; + expect(queue.execute.calledAfter(models.LivechatInquiry.unlock)).to.be.true; + expect(queue.execute.calledOnce).to.be.true; + }); + }); + describe('shouldStart', () => { + beforeEach(() => { + settings.get.resetHistory(); + getConfig.resetHistory(); + }); + after(() => { + settings.get.reset(); + getConfig.reset(); + }); + + it('should call stop if Livechat is not enabled', async () => { + settings.get.returns(false); + + const queue = new OmnichannelQueue(); + queue.stop = Sinon.stub(); + await queue.shouldStart(); + + expect(queue.stop.calledOnce).to.be.true; + }); + it('should call start if routing algorithm supports auto assignment', async () => { + settings.get.returns(true); + getConfig.returns({ autoAssignAgent: true }); + + const queue = new OmnichannelQueue(); + queue.start = Sinon.stub(); + await queue.shouldStart(); + + expect(queue.start.calledOnce).to.be.true; + expect(queue.start.calledAfter(getConfig)).to.be.true; + }); + it('should call stop if routing algorithm does not support auto assignment', async () => { + settings.get.returns(true); + getConfig.returns({ autoAssignAgent: false }); + + const queue = new OmnichannelQueue(); + queue.stop = Sinon.stub(); + await queue.shouldStart(); + + expect(queue.stop.calledOnce).to.be.true; + expect(queue.stop.calledAfter(getConfig)).to.be.true; + }); + }); + describe('reconciliation', () => { + beforeEach(() => { + models.LivechatInquiry.removeByRoomId.resetHistory(); + models.LivechatInquiry.takeInquiry.resetHistory(); + }); + + it('should remove inquiries from rooms that do not exist', async () => { + const queue = new OmnichannelQueue(); + await queue.reconciliation('missing', { roomId: 'rid', inquiryId: 'inquiryId' }); + + expect(models.LivechatInquiry.removeByRoomId.calledOnce).to.be.true; + }); + it('should take an inquiry if the room was taken', async () => { + const queue = new OmnichannelQueue(); + await queue.reconciliation('taken', { roomId: 'rid', inquiryId: 'inquiryId' }); + + expect(models.LivechatInquiry.takeInquiry.calledOnce).to.be.true; + }); + it('should remove inquiries from rooms that were closed', async () => { + const queue = new OmnichannelQueue(); + await queue.reconciliation('closed', { roomId: 'rid', inquiryId: 'inquiryId' }); + + expect(models.LivechatInquiry.removeByRoomId.calledOnce).to.be.true; + }); + it('should return true for any other case', async () => { + const queue = new OmnichannelQueue(); + expect(await queue.reconciliation('random', { roomId: 'rid', inquiryId: 'inquiryId' })).to.be.true; + expect(models.LivechatInquiry.removeByRoomId.notCalled).to.be.true; + expect(models.LivechatInquiry.takeInquiry.notCalled).to.be.true; + }); + }); + describe('processWaitingQueue', () => { + let clock: any; + beforeEach(() => { + models.LivechatRooms.findOneById.reset(); + models.LivechatInquiry.takeInquiry.resetHistory(); + models.LivechatInquiry.removeByRoomId.resetHistory(); + delegateInquiry.resetHistory(); + queueLogger.debug.resetHistory(); + clock = Sinon.useFakeTimers(); + }); + afterEach(() => { + clock.restore(); + }); + after(() => { + models.LivechatRooms.findOneById.reset(); + models.LivechatInquiry.takeInquiry.reset(); + delegateInquiry.reset(); + queueLogger.debug.reset(); + clock.reset(); + }); + + it('should process the public queue when department is undefined', async () => { + const queue = new OmnichannelQueue(); + + expect(await queue.processWaitingQueue(undefined, mockedInquiry)).to.be.true; + expect(queueLogger.debug.calledWith('Processing inquiry inquiryId from queue Public')); + expect(models.LivechatRooms.findOneById.calledOnce).to.be.true; + }); + it('should call removeInquiry when findOneById returns null', async () => { + models.LivechatRooms.findOneById.returns(null); + + const queue = new OmnichannelQueue(); + expect(await queue.processWaitingQueue('department1', mockedInquiry)).to.be.true; + expect( + queueLogger.debug.calledWith({ + msg: 'Room from inquiry missing. Removing inquiry', + roomId: 'rid', + inquiryId: 'inquiryId', + step: 'reconciliation', + }), + ).to.be.true; + expect(models.LivechatInquiry.removeByRoomId.calledOnce).to.be.true; + }); + it('should call takeInquiry when findOneById returns a room thats already being served', async () => { + models.LivechatRooms.findOneById.returns({ _id: 'rid', servedBy: { some: 'thing' } }); + + const queue = new OmnichannelQueue(); + queue.reconciliation = Sinon.stub().returns(true); + expect(await queue.processWaitingQueue('department1', mockedInquiry)).to.be.true; + expect(queue.reconciliation.calledOnce).to.be.true; + }); + it('should call removeInquiry when findOneById returns a room that was closed', async () => { + models.LivechatRooms.findOneById.returns({ _id: 'rid', closedAt: new Date() }); + + const queue = new OmnichannelQueue(); + queue.reconciliation = Sinon.stub().returns(true); + expect(await queue.processWaitingQueue('department1', mockedInquiry)).to.be.true; + expect(queue.reconciliation.calledOnce).to.be.true; + }); + it('should call delegateInquiry when prechecks are met and return false if inquiry was not served', async () => { + models.LivechatRooms.findOneById.returns({ _id: 'rid' }); + delegateInquiry.returns({}); + + const queue = new OmnichannelQueue(); + expect(await queue.processWaitingQueue('department1', mockedInquiry)).to.be.false; + expect(delegateInquiry.calledOnce).to.be.true; + }); + it('should call delegateInquiry and return true if inquiry was served', async () => { + models.LivechatRooms.findOneById.returns({ _id: 'rid' }); + delegateInquiry.returns({ _id: 'rid', servedBy: { _id: 'agentId' } }); + + const queue = new OmnichannelQueue(); + expect(await queue.processWaitingQueue('department1', mockedInquiry)).to.be.true; + expect(delegateInquiry.calledOnce).to.be.true; + }); + it('should call dispatchAgentDelegated if inquiry was served (after 1s)', async () => { + models.LivechatRooms.findOneById.returns({ _id: 'rid' }); + delegateInquiry.returns({ _id: 'rid', servedBy: { _id: 'agentId' } }); + + const queue = new OmnichannelQueue(); + expect(await queue.processWaitingQueue('department1', mockedInquiry)).to.be.true; + expect(delegateInquiry.calledOnce).to.be.true; + clock.tick(1000); + expect(dispatchAgentDelegated.calledOnce).to.be.true; + }); + }); + describe('execute', () => { + beforeEach(() => { + license.shouldPreventAction.reset(); + queueLogger.debug.reset(); + }); + + after(() => { + license.shouldPreventAction.reset(); + queueLogger.debug.reset(); + }); + + it('should return undefined if service is not running', async () => { + const queue = new OmnichannelQueue(); + queue.running = false; + expect(await queue.execute()).to.be.undefined; + }); + it('should return undefined if license is over mac limits', async () => { + license.shouldPreventAction.returns(true); + + const queue = new OmnichannelQueue(); + queue.running = true; + expect(await queue.execute()).to.be.undefined; + expect(license.shouldPreventAction.calledOnce).to.be.true; + expect(queue.running).to.be.false; + }); + it('should try to process a queue if license is not over mac limits', async () => { + license.shouldPreventAction.returns(false); + + const queue = new OmnichannelQueue(); + queue.running = true; + queue.nextQueue = Sinon.stub(); + await queue.execute(); + + expect(queue.nextQueue.calledOnce).to.be.true; + expect(queueLogger.debug.calledWith('Executing queue Public with timeout of 5000')).to.be.true; + }); + }); + describe('start', () => { + beforeEach(() => { + queueLogger.info.resetHistory(); + queueLogger.debug.resetHistory(); + }); + after(() => { + queueLogger.info.reset(); + queueLogger.debug.reset(); + }); + it('should do nothing if queue is already running', async () => { + const queue = new OmnichannelQueue(); + queue.running = true; + queue.execute = Sinon.stub(); + await queue.start(); + + expect(queue.execute.notCalled).to.be.true; + }); + it('should fetch active queues and set running to true', async () => { + const queue = new OmnichannelQueue(); + queue.running = false; + queue.getActiveQueues = Sinon.stub().returns(['department1']); + queue.execute = Sinon.stub(); + await queue.start(); + + expect(queue.running).to.be.true; + expect(queue.getActiveQueues.calledOnce).to.be.true; + expect(queueLogger.info.calledOnce).to.be.true; + expect(queueLogger.info.calledWith('Service started')).to.be.true; + expect(queue.execute.calledOnce).to.be.true; + }); + }); + describe('stop', () => { + beforeEach(() => { + models.LivechatInquiry.unlockAll.reset(); + queueLogger.info.resetHistory(); + }); + after(() => { + models.LivechatInquiry.unlockAll.reset(); + queueLogger.info.reset(); + }); + it('should unlock all inquiries and set running to false', async () => { + const queue = new OmnichannelQueue(); + queue.running = true; + await queue.stop(); + + expect(queue.running).to.be.false; + expect(models.LivechatInquiry.unlockAll.calledOnce).to.be.true; + expect(queueLogger.info.calledOnce).to.be.true; + expect(queueLogger.info.calledWith('Service stopped')).to.be.true; + }); + }); +}); From 6476aa947c067007dde09aae65a17c52c94e74e7 Mon Sep 17 00:00:00 2001 From: Guilherme Gazzo Date: Fri, 8 Mar 2024 13:33:41 -0300 Subject: [PATCH 17/79] fix: livechat sdk reconnect not resubscribing (#31941) --- .changeset/empty-hounds-jog.md | 5 +++++ ee/packages/ddp-client/src/livechat/LivechatClientImpl.ts | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) create mode 100644 .changeset/empty-hounds-jog.md diff --git a/.changeset/empty-hounds-jog.md b/.changeset/empty-hounds-jog.md new file mode 100644 index 000000000000..b6830e0522ef --- /dev/null +++ b/.changeset/empty-hounds-jog.md @@ -0,0 +1,5 @@ +--- +"@rocket.chat/ddp-client": patch +--- + +fix: livechat sdk reconnect not resubscribing diff --git a/ee/packages/ddp-client/src/livechat/LivechatClientImpl.ts b/ee/packages/ddp-client/src/livechat/LivechatClientImpl.ts index fa28d48ba5c8..973853678f6e 100644 --- a/ee/packages/ddp-client/src/livechat/LivechatClientImpl.ts +++ b/ee/packages/ddp-client/src/livechat/LivechatClientImpl.ts @@ -381,9 +381,9 @@ export class LivechatClientImpl extends DDPSDK implements LivechatStream, Livech const sdk = new LivechatClientImpl(connection, stream, account, timeoutControl, rest); connection.on('connected', () => { - Object.entries(stream.subscriptions).forEach(([, sub]) => { + for (const [, sub] of stream.subscriptions.entries()) { ddp.subscribeWithId(sub.id, sub.name, sub.params); - }); + } }); return sdk; From 1b1164189c04855fe30e391cbd7b28516c8fa133 Mon Sep 17 00:00:00 2001 From: Martin Schoeler Date: Mon, 11 Mar 2024 20:33:01 -0300 Subject: [PATCH 18/79] fix: setDepartment not persisting on chat closed (#31792) --- .changeset/thin-keys-impress.md | 5 + .../omnichannel-livechat-api.spec.ts | 93 ++++++++++++++----- packages/livechat/src/lib/hooks.js | 1 + packages/livechat/src/lib/room.js | 4 +- 4 files changed, 77 insertions(+), 26 deletions(-) create mode 100644 .changeset/thin-keys-impress.md diff --git a/.changeset/thin-keys-impress.md b/.changeset/thin-keys-impress.md new file mode 100644 index 000000000000..8679299972fc --- /dev/null +++ b/.changeset/thin-keys-impress.md @@ -0,0 +1,5 @@ +--- +"@rocket.chat/livechat": patch +--- + +Fixes issue of the `setDepartment` Livechat API method not setting the store value properly (is was only setting on the guest object) diff --git a/apps/meteor/tests/e2e/omnichannel/omnichannel-livechat-api.spec.ts b/apps/meteor/tests/e2e/omnichannel/omnichannel-livechat-api.spec.ts index c8810fa4eb77..a8fa27eb5d2c 100644 --- a/apps/meteor/tests/e2e/omnichannel/omnichannel-livechat-api.spec.ts +++ b/apps/meteor/tests/e2e/omnichannel/omnichannel-livechat-api.spec.ts @@ -6,6 +6,7 @@ import { createAuxContext } from '../fixtures/createAuxContext'; import { Users } from '../fixtures/userStates'; import { HomeOmnichannel, OmnichannelLiveChatEmbedded } from '../page-objects'; import { createAgent } from '../utils/omnichannel/agents'; +import { addAgentToDepartment, createDepartment } from '../utils/omnichannel/departments'; import { test, expect } from '../utils/test'; // TODO: Use official widget typing once that is merged @@ -32,7 +33,7 @@ declare const window: Window & { setAgent: (agent: { username: string; _id: string }) => void; setBusinessUnit: (businessUnit?: string) => void; setCustomField: (field: { key: string; value: string }) => void; - setDepartment: (department: { _id: string; name: string }) => void; + setDepartment: (dep: string) => void; setGuestEmail: (email: string) => void; setGuestName: (name: string) => void; setGuestToken: (token: string) => void; @@ -56,8 +57,8 @@ declare const window: Window & { }; test.describe('OC - Livechat API', () => { - // TODO: Check if there is a way to add livechat to the global window object - + // TODO: Check if there is a way to add livechat to the global window object + test.describe('Basic Widget Interactions', () => { // Tests that rely only on the widget itself, without requiring further interaction from the main RC app let poAuxContext: { page: Page; poHomeOmnichannel: HomeOmnichannel }; @@ -213,27 +214,24 @@ test.describe('OC - Livechat API', () => { test.skip(!IS_EE, 'Enterprise Only'); // Tests that requires interaction from an agent or more let poAuxContext: { page: Page; poHomeOmnichannel: HomeOmnichannel }; + let poAuxContext2: { page: Page; poHomeOmnichannel: HomeOmnichannel }; let poLiveChat: OmnichannelLiveChatEmbedded; let page: Page; - let depId: string; let agent: Awaited>; + let agent2: Awaited>; + let departments: Awaited>[]; + test.beforeAll(async ({ api }) => { agent = await createAgent(api, 'user1') - - const response = await api.post('/livechat/department', {department: { - enabled: true, - email: faker.internet.email(), - showOnRegistration: true, - showOnOfflineForm: true, - name: `new department ${Date.now()}`, - description: 'created from api', - }}); - - expect(response.status()).toBe(200); - - const resBody = await response.json(); - depId = resBody.department._id; + agent2 = await createAgent(api, 'user2') + + departments = await Promise.all([createDepartment(api), createDepartment(api)]); + const [departmentA, departmentB] = departments.map(({ data }) => data); + + await addAgentToDepartment(api, { department: departmentA, agentId: agent.data._id }) + await addAgentToDepartment(api, { department: departmentB, agentId: agent2.data._id }) + await expect((await api.post('/settings/Enable_CSP', { value: false })).status()).toBe(200); await expect((await api.post('/settings/Livechat_offline_email', { value: 'test@testing.com' })).status()).toBe(200); }); @@ -253,6 +251,11 @@ test.describe('OC - Livechat API', () => { await poAuxContext.poHomeOmnichannel.sidenav.switchStatus('online'); } + if (testInfo.title === 'OC - Livechat API - setDepartment') { + const { page: pageCtx2 } = await createAuxContext(browser, Users.user2); + poAuxContext2 = { page: pageCtx2, poHomeOmnichannel: new HomeOmnichannel(pageCtx) }; + } + await page.goto('/packages/rocketchat_livechat/assets/demo.html'); }); @@ -264,9 +267,10 @@ test.describe('OC - Livechat API', () => { test.afterAll(async ({ api }) => { await expect((await api.post('/settings/Enable_CSP', { value: true })).status()).toBe(200); await agent.delete(); + await agent2.delete(); + await expect((await api.post('/settings/Omnichannel_enable_department_removal', { value: true })).status()).toBe(200); - const response = await api.delete(`/livechat/department/${depId}`, { name: 'TestDep', email: 'TestDep@email.com' }); - expect(response.status()).toBe(200); + await Promise.all([...departments.map((department) => department.delete())]); await expect((await api.post('/settings/Omnichannel_enable_department_removal', { value: false })).status()).toBe(200); }); @@ -315,6 +319,47 @@ test.describe('OC - Livechat API', () => { }); }); + test('OC - Livechat API - setDepartment', async () => { + const [departmentA, departmentB] = departments.map(({ data }) => data); + const registerGuestVisitor = { + name: faker.person.firstName(), + email: faker.internet.email(), + token: faker.string.uuid(), + department: departmentA._id, + }; + + // Start Chat + await poLiveChat.page.evaluate(() => window.RocketChat.livechat.maximizeWidget()); + await expect(page.frameLocator('#rocketchat-iframe').getByText('Start Chat')).toBeVisible(); + + await poLiveChat.page.evaluate( + (registerGuestVisitor) => window.RocketChat.livechat.registerGuest(registerGuestVisitor), + registerGuestVisitor, + ); + + await expect(page.frameLocator('#rocketchat-iframe').getByText('Start Chat')).not.toBeVisible(); + + await poLiveChat.onlineAgentMessage.type('this_a_test_message_from_visitor'); + await poLiveChat.btnSendMessageToOnlineAgent.click(); + + await test.step('Expect registered guest to be in dep1', async () => { + await poAuxContext.poHomeOmnichannel.sidenav.openChat(registerGuestVisitor.name); + }); + + const depId = departmentB._id; + + await test.step('Expect setDepartment to change a guest department', async () => { + await poLiveChat.page.evaluate( + (depId) => window.RocketChat.livechat.setDepartment(depId), + depId, + ); + }); + + await test.step('Expect registered guest to be in dep2', async () => { + await poAuxContext2.poHomeOmnichannel.sidenav.openChat(registerGuestVisitor.name); + }); + }); + test('OC - Livechat API - registerGuest', async ({ browser }) => { const registerGuestVisitor = { name: faker.person.firstName(), @@ -495,14 +540,14 @@ test.describe('OC - Livechat API', () => { const { page: pageCtx } = await createAuxContext(browser, Users.user1); poAuxContext = { page: pageCtx, poHomeOmnichannel: new HomeOmnichannel(pageCtx) }; - + // This is needed since the livechat will not react to online/offline status changes if already loaded in a page if (testInfo.title === 'Expect onOfflineFormSubmit to trigger callback') { await poAuxContext.poHomeOmnichannel.sidenav.switchStatus('offline'); } else { await poAuxContext.poHomeOmnichannel.sidenav.switchStatus('online'); } - + await page.goto('/packages/rocketchat_livechat/assets/demo.html'); }); @@ -635,7 +680,7 @@ test.describe('OC - Livechat API', () => { await poLiveChat.sendMessage(newVisitor, false); await poLiveChat.onlineAgentMessage.type('this_a_test_message_from_visitor'); await poLiveChat.btnSendMessageToOnlineAgent.click(); - + const watchForTrigger = page.waitForFunction(() => window.onAgentStatusChange === true); @@ -717,5 +762,5 @@ test.describe('OC - Livechat API', () => { }); }); }); - + }); diff --git a/packages/livechat/src/lib/hooks.js b/packages/livechat/src/lib/hooks.js index 311cf0b2a00b..67e331371948 100644 --- a/packages/livechat/src/lib/hooks.js +++ b/packages/livechat/src/lib/hooks.js @@ -88,6 +88,7 @@ const api = { const department = departments.find((dep) => dep._id === value || dep.name === value)?._id || ''; updateIframeGuestData({ department }); + store.setState({ department }); if (defaultAgent && defaultAgent.department !== department) { store.setState({ defaultAgent: null }); diff --git a/packages/livechat/src/lib/room.js b/packages/livechat/src/lib/room.js index 1e4f975f1886..c1d2f0163a56 100644 --- a/packages/livechat/src/lib/room.js +++ b/packages/livechat/src/lib/room.js @@ -25,13 +25,13 @@ export const closeChat = async ({ transcriptRequested } = {}) => { await handleTranscript(); } - const { config: { settings: { clearLocalStorageWhenChatEnded } = {} } = {} } = store.state; + const { department, config: { settings: { clearLocalStorageWhenChatEnded } = {} } = {} } = store.state; if (clearLocalStorageWhenChatEnded) { // exclude UI-affecting flags const { iframe: currentIframe } = store.state; const { minimized, visible, undocked, expanded, businessUnit, config, iframe, ...initial } = initialState(); - initial.iframe = { ...currentIframe, guest: {} }; + initial.iframe = { ...currentIframe, guest: { department } }; await store.setState(initial); } From 68f0a91d536a546585cfa88ae5d12c46119a184d Mon Sep 17 00:00:00 2001 From: rocketchat-github-ci Date: Thu, 21 Mar 2024 15:57:05 +0000 Subject: [PATCH 19/79] Release 6.6.5 [no ci] --- .changeset/bump-patch-1710964059521.md | 5 --- .changeset/empty-hounds-jog.md | 5 --- .changeset/thin-keys-impress.md | 5 --- .changeset/tough-doors-juggle.md | 9 ----- apps/meteor/CHANGELOG.md | 38 +++++++++++++++++++ apps/meteor/app/utils/rocketchat.info | 2 +- apps/meteor/ee/server/services/CHANGELOG.md | 13 +++++++ apps/meteor/ee/server/services/package.json | 2 +- apps/meteor/package.json | 2 +- ee/apps/account-service/CHANGELOG.md | 13 +++++++ ee/apps/account-service/package.json | 2 +- ee/apps/authorization-service/CHANGELOG.md | 13 +++++++ ee/apps/authorization-service/package.json | 2 +- ee/apps/ddp-streamer/CHANGELOG.md | 15 ++++++++ ee/apps/ddp-streamer/package.json | 2 +- ee/apps/omnichannel-transcript/CHANGELOG.md | 14 +++++++ ee/apps/omnichannel-transcript/package.json | 2 +- ee/apps/presence-service/CHANGELOG.md | 13 +++++++ ee/apps/presence-service/package.json | 2 +- ee/apps/queue-worker/CHANGELOG.md | 13 +++++++ ee/apps/queue-worker/package.json | 2 +- ee/apps/stream-hub-service/CHANGELOG.md | 12 ++++++ ee/apps/stream-hub-service/package.json | 2 +- ee/packages/api-client/CHANGELOG.md | 10 +++++ ee/packages/api-client/package.json | 2 +- ee/packages/ddp-client/CHANGELOG.md | 12 ++++++ ee/packages/ddp-client/package.json | 2 +- ee/packages/license/CHANGELOG.md | 9 +++++ ee/packages/license/package.json | 2 +- ee/packages/omnichannel-services/CHANGELOG.md | 14 +++++++ ee/packages/omnichannel-services/package.json | 2 +- ee/packages/pdf-worker/CHANGELOG.md | 9 +++++ ee/packages/pdf-worker/package.json | 2 +- ee/packages/presence/CHANGELOG.md | 11 ++++++ ee/packages/presence/package.json | 2 +- package.json | 2 +- packages/core-services/CHANGELOG.md | 11 ++++++ packages/core-services/package.json | 2 +- packages/core-typings/CHANGELOG.md | 2 + packages/core-typings/package.json | 2 +- packages/cron/CHANGELOG.md | 10 +++++ packages/cron/package.json | 2 +- packages/fuselage-ui-kit/CHANGELOG.md | 11 ++++++ packages/fuselage-ui-kit/package.json | 6 +-- packages/gazzodown/CHANGELOG.md | 11 ++++++ packages/gazzodown/package.json | 8 ++-- packages/instance-status/CHANGELOG.md | 9 +++++ packages/instance-status/package.json | 2 +- packages/livechat/CHANGELOG.md | 11 ++++++ packages/livechat/package.json | 2 +- packages/model-typings/CHANGELOG.md | 9 +++++ packages/model-typings/package.json | 2 +- packages/models/CHANGELOG.md | 9 +++++ packages/models/package.json | 2 +- packages/rest-typings/CHANGELOG.md | 9 +++++ packages/rest-typings/package.json | 2 +- packages/ui-client/CHANGELOG.md | 9 +++++ packages/ui-client/package.json | 4 +- packages/ui-contexts/CHANGELOG.md | 11 ++++++ packages/ui-contexts/package.json | 2 +- packages/ui-video-conf/CHANGELOG.md | 9 +++++ packages/ui-video-conf/package.json | 4 +- packages/uikit-playground/CHANGELOG.md | 10 +++++ packages/uikit-playground/package.json | 2 +- packages/web-ui-registration/CHANGELOG.md | 9 +++++ packages/web-ui-registration/package.json | 4 +- 66 files changed, 389 insertions(+), 64 deletions(-) delete mode 100644 .changeset/bump-patch-1710964059521.md delete mode 100644 .changeset/empty-hounds-jog.md delete mode 100644 .changeset/thin-keys-impress.md delete mode 100644 .changeset/tough-doors-juggle.md diff --git a/.changeset/bump-patch-1710964059521.md b/.changeset/bump-patch-1710964059521.md deleted file mode 100644 index e1eaa7980afb..000000000000 --- a/.changeset/bump-patch-1710964059521.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@rocket.chat/meteor': patch ---- - -Bump @rocket.chat/meteor version. diff --git a/.changeset/empty-hounds-jog.md b/.changeset/empty-hounds-jog.md deleted file mode 100644 index b6830e0522ef..000000000000 --- a/.changeset/empty-hounds-jog.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@rocket.chat/ddp-client": patch ---- - -fix: livechat sdk reconnect not resubscribing diff --git a/.changeset/thin-keys-impress.md b/.changeset/thin-keys-impress.md deleted file mode 100644 index 8679299972fc..000000000000 --- a/.changeset/thin-keys-impress.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@rocket.chat/livechat": patch ---- - -Fixes issue of the `setDepartment` Livechat API method not setting the store value properly (is was only setting on the guest object) diff --git a/.changeset/tough-doors-juggle.md b/.changeset/tough-doors-juggle.md deleted file mode 100644 index 9da2ab1c6075..000000000000 --- a/.changeset/tough-doors-juggle.md +++ /dev/null @@ -1,9 +0,0 @@ ---- -"@rocket.chat/meteor": patch ---- - -Introduced a new step to the queue worker: when an inquiry that's on an improper status is selected for processing, queue worker will first check its status and will attempt to fix it. -For example, if an inquiry points to a closed room, there's no point in processing, system will now remove the inquiry -If an inquiry is already taken, the inquiry will be updated to reflect the new status and clean the queue. - -This prevents issues where the queue worker attempted to process an inquiry _forever_ because it was in an improper state. diff --git a/apps/meteor/CHANGELOG.md b/apps/meteor/CHANGELOG.md index 51271a641dad..e772f2abee3e 100644 --- a/apps/meteor/CHANGELOG.md +++ b/apps/meteor/CHANGELOG.md @@ -1,5 +1,43 @@ # @rocket.chat/meteor +## 6.6.5 + +### Patch Changes + +- Bump @rocket.chat/meteor version. + +- Bump @rocket.chat/meteor version. + +- ([#31998](https://github.com/RocketChat/Rocket.Chat/pull/31998)) Introduced a new step to the queue worker: when an inquiry that's on an improper status is selected for processing, queue worker will first check its status and will attempt to fix it. + For example, if an inquiry points to a closed room, there's no point in processing, system will now remove the inquiry + If an inquiry is already taken, the inquiry will be updated to reflect the new status and clean the queue. + + This prevents issues where the queue worker attempted to process an inquiry _forever_ because it was in an improper state. + +-
Updated dependencies []: + + - @rocket.chat/ui-contexts@4.0.5 + - @rocket.chat/ui-theming@0.1.2 + - @rocket.chat/fuselage-ui-kit@4.0.5 + - @rocket.chat/gazzodown@4.0.5 + - @rocket.chat/ui-client@4.0.5 + - @rocket.chat/ui-video-conf@4.0.5 + - @rocket.chat/web-ui-registration@4.0.5 + - @rocket.chat/core-typings@6.6.5 + - @rocket.chat/rest-typings@6.6.5 + - @rocket.chat/api-client@0.1.27 + - @rocket.chat/license@0.1.9 + - @rocket.chat/omnichannel-services@0.1.9 + - @rocket.chat/pdf-worker@0.0.33 + - @rocket.chat/presence@0.1.9 + - @rocket.chat/core-services@0.3.9 + - @rocket.chat/cron@0.0.29 + - @rocket.chat/model-typings@0.3.5 + - @rocket.chat/server-cloud-communication@0.0.2 + - @rocket.chat/models@0.0.33 + - @rocket.chat/instance-status@0.0.33 +
+ ## 6.6.4 ### Patch Changes diff --git a/apps/meteor/app/utils/rocketchat.info b/apps/meteor/app/utils/rocketchat.info index 803a115e25a3..4e361ccf9bfd 100644 --- a/apps/meteor/app/utils/rocketchat.info +++ b/apps/meteor/app/utils/rocketchat.info @@ -1,3 +1,3 @@ { - "version": "6.6.4" + "version": "6.6.5" } diff --git a/apps/meteor/ee/server/services/CHANGELOG.md b/apps/meteor/ee/server/services/CHANGELOG.md index 6aebf0f3f502..624b9596863a 100644 --- a/apps/meteor/ee/server/services/CHANGELOG.md +++ b/apps/meteor/ee/server/services/CHANGELOG.md @@ -1,5 +1,18 @@ # rocketchat-services +## 1.1.27 + +### Patch Changes + +-
Updated dependencies []: + + - @rocket.chat/core-typings@6.6.5 + - @rocket.chat/rest-typings@6.6.5 + - @rocket.chat/core-services@0.3.9 + - @rocket.chat/model-typings@0.3.5 + - @rocket.chat/models@0.0.33 +
+ ## 1.1.26 ### Patch Changes diff --git a/apps/meteor/ee/server/services/package.json b/apps/meteor/ee/server/services/package.json index 1ebe3d648c6f..cd0d4845c562 100644 --- a/apps/meteor/ee/server/services/package.json +++ b/apps/meteor/ee/server/services/package.json @@ -1,7 +1,7 @@ { "name": "rocketchat-services", "private": true, - "version": "1.1.26", + "version": "1.1.27", "description": "Rocket.Chat Authorization service", "main": "index.js", "scripts": { diff --git a/apps/meteor/package.json b/apps/meteor/package.json index 1384ad35044a..3f8003573ee7 100644 --- a/apps/meteor/package.json +++ b/apps/meteor/package.json @@ -1,7 +1,7 @@ { "name": "@rocket.chat/meteor", "description": "The Ultimate Open Source WebChat Platform", - "version": "6.6.4", + "version": "6.6.5", "private": true, "author": { "name": "Rocket.Chat", diff --git a/ee/apps/account-service/CHANGELOG.md b/ee/apps/account-service/CHANGELOG.md index da77898d4d62..3374428bcbfd 100644 --- a/ee/apps/account-service/CHANGELOG.md +++ b/ee/apps/account-service/CHANGELOG.md @@ -1,5 +1,18 @@ # @rocket.chat/account-service +## 0.3.9 + +### Patch Changes + +-
Updated dependencies []: + + - @rocket.chat/core-typings@6.6.5 + - @rocket.chat/rest-typings@6.6.5 + - @rocket.chat/core-services@0.3.9 + - @rocket.chat/model-typings@0.3.5 + - @rocket.chat/models@0.0.33 +
+ ## 0.3.8 ### Patch Changes diff --git a/ee/apps/account-service/package.json b/ee/apps/account-service/package.json index af7a4f455fe2..32cba36dccdf 100644 --- a/ee/apps/account-service/package.json +++ b/ee/apps/account-service/package.json @@ -1,7 +1,7 @@ { "name": "@rocket.chat/account-service", "private": true, - "version": "0.3.8", + "version": "0.3.9", "description": "Rocket.Chat Account service", "scripts": { "build": "tsc -p tsconfig.json", diff --git a/ee/apps/authorization-service/CHANGELOG.md b/ee/apps/authorization-service/CHANGELOG.md index 4517934fb510..2027533306ed 100644 --- a/ee/apps/authorization-service/CHANGELOG.md +++ b/ee/apps/authorization-service/CHANGELOG.md @@ -1,5 +1,18 @@ # @rocket.chat/authorization-service +## 0.3.9 + +### Patch Changes + +-
Updated dependencies []: + + - @rocket.chat/core-typings@6.6.5 + - @rocket.chat/rest-typings@6.6.5 + - @rocket.chat/core-services@0.3.9 + - @rocket.chat/model-typings@0.3.5 + - @rocket.chat/models@0.0.33 +
+ ## 0.3.8 ### Patch Changes diff --git a/ee/apps/authorization-service/package.json b/ee/apps/authorization-service/package.json index 8ceff7050118..c4ab73ce7801 100644 --- a/ee/apps/authorization-service/package.json +++ b/ee/apps/authorization-service/package.json @@ -1,7 +1,7 @@ { "name": "@rocket.chat/authorization-service", "private": true, - "version": "0.3.8", + "version": "0.3.9", "description": "Rocket.Chat Authorization service", "scripts": { "build": "tsc -p tsconfig.json", diff --git a/ee/apps/ddp-streamer/CHANGELOG.md b/ee/apps/ddp-streamer/CHANGELOG.md index 519d7e7bba0f..a88c39b16502 100644 --- a/ee/apps/ddp-streamer/CHANGELOG.md +++ b/ee/apps/ddp-streamer/CHANGELOG.md @@ -1,5 +1,20 @@ # @rocket.chat/ddp-streamer +## 0.2.8 + +### Patch Changes + +-
Updated dependencies []: + + - @rocket.chat/ui-contexts@4.0.5 + - @rocket.chat/core-typings@6.6.5 + - @rocket.chat/rest-typings@6.6.5 + - @rocket.chat/core-services@0.3.9 + - @rocket.chat/model-typings@0.3.5 + - @rocket.chat/models@0.0.33 + - @rocket.chat/instance-status@0.0.33 +
+ ## 0.2.7 ### Patch Changes diff --git a/ee/apps/ddp-streamer/package.json b/ee/apps/ddp-streamer/package.json index 2c5977778eb4..3665ba917b95 100644 --- a/ee/apps/ddp-streamer/package.json +++ b/ee/apps/ddp-streamer/package.json @@ -1,7 +1,7 @@ { "name": "@rocket.chat/ddp-streamer", "private": true, - "version": "0.2.7", + "version": "0.2.8", "description": "Rocket.Chat DDP-Streamer service", "scripts": { "build": "tsc -p tsconfig.json", diff --git a/ee/apps/omnichannel-transcript/CHANGELOG.md b/ee/apps/omnichannel-transcript/CHANGELOG.md index 20c321a0477e..69695b4c9326 100644 --- a/ee/apps/omnichannel-transcript/CHANGELOG.md +++ b/ee/apps/omnichannel-transcript/CHANGELOG.md @@ -1,5 +1,19 @@ # @rocket.chat/omnichannel-transcript +## 0.3.9 + +### Patch Changes + +-
Updated dependencies []: + + - @rocket.chat/core-typings@6.6.5 + - @rocket.chat/omnichannel-services@0.1.9 + - @rocket.chat/pdf-worker@0.0.33 + - @rocket.chat/core-services@0.3.9 + - @rocket.chat/model-typings@0.3.5 + - @rocket.chat/models@0.0.33 +
+ ## 0.3.8 ### Patch Changes diff --git a/ee/apps/omnichannel-transcript/package.json b/ee/apps/omnichannel-transcript/package.json index 12e00c707292..b140e06952d2 100644 --- a/ee/apps/omnichannel-transcript/package.json +++ b/ee/apps/omnichannel-transcript/package.json @@ -1,7 +1,7 @@ { "name": "@rocket.chat/omnichannel-transcript", "private": true, - "version": "0.3.8", + "version": "0.3.9", "description": "Rocket.Chat service", "scripts": { "build": "tsc -p tsconfig.json", diff --git a/ee/apps/presence-service/CHANGELOG.md b/ee/apps/presence-service/CHANGELOG.md index 975c7c9f3c93..947a128cc6f5 100644 --- a/ee/apps/presence-service/CHANGELOG.md +++ b/ee/apps/presence-service/CHANGELOG.md @@ -1,5 +1,18 @@ # @rocket.chat/presence-service +## 0.3.9 + +### Patch Changes + +-
Updated dependencies []: + + - @rocket.chat/core-typings@6.6.5 + - @rocket.chat/presence@0.1.9 + - @rocket.chat/core-services@0.3.9 + - @rocket.chat/model-typings@0.3.5 + - @rocket.chat/models@0.0.33 +
+ ## 0.3.8 ### Patch Changes diff --git a/ee/apps/presence-service/package.json b/ee/apps/presence-service/package.json index 37d49b373b7f..4872c2ad4041 100644 --- a/ee/apps/presence-service/package.json +++ b/ee/apps/presence-service/package.json @@ -1,7 +1,7 @@ { "name": "@rocket.chat/presence-service", "private": true, - "version": "0.3.8", + "version": "0.3.9", "description": "Rocket.Chat Presence service", "scripts": { "build": "tsc -p tsconfig.json", diff --git a/ee/apps/queue-worker/CHANGELOG.md b/ee/apps/queue-worker/CHANGELOG.md index 889b7650dc2e..6fecc6f59a64 100644 --- a/ee/apps/queue-worker/CHANGELOG.md +++ b/ee/apps/queue-worker/CHANGELOG.md @@ -1,5 +1,18 @@ # @rocket.chat/queue-worker +## 0.3.9 + +### Patch Changes + +-
Updated dependencies []: + + - @rocket.chat/core-typings@6.6.5 + - @rocket.chat/omnichannel-services@0.1.9 + - @rocket.chat/core-services@0.3.9 + - @rocket.chat/model-typings@0.3.5 + - @rocket.chat/models@0.0.33 +
+ ## 0.3.8 ### Patch Changes diff --git a/ee/apps/queue-worker/package.json b/ee/apps/queue-worker/package.json index 0dc49aef5462..c462533f66f9 100644 --- a/ee/apps/queue-worker/package.json +++ b/ee/apps/queue-worker/package.json @@ -1,7 +1,7 @@ { "name": "@rocket.chat/queue-worker", "private": true, - "version": "0.3.8", + "version": "0.3.9", "description": "Rocket.Chat service", "scripts": { "build": "tsc -p tsconfig.json", diff --git a/ee/apps/stream-hub-service/CHANGELOG.md b/ee/apps/stream-hub-service/CHANGELOG.md index 5dfe1c67445d..1cd40c35eb83 100644 --- a/ee/apps/stream-hub-service/CHANGELOG.md +++ b/ee/apps/stream-hub-service/CHANGELOG.md @@ -1,5 +1,17 @@ # @rocket.chat/stream-hub-service +## 0.3.9 + +### Patch Changes + +-
Updated dependencies []: + + - @rocket.chat/core-typings@6.6.5 + - @rocket.chat/core-services@0.3.9 + - @rocket.chat/model-typings@0.3.5 + - @rocket.chat/models@0.0.33 +
+ ## 0.3.8 ### Patch Changes diff --git a/ee/apps/stream-hub-service/package.json b/ee/apps/stream-hub-service/package.json index dd6f84172dad..6218ef405215 100644 --- a/ee/apps/stream-hub-service/package.json +++ b/ee/apps/stream-hub-service/package.json @@ -1,7 +1,7 @@ { "name": "@rocket.chat/stream-hub-service", "private": true, - "version": "0.3.8", + "version": "0.3.9", "description": "Rocket.Chat Stream Hub service", "scripts": { "build": "tsc -p tsconfig.json", diff --git a/ee/packages/api-client/CHANGELOG.md b/ee/packages/api-client/CHANGELOG.md index bc0db671297a..2a5c097bf177 100644 --- a/ee/packages/api-client/CHANGELOG.md +++ b/ee/packages/api-client/CHANGELOG.md @@ -1,5 +1,15 @@ # @rocket.chat/api-client +## 0.1.27 + +### Patch Changes + +-
Updated dependencies []: + + - @rocket.chat/core-typings@6.6.5 + - @rocket.chat/rest-typings@6.6.5 +
+ ## 0.1.26 ### Patch Changes diff --git a/ee/packages/api-client/package.json b/ee/packages/api-client/package.json index 13d31b0466f3..69815951a137 100644 --- a/ee/packages/api-client/package.json +++ b/ee/packages/api-client/package.json @@ -1,7 +1,7 @@ { "name": "@rocket.chat/api-client", "private": true, - "version": "0.1.26", + "version": "0.1.27", "devDependencies": { "@swc/core": "^1.3.95", "@swc/jest": "^0.2.29", diff --git a/ee/packages/ddp-client/CHANGELOG.md b/ee/packages/ddp-client/CHANGELOG.md index 85c7de8449f6..ae0c615b8685 100644 --- a/ee/packages/ddp-client/CHANGELOG.md +++ b/ee/packages/ddp-client/CHANGELOG.md @@ -1,5 +1,17 @@ # @rocket.chat/ddp-client +## 0.2.18 + +### Patch Changes + +- ([#31941](https://github.com/RocketChat/Rocket.Chat/pull/31941)) fix: livechat sdk reconnect not resubscribing + +-
Updated dependencies []: + + - @rocket.chat/rest-typings@6.6.5 + - @rocket.chat/api-client@0.1.27 +
+ ## 0.2.17 ### Patch Changes diff --git a/ee/packages/ddp-client/package.json b/ee/packages/ddp-client/package.json index f49ff62e1f9d..b723cc20d1f3 100644 --- a/ee/packages/ddp-client/package.json +++ b/ee/packages/ddp-client/package.json @@ -1,7 +1,7 @@ { "name": "@rocket.chat/ddp-client", "private": true, - "version": "0.2.17", + "version": "0.2.18", "devDependencies": { "@swc/core": "^1.3.95", "@swc/jest": "^0.2.29", diff --git a/ee/packages/license/CHANGELOG.md b/ee/packages/license/CHANGELOG.md index 7bdce01990de..476c74e6e0cd 100644 --- a/ee/packages/license/CHANGELOG.md +++ b/ee/packages/license/CHANGELOG.md @@ -1,5 +1,14 @@ # @rocket.chat/license +## 0.1.9 + +### Patch Changes + +-
Updated dependencies []: + + - @rocket.chat/core-typings@6.6.5 +
+ ## 0.1.8 ### Patch Changes diff --git a/ee/packages/license/package.json b/ee/packages/license/package.json index 88fc2b2d4d20..785cbb503c3f 100644 --- a/ee/packages/license/package.json +++ b/ee/packages/license/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/license", - "version": "0.1.8", + "version": "0.1.9", "private": true, "devDependencies": { "@swc/core": "^1.3.95", diff --git a/ee/packages/omnichannel-services/CHANGELOG.md b/ee/packages/omnichannel-services/CHANGELOG.md index 246f91f1b04e..1a95e9c5a10a 100644 --- a/ee/packages/omnichannel-services/CHANGELOG.md +++ b/ee/packages/omnichannel-services/CHANGELOG.md @@ -1,5 +1,19 @@ # @rocket.chat/omnichannel-services +## 0.1.9 + +### Patch Changes + +-
Updated dependencies []: + + - @rocket.chat/core-typings@6.6.5 + - @rocket.chat/rest-typings@6.6.5 + - @rocket.chat/pdf-worker@0.0.33 + - @rocket.chat/core-services@0.3.9 + - @rocket.chat/model-typings@0.3.5 + - @rocket.chat/models@0.0.33 +
+ ## 0.1.8 ### Patch Changes diff --git a/ee/packages/omnichannel-services/package.json b/ee/packages/omnichannel-services/package.json index 01f137c14d17..1939fd360c9e 100644 --- a/ee/packages/omnichannel-services/package.json +++ b/ee/packages/omnichannel-services/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/omnichannel-services", - "version": "0.1.8", + "version": "0.1.9", "private": true, "devDependencies": { "@rocket.chat/eslint-config": "workspace:^", diff --git a/ee/packages/pdf-worker/CHANGELOG.md b/ee/packages/pdf-worker/CHANGELOG.md index 83e90f1b8b15..dde2f84f7cdf 100644 --- a/ee/packages/pdf-worker/CHANGELOG.md +++ b/ee/packages/pdf-worker/CHANGELOG.md @@ -1,5 +1,14 @@ # @rocket.chat/pdf-worker +## 0.0.33 + +### Patch Changes + +-
Updated dependencies []: + + - @rocket.chat/core-typings@6.6.5 +
+ ## 0.0.32 ### Patch Changes diff --git a/ee/packages/pdf-worker/package.json b/ee/packages/pdf-worker/package.json index a71c914c6cbb..363e23bf7a31 100644 --- a/ee/packages/pdf-worker/package.json +++ b/ee/packages/pdf-worker/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/pdf-worker", - "version": "0.0.32", + "version": "0.0.33", "private": true, "devDependencies": { "@storybook/addon-essentials": "~6.5.16", diff --git a/ee/packages/presence/CHANGELOG.md b/ee/packages/presence/CHANGELOG.md index accd0042983e..c0df3d665627 100644 --- a/ee/packages/presence/CHANGELOG.md +++ b/ee/packages/presence/CHANGELOG.md @@ -1,5 +1,16 @@ # @rocket.chat/presence +## 0.1.9 + +### Patch Changes + +-
Updated dependencies []: + + - @rocket.chat/core-typings@6.6.5 + - @rocket.chat/core-services@0.3.9 + - @rocket.chat/models@0.0.33 +
+ ## 0.1.8 ### Patch Changes diff --git a/ee/packages/presence/package.json b/ee/packages/presence/package.json index bc465b59ed7c..4341948053b2 100644 --- a/ee/packages/presence/package.json +++ b/ee/packages/presence/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/presence", - "version": "0.1.8", + "version": "0.1.9", "private": true, "devDependencies": { "@babel/core": "~7.22.20", diff --git a/package.json b/package.json index 261c440f288c..a9592b9f3040 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "rocket.chat", - "version": "6.6.4", + "version": "6.6.5", "description": "Rocket.Chat Monorepo", "main": "index.js", "private": true, diff --git a/packages/core-services/CHANGELOG.md b/packages/core-services/CHANGELOG.md index f7d8e1a3f921..d6c97affc3d3 100644 --- a/packages/core-services/CHANGELOG.md +++ b/packages/core-services/CHANGELOG.md @@ -1,5 +1,16 @@ # @rocket.chat/core-services +## 0.3.9 + +### Patch Changes + +-
Updated dependencies []: + + - @rocket.chat/core-typings@6.6.5 + - @rocket.chat/rest-typings@6.6.5 + - @rocket.chat/models@0.0.33 +
+ ## 0.3.8 ### Patch Changes diff --git a/packages/core-services/package.json b/packages/core-services/package.json index 3cfc79f233d5..a30be0955f98 100644 --- a/packages/core-services/package.json +++ b/packages/core-services/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/core-services", - "version": "0.3.8", + "version": "0.3.9", "private": true, "devDependencies": { "@babel/core": "~7.22.20", diff --git a/packages/core-typings/CHANGELOG.md b/packages/core-typings/CHANGELOG.md index 51c896d9d43b..9ba518b47f49 100644 --- a/packages/core-typings/CHANGELOG.md +++ b/packages/core-typings/CHANGELOG.md @@ -1,5 +1,7 @@ # @rocket.chat/core-typings +## 6.6.5 + ## 6.6.4 ## 6.6.3 diff --git a/packages/core-typings/package.json b/packages/core-typings/package.json index 8b0dff531cfd..49240250fd8e 100644 --- a/packages/core-typings/package.json +++ b/packages/core-typings/package.json @@ -2,7 +2,7 @@ "$schema": "https://json.schemastore.org/package", "name": "@rocket.chat/core-typings", "private": true, - "version": "6.6.4", + "version": "6.6.5", "devDependencies": { "@rocket.chat/eslint-config": "workspace:^", "eslint": "~8.45.0", diff --git a/packages/cron/CHANGELOG.md b/packages/cron/CHANGELOG.md index 4b3b0cc7c031..7094178ecdb1 100644 --- a/packages/cron/CHANGELOG.md +++ b/packages/cron/CHANGELOG.md @@ -1,5 +1,15 @@ # @rocket.chat/cron +## 0.0.29 + +### Patch Changes + +-
Updated dependencies []: + + - @rocket.chat/core-typings@6.6.5 + - @rocket.chat/models@0.0.33 +
+ ## 0.0.28 ### Patch Changes diff --git a/packages/cron/package.json b/packages/cron/package.json index 48e00eb42011..002b83f53f48 100644 --- a/packages/cron/package.json +++ b/packages/cron/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/cron", - "version": "0.0.28", + "version": "0.0.29", "private": true, "devDependencies": { "@types/jest": "~29.5.7", diff --git a/packages/fuselage-ui-kit/CHANGELOG.md b/packages/fuselage-ui-kit/CHANGELOG.md index efa96f33eab2..bf8d0b4fc696 100644 --- a/packages/fuselage-ui-kit/CHANGELOG.md +++ b/packages/fuselage-ui-kit/CHANGELOG.md @@ -1,5 +1,16 @@ # Change Log +## 4.0.5 + +### Patch Changes + +-
Updated dependencies []: + + - @rocket.chat/ui-contexts@4.0.5 + - @rocket.chat/gazzodown@4.0.5 + - @rocket.chat/ui-video-conf@4.0.5 +
+ ## 4.0.4 ### Patch Changes diff --git a/packages/fuselage-ui-kit/package.json b/packages/fuselage-ui-kit/package.json index 37d3be23aff3..697af4205e1d 100644 --- a/packages/fuselage-ui-kit/package.json +++ b/packages/fuselage-ui-kit/package.json @@ -1,7 +1,7 @@ { "name": "@rocket.chat/fuselage-ui-kit", "private": true, - "version": "4.0.4", + "version": "4.0.5", "description": "UiKit elements for Rocket.Chat Apps built under Fuselage design system", "homepage": "https://rocketchat.github.io/Rocket.Chat.Fuselage/", "author": { @@ -48,9 +48,9 @@ "@rocket.chat/icons": "*", "@rocket.chat/prettier-config": "*", "@rocket.chat/styled": "*", - "@rocket.chat/ui-contexts": "4.0.4", + "@rocket.chat/ui-contexts": "4.0.5", "@rocket.chat/ui-kit": "0.33.0", - "@rocket.chat/ui-video-conf": "4.0.4", + "@rocket.chat/ui-video-conf": "4.0.5", "@tanstack/react-query": "*", "react": "*", "react-dom": "*" diff --git a/packages/gazzodown/CHANGELOG.md b/packages/gazzodown/CHANGELOG.md index dcfb8ee1c4af..7982a5312f79 100644 --- a/packages/gazzodown/CHANGELOG.md +++ b/packages/gazzodown/CHANGELOG.md @@ -1,5 +1,16 @@ # @rocket.chat/gazzodown +## 4.0.5 + +### Patch Changes + +-
Updated dependencies []: + + - @rocket.chat/ui-contexts@4.0.5 + - @rocket.chat/ui-client@4.0.5 + - @rocket.chat/core-typings@6.6.5 +
+ ## 4.0.4 ### Patch Changes diff --git a/packages/gazzodown/package.json b/packages/gazzodown/package.json index c8d9cbf49336..ac823753875c 100644 --- a/packages/gazzodown/package.json +++ b/packages/gazzodown/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/gazzodown", - "version": "4.0.4", + "version": "4.0.5", "private": true, "devDependencies": { "@babel/core": "~7.22.20", @@ -65,14 +65,14 @@ "/dist" ], "peerDependencies": { - "@rocket.chat/core-typings": "6.6.4", + "@rocket.chat/core-typings": "6.6.5", "@rocket.chat/css-in-js": "*", "@rocket.chat/fuselage": "*", "@rocket.chat/fuselage-tokens": "*", "@rocket.chat/message-parser": "*", "@rocket.chat/styled": "*", - "@rocket.chat/ui-client": "4.0.4", - "@rocket.chat/ui-contexts": "4.0.4", + "@rocket.chat/ui-client": "4.0.5", + "@rocket.chat/ui-contexts": "4.0.5", "katex": "*", "react": "*" }, diff --git a/packages/instance-status/CHANGELOG.md b/packages/instance-status/CHANGELOG.md index b7c7dd019f36..c00f2d43241a 100644 --- a/packages/instance-status/CHANGELOG.md +++ b/packages/instance-status/CHANGELOG.md @@ -1,5 +1,14 @@ # @rocket.chat/instance-status +## 0.0.33 + +### Patch Changes + +-
Updated dependencies []: + + - @rocket.chat/models@0.0.33 +
+ ## 0.0.32 ### Patch Changes diff --git a/packages/instance-status/package.json b/packages/instance-status/package.json index 6e13dd4a983a..dd2c0040f89a 100644 --- a/packages/instance-status/package.json +++ b/packages/instance-status/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/instance-status", - "version": "0.0.32", + "version": "0.0.33", "private": true, "devDependencies": { "@rocket.chat/eslint-config": "workspace:^", diff --git a/packages/livechat/CHANGELOG.md b/packages/livechat/CHANGELOG.md index 03fe1474bf39..8af1cf11e0e9 100644 --- a/packages/livechat/CHANGELOG.md +++ b/packages/livechat/CHANGELOG.md @@ -1,5 +1,16 @@ # @rocket.chat/livechat Change Log +## 1.14.18 + +### Patch Changes + +- ([#31792](https://github.com/RocketChat/Rocket.Chat/pull/31792)) Fixes issue of the `setDepartment` Livechat API method not setting the store value properly (is was only setting on the guest object) + +-
Updated dependencies []: + + - @rocket.chat/gazzodown@4.0.5 +
+ ## 1.14.17 ### Patch Changes diff --git a/packages/livechat/package.json b/packages/livechat/package.json index da6b96d974ca..8ed90fcffa65 100644 --- a/packages/livechat/package.json +++ b/packages/livechat/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/livechat", - "version": "1.14.17", + "version": "1.14.18", "files": [ "/build" ], diff --git a/packages/model-typings/CHANGELOG.md b/packages/model-typings/CHANGELOG.md index abe46dbcf09a..9239a584f046 100644 --- a/packages/model-typings/CHANGELOG.md +++ b/packages/model-typings/CHANGELOG.md @@ -1,5 +1,14 @@ # @rocket.chat/model-typings +## 0.3.5 + +### Patch Changes + +-
Updated dependencies []: + + - @rocket.chat/core-typings@6.6.5 +
+ ## 0.3.4 ### Patch Changes diff --git a/packages/model-typings/package.json b/packages/model-typings/package.json index d1ae03563adf..86fc5368f426 100644 --- a/packages/model-typings/package.json +++ b/packages/model-typings/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/model-typings", - "version": "0.3.4", + "version": "0.3.5", "private": true, "devDependencies": { "@types/jest": "~29.5.7", diff --git a/packages/models/CHANGELOG.md b/packages/models/CHANGELOG.md index 2a31ed572b93..c19627dc9b47 100644 --- a/packages/models/CHANGELOG.md +++ b/packages/models/CHANGELOG.md @@ -1,5 +1,14 @@ # @rocket.chat/models +## 0.0.33 + +### Patch Changes + +-
Updated dependencies []: + + - @rocket.chat/model-typings@0.3.5 +
+ ## 0.0.32 ### Patch Changes diff --git a/packages/models/package.json b/packages/models/package.json index 9fcfe8da679d..730765cd6778 100644 --- a/packages/models/package.json +++ b/packages/models/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/models", - "version": "0.0.32", + "version": "0.0.33", "private": true, "devDependencies": { "@types/jest": "~29.5.7", diff --git a/packages/rest-typings/CHANGELOG.md b/packages/rest-typings/CHANGELOG.md index 7b4bf1abc9fb..95d0a66c220d 100644 --- a/packages/rest-typings/CHANGELOG.md +++ b/packages/rest-typings/CHANGELOG.md @@ -1,5 +1,14 @@ # @rocket.chat/rest-typings +## 6.6.5 + +### Patch Changes + +-
Updated dependencies []: + + - @rocket.chat/core-typings@6.6.5 +
+ ## 6.6.4 ### Patch Changes diff --git a/packages/rest-typings/package.json b/packages/rest-typings/package.json index 011223ed27cf..b677af5d2ffa 100644 --- a/packages/rest-typings/package.json +++ b/packages/rest-typings/package.json @@ -1,7 +1,7 @@ { "name": "@rocket.chat/rest-typings", "private": true, - "version": "6.6.4", + "version": "6.6.5", "devDependencies": { "@rocket.chat/eslint-config": "workspace:^", "@types/jest": "~29.5.7", diff --git a/packages/ui-client/CHANGELOG.md b/packages/ui-client/CHANGELOG.md index 7c38755e135c..9fda5551a98e 100644 --- a/packages/ui-client/CHANGELOG.md +++ b/packages/ui-client/CHANGELOG.md @@ -1,5 +1,14 @@ # @rocket.chat/ui-client +## 4.0.5 + +### Patch Changes + +-
Updated dependencies []: + + - @rocket.chat/ui-contexts@4.0.5 +
+ ## 4.0.4 ### Patch Changes diff --git a/packages/ui-client/package.json b/packages/ui-client/package.json index 079a8e9678bd..5895cd8f7a34 100644 --- a/packages/ui-client/package.json +++ b/packages/ui-client/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/ui-client", - "version": "4.0.4", + "version": "4.0.5", "private": true, "devDependencies": { "@babel/core": "~7.22.20", @@ -63,7 +63,7 @@ "@rocket.chat/fuselage": "*", "@rocket.chat/fuselage-hooks": "*", "@rocket.chat/icons": "*", - "@rocket.chat/ui-contexts": "4.0.4", + "@rocket.chat/ui-contexts": "4.0.5", "react": "~17.0.2" }, "volta": { diff --git a/packages/ui-contexts/CHANGELOG.md b/packages/ui-contexts/CHANGELOG.md index 5bc3b573c465..db1b4c8f50a8 100644 --- a/packages/ui-contexts/CHANGELOG.md +++ b/packages/ui-contexts/CHANGELOG.md @@ -1,5 +1,16 @@ # @rocket.chat/ui-contexts +## 4.0.5 + +### Patch Changes + +-
Updated dependencies [6476aa947c]: + + - @rocket.chat/ddp-client@0.2.18 + - @rocket.chat/core-typings@6.6.5 + - @rocket.chat/rest-typings@6.6.5 +
+ ## 4.0.4 ### Patch Changes diff --git a/packages/ui-contexts/package.json b/packages/ui-contexts/package.json index 8ea66e29b48e..b919bf2382ff 100644 --- a/packages/ui-contexts/package.json +++ b/packages/ui-contexts/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/ui-contexts", - "version": "4.0.4", + "version": "4.0.5", "private": true, "devDependencies": { "@rocket.chat/core-typings": "workspace:^", diff --git a/packages/ui-video-conf/CHANGELOG.md b/packages/ui-video-conf/CHANGELOG.md index 91fd3e6cdb53..2c7af32e5d0d 100644 --- a/packages/ui-video-conf/CHANGELOG.md +++ b/packages/ui-video-conf/CHANGELOG.md @@ -1,5 +1,14 @@ # @rocket.chat/ui-video-conf +## 4.0.5 + +### Patch Changes + +-
Updated dependencies []: + + - @rocket.chat/ui-contexts@4.0.5 +
+ ## 4.0.4 ### Patch Changes diff --git a/packages/ui-video-conf/package.json b/packages/ui-video-conf/package.json index 1c7fa6d4cbbb..0af4f828cb95 100644 --- a/packages/ui-video-conf/package.json +++ b/packages/ui-video-conf/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/ui-video-conf", - "version": "4.0.4", + "version": "4.0.5", "private": true, "devDependencies": { "@babel/core": "~7.22.20", @@ -35,7 +35,7 @@ "@rocket.chat/fuselage-hooks": "*", "@rocket.chat/icons": "*", "@rocket.chat/styled": "*", - "@rocket.chat/ui-contexts": "4.0.4", + "@rocket.chat/ui-contexts": "4.0.5", "react": "^17.0.2", "react-dom": "^17.0.2" }, diff --git a/packages/uikit-playground/CHANGELOG.md b/packages/uikit-playground/CHANGELOG.md index 6cf49f0404ed..efba9b4370ab 100644 --- a/packages/uikit-playground/CHANGELOG.md +++ b/packages/uikit-playground/CHANGELOG.md @@ -1,5 +1,15 @@ # @rocket.chat/uikit-playground +## 0.2.18 + +### Patch Changes + +-
Updated dependencies []: + + - @rocket.chat/ui-contexts@4.0.5 + - @rocket.chat/fuselage-ui-kit@4.0.5 +
+ ## 0.2.17 ### Patch Changes diff --git a/packages/uikit-playground/package.json b/packages/uikit-playground/package.json index f4578393e496..a12ac8c3e0dd 100644 --- a/packages/uikit-playground/package.json +++ b/packages/uikit-playground/package.json @@ -1,7 +1,7 @@ { "name": "@rocket.chat/uikit-playground", "private": true, - "version": "0.2.17", + "version": "0.2.18", "type": "module", "scripts": { "dev": "vite", diff --git a/packages/web-ui-registration/CHANGELOG.md b/packages/web-ui-registration/CHANGELOG.md index 28cc9a5d32bb..6bf35ae8a0d2 100644 --- a/packages/web-ui-registration/CHANGELOG.md +++ b/packages/web-ui-registration/CHANGELOG.md @@ -1,5 +1,14 @@ # @rocket.chat/web-ui-registration +## 4.0.5 + +### Patch Changes + +-
Updated dependencies []: + + - @rocket.chat/ui-contexts@4.0.5 +
+ ## 4.0.4 ### Patch Changes diff --git a/packages/web-ui-registration/package.json b/packages/web-ui-registration/package.json index fa8e6d6ad523..eda30e3d1ae2 100644 --- a/packages/web-ui-registration/package.json +++ b/packages/web-ui-registration/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/web-ui-registration", - "version": "4.0.4", + "version": "4.0.5", "private": true, "homepage": "https://rocket.chat", "main": "./dist/index.js", @@ -51,7 +51,7 @@ "peerDependencies": { "@rocket.chat/layout": "*", "@rocket.chat/tools": "0.2.1", - "@rocket.chat/ui-contexts": "4.0.4", + "@rocket.chat/ui-contexts": "4.0.5", "@tanstack/react-query": "*", "react": "*", "react-hook-form": "*", From c8b11da29f7ebc88b842c881351703d54fce9d3f Mon Sep 17 00:00:00 2001 From: Martin Schoeler Date: Thu, 21 Mar 2024 14:57:55 -0300 Subject: [PATCH 20/79] test(Livechat): More Livechat Tests (#31995) --- .../omnichannel-livechat-department.spec.ts | 122 ++++++++++++++++++ .../omnichannel/omnichannel-livechat.spec.ts | 119 ++++++++++++++++- .../e2e/page-objects/home-omnichannel.ts | 2 +- .../e2e/page-objects/omnichannel-livechat.ts | 40 +++++- .../e2e/utils/omnichannel/departments.ts | 58 +++++++-- .../livechat/src/components/Header/index.tsx | 2 +- .../src/routes/SwitchDepartment/index.tsx | 2 +- 7 files changed, 319 insertions(+), 26 deletions(-) create mode 100644 apps/meteor/tests/e2e/omnichannel/omnichannel-livechat-department.spec.ts diff --git a/apps/meteor/tests/e2e/omnichannel/omnichannel-livechat-department.spec.ts b/apps/meteor/tests/e2e/omnichannel/omnichannel-livechat-department.spec.ts new file mode 100644 index 000000000000..fe820a71f62c --- /dev/null +++ b/apps/meteor/tests/e2e/omnichannel/omnichannel-livechat-department.spec.ts @@ -0,0 +1,122 @@ +import { faker } from '@faker-js/faker'; + +import { IS_EE } from '../config/constants'; +import { createAuxContext } from '../fixtures/createAuxContext'; +import { Users } from '../fixtures/userStates'; +import { HomeOmnichannel, OmnichannelLiveChat } from '../page-objects'; +import { createAgent } from '../utils/omnichannel/agents'; +import { addAgentToDepartment, createDepartment } from '../utils/omnichannel/departments'; +import { test, expect } from '../utils/test'; + +const firstUser = { + name: `${faker.person.firstName()} ${faker.string.uuid()}}`, + email: faker.internet.email(), +}; + +test.use({ storageState: Users.user1.state }); + +test.describe('OC - Livechat - Department Flow', () => { + // Needs Departments to test this, so needs an EE license for multiple deps + test.skip(!IS_EE, 'Enterprise Only'); + + let poLiveChat: OmnichannelLiveChat; + let poHomeOmnichannelAgent1: HomeOmnichannel; + let poHomeOmnichannelAgent2: HomeOmnichannel; + let departments: Awaited>[]; + let departmentA: Awaited>['data']; + let departmentB: Awaited>['data']; + let agents: Awaited>[]; + let agent1: Awaited>['data']; + let agent2: Awaited>['data']; + + test.beforeAll(async ({ api }) => { + // Assign agents & departments + agents = await Promise.all([createAgent(api, 'user1'), createAgent(api, 'user2')]); + [agent1, agent2] = agents.map(({ data }) => data); + departments = await Promise.all([ + createDepartment(api, { showOnRegistration: true }), + createDepartment(api, { showOnRegistration: true }), + ]); + [departmentA, departmentB] = departments.map(({ data }) => data); + await addAgentToDepartment(api, { department: departmentA, agentId: agent1._id }); + await addAgentToDepartment(api, { department: departmentB, agentId: agent2._id }); + }); + + test.beforeEach(async ({ page, api, browser }) => { + // Create Pages + const { page: agent1Page } = await createAuxContext(browser, Users.user1, '/', true); + poHomeOmnichannelAgent1 = new HomeOmnichannel(agent1Page); + const { page: agent2Page } = await createAuxContext(browser, Users.user2, '/', true); + poHomeOmnichannelAgent2 = new HomeOmnichannel(agent2Page); + + poLiveChat = new OmnichannelLiveChat(page, api); + await poLiveChat.page.goto('/livechat'); + }); + + test.afterEach(async ({ page }) => { + await poHomeOmnichannelAgent1.page?.close(); + await poHomeOmnichannelAgent2.page?.close(); + await page.close(); + }); + + test.afterAll(async ({ api }) => { + await expect((await api.post('/settings/Omnichannel_enable_department_removal', { value: true })).status()).toBe(200); + await Promise.all([...agents.map((agent) => agent.delete())]); + await Promise.all([...departments.map((department) => department.delete())]); + await expect((await api.post('/settings/Omnichannel_enable_department_removal', { value: false })).status()).toBe(200); + }); + + test('OC - Livechat - Chat with Department', async () => { + await test.step('expect start Chat with department', async () => { + await poLiveChat.openAnyLiveChat(); + await poLiveChat.sendMessage(firstUser, false, departmentA.name); + await expect(poLiveChat.onlineAgentMessage).toBeVisible(); + await poLiveChat.onlineAgentMessage.fill('this_a_test_message_from_user'); + await poLiveChat.btnSendMessageToOnlineAgent.click(); + await expect(poLiveChat.page.locator('div >> text="this_a_test_message_from_user"')).toBeVisible(); + }); + + await test.step('expect message to be received by department', async () => { + await poHomeOmnichannelAgent1.sidenav.openChat(firstUser.name); + await expect(poHomeOmnichannelAgent1.content.lastUserMessage).toBeVisible(); + await expect(poHomeOmnichannelAgent1.content.lastUserMessage).toContainText('this_a_test_message_from_user'); + }); + + await test.step('expect message to be sent by department', async () => { + await poHomeOmnichannelAgent1.content.sendMessage('this_a_test_message_from_agent'); + await expect(poLiveChat.page.locator('div >> text="this_a_test_message_from_agent"')).toBeVisible(); + }); + }); + + test('OC - Livechat - Change Department', async () => { + await test.step('expect start Chat with department', async () => { + await poLiveChat.openAnyLiveChat(); + await poLiveChat.sendMessage(firstUser, false, departmentA.name); + await expect(poLiveChat.onlineAgentMessage).toBeVisible(); + await poLiveChat.onlineAgentMessage.fill('this_a_test_message_from_user'); + await poLiveChat.btnSendMessageToOnlineAgent.click(); + await expect(poLiveChat.page.locator('div >> text="this_a_test_message_from_user"')).toBeVisible(); + }); + + await test.step('expect to change department', async () => { + await poLiveChat.changeDepartment(departmentB.name); + + // Expect keep chat history + await expect(poLiveChat.page.locator('div >> text="this_a_test_message_from_user"')).toBeVisible(); + + // Expect user to have changed + await expect(await poLiveChat.headerTitle.textContent()).toEqual(agent2.username); + }); + + await test.step('expect message to be received by department', async () => { + await poHomeOmnichannelAgent2.sidenav.openChat(firstUser.name); + await expect(poHomeOmnichannelAgent2.content.lastUserMessage).toBeVisible(); + await expect(poHomeOmnichannelAgent2.content.lastUserMessage).toContainText('this_a_test_message_from_user'); + }); + + await test.step('expect message to be sent by department', async () => { + await poHomeOmnichannelAgent2.content.sendMessage('this_a_test_message_from_agent'); + await expect(poLiveChat.page.locator('div >> text="this_a_test_message_from_agent"')).toBeVisible(); + }); + }); +}); diff --git a/apps/meteor/tests/e2e/omnichannel/omnichannel-livechat.spec.ts b/apps/meteor/tests/e2e/omnichannel/omnichannel-livechat.spec.ts index 39bc606b1382..35629880e749 100644 --- a/apps/meteor/tests/e2e/omnichannel/omnichannel-livechat.spec.ts +++ b/apps/meteor/tests/e2e/omnichannel/omnichannel-livechat.spec.ts @@ -3,6 +3,7 @@ import { faker } from '@faker-js/faker'; import { createAuxContext } from '../fixtures/createAuxContext'; import { Users } from '../fixtures/userStates'; import { HomeOmnichannel, OmnichannelLiveChat } from '../page-objects'; +import { createAgent } from '../utils/omnichannel/agents'; import { test, expect } from '../utils/test'; const firstUser = { @@ -47,10 +48,10 @@ test.describe.serial('OC - Livechat', () => { test('OC - Livechat - Send message to online agent', async () => { await test.step('expect message to be sent by livechat', async () => { await poLiveChat.page.reload(); - await poLiveChat.openLiveChat(); + await poLiveChat.openAnyLiveChat(); await poLiveChat.sendMessage(firstUser, false); - await poLiveChat.onlineAgentMessage.type('this_a_test_message_from_user'); + await poLiveChat.onlineAgentMessage.fill('this_a_test_message_from_user'); await poLiveChat.btnSendMessageToOnlineAgent.click(); await expect(poLiveChat.page.locator('div >> text="this_a_test_message_from_user"')).toBeVisible(); @@ -72,7 +73,7 @@ test.describe.serial('OC - Livechat', () => { }); await test.step('expect when user minimizes the livechat screen, the composer should be hidden', async () => { - await poLiveChat.openLiveChat(); + await poLiveChat.openAnyLiveChat(); await expect(poLiveChat.page.locator('[contenteditable="true"]')).not.toBeVisible(); }); @@ -126,10 +127,10 @@ test.describe.serial('OC - Livechat - Resub after close room', () => { }); test('OC - Livechat - Resub after close room', async () => { - await test.step('expect livechat conversation to be opened again', async () => { + await test.step('expect livechat conversation to be opened again, different guest', async () => { await poLiveChat.startNewChat(); await poLiveChat.sendMessage(secondUser, false); - await poLiveChat.onlineAgentMessage.type('this_a_test_message_from_user'); + await poLiveChat.onlineAgentMessage.fill('this_a_test_message_from_user'); await poLiveChat.btnSendMessageToOnlineAgent.click(); await expect(poLiveChat.page.locator('div >> text="this_a_test_message_from_user"')).toBeVisible(); }); @@ -147,6 +148,114 @@ test.describe.serial('OC - Livechat - Resub after close room', () => { }); }); +test.describe('OC - Livechat - Resume chat after closing', () => { + let poLiveChat: OmnichannelLiveChat; + let poHomeOmnichannel: HomeOmnichannel; + + test.beforeAll(async ({ api }) => { + const statusCode = (await api.post('/livechat/users/agent', { username: 'user1' })).status(); + await expect(statusCode).toBe(200); + }); + + test.beforeAll(async ({ browser, api }) => { + const { page: omniPage } = await createAuxContext(browser, Users.user1, '/', true); + poHomeOmnichannel = new HomeOmnichannel(omniPage); + + const { page: livechatPage } = await createAuxContext(browser, Users.user1, '/livechat', false); + poLiveChat = new OmnichannelLiveChat(livechatPage, api); + + await poLiveChat.sendMessageAndCloseChat(firstUser); + }); + + test.afterAll(async ({ api }) => { + await api.delete('/livechat/users/agent/user1'); + await poLiveChat.page?.close(); + }); + + test('OC - Livechat - Resume chat after closing', async () => { + await test.step('expect livechat conversation to be opened again', async () => { + await poLiveChat.startNewChat(); + await expect(poLiveChat.onlineAgentMessage).toBeVisible(); + await poLiveChat.onlineAgentMessage.fill('this_a_test_message_from_user'); + await poLiveChat.btnSendMessageToOnlineAgent.click(); + await expect(poLiveChat.page.locator('div >> text="this_a_test_message_from_user"')).toBeVisible(); + }); + + await test.step('expect message to be received by agent', async () => { + await poHomeOmnichannel.sidenav.openChat(firstUser.name); + await expect(poHomeOmnichannel.content.lastUserMessage).toBeVisible(); + await expect(poHomeOmnichannel.content.lastUserMessage).toContainText('this_a_test_message_from_user'); + }); + + await test.step('expect message to be sent by agent', async () => { + await poHomeOmnichannel.content.sendMessage('this_a_test_message_from_agent'); + await expect(poLiveChat.page.locator('div >> text="this_a_test_message_from_agent"')).toBeVisible(); + }); + }); +}); + +test.describe('OC - Livechat - Close chat using widget', () => { + let poLiveChat: OmnichannelLiveChat; + let poHomeOmnichannel: HomeOmnichannel; + let agent: Awaited>; + + test.beforeAll(async ({ browser, api }) => { + agent = await createAgent(api, 'user1'); + + const { page } = await createAuxContext(browser, Users.user1, '/'); + poHomeOmnichannel = new HomeOmnichannel(page); + }); + + test.beforeEach(async ({ page, api }) => { + poLiveChat = new OmnichannelLiveChat(page, api); + + await poLiveChat.page.goto('/livechat'); + }); + + test.afterAll(async () => { + await poHomeOmnichannel.page?.close(); + await agent.delete(); + }); + + test('OC - Livechat - Close Chat', async () => { + await poLiveChat.openAnyLiveChat(); + await poLiveChat.sendMessage(firstUser, false); + await poLiveChat.onlineAgentMessage.fill('this_a_test_message_from_user'); + await poLiveChat.btnSendMessageToOnlineAgent.click(); + + await test.step('expect to close a livechat conversation', async () => { + await expect(poLiveChat.btnOptions).toBeVisible(); + await poLiveChat.btnOptions.click(); + + await expect(poLiveChat.btnCloseChat).toBeVisible(); + await poLiveChat.btnCloseChat.click(); + + await poLiveChat.btnCloseChatConfirm.click(); + + await expect(poLiveChat.btnNewChat).toBeVisible(); + }); + }); + + test('OC - Livechat - Close Chat twice', async () => { + await poLiveChat.sendMessageAndCloseChat(firstUser); + await poLiveChat.startNewChat(); + await poLiveChat.onlineAgentMessage.fill('this_a_test_message_from_user'); + await poLiveChat.btnSendMessageToOnlineAgent.click(); + + await test.step('expect to close a livechat conversation a second time', async () => { + await expect(poLiveChat.btnOptions).toBeVisible(); + await poLiveChat.btnOptions.click(); + + await expect(poLiveChat.btnCloseChat).toBeVisible(); + await poLiveChat.btnCloseChat.click(); + + await poLiveChat.btnCloseChatConfirm.click(); + + await expect(poLiveChat.btnNewChat).toBeVisible(); + }); + }); +}); + test.describe('OC - Livechat - Livechat_Display_Offline_Form', () => { let poLiveChat: OmnichannelLiveChat; const message = 'This form is not available'; diff --git a/apps/meteor/tests/e2e/page-objects/home-omnichannel.ts b/apps/meteor/tests/e2e/page-objects/home-omnichannel.ts index e93e90b0b492..9111df7080ab 100644 --- a/apps/meteor/tests/e2e/page-objects/home-omnichannel.ts +++ b/apps/meteor/tests/e2e/page-objects/home-omnichannel.ts @@ -10,7 +10,7 @@ import { OmnichannelTranscript } from './omnichannel-transcript'; import { OmnichannelTriggers } from './omnichannel-triggers'; export class HomeOmnichannel { - private readonly page: Page; + readonly page: Page; readonly content: HomeOmnichannelContent; diff --git a/apps/meteor/tests/e2e/page-objects/omnichannel-livechat.ts b/apps/meteor/tests/e2e/page-objects/omnichannel-livechat.ts index af539a7783f1..c372dd6d8572 100644 --- a/apps/meteor/tests/e2e/page-objects/omnichannel-livechat.ts +++ b/apps/meteor/tests/e2e/page-objects/omnichannel-livechat.ts @@ -29,6 +29,10 @@ export class OmnichannelLiveChat { return this.page.locator(`button >> text="Finish this chat"`); } + get btnChangeDepartment(): Locator { + return this.page.locator(`button >> text="Change department"`); + } + get btnCloseChatConfirm(): Locator { return this.page.locator(`button >> text="Yes"`); } @@ -40,11 +44,25 @@ export class OmnichannelLiveChat { get btnChatNow(): Locator { return this.page.locator('[type="button"] >> text="Chat now"'); } + + get headerTitle(): Locator { + return this.page.locator('[data-qa="header-title"]'); + } txtChatMessage(message: string): Locator { return this.page.locator(`text="${message}"`); } + async changeDepartment (department: string): Promise { + await this.btnOptions.click(); + await this.btnChangeDepartment.click(); + await this.selectDepartment.waitFor({ state: 'visible' }); + await this.selectDepartment.selectOption({ label: department }); + await this.btnSendMessage('Start chat').click(); + await this.btnYes.click(); + await this.btnOk.click(); + } + async closeChat(): Promise { await this.btnOptions.click(); await this.btnCloseChat.click(); @@ -80,6 +98,10 @@ export class OmnichannelLiveChat { return this.page.locator('[name="email"]'); } + get selectDepartment(): Locator { + return this.page.locator('[name="department"]'); + } + get textAreaMessage(): Locator { return this.page.locator('[name="message"]'); } @@ -92,6 +114,10 @@ export class OmnichannelLiveChat { return this.page.locator('role=button[name="OK"]'); } + get btnYes(): Locator { + return this.page.locator('role=button[name="Yes"]'); + } + get onlineAgentMessage(): Locator { return this.page.locator('[contenteditable="true"]'); } @@ -104,13 +130,19 @@ export class OmnichannelLiveChat { return this.page.locator('div.message-text__WwYco p'); } - public async sendMessage(liveChatUser: { name: string; email: string }, isOffline = true): Promise { + public async sendMessage(liveChatUser: { name: string; email: string }, isOffline = true, department?: string): Promise { const buttonLabel = isOffline ? 'Send' : 'Start chat'; - await this.inputName.type(liveChatUser.name); - await this.inputEmail.type(liveChatUser.email); + await this.inputName.fill(liveChatUser.name); + await this.inputEmail.fill(liveChatUser.email); + + if (department) { + await this.selectDepartment.selectOption({ label: department }); + } + if (isOffline) { await this.textAreaMessage.type('any_message'); } + await this.btnSendMessage(buttonLabel).click(); await this.page.waitForSelector('[data-qa="livechat-composer"]'); } @@ -119,7 +151,7 @@ export class OmnichannelLiveChat { liveChatUser: { name: string; email: string }, message = 'this_a_test_message_from_user', ): Promise { - await this.openLiveChat(); + await this.openAnyLiveChat(); await this.sendMessage(liveChatUser, false); await this.onlineAgentMessage.type(message); await this.btnSendMessageToOnlineAgent.click(); diff --git a/apps/meteor/tests/e2e/utils/omnichannel/departments.ts b/apps/meteor/tests/e2e/utils/omnichannel/departments.ts index 2b4fefd666c6..455410808720 100644 --- a/apps/meteor/tests/e2e/utils/omnichannel/departments.ts +++ b/apps/meteor/tests/e2e/utils/omnichannel/departments.ts @@ -3,24 +3,54 @@ import { ILivechatDepartment } from '@rocket.chat/core-typings'; import { BaseTest } from '../test'; -type CreateDepartmentParams = { name?: string; maxNumberSimultaneousChat?: number }; +type CreateDepartmentParams = { + name?: string; + enabled?: boolean; + description?: string; + showOnRegistration?: boolean; + showOnOfflineForm?: boolean; + requestTagBeforeClosingChat?: boolean; + email?: string; + chatClosingTags?: string[]; + offlineMessageChannelName?: string; + abandonedRoomsCloseCustomMessage?: string, + waitingQueueMessage?: string; + departmentsAllowedToForward?: string[]; + fallbackForwardDepartment?: string; + maxNumberSimultaneousChat?: number; + }; -export const createDepartment = async (api: BaseTest['api'], { name = '', maxNumberSimultaneousChat }: CreateDepartmentParams = {}) => { +export const createDepartment = async (api: BaseTest['api'], { + name = '', + enabled = true, + description = '', + showOnRegistration = false, + showOnOfflineForm = false, + requestTagBeforeClosingChat = false, + email = '', + chatClosingTags = [], + offlineMessageChannelName = '', + abandonedRoomsCloseCustomMessage = '', + waitingQueueMessage = '', + departmentsAllowedToForward = [], + fallbackForwardDepartment = '', + maxNumberSimultaneousChat +}: CreateDepartmentParams = {}) => { const response = await api.post('/livechat/department', { department: { name: name || faker.string.uuid(), - enabled: true, - description: '', - showOnRegistration: false, - showOnOfflineForm: false, - requestTagBeforeClosingChat: false, - email: faker.internet.email(), - chatClosingTags: [], - offlineMessageChannelName: '', - abandonedRoomsCloseCustomMessage: '', - waitingQueueMessage: '', - departmentsAllowedToForward: [], - fallbackForwardDepartment: '', + enabled, + description, + showOnRegistration, + showOnOfflineForm, + requestTagBeforeClosingChat, + email: email || faker.internet.email(), + chatClosingTags, + offlineMessageChannelName, + abandonedRoomsCloseCustomMessage, + waitingQueueMessage, + departmentsAllowedToForward, + fallbackForwardDepartment, maxNumberSimultaneousChat, }, }); diff --git a/packages/livechat/src/components/Header/index.tsx b/packages/livechat/src/components/Header/index.tsx index 68c63d0f6808..d92525482d68 100644 --- a/packages/livechat/src/components/Header/index.tsx +++ b/packages/livechat/src/components/Header/index.tsx @@ -54,7 +54,7 @@ export const Content = ({ children, className = undefined, ...props }: HeaderCom ); export const Title = ({ children, className = undefined, ...props }: HeaderComponentProps) => ( -
+
{children}
); diff --git a/packages/livechat/src/routes/SwitchDepartment/index.tsx b/packages/livechat/src/routes/SwitchDepartment/index.tsx index 8a0df60f002d..5c7f79b9ce5a 100644 --- a/packages/livechat/src/routes/SwitchDepartment/index.tsx +++ b/packages/livechat/src/routes/SwitchDepartment/index.tsx @@ -31,7 +31,7 @@ const SwitchDepartment: FunctionalComponent<{ path: string }> = () => { iframe: { guest }, iframe, room, - loading = false, + loading = true, dispatch, alerts, token, From d742b25235707c6b5ffd6924f5c4817ac76eeb2c Mon Sep 17 00:00:00 2001 From: Kevin Aleman Date: Thu, 21 Mar 2024 14:01:32 -0600 Subject: [PATCH 21/79] refactor: Add `projection` and change promise calls to `Promise.all` on LivechatAgentActivityMonitor (#32036) --- .../LivechatAgentActivityMonitor.ts | 51 ++++++++----------- 1 file changed, 22 insertions(+), 29 deletions(-) diff --git a/apps/meteor/app/livechat/server/statistics/LivechatAgentActivityMonitor.ts b/apps/meteor/app/livechat/server/statistics/LivechatAgentActivityMonitor.ts index 76e9e04f1a24..b82dcc30411d 100644 --- a/apps/meteor/app/livechat/server/statistics/LivechatAgentActivityMonitor.ts +++ b/apps/meteor/app/livechat/server/statistics/LivechatAgentActivityMonitor.ts @@ -52,21 +52,19 @@ export class LivechatAgentActivityMonitor { // TODO use service event socket.connected instead Meteor.onConnection((connection: unknown) => this._handleMeteorConnection(connection as ISocketConnection)); callbacks.add('livechat.agentStatusChanged', this._handleAgentStatusChanged); - callbacks.add('livechat.setUserStatusLivechat', async (...args) => { + callbacks.add('livechat.setUserStatusLivechat', (...args) => { return this._handleUserStatusLivechatChanged(...args); }); this._started = true; } async _startMonitoring(): Promise { - await this.scheduler.add(this._name, '0 0 * * *', async () => this._updateActiveSessions()); + await this.scheduler.add(this._name, '0 0 * * *', () => this._updateActiveSessions()); } async _updateActiveSessions(): Promise { - const openLivechatAgentSessions = await LivechatAgentActivity.findOpenSessions(); - if (!(await openLivechatAgentSessions.count())) { - return; - } + const openLivechatAgentSessions = LivechatAgentActivity.findOpenSessions(); + const today = moment(new Date()); const startedAt = new Date(today.year(), today.month(), today.date()); for await (const session of openLivechatAgentSessions) { @@ -74,15 +72,11 @@ export class LivechatAgentActivityMonitor { const stoppedAt = new Date(startDate.year(), startDate.month(), startDate.date(), 23, 59, 59); const data = { ...formatDate(startDate.toDate()), agentId: session.agentId }; const availableTime = moment(stoppedAt).diff(moment(new Date(session.lastStartedAt)), 'seconds'); - await LivechatAgentActivity.updateLastStoppedAt({ - ...data, - availableTime, - lastStoppedAt: stoppedAt, - }); - await LivechatAgentActivity.updateServiceHistory({ - ...data, - serviceHistory: { startedAt: session.lastStartedAt, stoppedAt }, - }); + + await Promise.all([ + LivechatAgentActivity.updateLastStoppedAt({ ...data, availableTime, lastStoppedAt: stoppedAt }), + LivechatAgentActivity.updateServiceHistory({ ...data, serviceHistory: { startedAt: session.lastStartedAt, stoppedAt } }), + ]); await this._createOrUpdateSession(session.agentId, startedAt); } } @@ -96,7 +90,9 @@ export class LivechatAgentActivityMonitor { if (!session) { return; } - const user = await Users.findOneById(session.userId); + const user = await Users.findOneById>(session.userId, { + projection: { _id: 1, status: 1, statusLivechat: 1 }, + }); if (user && user.status !== 'offline' && user.statusLivechat === 'available') { await this._createOrUpdateSession(user._id); } @@ -112,7 +108,7 @@ export class LivechatAgentActivityMonitor { return; } - const user = await Users.findOneById(userId); + const user = await Users.findOneById>(userId, { projection: { statusLivechat: 1 } }); if (!user || user.statusLivechat !== 'available') { return; } @@ -129,7 +125,7 @@ export class LivechatAgentActivityMonitor { return; } - const user = await Users.findOneById(userId); + const user = await Users.findOneById>(userId, { projection: { status: 1 } }); if (user && user.status === 'offline') { return; } @@ -158,16 +154,13 @@ export class LivechatAgentActivityMonitor { const stoppedAt = new Date(); const availableTime = moment(stoppedAt).diff(moment(new Date(livechatSession.lastStartedAt)), 'seconds'); - await LivechatAgentActivity.updateLastStoppedAt({ - agentId, - date, - availableTime, - lastStoppedAt: stoppedAt, - }); - await LivechatAgentActivity.updateServiceHistory({ - agentId, - date, - serviceHistory: { startedAt: livechatSession.lastStartedAt, stoppedAt }, - }); + await Promise.all([ + LivechatAgentActivity.updateLastStoppedAt({ agentId, date, availableTime, lastStoppedAt: stoppedAt }), + LivechatAgentActivity.updateServiceHistory({ + agentId, + date, + serviceHistory: { startedAt: livechatSession.lastStartedAt, stoppedAt }, + }), + ]); } } From 475c0417e97bd38d8842a6dc1bc243d0b257d7be Mon Sep 17 00:00:00 2001 From: Aleksander Nicacio da Silva Date: Thu, 21 Mar 2024 17:42:33 -0300 Subject: [PATCH 22/79] feat: Added setting and method to control Livechat system messages visibility (#31751) --- .changeset/cyan-shoes-fly.md | 6 ++++ .../app/livechat/server/api/lib/livechat.ts | 1 + .../app/livechat/server/lib/LivechatTyped.ts | 1 + .../livechat-enterprise/server/settings.ts | 17 +++++++++++ packages/i18n/src/locales/en.i18n.json | 4 +++ packages/i18n/src/locales/pt-BR.i18n.json | 4 +++ .../livechat/src/helpers/canRenderMessage.ts | 29 ++++++++++++++----- packages/livechat/src/lib/hooks.ts | 6 ++++ packages/livechat/src/store/index.tsx | 9 ++++++ packages/livechat/src/widget.ts | 24 +++++++++++++++ 10 files changed, 93 insertions(+), 8 deletions(-) create mode 100644 .changeset/cyan-shoes-fly.md diff --git a/.changeset/cyan-shoes-fly.md b/.changeset/cyan-shoes-fly.md new file mode 100644 index 000000000000..e89b64a01a31 --- /dev/null +++ b/.changeset/cyan-shoes-fly.md @@ -0,0 +1,6 @@ +--- +"@rocket.chat/meteor": minor +"@rocket.chat/livechat": minor +--- + +Added Livechat setting `Hide system messages` & API method `setHiddenSystemMessages`, to customize system message visibility within the widget. diff --git a/apps/meteor/app/livechat/server/api/lib/livechat.ts b/apps/meteor/app/livechat/server/api/lib/livechat.ts index 24f5f8cc7c36..0f7da0b7c9e9 100644 --- a/apps/meteor/app/livechat/server/api/lib/livechat.ts +++ b/apps/meteor/app/livechat/server/api/lib/livechat.ts @@ -170,6 +170,7 @@ export async function settings({ businessUnit = '' }: { businessUnit?: string } limitTextLength: initSettings.Livechat_enable_message_character_limit && (initSettings.Livechat_message_character_limit || initSettings.Message_MaxAllowedSize), + hiddenSystemMessages: initSettings.Livechat_hide_system_messages, }, theme: { title: initSettings.Livechat_title, diff --git a/apps/meteor/app/livechat/server/lib/LivechatTyped.ts b/apps/meteor/app/livechat/server/lib/LivechatTyped.ts index d9e1fe84d854..776990beaa21 100644 --- a/apps/meteor/app/livechat/server/lib/LivechatTyped.ts +++ b/apps/meteor/app/livechat/server/lib/LivechatTyped.ts @@ -1126,6 +1126,7 @@ class LivechatClass { 'Livechat_show_agent_info', 'Livechat_clear_local_storage_when_chat_ended', 'Livechat_history_monitor_type', + 'Livechat_hide_system_messages', ] as const; type SettingTypes = (typeof validSettings)[number] | 'Livechat_Show_Connecting'; diff --git a/apps/meteor/ee/app/livechat-enterprise/server/settings.ts b/apps/meteor/ee/app/livechat-enterprise/server/settings.ts index 3a99535ca2ed..c2f66bc79355 100644 --- a/apps/meteor/ee/app/livechat-enterprise/server/settings.ts +++ b/apps/meteor/ee/app/livechat-enterprise/server/settings.ts @@ -263,6 +263,23 @@ export const createSettings = async (): Promise => { i18nLabel: 'Omnichannel_transcript_pdf', }); + await settingsRegistry.add('Livechat_hide_system_messages', ['uj', 'ul', 'livechat-close'], { + type: 'multiSelect', + group: 'Omnichannel', + section: 'Livechat', + enterprise: true, + modules: ['livechat-enterprise'], + invalidValue: ['uj', 'ul', 'livechat-close'], + public: true, + values: [ + { key: 'uj', i18nLabel: 'Message_HideType_uj' }, + { key: 'ul', i18nLabel: 'Message_HideType_ul' }, + { key: 'livechat-close', i18nLabel: 'Message_HideType_livechat_closed' }, + { key: 'livechat-started', i18nLabel: 'Message_HideType_livechat_started' }, + { key: 'livechat_transfer_history', i18nLabel: 'Message_HideType_livechat_transfer_history' }, + ], + }); + await Settings.addOptionValueById('Livechat_Routing_Method', { key: 'Load_Balancing', i18nLabel: 'Load_Balancing', diff --git a/packages/i18n/src/locales/en.i18n.json b/packages/i18n/src/locales/en.i18n.json index 2dfcdaf22f05..849dcab49c5c 100644 --- a/packages/i18n/src/locales/en.i18n.json +++ b/packages/i18n/src/locales/en.i18n.json @@ -3175,6 +3175,7 @@ "Livechat_offline": "Omnichannel offline", "Livechat_offline_message_sent": "Livechat offline message sent", "Livechat_OfflineMessageToChannel_enabled": "Send Livechat offline messages to a channel", + "Livechat_hide_system_messages": "Hide system messages", "Omnichannel_chat_closed_due_to_inactivity": "The chat was automatically closed because we haven't received any reply from {{guest}} in {{timeout}} seconds", "Omnichannel_actions": "Omnichannel actions", "Omnichannel_on_hold_chat_resumed": "On Hold Chat Resumed: {{comment}}", @@ -3532,6 +3533,9 @@ "Message_HideType_changed_announcement": "Hide \"Room announcement changed to\" messages", "Message_HideType_ut": "Hide \"User Joined Conversation\" messages", "Message_HideType_wm": "Hide \"Welcome\" messages", + "Message_HideType_livechat_closed": "Hide \"Conversation finished\" messages", + "Message_HideType_livechat_started": "Hide \"Conversation started\" messages", + "Message_HideType_livechat_transfer_history": "Hide \"Conversation transfered\" messages", "Message_Id": "Message Id", "Message_Ignored": "This message was ignored", "message-impersonate": "Impersonate Other Users", diff --git a/packages/i18n/src/locales/pt-BR.i18n.json b/packages/i18n/src/locales/pt-BR.i18n.json index f8cc3513463f..76fc3db44e7e 100644 --- a/packages/i18n/src/locales/pt-BR.i18n.json +++ b/packages/i18n/src/locales/pt-BR.i18n.json @@ -2684,6 +2684,7 @@ "Livechat_offline": "Omnichannel offline", "Livechat_offline_message_sent": "Mensagem offline do livechat enviada", "Livechat_OfflineMessageToChannel_enabled": "Envie mensagens offline do livechat para um canal", + "Livechat_hide_system_messages": "Ocultar mensagens do sistema", "Omnichannel_on_hold_chat_resumed": "Conversa em espera retomada: {{comment}}", "Omnichannel_on_hold_chat_automatically": "A conversa foi automaticamente retomada de em espera após receber uma nova mensagem de {{guest}}", "Omnichannel_on_hold_chat_resumed_manually": "A conversa foi manualmente retomada de em espera por {{user}}", @@ -2961,6 +2962,9 @@ "Message_HideType_user_removed_room_from_team": "Ocultar mensagens de \"Usuário removeu sala da equipe\"", "Message_HideType_ut": "Ocultar mensagens de \"Usuário entrou na conversa\"", "Message_HideType_wm": "Ocultar mensagens de \"Bem-vindo\"", + "Message_HideType_livechat_closed": "Ocultar mensagens de \"Conversa encerrada\"", + "Message_HideType_livechat_started": "Ocultar mensagens de \"Conversa iniciada\"", + "Message_HideType_livechat_transfer_history": "Ocultar mensagens de \"Histórico de transferência\"", "Message_Id": "ID da mensagem", "Message_Ignored": "Esta mensagem foi ignorada", "message-impersonate": "Personificar outros usuários", diff --git a/packages/livechat/src/helpers/canRenderMessage.ts b/packages/livechat/src/helpers/canRenderMessage.ts index b7dd462498e6..726ec689631c 100644 --- a/packages/livechat/src/helpers/canRenderMessage.ts +++ b/packages/livechat/src/helpers/canRenderMessage.ts @@ -1,27 +1,40 @@ import { MESSAGE_TYPE_COMMAND, - MESSAGE_TYPE_LIVECHAT_CLOSED, MESSAGE_TYPE_LIVECHAT_NAVIGATION_HISTORY, MESSAGE_TYPE_PRIORITY_CHANGE, + MESSAGE_TYPE_ROOM_NAME_CHANGED, MESSAGE_TYPE_SLA_CHANGE, MESSAGE_TYPE_USER_ADDED, - MESSAGE_TYPE_USER_JOINED, - MESSAGE_TYPE_USER_LEFT, + MESSAGE_TYPE_USER_REMOVED, + MESSAGE_TYPE_WELCOME, MESSAGE_VIDEO_CALL, MESSAGE_WEBRTC_CALL, } from '../components/Messages/constants'; +import store from '../store'; const msgTypesNotRendered = [ + MESSAGE_TYPE_WELCOME, + MESSAGE_TYPE_ROOM_NAME_CHANGED, + MESSAGE_TYPE_USER_ADDED, + MESSAGE_TYPE_USER_REMOVED, MESSAGE_VIDEO_CALL, MESSAGE_WEBRTC_CALL, MESSAGE_TYPE_LIVECHAT_NAVIGATION_HISTORY, - MESSAGE_TYPE_USER_ADDED, MESSAGE_TYPE_COMMAND, - MESSAGE_TYPE_USER_JOINED, - MESSAGE_TYPE_USER_LEFT, - MESSAGE_TYPE_LIVECHAT_CLOSED, MESSAGE_TYPE_PRIORITY_CHANGE, MESSAGE_TYPE_SLA_CHANGE, ]; -export const canRenderMessage = ({ t }: { t: string }) => !msgTypesNotRendered.includes(t); +export const getHiddenSystemMessages = () => { + const { config, iframe } = store.state; + const configHiddenSystemMessages = config.settings.hiddenSystemMessages || []; + const localHiddenSystemMessages = iframe.hiddenSystemMessages || []; + + return [...configHiddenSystemMessages, ...localHiddenSystemMessages] as string[]; +}; + +export const canRenderMessage = ({ t }: { t: string }) => { + const hiddenSystemMessages = getHiddenSystemMessages(); + + return !msgTypesNotRendered.includes(t) && !hiddenSystemMessages.includes(t); +}; diff --git a/packages/livechat/src/lib/hooks.ts b/packages/livechat/src/lib/hooks.ts index 300c7804e6d7..a3d456fec3bf 100644 --- a/packages/livechat/src/lib/hooks.ts +++ b/packages/livechat/src/lib/hooks.ts @@ -244,10 +244,16 @@ const api = { setParentUrl: (parentUrl: StoreState['parentUrl']) => { store.setState({ parentUrl }); }, + setGuestMetadata(metadata: StoreState['iframe']['guestMetadata']) { const { iframe } = store.state; store.setState({ iframe: { ...iframe, guestMetadata: metadata } }); }, + + setHiddenSystemMessages: (hiddenSystemMessages: StoreState['iframe']['hiddenSystemMessages']) => { + const { iframe } = store.state; + store.setState({ iframe: { ...iframe, hiddenSystemMessages } }); + }, }; function onNewMessageHandler(event: MessageEvent>) { diff --git a/packages/livechat/src/store/index.tsx b/packages/livechat/src/store/index.tsx index 4725a435aad5..d35843e07c8d 100644 --- a/packages/livechat/src/store/index.tsx +++ b/packages/livechat/src/store/index.tsx @@ -10,6 +10,13 @@ import { parentCall } from '../lib/parentCall'; import { createToken } from '../lib/random'; import Store from './Store'; +export type LivechatHiddenSytemMessageType = + | 'uj' // User joined + | 'ul' // User left + | 'livechat-close' // Chat closed + | 'livechat-started' // Chat started + | 'livechat_transfer_history'; // Chat transfered + export type StoreState = { token: string; typing: string[]; @@ -45,6 +52,7 @@ export type StoreState = { showConnecting?: any; limitTextLength?: any; displayOfflineForm?: boolean; + hiddenSystemMessages?: LivechatHiddenSytemMessageType[]; }; online?: boolean; departments: Department[]; @@ -73,6 +81,7 @@ export type StoreState = { department?: string; language?: string; defaultDepartment?: string; + hiddenSystemMessages?: LivechatHiddenSytemMessageType[]; }; gdpr: { accepted: boolean; diff --git a/packages/livechat/src/widget.ts b/packages/livechat/src/widget.ts index 2f1e8f4ea318..b845602acc34 100644 --- a/packages/livechat/src/widget.ts +++ b/packages/livechat/src/widget.ts @@ -42,6 +42,7 @@ type InitializeParams = { agent: StoreState['defaultAgent']; parentUrl: string; setGuestMetadata: StoreState['iframe']['guestMetadata']; + hiddenSystemMessages: StoreState['iframe']['hiddenSystemMessages']; }; const WIDGET_OPEN_WIDTH = 365; @@ -75,6 +76,8 @@ export const VALID_CALLBACKS = [ 'no-agent-online', ]; +const VALID_SYSTEM_MESSAGES = ['uj', 'ul', 'livechat-close', 'livechat-started', 'livechat_transfer_history']; + const callbacks = mitt(); function registerCallback(eventName: string, fn: () => unknown) { @@ -355,6 +358,23 @@ function setGuestMetadata(metadata: StoreState['iframe']['guestMetadata']) { callHook('setGuestMetadata', metadata); } +function setHiddenSystemMessages(hidden: StoreState['iframe']['hiddenSystemMessages']) { + if (!Array.isArray(hidden)) { + throw new Error('Error: Invalid parameters. Value must be an array of strings'); + } + + const hiddenSystemMessages = hidden.filter((h) => { + if (VALID_SYSTEM_MESSAGES.includes(h)) { + return true; + } + + console.warn(`Error: Invalid system message "${h}"`); + return false; + }); + + callHook('setHiddenSystemMessages', hiddenSystemMessages); +} + function initialize(initParams: Partial) { for (const initKey in initParams) { if (!initParams.hasOwnProperty(initKey)) { @@ -407,6 +427,9 @@ function initialize(initParams: Partial) { case 'setGuestMetadata': setGuestMetadata(params as InitializeParams['setGuestMetadata']); continue; + case 'hiddenSystemMessages': + setHiddenSystemMessages(params as InitializeParams['hiddenSystemMessages']); + continue; default: continue; } @@ -506,6 +529,7 @@ const livechatWidgetAPI = { setParentUrl, setGuestMetadata, clearAllCallbacks, + setHiddenSystemMessages, // callbacks onChatMaximized(fn: () => void) { From 469afbd4d51b9dc4dc14d51193eb073c3f0e1cde Mon Sep 17 00:00:00 2001 From: Martin Schoeler Date: Thu, 21 Mar 2024 18:36:42 -0300 Subject: [PATCH 23/79] test(Omnichannel): fix flaky units test (#32050) --- .../e2e/omnichannel/omnichannel-units.spec.ts | 21 +++++++------------ 1 file changed, 7 insertions(+), 14 deletions(-) diff --git a/apps/meteor/tests/e2e/omnichannel/omnichannel-units.spec.ts b/apps/meteor/tests/e2e/omnichannel/omnichannel-units.spec.ts index 703da8e1be9e..5e24dc8622ae 100644 --- a/apps/meteor/tests/e2e/omnichannel/omnichannel-units.spec.ts +++ b/apps/meteor/tests/e2e/omnichannel/omnichannel-units.spec.ts @@ -106,9 +106,6 @@ test.describe('OC - Manage Units', () => { test('OC - Manage Units - Edit unit', async ({ api, page }) => { const editedUnitName = faker.string.uuid(); - await page.goto('/omnichannel'); - await poOmnichannelUnits.sidenav.linkUnits.click(); - const unit = await test.step('expect to create new unit', async () => { const { data: unit } = await createOrUpdateUnit(api, { name: faker.string.uuid(), @@ -120,6 +117,9 @@ test.describe('OC - Manage Units', () => { return unit; }); + await page.goto('/omnichannel'); + await poOmnichannelUnits.sidenav.linkUnits.click(); + await test.step('expect to edit unit', async () => { await poOmnichannelUnits.search(unit.name); await poOmnichannelUnits.findRowByName(unit.name).click(); @@ -129,8 +129,7 @@ test.describe('OC - Manage Units', () => { }); await test.step('expect unit to have been edited', async () => { - await poOmnichannelUnits.sidenav.linkPriorities.click(); - await poOmnichannelUnits.sidenav.linkUnits.click(); // refresh the page + await expect(poOmnichannelUnits.inputSearch).toBeVisible(); await poOmnichannelUnits.search(editedUnitName); await expect(poOmnichannelUnits.findRowByName(editedUnitName)).toBeVisible(); }); @@ -158,15 +157,9 @@ test.describe('OC - Manage Units', () => { }); await test.step('expect to have been deleted', async () => { - await poOmnichannelUnits.sidenav.linkPriorities.click(); - await poOmnichannelUnits.sidenav.linkUnits.click(); // refresh the page - - if (await poOmnichannelUnits.inputSearch.isVisible()) { - await poOmnichannelUnits.search(editedUnitName); - await expect(poOmnichannelUnits.findRowByName(editedUnitName)).not.toBeVisible(); - } else { - await expect(page.locator('h3 >> text="No units yet"')).toBeVisible(); - } + await expect(poOmnichannelUnits.inputSearch).toBeVisible(); + await poOmnichannelUnits.inputSearch.clear(); + await expect(page.locator('h3 >> text="No units yet"')).toBeVisible(); }); }); }); From 0570f6740a363d9f448472abfae49968aa5e1411 Mon Sep 17 00:00:00 2001 From: Kevin Aleman Date: Fri, 22 Mar 2024 06:51:12 -0600 Subject: [PATCH 24/79] fix: `livechat/visitor` not updating custom fields some times (#31890) --- .changeset/happy-pillows-call.md | 6 ++ .../app/livechat/server/api/v1/visitor.ts | 52 +++++++--- .../server/models/raw/LivechatCustomField.ts | 10 +- .../end-to-end/api/livechat/09-visitors.ts | 99 +++++++++++++++++++ .../src/models/ILivechatCustomFieldModel.ts | 5 + 5 files changed, 160 insertions(+), 12 deletions(-) create mode 100644 .changeset/happy-pillows-call.md diff --git a/.changeset/happy-pillows-call.md b/.changeset/happy-pillows-call.md new file mode 100644 index 000000000000..9100e1f7fe1b --- /dev/null +++ b/.changeset/happy-pillows-call.md @@ -0,0 +1,6 @@ +--- +"@rocket.chat/meteor": patch +"@rocket.chat/model-typings": patch +--- + +Changed logic that process custom fields from visitors when updating its data, making the process more reliable and faster. diff --git a/apps/meteor/app/livechat/server/api/v1/visitor.ts b/apps/meteor/app/livechat/server/api/v1/visitor.ts index 3d78280c5109..9c19f5bbdec8 100644 --- a/apps/meteor/app/livechat/server/api/v1/visitor.ts +++ b/apps/meteor/app/livechat/server/api/v1/visitor.ts @@ -1,4 +1,4 @@ -import type { ILivechatVisitor, IRoom } from '@rocket.chat/core-typings'; +import type { ILivechatCustomField, ILivechatVisitor, IRoom } from '@rocket.chat/core-typings'; import { LivechatVisitors as VisitorsRaw, LivechatCustomField, LivechatRooms } from '@rocket.chat/models'; import { Match, check } from 'meteor/check'; import { Meteor } from 'meteor/meteor'; @@ -68,16 +68,46 @@ API.v1.addRoute('livechat/visitor', { ); } - if (customFields && Array.isArray(customFields)) { - for await (const field of customFields) { - const customField = await LivechatCustomField.findOneById(field.key); - if (!customField) { - continue; - } - const { key, value, overwrite } = field; - if (customField.scope === 'visitor' && !(await VisitorsRaw.updateLivechatDataByToken(token, key, value, overwrite))) { - return API.v1.failure(); - } + if (customFields && Array.isArray(customFields) && customFields.length > 0) { + const keys = customFields.map((field) => field.key); + const errors: string[] = []; + + const processedKeys = await Promise.all( + await LivechatCustomField.findByIdsAndScope>(keys, 'visitor', { + projection: { _id: 1 }, + }) + .map(async (field) => { + const customField = customFields.find((f) => f.key === field._id); + if (!customField) { + return; + } + + const { key, value, overwrite } = customField; + // TODO: Change this to Bulk update + if (!(await VisitorsRaw.updateLivechatDataByToken(token, key, value, overwrite))) { + errors.push(key); + } + + return key; + }) + .toArray(), + ); + + if (processedKeys.length !== keys.length) { + LivechatTyped.logger.warn({ + msg: 'Some custom fields were not processed', + visitorId, + missingKeys: keys.filter((key) => !processedKeys.includes(key)), + }); + } + + if (errors.length > 0) { + LivechatTyped.logger.error({ + msg: 'Error updating custom fields', + visitorId, + errors, + }); + throw new Error('error-updating-custom-fields'); } visitor = await VisitorsRaw.findOneEnabledById(visitorId, {}); diff --git a/apps/meteor/server/models/raw/LivechatCustomField.ts b/apps/meteor/server/models/raw/LivechatCustomField.ts index 46bc32c52177..71228f55069d 100644 --- a/apps/meteor/server/models/raw/LivechatCustomField.ts +++ b/apps/meteor/server/models/raw/LivechatCustomField.ts @@ -1,6 +1,6 @@ import type { ILivechatCustomField, RocketChatRecordDeleted } from '@rocket.chat/core-typings'; import type { ILivechatCustomFieldModel } from '@rocket.chat/model-typings'; -import type { Db, Collection, IndexDescription, FindOptions, FindCursor } from 'mongodb'; +import type { Db, Collection, IndexDescription, FindOptions, FindCursor, Document } from 'mongodb'; import { BaseRaw } from './BaseRaw'; @@ -73,4 +73,12 @@ export class LivechatCustomFieldRaw extends BaseRaw implem return record; } + + findByIdsAndScope( + ids: ILivechatCustomField['_id'][], + scope: ILivechatCustomField['scope'], + options?: FindOptions, + ): FindCursor { + return this.find({ _id: { $in: ids }, scope }, options); + } } diff --git a/apps/meteor/tests/end-to-end/api/livechat/09-visitors.ts b/apps/meteor/tests/end-to-end/api/livechat/09-visitors.ts index cfa976fc1d97..58484e857c40 100644 --- a/apps/meteor/tests/end-to-end/api/livechat/09-visitors.ts +++ b/apps/meteor/tests/end-to-end/api/livechat/09-visitors.ts @@ -115,6 +115,105 @@ describe('LIVECHAT - visitors', function () { expect(body2.visitor).to.have.property('phone'); expect(body2.visitor.phone[0].phoneNumber).to.equal(phone); }); + it('should update a visitor custom fields when customFields key is provided', async () => { + const token = `${new Date().getTime()}-test`; + const customFieldName = `new_custom_field_${Date.now()}`; + await createCustomField({ + searchable: true, + field: customFieldName, + label: customFieldName, + defaultValue: 'test_default_address', + scope: 'visitor', + visibility: 'public', + regexp: '', + }); + const { body } = await request.post(api('livechat/visitor')).send({ + visitor: { + token, + customFields: [{ key: customFieldName, value: 'Not a real address :)', overwrite: true }], + }, + }); + + expect(body).to.have.property('success', true); + expect(body).to.have.property('visitor'); + expect(body.visitor).to.have.property('token', token); + expect(body.visitor).to.have.property('livechatData'); + expect(body.visitor.livechatData).to.have.property(customFieldName, 'Not a real address :)'); + }); + + it('should not update a custom field when it does not exists', async () => { + const token = `${new Date().getTime()}-test`; + const customFieldName = `new_custom_field_${Date.now()}`; + const { body } = await request.post(api('livechat/visitor')).send({ + visitor: { + token, + customFields: [{ key: customFieldName, value: 'Not a real address :)', overwrite: true }], + }, + }); + + expect(body).to.have.property('success', true); + expect(body).to.have.property('visitor'); + expect(body.visitor).to.have.property('token', token); + expect(body.visitor).to.not.have.property('livechatData'); + }); + + it('should not update a custom field when the scope of it is not visitor', async () => { + const token = `${new Date().getTime()}-test`; + const customFieldName = `new_custom_field_${Date.now()}`; + await createCustomField({ + searchable: true, + field: customFieldName, + label: customFieldName, + defaultValue: 'test_default_address', + scope: 'room', + visibility: 'public', + regexp: '', + }); + const { body } = await request.post(api('livechat/visitor')).send({ + visitor: { + token, + customFields: [{ key: customFieldName, value: 'Not a real address :)', overwrite: true }], + }, + }); + + expect(body).to.have.property('success', true); + expect(body).to.have.property('visitor'); + expect(body.visitor).to.have.property('token', token); + expect(body.visitor).to.not.have.property('livechatData'); + }); + + it('should not update a custom field whe the overwrite flag is false', async () => { + const token = `${new Date().getTime()}-test`; + const customFieldName = `new_custom_field_${Date.now()}`; + await createCustomField({ + searchable: true, + field: customFieldName, + label: customFieldName, + defaultValue: 'test_default_address', + scope: 'visitor', + visibility: 'public', + regexp: '', + }); + await request.post(api('livechat/visitor')).send({ + visitor: { + token, + customFields: [{ key: customFieldName, value: 'Not a real address :)', overwrite: true }], + }, + }); + + const { body } = await request.post(api('livechat/visitor')).send({ + visitor: { + token, + customFields: [{ key: customFieldName, value: 'This should not change!', overwrite: false }], + }, + }); + + expect(body).to.have.property('success', true); + expect(body).to.have.property('visitor'); + expect(body.visitor).to.have.property('token', token); + expect(body.visitor).to.have.property('livechatData'); + expect(body.visitor.livechatData).to.have.property(customFieldName, 'Not a real address :)'); + }); }); describe('livechat/visitors.info', () => { diff --git a/packages/model-typings/src/models/ILivechatCustomFieldModel.ts b/packages/model-typings/src/models/ILivechatCustomFieldModel.ts index 856d39c2dd4d..06b5ac145027 100644 --- a/packages/model-typings/src/models/ILivechatCustomFieldModel.ts +++ b/packages/model-typings/src/models/ILivechatCustomFieldModel.ts @@ -34,4 +34,9 @@ export interface ILivechatCustomFieldModel extends IBaseModel; + findByIdsAndScope( + ids: ILivechatCustomField['_id'][], + scope: ILivechatCustomField['scope'], + options?: FindOptions, + ): FindCursor; } From 506fa7ca00bfac0c25dc2d730b70620042468c20 Mon Sep 17 00:00:00 2001 From: gabriellsh <40830821+gabriellsh@users.noreply.github.com> Date: Fri, 22 Mar 2024 10:54:01 -0300 Subject: [PATCH 25/79] fix: Layout shift on room body when loading uikit messages (#31894) Co-authored-by: Guilherme Gazzo --- .changeset/long-phones-reflect.md | 5 +++++ .../client/components/message/uikit/UiKitMessageBlock.tsx | 8 +++----- .../fuselage-ui-kit/src/elements/MarkdownTextElement.tsx | 8 +++++++- packages/gazzodown/src/elements/BoldSpan.tsx | 4 +--- packages/gazzodown/src/elements/InlineElements.tsx | 2 +- packages/gazzodown/src/elements/ItalicSpan.tsx | 4 +--- packages/gazzodown/src/elements/StrikeSpan.tsx | 4 +--- 7 files changed, 19 insertions(+), 16 deletions(-) create mode 100644 .changeset/long-phones-reflect.md diff --git a/.changeset/long-phones-reflect.md b/.changeset/long-phones-reflect.md new file mode 100644 index 000000000000..4c822bd2fecb --- /dev/null +++ b/.changeset/long-phones-reflect.md @@ -0,0 +1,5 @@ +--- +"@rocket.chat/meteor": patch +--- + +fixed a small issue that was causing the room layout to shift when loading apps messages diff --git a/apps/meteor/client/components/message/uikit/UiKitMessageBlock.tsx b/apps/meteor/client/components/message/uikit/UiKitMessageBlock.tsx index 3b8570e0de22..dbdd8f4e731b 100644 --- a/apps/meteor/client/components/message/uikit/UiKitMessageBlock.tsx +++ b/apps/meteor/client/components/message/uikit/UiKitMessageBlock.tsx @@ -1,8 +1,8 @@ import type { IMessage, IRoom } from '@rocket.chat/core-typings'; -import { MessageBlock, Skeleton } from '@rocket.chat/fuselage'; +import { MessageBlock } from '@rocket.chat/fuselage'; import { UiKitComponent, UiKitMessage as UiKitMessageSurfaceRender, UiKitContext } from '@rocket.chat/fuselage-ui-kit'; import type { MessageSurfaceLayout } from '@rocket.chat/ui-kit'; -import React, { Suspense } from 'react'; +import React from 'react'; import { useMessageBlockContextValue } from '../../../uikit/hooks/useMessageBlockContextValue'; import GazzodownText from '../../GazzodownText'; @@ -20,9 +20,7 @@ const UiKitMessageBlock = ({ rid, mid, blocks }: UiKitMessageBlockProps) => { - }> - - + diff --git a/packages/fuselage-ui-kit/src/elements/MarkdownTextElement.tsx b/packages/fuselage-ui-kit/src/elements/MarkdownTextElement.tsx index 3eb04576851a..21f34ada9c93 100644 --- a/packages/fuselage-ui-kit/src/elements/MarkdownTextElement.tsx +++ b/packages/fuselage-ui-kit/src/elements/MarkdownTextElement.tsx @@ -1,6 +1,8 @@ +import { Skeleton } from '@rocket.chat/fuselage'; import { Markup } from '@rocket.chat/gazzodown'; import { parse } from '@rocket.chat/message-parser'; import type { TextObject } from '@rocket.chat/ui-kit'; +import { Suspense } from 'react'; import { useAppTranslation } from '../hooks/useAppTranslation'; @@ -15,7 +17,11 @@ const MarkdownTextElement = ({ textObject }: { textObject: TextObject }) => { return null; } - return ; + return ( + }> + ; + + ); }; export default MarkdownTextElement; diff --git a/packages/gazzodown/src/elements/BoldSpan.tsx b/packages/gazzodown/src/elements/BoldSpan.tsx index 8ce85f4dccc0..c00cd0c1d95a 100644 --- a/packages/gazzodown/src/elements/BoldSpan.tsx +++ b/packages/gazzodown/src/elements/BoldSpan.tsx @@ -1,7 +1,7 @@ import type * as MessageParser from '@rocket.chat/message-parser'; import type { ReactElement } from 'react'; -import { lazy } from 'react'; +import CodeElement from '../code/CodeElement'; import EmojiElement from '../emoji/EmojiElement'; import ChannelMentionElement from '../mentions/ChannelMentionElement'; import UserMentionElement from '../mentions/UserMentionElement'; @@ -10,8 +10,6 @@ import LinkSpan from './LinkSpan'; import PlainSpan from './PlainSpan'; import StrikeSpan from './StrikeSpan'; -const CodeElement = lazy(() => import('../code/CodeElement')); - type MessageBlock = | MessageParser.Emoji | MessageParser.ChannelMention diff --git a/packages/gazzodown/src/elements/InlineElements.tsx b/packages/gazzodown/src/elements/InlineElements.tsx index e263510f843a..39fcd7938cff 100644 --- a/packages/gazzodown/src/elements/InlineElements.tsx +++ b/packages/gazzodown/src/elements/InlineElements.tsx @@ -1,6 +1,7 @@ import type * as MessageParser from '@rocket.chat/message-parser'; import { lazy, ReactElement } from 'react'; +import CodeElement from '../code/CodeElement'; import ColorElement from '../colors/ColorElement'; import EmojiElement from '../emoji/EmojiElement'; import KatexErrorBoundary from '../katex/KatexErrorBoundary'; @@ -14,7 +15,6 @@ import PlainSpan from './PlainSpan'; import StrikeSpan from './StrikeSpan'; import Timestamp from './Timestamp'; -const CodeElement = lazy(() => import('../code/CodeElement')); const KatexElement = lazy(() => import('../katex/KatexElement')); type InlineElementsProps = { diff --git a/packages/gazzodown/src/elements/ItalicSpan.tsx b/packages/gazzodown/src/elements/ItalicSpan.tsx index 778b37cc2c47..4893d3b7e3b6 100644 --- a/packages/gazzodown/src/elements/ItalicSpan.tsx +++ b/packages/gazzodown/src/elements/ItalicSpan.tsx @@ -1,7 +1,7 @@ import type * as MessageParser from '@rocket.chat/message-parser'; import type { ReactElement } from 'react'; -import { lazy } from 'react'; +import CodeElement from '../code/CodeElement'; import EmojiElement from '../emoji/EmojiElement'; import ChannelMentionElement from '../mentions/ChannelMentionElement'; import UserMentionElement from '../mentions/UserMentionElement'; @@ -10,8 +10,6 @@ import LinkSpan from './LinkSpan'; import PlainSpan from './PlainSpan'; import StrikeSpan from './StrikeSpan'; -const CodeElement = lazy(() => import('../code/CodeElement')); - type MessageBlock = | MessageParser.Emoji | MessageParser.ChannelMention diff --git a/packages/gazzodown/src/elements/StrikeSpan.tsx b/packages/gazzodown/src/elements/StrikeSpan.tsx index bbc4b899a40f..34417f45d787 100644 --- a/packages/gazzodown/src/elements/StrikeSpan.tsx +++ b/packages/gazzodown/src/elements/StrikeSpan.tsx @@ -1,7 +1,7 @@ import type * as MessageParser from '@rocket.chat/message-parser'; import type { ReactElement } from 'react'; -import { lazy } from 'react'; +import CodeElement from '../code/CodeElement'; import EmojiElement from '../emoji/EmojiElement'; import ChannelMentionElement from '../mentions/ChannelMentionElement'; import UserMentionElement from '../mentions/UserMentionElement'; @@ -10,8 +10,6 @@ import ItalicSpan from './ItalicSpan'; import LinkSpan from './LinkSpan'; import PlainSpan from './PlainSpan'; -const CodeElement = lazy(() => import('../code/CodeElement')); - type MessageBlock = | MessageParser.Timestamp | MessageParser.Emoji From 574682dedf337441c2d6a211623223b9b226924c Mon Sep 17 00:00:00 2001 From: Martin Schoeler Date: Fri, 22 Mar 2024 11:15:51 -0300 Subject: [PATCH 26/79] test(Omnichannel): fix priorities flaky test (#32051) --- .../tests/e2e/omnichannel/omnichannel-priorities-sidebar.spec.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/apps/meteor/tests/e2e/omnichannel/omnichannel-priorities-sidebar.spec.ts b/apps/meteor/tests/e2e/omnichannel/omnichannel-priorities-sidebar.spec.ts index f9550ebbac0e..31add936d346 100644 --- a/apps/meteor/tests/e2e/omnichannel/omnichannel-priorities-sidebar.spec.ts +++ b/apps/meteor/tests/e2e/omnichannel/omnichannel-priorities-sidebar.spec.ts @@ -63,6 +63,7 @@ test.describe.serial('OC - Priorities [Sidebar]', () => { await test.step('expect to change inquiry priority using sidebar menu', async () => { await poHomeChannel.sidenav.getSidebarItemByName(NEW_USER.name).click(); + await expect(poHomeChannel.content.btnTakeChat).toBeVisible(); await expect(poRoomInfo.getLabel('Priority')).not.toBeVisible(); From b33e5a95fd83c0fb4651eee72cc8f18e8423f82e Mon Sep 17 00:00:00 2001 From: Aleksander Nicacio da Silva Date: Fri, 22 Mar 2024 16:40:05 -0300 Subject: [PATCH 27/79] feat: added tag to premium settings in CE workspaces (#32038) --- .changeset/thirty-berries-learn.md | 8 +++++++ .../views/admin/settings/MemoizedSetting.tsx | 2 +- .../client/views/admin/settings/Setting.tsx | 21 ++++++++++++++++--- .../settings/inputs/AssetSettingInput.tsx | 18 +++++++--------- .../settings/inputs/BooleanSettingInput.tsx | 14 +++---------- .../inputs/CodeMirror/CodeMirrorBox.tsx | 4 ++-- .../settings/inputs/CodeSettingInput.tsx | 12 ++--------- .../settings/inputs/ColorSettingInput.tsx | 15 +++---------- .../settings/inputs/FontSettingInput.tsx | 14 +++---------- .../settings/inputs/GenericSettingInput.tsx | 14 +++---------- .../admin/settings/inputs/IntSettingInput.tsx | 13 ++---------- .../settings/inputs/LanguageSettingInput.tsx | 15 ++----------- .../settings/inputs/LookupSettingInput.tsx | 14 ++----------- .../inputs/MultiSelectSettingInput.tsx | 14 ++----------- .../settings/inputs/PasswordSettingInput.tsx | 15 ++----------- .../inputs/RelativeUrlSettingInput.tsx | 15 ++----------- .../settings/inputs/RoomPickSettingInput.tsx | 14 ++----------- .../settings/inputs/SelectSettingInput.tsx | 14 ++----------- .../inputs/SelectTimezoneSettingInput.tsx | 15 ++----------- .../settings/inputs/StringSettingInput.tsx | 14 ++----------- .../views/admin/settings/inputs/types.ts | 18 ++++++++++++++++ 21 files changed, 89 insertions(+), 194 deletions(-) create mode 100644 .changeset/thirty-berries-learn.md create mode 100644 apps/meteor/client/views/admin/settings/inputs/types.ts diff --git a/.changeset/thirty-berries-learn.md b/.changeset/thirty-berries-learn.md new file mode 100644 index 000000000000..99a88729c99a --- /dev/null +++ b/.changeset/thirty-berries-learn.md @@ -0,0 +1,8 @@ +--- +"@rocket.chat/meteor": patch +--- + +**Added tag to premium settings in CE workspaces** + +A premium tag will be displayed alongside the setting label for premium exclusive settings in CE workspaces. +This will bring visibility for users of our premium features while also informing them of the reason why the setting is currently disabled. diff --git a/apps/meteor/client/views/admin/settings/MemoizedSetting.tsx b/apps/meteor/client/views/admin/settings/MemoizedSetting.tsx index 5534e4cef7b3..d0b5c10e2c80 100644 --- a/apps/meteor/client/views/admin/settings/MemoizedSetting.tsx +++ b/apps/meteor/client/views/admin/settings/MemoizedSetting.tsx @@ -55,7 +55,7 @@ type MemoizedSettingProps = { onResetButtonClick?: () => void; className?: string; invisible?: boolean; - label?: string; + label?: ReactNode; sectionChanged?: boolean; hasResetButton?: boolean; disabled?: boolean; diff --git a/apps/meteor/client/views/admin/settings/Setting.tsx b/apps/meteor/client/views/admin/settings/Setting.tsx index d9076e5fb4f6..6a08352b9180 100644 --- a/apps/meteor/client/views/admin/settings/Setting.tsx +++ b/apps/meteor/client/views/admin/settings/Setting.tsx @@ -1,6 +1,6 @@ import type { ISettingColor, SettingEditor, SettingValue } from '@rocket.chat/core-typings'; import { isSettingColor, isSetting } from '@rocket.chat/core-typings'; -import { Button } from '@rocket.chat/fuselage'; +import { Box, Button, Tag } from '@rocket.chat/fuselage'; import { useDebouncedCallback } from '@rocket.chat/fuselage-hooks'; import { useSettingStructure, useTranslation } from '@rocket.chat/ui-contexts'; import type { ReactElement } from 'react'; @@ -96,7 +96,7 @@ function Setting({ className = undefined, settingId, sectionChanged }: SettingPr const { _id, disabled, readonly, type, packageValue, i18nLabel, i18nDescription, alert, invisible } = setting; - const label = (t.has(i18nLabel) && t(i18nLabel)) || (t.has(_id) && t(_id)) || i18nLabel || _id; + const labelText = (t.has(i18nLabel) && t(i18nLabel)) || (t.has(_id) && t(_id)) || i18nLabel || _id; const hint = useMemo( () => @@ -119,6 +119,21 @@ function Setting({ className = undefined, settingId, sectionChanged }: SettingPr [shouldDisableEnterprise, t], ); + const label = useMemo(() => { + if (!shouldDisableEnterprise) { + return labelText; + } + + return ( + <> + + {labelText} + + {t('Premium')} + + ); + }, [labelText, shouldDisableEnterprise, t]); + const hasResetButton = !shouldDisableEnterprise && !readonly && @@ -132,7 +147,7 @@ function Setting({ className = undefined, settingId, sectionChanged }: SettingPr return ( , 'onChangeValue'> & { asset?: any; - required?: boolean; fileConstraints?: { extensions: string[] }; }; -function AssetSettingInput({ _id, label, value, asset, required, fileConstraints }: AssetSettingInputProps): ReactElement { +function AssetSettingInput({ _id, label, value, asset, required, disabled, fileConstraints }: AssetSettingInputProps): ReactElement { const t = useTranslation(); const dispatchToastMessage = useToastMessageDispatch(); @@ -78,19 +75,20 @@ function AssetSettingInput({ _id, label, value, asset, required, fileConstraints )}
{value?.url ? ( - ) : ( -
+ {t('Select_file')} -
+ )}
diff --git a/apps/meteor/client/views/admin/settings/inputs/BooleanSettingInput.tsx b/apps/meteor/client/views/admin/settings/inputs/BooleanSettingInput.tsx index 7dc45f6a5392..cf18a6f0d1df 100644 --- a/apps/meteor/client/views/admin/settings/inputs/BooleanSettingInput.tsx +++ b/apps/meteor/client/views/admin/settings/inputs/BooleanSettingInput.tsx @@ -3,18 +3,10 @@ import type { ReactElement, SyntheticEvent } from 'react'; import React from 'react'; import ResetSettingButton from '../ResetSettingButton'; +import type { SettingInputProps } from './types'; + +type BooleanSettingInputProps = SettingInputProps; -type BooleanSettingInputProps = { - _id: string; - label: string; - disabled?: boolean; - readonly?: boolean; - required?: boolean; - value: boolean; - hasResetButton: boolean; - onChangeValue: (value: boolean) => void; - onResetButtonClick: () => void; -}; function BooleanSettingInput({ _id, label, diff --git a/apps/meteor/client/views/admin/settings/inputs/CodeMirror/CodeMirrorBox.tsx b/apps/meteor/client/views/admin/settings/inputs/CodeMirror/CodeMirrorBox.tsx index 730b22b6b58c..ce6d2dfd6000 100644 --- a/apps/meteor/client/views/admin/settings/inputs/CodeMirror/CodeMirrorBox.tsx +++ b/apps/meteor/client/views/admin/settings/inputs/CodeMirror/CodeMirrorBox.tsx @@ -2,10 +2,10 @@ import { css } from '@rocket.chat/css-in-js'; import { Box, Button, ButtonGroup } from '@rocket.chat/fuselage'; import { useToggle } from '@rocket.chat/fuselage-hooks'; import { useTranslation } from '@rocket.chat/ui-contexts'; -import type { ReactElement } from 'react'; +import type { ReactElement, ReactNode } from 'react'; import React from 'react'; -const CodeMirrorBox = ({ label, children }: { label: string; children: ReactElement }) => { +const CodeMirrorBox = ({ label, children }: { label: ReactNode; children: ReactElement }) => { const t = useTranslation(); const [fullScreen, toggleFullScreen] = useToggle(false); diff --git a/apps/meteor/client/views/admin/settings/inputs/CodeSettingInput.tsx b/apps/meteor/client/views/admin/settings/inputs/CodeSettingInput.tsx index 0424e862bd08..f019e4742bf4 100644 --- a/apps/meteor/client/views/admin/settings/inputs/CodeSettingInput.tsx +++ b/apps/meteor/client/views/admin/settings/inputs/CodeSettingInput.tsx @@ -5,21 +5,13 @@ import React from 'react'; import ResetSettingButton from '../ResetSettingButton'; import CodeMirror from './CodeMirror'; import CodeMirrorBox from './CodeMirror/CodeMirrorBox'; +import type { SettingInputProps } from './types'; -type CodeSettingInputProps = { - _id: string; - label: string; +type CodeSettingInputProps = SettingInputProps & { hint: string; - value?: string; code: string; - placeholder?: string; readonly: boolean; - autocomplete: boolean; disabled: boolean; - required?: boolean; - hasResetButton: boolean; - onChangeValue: (value: string) => void; - onResetButtonClick: () => void; }; function CodeSettingInput({ diff --git a/apps/meteor/client/views/admin/settings/inputs/ColorSettingInput.tsx b/apps/meteor/client/views/admin/settings/inputs/ColorSettingInput.tsx index a4f61b811549..dab9e63f7435 100644 --- a/apps/meteor/client/views/admin/settings/inputs/ColorSettingInput.tsx +++ b/apps/meteor/client/views/admin/settings/inputs/ColorSettingInput.tsx @@ -5,23 +5,14 @@ import type { ReactElement } from 'react'; import React, { useCallback } from 'react'; import ResetSettingButton from '../ResetSettingButton'; +import type { SettingInputProps } from './types'; -type ColorSettingInputProps = { - _id: string; - label: string; +type ColorSettingInputProps = SettingInputProps & { value: string; editor: string; allowedTypes?: TranslationKey[]; - placeholder?: string; - readonly?: boolean; - autocomplete?: boolean; - disabled?: boolean; - required?: boolean; - hasResetButton?: boolean; - onChangeValue?: (value: string) => void; - onChangeEditor?: (value: string) => void; - onResetButtonClick?: () => void; }; + function ColorSettingInput({ _id, label, diff --git a/apps/meteor/client/views/admin/settings/inputs/FontSettingInput.tsx b/apps/meteor/client/views/admin/settings/inputs/FontSettingInput.tsx index 1c1c45913bc1..4508f52222ba 100644 --- a/apps/meteor/client/views/admin/settings/inputs/FontSettingInput.tsx +++ b/apps/meteor/client/views/admin/settings/inputs/FontSettingInput.tsx @@ -3,20 +3,12 @@ import type { FormEventHandler, ReactElement } from 'react'; import React from 'react'; import ResetSettingButton from '../ResetSettingButton'; +import type { SettingInputProps } from './types'; -type FontSettingInputProps = { - _id: string; - label: string; +type FontSettingInputProps = SettingInputProps & { value: string; - placeholder?: string; - readonly?: boolean; - autocomplete?: boolean; - disabled?: boolean; - required?: boolean; - hasResetButton?: boolean; - onChangeValue?: (value: string) => void; - onResetButtonClick?: () => void; }; + function FontSettingInput({ _id, label, diff --git a/apps/meteor/client/views/admin/settings/inputs/GenericSettingInput.tsx b/apps/meteor/client/views/admin/settings/inputs/GenericSettingInput.tsx index daabea2b1d0e..8f6c38dbe22e 100644 --- a/apps/meteor/client/views/admin/settings/inputs/GenericSettingInput.tsx +++ b/apps/meteor/client/views/admin/settings/inputs/GenericSettingInput.tsx @@ -3,20 +3,12 @@ import type { FormEventHandler, ReactElement } from 'react'; import React from 'react'; import ResetSettingButton from '../ResetSettingButton'; +import type { SettingInputProps } from './types'; -type GenericSettingInputProps = { - _id: string; - label: string; +type GenericSettingInputProps = SettingInputProps & { value: string; - placeholder?: string; - readonly?: boolean; - autocomplete?: boolean; - disabled?: boolean; - required?: boolean; - hasResetButton?: boolean; - onChangeValue?: (value: string) => void; - onResetButtonClick?: () => void; }; + function GenericSettingInput({ _id, label, diff --git a/apps/meteor/client/views/admin/settings/inputs/IntSettingInput.tsx b/apps/meteor/client/views/admin/settings/inputs/IntSettingInput.tsx index 16100f128466..053f00be2f85 100644 --- a/apps/meteor/client/views/admin/settings/inputs/IntSettingInput.tsx +++ b/apps/meteor/client/views/admin/settings/inputs/IntSettingInput.tsx @@ -3,19 +3,10 @@ import type { FormEventHandler, ReactElement } from 'react'; import React from 'react'; import ResetSettingButton from '../ResetSettingButton'; +import type { SettingInputProps } from './types'; -type IntSettingInputProps = { - _id: string; - label: string; +type IntSettingInputProps = SettingInputProps & { value: string; - placeholder?: string; - readonly?: boolean; - autocomplete?: boolean; - disabled?: boolean; - required?: boolean; - hasResetButton?: boolean; - onChangeValue?: (value: string | number) => void; - onResetButtonClick?: () => void; }; function IntSettingInput({ diff --git a/apps/meteor/client/views/admin/settings/inputs/LanguageSettingInput.tsx b/apps/meteor/client/views/admin/settings/inputs/LanguageSettingInput.tsx index f91642a5eed9..6044cc754602 100644 --- a/apps/meteor/client/views/admin/settings/inputs/LanguageSettingInput.tsx +++ b/apps/meteor/client/views/admin/settings/inputs/LanguageSettingInput.tsx @@ -4,20 +4,9 @@ import type { ReactElement } from 'react'; import React from 'react'; import ResetSettingButton from '../ResetSettingButton'; +import type { SettingInputProps } from './types'; -type LanguageSettingInputProps = { - _id: string; - label: string; - value: string; - placeholder?: string; - readonly?: boolean; - autocomplete?: boolean; - disabled?: boolean; - required?: boolean; - hasResetButton?: boolean; - onChangeValue?: (value: string | number) => void; - onResetButtonClick?: () => void; -}; +type LanguageSettingInputProps = SettingInputProps; function LanguageSettingInput({ _id, diff --git a/apps/meteor/client/views/admin/settings/inputs/LookupSettingInput.tsx b/apps/meteor/client/views/admin/settings/inputs/LookupSettingInput.tsx index 360eba91a785..d2c7029f994d 100644 --- a/apps/meteor/client/views/admin/settings/inputs/LookupSettingInput.tsx +++ b/apps/meteor/client/views/admin/settings/inputs/LookupSettingInput.tsx @@ -6,20 +6,10 @@ import React from 'react'; import type { AsyncState } from '../../../../hooks/useAsyncState'; import { useEndpointData } from '../../../../hooks/useEndpointData'; import ResetSettingButton from '../ResetSettingButton'; +import type { SettingInputProps } from './types'; -type LookupSettingInputProps = { - _id: string; - label: string; - value?: string; +type LookupSettingInputProps = SettingInputProps & { lookupEndpoint: PathPattern extends `/${infer U}` ? U : PathPattern; - placeholder?: string; - readonly?: boolean; - autocomplete?: boolean; - disabled?: boolean; - required?: boolean; - hasResetButton?: boolean; - onChangeValue?: (value: string) => void; - onResetButtonClick?: () => void; }; function LookupSettingInput({ diff --git a/apps/meteor/client/views/admin/settings/inputs/MultiSelectSettingInput.tsx b/apps/meteor/client/views/admin/settings/inputs/MultiSelectSettingInput.tsx index c0d12ee401cf..a484dc1133f0 100644 --- a/apps/meteor/client/views/admin/settings/inputs/MultiSelectSettingInput.tsx +++ b/apps/meteor/client/views/admin/settings/inputs/MultiSelectSettingInput.tsx @@ -5,21 +5,11 @@ import type { ReactElement } from 'react'; import React from 'react'; import ResetSettingButton from '../ResetSettingButton'; +import type { SettingInputProps } from './types'; export type valuesOption = { key: string; i18nLabel: TranslationKey }; -type MultiSelectSettingInputProps = { - _id: string; - label: string; - value?: [string, string]; +type MultiSelectSettingInputProps = SettingInputProps<[string, string], string[]> & { values: valuesOption[]; - placeholder?: string; - readonly?: boolean; - autocomplete?: boolean; - disabled?: boolean; - required?: boolean; - hasResetButton?: boolean; - onChangeValue?: (value: string[]) => void; - onResetButtonClick?: () => void; }; function MultiSelectSettingInput({ diff --git a/apps/meteor/client/views/admin/settings/inputs/PasswordSettingInput.tsx b/apps/meteor/client/views/admin/settings/inputs/PasswordSettingInput.tsx index 249fb7e8c90d..75743c9f5a6c 100644 --- a/apps/meteor/client/views/admin/settings/inputs/PasswordSettingInput.tsx +++ b/apps/meteor/client/views/admin/settings/inputs/PasswordSettingInput.tsx @@ -3,20 +3,9 @@ import type { EventHandler, ReactElement, SyntheticEvent } from 'react'; import React from 'react'; import ResetSettingButton from '../ResetSettingButton'; +import type { SettingInputProps } from './types'; -type PasswordSettingInputProps = { - _id: string; - label: string; - value?: string | number | readonly string[] | undefined; - placeholder?: string; - readonly?: boolean; - autocomplete?: boolean; - disabled?: boolean; - required?: boolean; - hasResetButton?: boolean; - onChangeValue?: (value: string) => void; - onResetButtonClick?: () => void; -}; +type PasswordSettingInputProps = SettingInputProps; function PasswordSettingInput({ _id, diff --git a/apps/meteor/client/views/admin/settings/inputs/RelativeUrlSettingInput.tsx b/apps/meteor/client/views/admin/settings/inputs/RelativeUrlSettingInput.tsx index 681232e41802..ac03596cc273 100644 --- a/apps/meteor/client/views/admin/settings/inputs/RelativeUrlSettingInput.tsx +++ b/apps/meteor/client/views/admin/settings/inputs/RelativeUrlSettingInput.tsx @@ -4,20 +4,9 @@ import type { EventHandler, ReactElement, SyntheticEvent } from 'react'; import React from 'react'; import ResetSettingButton from '../ResetSettingButton'; +import type { SettingInputProps } from './types'; -type RelativeUrlSettingInputProps = { - _id: string; - label: string; - value?: string; - placeholder?: string; - readonly?: boolean; - autocomplete?: boolean; - disabled?: boolean; - required?: boolean; - hasResetButton?: boolean; - onChangeValue?: (value: string) => void; - onResetButtonClick?: () => void; -}; +type RelativeUrlSettingInputProps = SettingInputProps; function RelativeUrlSettingInput({ _id, diff --git a/apps/meteor/client/views/admin/settings/inputs/RoomPickSettingInput.tsx b/apps/meteor/client/views/admin/settings/inputs/RoomPickSettingInput.tsx index fab66ff7a066..df2a4c1b0688 100644 --- a/apps/meteor/client/views/admin/settings/inputs/RoomPickSettingInput.tsx +++ b/apps/meteor/client/views/admin/settings/inputs/RoomPickSettingInput.tsx @@ -5,19 +5,9 @@ import React from 'react'; import RoomAutoCompleteMultiple from '../../../../components/RoomAutoCompleteMultiple'; import ResetSettingButton from '../ResetSettingButton'; +import type { SettingInputProps } from './types'; -type RoomPickSettingInputProps = { - _id: string; - label: string; - value?: SettingValueRoomPick | ''; - placeholder?: string; - readonly?: boolean; - disabled?: boolean; - required?: boolean; - hasResetButton?: boolean; - onChangeValue: (value: SettingValueRoomPick) => void; - onResetButtonClick?: () => void; -}; +type RoomPickSettingInputProps = SettingInputProps; function RoomPickSettingInput({ _id, diff --git a/apps/meteor/client/views/admin/settings/inputs/SelectSettingInput.tsx b/apps/meteor/client/views/admin/settings/inputs/SelectSettingInput.tsx index f12104f07d0c..2ace88fda2cb 100644 --- a/apps/meteor/client/views/admin/settings/inputs/SelectSettingInput.tsx +++ b/apps/meteor/client/views/admin/settings/inputs/SelectSettingInput.tsx @@ -5,20 +5,10 @@ import type { ReactElement } from 'react'; import React from 'react'; import ResetSettingButton from '../ResetSettingButton'; +import type { SettingInputProps } from './types'; -type SelectSettingInputProps = { - _id: string; - label: string; - value?: string; +type SelectSettingInputProps = SettingInputProps & { values?: { key: string; i18nLabel: TranslationKey }[]; - placeholder?: string; - readonly?: boolean; - autocomplete?: boolean; - disabled?: boolean; - required?: boolean; - hasResetButton?: boolean; - onChangeValue?: (value: string) => void; - onResetButtonClick?: () => void; }; function SelectSettingInput({ diff --git a/apps/meteor/client/views/admin/settings/inputs/SelectTimezoneSettingInput.tsx b/apps/meteor/client/views/admin/settings/inputs/SelectTimezoneSettingInput.tsx index 55f877c77c44..fd1fc147a51a 100644 --- a/apps/meteor/client/views/admin/settings/inputs/SelectTimezoneSettingInput.tsx +++ b/apps/meteor/client/views/admin/settings/inputs/SelectTimezoneSettingInput.tsx @@ -4,20 +4,9 @@ import type { ReactElement } from 'react'; import React from 'react'; import ResetSettingButton from '../ResetSettingButton'; +import type { SettingInputProps } from './types'; -type SelectTimezoneSettingInputProps = { - _id: string; - label: string; - value?: string; - placeholder?: string; - readonly?: boolean; - autocomplete?: boolean; - disabled?: boolean; - required?: boolean; - hasResetButton?: boolean; - onChangeValue?: (value: string) => void; - onResetButtonClick?: () => void; -}; +type SelectTimezoneSettingInputProps = SettingInputProps; function SelectTimezoneSettingInput({ _id, diff --git a/apps/meteor/client/views/admin/settings/inputs/StringSettingInput.tsx b/apps/meteor/client/views/admin/settings/inputs/StringSettingInput.tsx index 1803f54a3631..2652fb122162 100644 --- a/apps/meteor/client/views/admin/settings/inputs/StringSettingInput.tsx +++ b/apps/meteor/client/views/admin/settings/inputs/StringSettingInput.tsx @@ -3,22 +3,12 @@ import type { EventHandler, ReactElement, SyntheticEvent } from 'react'; import React from 'react'; import ResetSettingButton from '../ResetSettingButton'; +import type { SettingInputProps } from './types'; -type StringSettingInputProps = { - _id: string; - label: string; +type StringSettingInputProps = SettingInputProps & { name?: string; - value?: string; multiline?: boolean; - placeholder?: string; - readonly?: boolean; error?: string; - autocomplete?: boolean; - disabled?: boolean; - required?: boolean; - hasResetButton?: boolean; - onChangeValue?: (value: string) => void; - onResetButtonClick?: () => void; }; function StringSettingInput({ diff --git a/apps/meteor/client/views/admin/settings/inputs/types.ts b/apps/meteor/client/views/admin/settings/inputs/types.ts new file mode 100644 index 000000000000..d978a3ad6b4d --- /dev/null +++ b/apps/meteor/client/views/admin/settings/inputs/types.ts @@ -0,0 +1,18 @@ +import type { ReactNode } from 'react'; + +export type SettingInputProps = { + _id: string; + label: ReactNode; + value?: V; + placeholder?: string; + readonly?: boolean; + autocomplete?: boolean; + disabled: boolean; + required?: boolean; + hint?: string; + editor?: string; + hasResetButton: boolean; + onChangeValue: (value: R) => void; + onResetButtonClick?: () => void; + onChangeEditor?: (value: string | undefined) => void; +}; From 9d23d40640da4deddeea8e359701e6a0a51741a2 Mon Sep 17 00:00:00 2001 From: Aleksander Nicacio da Silva Date: Fri, 22 Mar 2024 17:37:26 -0300 Subject: [PATCH 28/79] feat: Livechat theming improvements (#31772) --- .changeset/fuzzy-vans-own.md | 16 ++ .../app/livechat/server/api/lib/livechat.ts | 2 + .../app/livechat/server/lib/LivechatTyped.ts | 2 + .../livechat-enterprise/server/settings.ts | 29 +++ packages/i18n/src/locales/en.i18n.json | 5 + packages/i18n/src/locales/pt-BR.i18n.json | 5 + packages/livechat/src/components/App/App.tsx | 13 +- .../src/components/Messages/Message/index.js | 15 +- .../Messages/MessageAvatars/index.js | 22 ++- .../Messages/MessageBubble/styles.scss | 15 +- .../components/Messages/MessageList/index.js | 8 +- .../Messages/MessageList/styles.scss | 3 + .../src/components/Screen/ScreenProvider.tsx | 56 +++++- .../livechat/src/components/Screen/index.js | 13 +- .../src/components/Screen/styles.scss | 4 + packages/livechat/src/lib/hooks.ts | 1 + .../livechat/src/routes/Chat/component.js | 10 +- .../livechat/src/routes/Chat/connector.tsx | 176 +++++++++--------- packages/livechat/src/store/index.tsx | 17 +- packages/livechat/src/widget.ts | 22 ++- 20 files changed, 304 insertions(+), 130 deletions(-) create mode 100644 .changeset/fuzzy-vans-own.md diff --git a/.changeset/fuzzy-vans-own.md b/.changeset/fuzzy-vans-own.md new file mode 100644 index 000000000000..3508c6786a73 --- /dev/null +++ b/.changeset/fuzzy-vans-own.md @@ -0,0 +1,16 @@ +--- +"@rocket.chat/meteor": minor +"@rocket.chat/livechat": minor +--- + +Improved Livechat's theming capabilities + + +| Name (`setTheme`, `initialize`) | Workspace setting | Default value | Description | +|---------------------------------|----------------------------------------|---------------|-------------| +| `position` | Livechat widget position on the screen | `right` | Changes the widget position on the screen. Can be `left` or `right` | +| `background` | Livechat background | `N/A` | Changes the message list background. Accepts the same values as the CSS property [background](https://developer.mozilla.org/en-US/docs/Web/CSS/background) | +| `guestBubbleBackgroundColor` | `N/A` | `N/A` | Changes the guest's message bubble background color | +| `agentBubbleBackgroundColor` | `N/A` | `N/A` | Changes the agent's message bubble background color | +| `hideGuestAvatar` | `N/A` | `false` | Hides/shows the guest avatar | +| `hideAgentAvatar` | `N/A` | `true` | Hides/shows the agent avatar | diff --git a/apps/meteor/app/livechat/server/api/lib/livechat.ts b/apps/meteor/app/livechat/server/api/lib/livechat.ts index 0f7da0b7c9e9..097f66f35055 100644 --- a/apps/meteor/app/livechat/server/api/lib/livechat.ts +++ b/apps/meteor/app/livechat/server/api/lib/livechat.ts @@ -177,6 +177,8 @@ export async function settings({ businessUnit = '' }: { businessUnit?: string } color: initSettings.Livechat_title_color, offlineTitle: initSettings.Livechat_offline_title, offlineColor: initSettings.Livechat_offline_title_color, + position: initSettings.Livechat_widget_position || 'right', + background: initSettings.Livechat_background, actionLinks: { webrtc: [ { diff --git a/apps/meteor/app/livechat/server/lib/LivechatTyped.ts b/apps/meteor/app/livechat/server/lib/LivechatTyped.ts index 776990beaa21..2db2a6109fb6 100644 --- a/apps/meteor/app/livechat/server/lib/LivechatTyped.ts +++ b/apps/meteor/app/livechat/server/lib/LivechatTyped.ts @@ -1127,6 +1127,8 @@ class LivechatClass { 'Livechat_clear_local_storage_when_chat_ended', 'Livechat_history_monitor_type', 'Livechat_hide_system_messages', + 'Livechat_widget_position', + 'Livechat_background', ] as const; type SettingTypes = (typeof validSettings)[number] | 'Livechat_Show_Connecting'; diff --git a/apps/meteor/ee/app/livechat-enterprise/server/settings.ts b/apps/meteor/ee/app/livechat-enterprise/server/settings.ts index c2f66bc79355..27a9888fe342 100644 --- a/apps/meteor/ee/app/livechat-enterprise/server/settings.ts +++ b/apps/meteor/ee/app/livechat-enterprise/server/settings.ts @@ -194,6 +194,35 @@ export const createSettings = async (): Promise => { modules: ['livechat-enterprise'], }); + await settingsRegistry.add('Livechat_widget_position', 'right', { + type: 'select', + group: 'Omnichannel', + section: 'Livechat', + i18nLabel: 'Livechat_widget_position_on_the_screen', + public: true, + values: [ + { key: 'left', i18nLabel: 'Left' }, + { key: 'right', i18nLabel: 'Right' }, + ], + enterprise: true, + invalidValue: 'right', + modules: ['livechat-enterprise'], + enableQuery: omnichannelEnabledQuery, + }); + + await settingsRegistry.add('Livechat_background', '', { + type: 'string', + group: 'Omnichannel', + section: 'Livechat', + i18nDescription: 'Livechat_background_description', + placeholder: '#FFFFFF', + public: true, + enterprise: true, + invalidValue: '', + modules: ['livechat-enterprise'], + enableQuery: omnichannelEnabledQuery, + }); + await settingsRegistry.add('Omnichannel_contact_manager_routing', true, { type: 'boolean', group: 'Omnichannel', diff --git a/packages/i18n/src/locales/en.i18n.json b/packages/i18n/src/locales/en.i18n.json index 849dcab49c5c..8178b4fcb039 100644 --- a/packages/i18n/src/locales/en.i18n.json +++ b/packages/i18n/src/locales/en.i18n.json @@ -3117,6 +3117,7 @@ "leave-p_description": "Permission to leave private groups", "Lets_get_you_new_one_": "Let's get you a new one!", "Let_them_know": "Let them know", + "Left": "Left", "License": "License", "Line": "Line", "Link": "Link", @@ -3176,6 +3177,9 @@ "Livechat_offline_message_sent": "Livechat offline message sent", "Livechat_OfflineMessageToChannel_enabled": "Send Livechat offline messages to a channel", "Livechat_hide_system_messages": "Hide system messages", + "Livechat_widget_position_on_the_screen": "Livechat widget position on the screen", + "Livechat_background": "Livechat background", + "Livechat_background_description": "Define a background using hexadecimal (#F5455C), a color name (red) or an image using a URL (`url('https://example.com/image.png')`). This field follows CSS standards. [See documentation](https://developer.mozilla.org/en-US/docs/Web/CSS/background).", "Omnichannel_chat_closed_due_to_inactivity": "The chat was automatically closed because we haven't received any reply from {{guest}} in {{timeout}} seconds", "Omnichannel_actions": "Omnichannel actions", "Omnichannel_on_hold_chat_resumed": "On Hold Chat Resumed: {{comment}}", @@ -4449,6 +4453,7 @@ "Review_devices": "Review when and where devices are connecting from", "Ringing": "Ringing", "Ringtones_and_visual_indicators_notify_people_of_incoming_calls": "Ringtones and visual indicators notify people of incoming calls.", + "Right": "Right", "Robot_Instructions_File_Content": "Robots.txt File Contents", "Root": "Root", "Required_action": "Required action", diff --git a/packages/i18n/src/locales/pt-BR.i18n.json b/packages/i18n/src/locales/pt-BR.i18n.json index 76fc3db44e7e..01f29bd65b4f 100644 --- a/packages/i18n/src/locales/pt-BR.i18n.json +++ b/packages/i18n/src/locales/pt-BR.i18n.json @@ -2635,6 +2635,7 @@ "leave-p": "Deixar grupos privados", "leave-p_description": "Permissão para deixar grupos privados", "Lets_get_you_new_one_": "Vamos pegar outro!", + "Left": "Esquerda", "List_of_Channels": "Lista de Canais", "List_of_departments_for_forward": "Lista de departamentos permitidos para encaminhamento (opcional).", "List_of_departments_for_forward_description": "Permite definir uma lista restrita de departamentos que podem receber conversas deste departamento.", @@ -2685,6 +2686,9 @@ "Livechat_offline_message_sent": "Mensagem offline do livechat enviada", "Livechat_OfflineMessageToChannel_enabled": "Envie mensagens offline do livechat para um canal", "Livechat_hide_system_messages": "Ocultar mensagens do sistema", + "Livechat_widget_position_on_the_screen": "Posição do livechat widget na tela", + "Livechat_background": "Livechat plano de fundo", + "Livechat_background_description": "Defina uma plano de fundo usando hexadecimal (#F5455C), um nome de cor (red) ou uma imagem através de uma URL (`url('https://example.com/image.png')`). Este campo segue os padrões do CSS. [See documentation](https://developer.mozilla.org/en-US/docs/Web/CSS/background).", "Omnichannel_on_hold_chat_resumed": "Conversa em espera retomada: {{comment}}", "Omnichannel_on_hold_chat_automatically": "A conversa foi automaticamente retomada de em espera após receber uma nova mensagem de {{guest}}", "Omnichannel_on_hold_chat_resumed_manually": "A conversa foi manualmente retomada de em espera por {{user}}", @@ -3655,6 +3659,7 @@ "Return_to_previous_page": "Retornar para a página anterior", "Return_to_the_queue": "Retornar para fila", "Ringing": "Tocando", + "Right": "Direita", "Robot_Instructions_File_Content": "Conteúdo do arquivo Robots.txt", "Default_Referrer_Policy": "Política de referência padrão", "Default_Referrer_Policy_Description": "Controla o cabeçalho 'referência' que é enviado ao solicitar mídia incorporada de outros servidores. Para obter mais informações, consulte [este link do MDN](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Referrer-Policy). Lembre-se de que é necessária uma atualização completa da página para ter resultado.", diff --git a/packages/livechat/src/components/App/App.tsx b/packages/livechat/src/components/App/App.tsx index ba1f435409f3..ba3e941c2755 100644 --- a/packages/livechat/src/components/App/App.tsx +++ b/packages/livechat/src/components/App/App.tsx @@ -22,17 +22,13 @@ import LeaveMessage from '../../routes/LeaveMessage'; import Register from '../../routes/Register'; import SwitchDepartment from '../../routes/SwitchDepartment'; import TriggerMessage from '../../routes/TriggerMessage'; -import type { Dispatch } from '../../store'; +import type { Dispatch, StoreState } from '../../store'; import { ScreenProvider } from '../Screen/ScreenProvider'; type AppProps = { config: { - settings: { - registrationForm?: boolean; - nameFieldRegistrationForm?: boolean; - emailFieldRegistrationForm?: boolean; - forceAcceptDataProcessingConsent?: boolean; - }; + settings: StoreState['config']['settings']; + theme: StoreState['config']['theme']; online?: boolean; departments: Department[]; enabled?: boolean; @@ -64,6 +60,7 @@ type AppProps = { name: string; email: string; }; + theme: StoreState['iframe']['theme']; }; i18n: typeof i18next; }; @@ -141,11 +138,13 @@ export class App extends Component { const { minimized, iframe: { visible }, + config: { theme }, dispatch, } = this.props; parentCall(minimized ? 'minimizeWindow' : 'restoreWindow'); parentCall(visible ? 'showWidget' : 'hideWidget'); + parentCall('setWidgetPosition', theme.position || 'right'); visibility.addListener(this.handleVisibilityChange); diff --git a/packages/livechat/src/components/Messages/Message/index.js b/packages/livechat/src/components/Messages/Message/index.js index 56cd74239e5a..74387dae6719 100644 --- a/packages/livechat/src/components/Messages/Message/index.js +++ b/packages/livechat/src/components/Messages/Message/index.js @@ -92,9 +92,20 @@ const getMessageUsernames = (compact, message) => { return [username]; }; -const Message = ({ avatarResolver, attachmentResolver = getAttachmentUrl, use, me, compact, className, style = {}, t, ...message }) => ( +const Message = ({ + avatarResolver, + attachmentResolver = getAttachmentUrl, + use, + me, + compact, + className, + style = {}, + t, + hideAvatar, + ...message +}) => ( - {!message.type && } + {!message.type && !hideAvatar && } {renderContent({ text: message.type ? getSystemMessageText(message, t) : message.msg, diff --git a/packages/livechat/src/components/Messages/MessageAvatars/index.js b/packages/livechat/src/components/Messages/MessageAvatars/index.js index 07ca6644f79f..aa25528be11b 100644 --- a/packages/livechat/src/components/Messages/MessageAvatars/index.js +++ b/packages/livechat/src/components/Messages/MessageAvatars/index.js @@ -4,10 +4,18 @@ import { createClassName } from '../../../helpers/createClassName'; import { Avatar } from '../../Avatar'; import styles from './styles.scss'; -export const MessageAvatars = memo(({ avatarResolver = () => null, usernames = [], className, style = {} }) => ( -
- {usernames.map((username) => ( - - ))} -
-)); +export const MessageAvatars = memo(({ avatarResolver = () => null, usernames = [], className, style = {} }) => { + const avatars = usernames.filter(Boolean); + + if (!avatars.length) { + return null; + } + + return ( +
+ {avatars.map((username) => ( + + ))} +
+ ); +}); diff --git a/packages/livechat/src/components/Messages/MessageBubble/styles.scss b/packages/livechat/src/components/Messages/MessageBubble/styles.scss index 1d1e8bc9664e..e155aa194c24 100644 --- a/packages/livechat/src/components/Messages/MessageBubble/styles.scss +++ b/packages/livechat/src/components/Messages/MessageBubble/styles.scss @@ -12,11 +12,8 @@ $message-bubble-me-link-color: $color-text-lighter; $message-bubble-nude-padding: 0; $message-bubble-quoted-padding: 12px 12px 12px 0; $message-bubble-quoted-indicator-width: 3px; -$message-bubble-quoted-indicator-margin: - (-2 * $message-bubble-quoted-indicator-width) - (2 * $message-bubble-quoted-indicator-width) - (-2 * $message-bubble-quoted-indicator-width) - $message-bubble-quoted-indicator-width; +$message-bubble-quoted-indicator-margin: (-2 * $message-bubble-quoted-indicator-width) (2 * $message-bubble-quoted-indicator-width) + (-2 * $message-bubble-quoted-indicator-width) $message-bubble-quoted-indicator-width; $message-bubble-quoted-indicator-border-radius: $default-border-radius; $message-bubble-quoted-indicator-color: $color-green; @@ -28,7 +25,7 @@ $message-bubble-quoted-indicator-color: $color-green; color: $message-bubble-color; border-radius: $message-bubble-border-radius; - background-color: $message-bubble-background-color; + background-color: var(--receiver-bubble-background-color, $message-bubble-background-color); align-items: stretch; flex-flow: row nowrap; justify-content: flex-start; @@ -39,7 +36,7 @@ $message-bubble-quoted-indicator-color: $color-green; &--inverse { color: var(--font-color, $message-bubble-me-color); - background-color: var(--color, $message-bubble-me-background-color); + background-color: var(--sender-bubble-background-color, var(--color, $message-bubble-me-background-color)); a { color: var(--font-color, $message-bubble-me-link-color); @@ -55,13 +52,13 @@ $message-bubble-quoted-indicator-color: $color-green; &--quoted { padding: $message-bubble-quoted-padding; - background-color: $message-bubble-background-color; + background-color: var(--receiver-bubble-background-color, $message-bubble-background-color); &::before { width: $message-bubble-quoted-indicator-width; margin: -6px 6px -6px 3px; - content: ""; + content: ''; border-radius: $message-bubble-quoted-indicator-border-radius; background-color: $message-bubble-quoted-indicator-color; diff --git a/packages/livechat/src/components/Messages/MessageList/index.js b/packages/livechat/src/components/Messages/MessageList/index.js index 9e94a5b83893..cd7e2017397f 100644 --- a/packages/livechat/src/components/Messages/MessageList/index.js +++ b/packages/livechat/src/components/Messages/MessageList/index.js @@ -144,8 +144,8 @@ export class MessageList extends MemoizedComponent { typingUsernames, }) => { const items = []; - const { incomingCallAlert } = store.state; - const { ongoingCall } = store.state; + const { incomingCallAlert, ongoingCall } = store.state; + const { hideSenderAvatar = false, hideReceiverAvatar = false } = this.props || {}; for (let i = 0; i < messages.length; ++i) { const previousMessage = messages[i - 1]; @@ -180,6 +180,7 @@ export class MessageList extends MemoizedComponent { items.push(); } + const isMe = uid && message.u && uid === message.u._id; items.push( unknown; dismissNotification: () => void; theme?: { - color: string; - fontColor: string; - iconColor: string; + color?: string; + fontColor?: string; + iconColor?: string; + position?: 'left' | 'right'; + guestBubbleBackgroundColor?: string; + agentBubbleBackgroundColor?: string; + background?: string; + hideGuestAvatar?: boolean; + hideAgentAvatar?: boolean; }; }; @@ -38,6 +44,8 @@ export const ScreenContext = createContext({ color: '', fontColor: '', iconColor: '', + hideAgentAvatar: false, + hideGuestAvatar: true, }, notificationsEnabled: true, minimized: true, @@ -50,13 +58,41 @@ export const ScreenContext = createContext({ } as ScreenContextValue); export const ScreenProvider: FunctionalComponent = ({ children }) => { - const { dispatch, config, sound, minimized = true, undocked, expanded = false, alerts, modal, iframe } = useContext(StoreContext); + const { + dispatch, + config, + sound, + minimized = true, + undocked, + expanded = false, + alerts, + modal, + iframe, + ...store + } = useContext(StoreContext); const { department, name, email } = iframe.guest || {}; - const { color } = config.theme || {}; - const { color: customColor, fontColor: customFontColor, iconColor: customIconColor } = iframe.theme || {}; + const { color, position: configPosition, background } = config.theme || {}; + + const { + color: customColor, + fontColor: customFontColor, + iconColor: customIconColor, + guestBubbleBackgroundColor, + agentBubbleBackgroundColor, + position: customPosition, + background: customBackground, + hideAgentAvatar = false, + hideGuestAvatar = true, + } = iframe.theme || {}; const [poppedOut, setPopedOut] = useState(false); + const position = customPosition || configPosition || 'right'; + + useEffect(() => { + parentCall('setWidgetPosition', position || 'right'); + }, [position]); + const handleEnableNotifications = () => { dispatch({ sound: { ...sound, enabled: true } }); }; @@ -118,6 +154,12 @@ export const ScreenProvider: FunctionalComponent = ({ children }) => { color: customColor || color, fontColor: customFontColor, iconColor: customIconColor, + position, + guestBubbleBackgroundColor, + agentBubbleBackgroundColor, + background: customBackground || background, + hideAgentAvatar, + hideGuestAvatar, }, notificationsEnabled: sound?.enabled, minimized: !poppedOut && (minimized || undocked), diff --git a/packages/livechat/src/components/Screen/index.js b/packages/livechat/src/components/Screen/index.js index f9bf036e19e2..c3b792f16a54 100644 --- a/packages/livechat/src/components/Screen/index.js +++ b/packages/livechat/src/components/Screen/index.js @@ -69,6 +69,9 @@ const CssVar = ({ theme }) => { ${theme.color ? `--color: ${theme.color};` : ''} ${theme.fontColor ? `--font-color: ${theme.fontColor};` : ''} ${theme.iconColor ? `--icon-color: ${theme.iconColor};` : ''} + ${theme.guestBubbleBackgroundColor ? `--sender-bubble-background-color: ${theme.guestBubbleBackgroundColor};` : ''} + ${theme.agentBubbleBackgroundColor ? `--receiver-bubble-background-color: ${theme.agentBubbleBackgroundColor};` : ''} + ${theme.background ? `--message-list-background: ${theme.background};` : ''} } `} ); @@ -95,7 +98,15 @@ export const Screen = ({ title, color, agent, children, className, unread, trigg } = useContext(ScreenContext); return ( -
+
{triggered && ( + ); +}; diff --git a/packages/livechat/src/components/Screen/ScreenProvider.tsx b/packages/livechat/src/components/Screen/ScreenProvider.tsx index 164452e784d2..1d1295b126b3 100644 --- a/packages/livechat/src/components/Screen/ScreenProvider.tsx +++ b/packages/livechat/src/components/Screen/ScreenProvider.tsx @@ -9,6 +9,8 @@ import Triggers from '../../lib/triggers'; import { StoreContext } from '../../store'; export type ScreenContextValue = { + hideWatermark: boolean; + livechatLogo: { url: string } | undefined; notificationsEnabled: boolean; minimized: boolean; expanded: boolean; @@ -72,6 +74,7 @@ export const ScreenProvider: FunctionalComponent = ({ children }) => { } = useContext(StoreContext); const { department, name, email } = iframe.guest || {}; const { color, position: configPosition, background } = config.theme || {}; + const { livechatLogo, hideWatermark = false } = config.settings || {}; const { color: customColor, @@ -165,6 +168,8 @@ export const ScreenProvider: FunctionalComponent = ({ children }) => { minimized: !poppedOut && (minimized || undocked), expanded: !minimized && expanded, windowed: !minimized && poppedOut, + livechatLogo, + hideWatermark, sound, alerts, modal, diff --git a/packages/livechat/src/components/Screen/index.js b/packages/livechat/src/components/Screen/index.js index c3b792f16a54..4123a832d8ee 100644 --- a/packages/livechat/src/components/Screen/index.js +++ b/packages/livechat/src/components/Screen/index.js @@ -1,12 +1,12 @@ import { useContext, useEffect } from 'preact/hooks'; import { createClassName } from '../../helpers/createClassName'; -import ChatIcon from '../../icons/chat.svg'; import CloseIcon from '../../icons/close.svg'; import { Button } from '../Button'; import { Footer, FooterContent, PoweredBy } from '../Footer'; import { PopoverContainer } from '../Popover'; import { Sound } from '../Sound'; +import { ChatButton } from './ChatButton'; import ScreenHeader from './Header'; import { ScreenContext } from './ScreenProvider'; import styles from './styles.scss'; @@ -15,29 +15,20 @@ export const ScreenContent = ({ children, nopadding, triggered = false, full = f
{children}
); -export const ScreenFooter = ({ children, options, limit }) => ( -
- {children && {children}} - - {options} - {limit} - - -
-); +export const ScreenFooter = ({ children, options, limit }) => { + const { hideWatermark } = useContext(ScreenContext); -const ChatButton = ({ text, minimized, badge, onClick, triggered = false, agent }) => ( - -); + return ( +
+ {children && {children}} + + {options} + {limit} + {!hideWatermark && } + +
+ ); +}; const CssVar = ({ theme }) => { useEffect(() => { @@ -81,6 +72,7 @@ const CssVar = ({ theme }) => { export const Screen = ({ title, color, agent, children, className, unread, triggered = false, queueInfo, onSoundStop }) => { const { theme = {}, + livechatLogo, notificationsEnabled, minimized = false, expanded = false, @@ -150,6 +142,8 @@ export const Screen = ({ title, color, agent, children, className, unread, trigg text={title} badge={unread} minimized={minimized} + logoUrl={livechatLogo?.url} + className={createClassName(styles, 'screen__chat-button')} onClick={minimized ? onRestore : onMinimize} /> diff --git a/packages/livechat/src/store/index.tsx b/packages/livechat/src/store/index.tsx index b0ee2f1b71af..dad324870273 100644 --- a/packages/livechat/src/store/index.tsx +++ b/packages/livechat/src/store/index.tsx @@ -55,6 +55,8 @@ export type StoreState = { limitTextLength?: any; displayOfflineForm?: boolean; hiddenSystemMessages?: LivechatHiddenSytemMessageType[]; + hideWatermark?: boolean; + livechatLogo?: { url: string }; }; online?: boolean; departments: Department[]; From 95540f58dea3dd2be6a5df32f350d5b53cb7d872 Mon Sep 17 00:00:00 2001 From: Martin Schoeler Date: Mon, 25 Mar 2024 10:47:47 -0300 Subject: [PATCH 37/79] test: failing registerGuest function when same token is provided (#31968) --- .../omnichannel-livechat-api.spec.ts | 45 +++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/apps/meteor/tests/e2e/omnichannel/omnichannel-livechat-api.spec.ts b/apps/meteor/tests/e2e/omnichannel/omnichannel-livechat-api.spec.ts index 50fbd69d9b79..1c6cf2404fe4 100644 --- a/apps/meteor/tests/e2e/omnichannel/omnichannel-livechat-api.spec.ts +++ b/apps/meteor/tests/e2e/omnichannel/omnichannel-livechat-api.spec.ts @@ -405,6 +405,51 @@ test.describe('OC - Livechat API', () => { }); }); + test('OC - Livechat API - registerGuest multiple times', async () => { + const registerGuestVisitor = { + name: faker.person.firstName(), + email: faker.internet.email(), + token: faker.string.uuid(), + }; + + await test.step('Expect registerGuest work with the same token, multiple times', async () => { + test.fail(); + + await poLiveChat.page.evaluate(() => window.RocketChat.livechat.maximizeWidget()); + await expect(page.frameLocator('#rocketchat-iframe').getByText('Start Chat')).toBeVisible(); + + await poLiveChat.page.evaluate( + (registerGuestVisitor) => window.RocketChat.livechat.registerGuest(registerGuestVisitor), + registerGuestVisitor, + ); + + await expect(page.frameLocator('#rocketchat-iframe').getByText('Start Chat')).not.toBeVisible(); + + await poLiveChat.onlineAgentMessage.type('this_a_test_message_from_visitor'); + await poLiveChat.btnSendMessageToOnlineAgent.click(); + + await expect(poLiveChat.txtChatMessage('this_a_test_message_from_visitor')).toBeVisible(); + + await poLiveChat.page.evaluate( + (registerGuestVisitor) => window.RocketChat.livechat.registerGuest(registerGuestVisitor), + registerGuestVisitor, + ); + + await page.waitForTimeout(500); + + await expect(poLiveChat.txtChatMessage('this_a_test_message_from_visitor')).toBeVisible(); + + await poLiveChat.page.evaluate( + (registerGuestVisitor) => window.RocketChat.livechat.registerGuest(registerGuestVisitor), + registerGuestVisitor, + ); + + await page.waitForTimeout(500); + + await expect(poLiveChat.txtChatMessage('this_a_test_message_from_visitor')).toBeVisible(); + }); + }); + test('OC - Livechat API - setGuestEmail', async () => { const registerGuestVisitor = { name: faker.person.firstName(), From d1b1ffe9e56fca669229a50986a804b3eefff2ce Mon Sep 17 00:00:00 2001 From: Aleksander Nicacio da Silva Date: Mon, 25 Mar 2024 11:48:19 -0300 Subject: [PATCH 38/79] feat: added Livechat's new theming settings to Appearance page (#32043) Co-authored-by: Kevin Aleman <11577696+KevLehman@users.noreply.github.com> --- .changeset/good-baboons-shop.md | 13 +++ .../imports/server/rest/appearance.ts | 19 +++- .../app/livechat/server/api/lib/appearance.ts | 4 + .../appearance/AppearanceFieldLabel.tsx | 32 ++++++ .../omnichannel/appearance/AppearanceForm.tsx | 104 +++++++++++++++++- .../end-to-end/api/livechat/02-appearance.ts | 57 ++++++++++ packages/rest-typings/src/v1/omnichannel.ts | 4 +- 7 files changed, 229 insertions(+), 4 deletions(-) create mode 100644 .changeset/good-baboons-shop.md create mode 100644 apps/meteor/client/views/omnichannel/appearance/AppearanceFieldLabel.tsx diff --git a/.changeset/good-baboons-shop.md b/.changeset/good-baboons-shop.md new file mode 100644 index 000000000000..5a7230d841fb --- /dev/null +++ b/.changeset/good-baboons-shop.md @@ -0,0 +1,13 @@ +--- +"@rocket.chat/meteor": minor +"@rocket.chat/rest-typings": minor +--- + +**Added Livechat's new theming settings to Appearance page (available for Premium workspaces)** + +Newly added settings are: +- `Livechat widget position on the screen`: Changes the widget position between left or right of the viewport +- `Livechat background`: Changes the message list background. Receives the same value as the CSS's background property. +- `Hide system messages`: Changes the visibility of system messages displayed on the widget. +- `Hide "powered by Rocket.Chat"`: Changes the visibility of Rocket.Chat's watermark on the widget. + diff --git a/apps/meteor/app/livechat/imports/server/rest/appearance.ts b/apps/meteor/app/livechat/imports/server/rest/appearance.ts index 5a0a884d97b2..55607551ec3a 100644 --- a/apps/meteor/app/livechat/imports/server/rest/appearance.ts +++ b/apps/meteor/app/livechat/imports/server/rest/appearance.ts @@ -1,3 +1,4 @@ +import type { ISettingSelectOption } from '@rocket.chat/core-typings'; import { Settings } from '@rocket.chat/models'; import { isPOSTLivechatAppearanceParams } from '@rocket.chat/rest-typings'; @@ -45,6 +46,10 @@ API.v1.addRoute( 'Livechat_name_field_registration_form', 'Livechat_email_field_registration_form', 'Livechat_registration_form_message', + 'Livechat_hide_watermark', + 'Livechat_background', + 'Livechat_widget_position', + 'Livechat_hide_system_messages', ]; const valid = settings.every((setting) => validSettingList.includes(setting._id)); @@ -60,6 +65,10 @@ API.v1.addRoute( return; } + if (dbSetting.type === 'multiSelect' && (!Array.isArray(setting.value) || !validateValues(setting.value, dbSetting.values))) { + return; + } + switch (dbSetting?.type) { case 'boolean': return { @@ -91,7 +100,11 @@ API.v1.addRoute( }, ); -function coerceInt(value: string | number | boolean): number { +function validateValues(values: string[], allowedValues: ISettingSelectOption[] = []): boolean { + return values.every((value) => allowedValues.some((allowedValue) => allowedValue.key === value)); +} + +function coerceInt(value: string | number | boolean | string[]): number { if (typeof value === 'number') { return value; } @@ -100,6 +113,10 @@ function coerceInt(value: string | number | boolean): number { return 0; } + if (Array.isArray(value)) { + return 0; + } + const parsedValue = parseInt(value, 10); if (Number.isNaN(parsedValue)) { return 0; diff --git a/apps/meteor/app/livechat/server/api/lib/appearance.ts b/apps/meteor/app/livechat/server/api/lib/appearance.ts index d0a0a3df6b17..785413ead9d1 100644 --- a/apps/meteor/app/livechat/server/api/lib/appearance.ts +++ b/apps/meteor/app/livechat/server/api/lib/appearance.ts @@ -24,6 +24,10 @@ export async function findAppearance(): Promise<{ appearance: ISetting[] }> { 'Livechat_email_field_registration_form', 'Livechat_registration_form_message', 'Livechat_conversation_finished_text', + 'Livechat_hide_watermark', + 'Livechat_background', + 'Livechat_widget_position', + 'Livechat_hide_system_messages', ], }, }; diff --git a/apps/meteor/client/views/omnichannel/appearance/AppearanceFieldLabel.tsx b/apps/meteor/client/views/omnichannel/appearance/AppearanceFieldLabel.tsx new file mode 100644 index 000000000000..ba8b54aeaccf --- /dev/null +++ b/apps/meteor/client/views/omnichannel/appearance/AppearanceFieldLabel.tsx @@ -0,0 +1,32 @@ +import { FieldLabel as BaseFieldLabel, Box, Tag } from '@rocket.chat/fuselage'; +import { useTranslation } from '@rocket.chat/ui-contexts'; +import type { ComponentProps } from 'react'; +import React from 'react'; + +import { useHasLicenseModule } from '../../../../ee/client/hooks/useHasLicenseModule'; + +type FieldLabelProps = ComponentProps & { + premium?: boolean; + children: string; +}; + +const FieldLabel = ({ children: label, premium = false }: FieldLabelProps) => { + const t = useTranslation(); + const hasLicense = useHasLicenseModule('livechat-enterprise'); + const shouldDisableEnterprise = premium && !hasLicense; + + if (!shouldDisableEnterprise) { + return {label}; + } + + return ( + + + {label} + + {t('Premium')} + + ); +}; + +export default FieldLabel; diff --git a/apps/meteor/client/views/omnichannel/appearance/AppearanceForm.tsx b/apps/meteor/client/views/omnichannel/appearance/AppearanceForm.tsx index 258cda39e962..91c8d20f49f7 100644 --- a/apps/meteor/client/views/omnichannel/appearance/AppearanceForm.tsx +++ b/apps/meteor/client/views/omnichannel/appearance/AppearanceForm.tsx @@ -1,6 +1,5 @@ import { Field, - FieldLabel, FieldRow, TextInput, ToggleSwitch, @@ -9,6 +8,9 @@ import { InputBox, TextAreaInput, NumberInput, + Select, + MultiSelect, + FieldHint, } from '@rocket.chat/fuselage'; import { useUniqueId } from '@rocket.chat/fuselage-hooks'; import { useTranslation } from '@rocket.chat/ui-contexts'; @@ -16,8 +18,13 @@ import type { ChangeEvent } from 'react'; import React from 'react'; import { Controller, useFormContext } from 'react-hook-form'; +import { useHasLicenseModule } from '../../../../ee/client/hooks/useHasLicenseModule'; +import MarkdownText from '../../../components/MarkdownText'; +import FieldLabel from './AppearanceFieldLabel'; + const AppearanceForm = () => { const t = useTranslation(); + const isEnterprise = useHasLicenseModule('livechat-enterprise'); const { control, watch } = useFormContext(); const { Livechat_enable_message_character_limit } = watch(); @@ -41,9 +48,101 @@ const AppearanceForm = () => { const livechatRegistrationFormMessageField = useUniqueId(); const livechatConversationFinishedMessageField = useUniqueId(); const livechatConversationFinishedTextField = useUniqueId(); + const livechatHideWatermarkField = useUniqueId(); + const livechatWidgetPositionField = useUniqueId(); + const livechatBackgroundField = useUniqueId(); + const livechatHideSystemMessagesField = useUniqueId(); return ( + + + + + + {t('Livechat_hide_watermark')} + + ( + + )} + /> + + + + + + {t('Livechat_background')} + + + ( + + )} + /> + + + + + + + + + {t('Livechat_widget_position_on_the_screen')} + + + ( + Date: Wed, 3 Apr 2024 11:19:19 -0300 Subject: [PATCH 64/79] test(livechat): fix Department flaky test (#32102) --- .../omnichannel-livechat-department.spec.ts | 70 +++++++++++++++---- .../e2e/page-objects/omnichannel-livechat.ts | 18 ++--- .../src/components/Modal/component.js | 7 +- 3 files changed, 68 insertions(+), 27 deletions(-) diff --git a/apps/meteor/tests/e2e/omnichannel/omnichannel-livechat-department.spec.ts b/apps/meteor/tests/e2e/omnichannel/omnichannel-livechat-department.spec.ts index fe820a71f62c..c0b2bf8ae852 100644 --- a/apps/meteor/tests/e2e/omnichannel/omnichannel-livechat-department.spec.ts +++ b/apps/meteor/tests/e2e/omnichannel/omnichannel-livechat-department.spec.ts @@ -8,10 +8,7 @@ import { createAgent } from '../utils/omnichannel/agents'; import { addAgentToDepartment, createDepartment } from '../utils/omnichannel/departments'; import { test, expect } from '../utils/test'; -const firstUser = { - name: `${faker.person.firstName()} ${faker.string.uuid()}}`, - email: faker.internet.email(), -}; + test.use({ storageState: Users.user1.state }); @@ -54,8 +51,8 @@ test.describe('OC - Livechat - Department Flow', () => { }); test.afterEach(async ({ page }) => { - await poHomeOmnichannelAgent1.page?.close(); - await poHomeOmnichannelAgent2.page?.close(); + await poHomeOmnichannelAgent1?.page?.close(); + await poHomeOmnichannelAgent2?.page?.close(); await page.close(); }); @@ -67,9 +64,15 @@ test.describe('OC - Livechat - Department Flow', () => { }); test('OC - Livechat - Chat with Department', async () => { + + const guest = { + name: `${faker.person.firstName()} ${faker.string.nanoid(10)}}`, + email: faker.internet.email(), + }; + await test.step('expect start Chat with department', async () => { await poLiveChat.openAnyLiveChat(); - await poLiveChat.sendMessage(firstUser, false, departmentA.name); + await poLiveChat.sendMessage(guest, false, departmentA.name); await expect(poLiveChat.onlineAgentMessage).toBeVisible(); await poLiveChat.onlineAgentMessage.fill('this_a_test_message_from_user'); await poLiveChat.btnSendMessageToOnlineAgent.click(); @@ -77,7 +80,7 @@ test.describe('OC - Livechat - Department Flow', () => { }); await test.step('expect message to be received by department', async () => { - await poHomeOmnichannelAgent1.sidenav.openChat(firstUser.name); + await poHomeOmnichannelAgent1.sidenav.openChat(guest.name); await expect(poHomeOmnichannelAgent1.content.lastUserMessage).toBeVisible(); await expect(poHomeOmnichannelAgent1.content.lastUserMessage).toContainText('this_a_test_message_from_user'); }); @@ -89,34 +92,73 @@ test.describe('OC - Livechat - Department Flow', () => { }); test('OC - Livechat - Change Department', async () => { + + const guest = { + name: `${faker.person.firstName()} ${faker.string.nanoid(10)}}`, + email: faker.internet.email(), + + }; await test.step('expect start Chat with department', async () => { await poLiveChat.openAnyLiveChat(); - await poLiveChat.sendMessage(firstUser, false, departmentA.name); + await poLiveChat.sendMessage(guest, false, departmentA.name); await expect(poLiveChat.onlineAgentMessage).toBeVisible(); await poLiveChat.onlineAgentMessage.fill('this_a_test_message_from_user'); await poLiveChat.btnSendMessageToOnlineAgent.click(); await expect(poLiveChat.page.locator('div >> text="this_a_test_message_from_user"')).toBeVisible(); }); + await test.step('expect message to be received by department 1', async () => { + await poHomeOmnichannelAgent1.sidenav.openChat(guest.name); + await expect(poHomeOmnichannelAgent1.content.lastUserMessage).toBeVisible(); + await expect(poHomeOmnichannelAgent1.content.lastUserMessage).toContainText('this_a_test_message_from_user'); + }); + + await test.step('expect message to be sent by department 1', async () => { + await poHomeOmnichannelAgent1.content.sendMessage('this_a_test_message_from_agent_department_1'); + await expect(poLiveChat.page.locator('div >> text="this_a_test_message_from_agent_department_1"')).toBeVisible(); + await poHomeOmnichannelAgent1.page.close(); + }); + await test.step('expect to change department', async () => { - await poLiveChat.changeDepartment(departmentB.name); + await poLiveChat.btnOptions.click(); + await poLiveChat.btnChangeDepartment.click(); + + await expect(poLiveChat.selectDepartment).toBeVisible(); + await poLiveChat.selectDepartment.selectOption({ label: departmentB.name }); + + await expect(poLiveChat.btnSendMessage('Start chat')).toBeEnabled(); + await poLiveChat.btnSendMessage('Start chat').click(); + + await expect(poLiveChat.livechatModal).toBeVisible(); + + await expect(poLiveChat.livechatModalText('Are you sure you want to switch the department?')).toBeVisible(); + await poLiveChat.btnYes.click(); + + await expect(poLiveChat.livechatModal).toBeVisible(); + + await expect(poLiveChat.livechatModalText('Department switched')).toBeVisible(); + await poLiveChat.btnOk.click(); // Expect keep chat history await expect(poLiveChat.page.locator('div >> text="this_a_test_message_from_user"')).toBeVisible(); // Expect user to have changed await expect(await poLiveChat.headerTitle.textContent()).toEqual(agent2.username); + + await poLiveChat.onlineAgentMessage.fill('this_a_test_message_from_user_to_department_2'); + await poLiveChat.btnSendMessageToOnlineAgent.click(); + await expect(poLiveChat.page.locator('div >> text="this_a_test_message_from_user_to_department_2"')).toBeVisible(); }); await test.step('expect message to be received by department', async () => { - await poHomeOmnichannelAgent2.sidenav.openChat(firstUser.name); + await poHomeOmnichannelAgent2.sidenav.openChat(guest.name); await expect(poHomeOmnichannelAgent2.content.lastUserMessage).toBeVisible(); - await expect(poHomeOmnichannelAgent2.content.lastUserMessage).toContainText('this_a_test_message_from_user'); + await expect(poHomeOmnichannelAgent2.content.lastUserMessage).toContainText('this_a_test_message_from_user_to_department_2'); }); await test.step('expect message to be sent by department', async () => { - await poHomeOmnichannelAgent2.content.sendMessage('this_a_test_message_from_agent'); - await expect(poLiveChat.page.locator('div >> text="this_a_test_message_from_agent"')).toBeVisible(); + await poHomeOmnichannelAgent2.content.sendMessage('this_a_test_message_from_agent_department_2'); + await expect(poLiveChat.page.locator('div >> text="this_a_test_message_from_agent_department_2"')).toBeVisible(); }); }); }); diff --git a/apps/meteor/tests/e2e/page-objects/omnichannel-livechat.ts b/apps/meteor/tests/e2e/page-objects/omnichannel-livechat.ts index 7099af127ee2..1029c8ba2819 100644 --- a/apps/meteor/tests/e2e/page-objects/omnichannel-livechat.ts +++ b/apps/meteor/tests/e2e/page-objects/omnichannel-livechat.ts @@ -59,16 +59,6 @@ export class OmnichannelLiveChat { return this.page.locator(`text="${message}"`); } - async changeDepartment (department: string): Promise { - await this.btnOptions.click(); - await this.btnChangeDepartment.click(); - await this.selectDepartment.waitFor({ state: 'visible' }); - await this.selectDepartment.selectOption({ label: department }); - await this.btnSendMessage('Start chat').click(); - await this.btnYes.click(); - await this.btnOk.click(); - } - async closeChat(): Promise { await this.btnOptions.click(); await this.btnCloseChat.click(); @@ -132,8 +122,12 @@ export class OmnichannelLiveChat { return this.page.locator('footer div div div:nth-child(3) button'); } - get firstAutoMessage(): Locator { - return this.page.locator('div.message-text__WwYco p'); + get livechatModal(): Locator { + return this.page.locator('[data-qa-type="modal-overlay"]'); + } + + livechatModalText(text: string): Locator { + return this.page.locator(`[data-qa-type="modal-overlay"] >> text=${text}`); } get fileUploadTarget(): Locator { diff --git a/packages/livechat/src/components/Modal/component.js b/packages/livechat/src/components/Modal/component.js index 195d4598f217..16f0df40d8ea 100644 --- a/packages/livechat/src/components/Modal/component.js +++ b/packages/livechat/src/components/Modal/component.js @@ -48,7 +48,12 @@ export class Modal extends Component { render = ({ children, animated, open, ...props }) => open ? ( -
+
{children}
From 0fcf1f0f1b3500bdcbb2b5bee7076629deb10a2d Mon Sep 17 00:00:00 2001 From: Douglas Fabris Date: Wed, 3 Apr 2024 13:01:51 -0300 Subject: [PATCH 65/79] chore: Remove duplicated `ChannelDeletionTable` (#32114) --- .../info/Delete/ChannelDeletionTable.tsx | 78 ------------------- .../info/Delete/ChannelDeletionTableRow.tsx | 35 --------- .../ChannelDeletionTable.tsx | 4 +- 3 files changed, 2 insertions(+), 115 deletions(-) delete mode 100644 apps/meteor/client/views/teams/contextualBar/info/Delete/ChannelDeletionTable.tsx delete mode 100644 apps/meteor/client/views/teams/contextualBar/info/Delete/ChannelDeletionTableRow.tsx diff --git a/apps/meteor/client/views/teams/contextualBar/info/Delete/ChannelDeletionTable.tsx b/apps/meteor/client/views/teams/contextualBar/info/Delete/ChannelDeletionTable.tsx deleted file mode 100644 index b04c0dbc7bf7..000000000000 --- a/apps/meteor/client/views/teams/contextualBar/info/Delete/ChannelDeletionTable.tsx +++ /dev/null @@ -1,78 +0,0 @@ -import type { IRoom, Serialized } from '@rocket.chat/core-typings'; -import { Box, CheckBox } from '@rocket.chat/fuselage'; -import { useTranslation } from '@rocket.chat/ui-contexts'; -import React from 'react'; - -import { GenericTable, GenericTableHeaderCell, GenericTableBody, GenericTableHeader } from '../../../../../components/GenericTable'; -import { useSort } from '../../../../../components/GenericTable/hooks/useSort'; -import ChannelDeletionTableRow from './ChannelDeletionTableRow'; - -type ChannelDeletationTable = { - rooms: Serialized[]; - onToggleAllRooms: () => void; - onChangeRoomSelection: (room: Serialized) => void; - selectedRooms: { [key: string]: Serialized }; -}; - -const ChannelDeletionTable = ({ rooms, onChangeRoomSelection, selectedRooms, onToggleAllRooms }: ChannelDeletationTable) => { - const t = useTranslation(); - const { sortBy, sortDirection, setSort } = useSort<'name' | 'usersCount'>('name'); - - const selectedRoomsLength = Object.values(selectedRooms).filter(Boolean).length; - - const getSortedChannels = () => { - if (rooms) { - const sortedRooms = [...rooms]; - if (sortBy === 'name') { - sortedRooms.sort((a, b) => (a.name && b.name ? a.name.localeCompare(b.name) : 0)); - } - if (sortBy === 'usersCount') { - sortedRooms.sort((a, b) => a.usersCount - b.usersCount); - } - if (sortDirection === 'desc') { - return sortedRooms?.reverse(); - } - return sortedRooms; - } - }; - - const sortedRooms = getSortedChannels(); - - const checked = rooms.length === selectedRoomsLength; - const indeterminate = rooms.length > selectedRoomsLength && selectedRoomsLength > 0; - - const headers = ( - <> - - - {t('Channel_name')} - - - - {t('Members')} - - - - ); - - return ( - - - {headers} - - {sortedRooms?.map((room) => ( - - ))} - - - - ); -}; - -export default ChannelDeletionTable; diff --git a/apps/meteor/client/views/teams/contextualBar/info/Delete/ChannelDeletionTableRow.tsx b/apps/meteor/client/views/teams/contextualBar/info/Delete/ChannelDeletionTableRow.tsx deleted file mode 100644 index 7531d4c2b3f5..000000000000 --- a/apps/meteor/client/views/teams/contextualBar/info/Delete/ChannelDeletionTableRow.tsx +++ /dev/null @@ -1,35 +0,0 @@ -import type { IRoom, Serialized } from '@rocket.chat/core-typings'; -import { CheckBox, Margins } from '@rocket.chat/fuselage'; -import { useMutableCallback } from '@rocket.chat/fuselage-hooks'; -import React from 'react'; - -import { GenericTableRow, GenericTableCell } from '../../../../../components/GenericTable'; -import { RoomIcon } from '../../../../../components/RoomIcon'; - -type ChannelDeletionTableRowProps = { - room: Serialized; - onChange: (room: Serialized) => void; - selected: boolean; -}; - -const ChannelDeletionTableRow = ({ room, onChange, selected }: ChannelDeletionTableRowProps) => { - const { name, fname, usersCount } = room; - const handleChange = useMutableCallback(() => onChange(room)); - - return ( - - - - - - {fname ?? name} - - - - {usersCount} - - - ); -}; - -export default ChannelDeletionTableRow; diff --git a/apps/meteor/client/views/teams/contextualBar/info/DeleteTeam/ChannelDeletionTable/ChannelDeletionTable.tsx b/apps/meteor/client/views/teams/contextualBar/info/DeleteTeam/ChannelDeletionTable/ChannelDeletionTable.tsx index fb5bf144372b..4bd85aed663c 100644 --- a/apps/meteor/client/views/teams/contextualBar/info/DeleteTeam/ChannelDeletionTable/ChannelDeletionTable.tsx +++ b/apps/meteor/client/views/teams/contextualBar/info/DeleteTeam/ChannelDeletionTable/ChannelDeletionTable.tsx @@ -7,14 +7,14 @@ import { GenericTable, GenericTableHeaderCell, GenericTableBody, GenericTableHea import { useSort } from '../../../../../../components/GenericTable/hooks/useSort'; import ChannelDeletionTableRow from './ChannelDeletionTableRow'; -type ChannelDeletationTable = { +type ChannelDeletionTableProps = { rooms: Serialized[]; onToggleAllRooms: () => void; onChangeRoomSelection: (room: Serialized) => void; selectedRooms: { [key: string]: Serialized }; }; -const ChannelDeletionTable = ({ rooms, onChangeRoomSelection, selectedRooms, onToggleAllRooms }: ChannelDeletationTable) => { +const ChannelDeletionTable = ({ rooms, onChangeRoomSelection, selectedRooms, onToggleAllRooms }: ChannelDeletionTableProps) => { const t = useTranslation(); const { sortBy, sortDirection, setSort } = useSort<'name' | 'usersCount'>('name'); From 1626945fa3c4a9ade57fe09a479f442a5a51bc62 Mon Sep 17 00:00:00 2001 From: Kevin Aleman Date: Wed, 3 Apr 2024 14:59:33 -0600 Subject: [PATCH 66/79] fix: UI allowing to mark room as favorite despite room was not a `default` room (#32063) --- .changeset/pink-ants-sing.md | 6 ++ .../client/views/admin/rooms/EditRoom.tsx | 4 +- apps/meteor/tests/e2e/administration.spec.ts | 15 +++++ apps/meteor/tests/end-to-end/api/09-rooms.js | 61 ++++++++++++++++++- 4 files changed, 83 insertions(+), 3 deletions(-) create mode 100644 .changeset/pink-ants-sing.md diff --git a/.changeset/pink-ants-sing.md b/.changeset/pink-ants-sing.md new file mode 100644 index 000000000000..7b4841a11561 --- /dev/null +++ b/.changeset/pink-ants-sing.md @@ -0,0 +1,6 @@ +--- +"@rocket.chat/meteor": patch +--- + +Fixed a UI issue that allowed a user to "mark" a room as favorite even when a room was not default. The Back-End was correctly ignoring the `favorite` property from being updated when the room was not default, but the UI still allowed users to try. +As UI allowed but changes were not saved, this gave the impression that the function was not working. diff --git a/apps/meteor/client/views/admin/rooms/EditRoom.tsx b/apps/meteor/client/views/admin/rooms/EditRoom.tsx index 1522f4694160..cc165bca215b 100644 --- a/apps/meteor/client/views/admin/rooms/EditRoom.tsx +++ b/apps/meteor/client/views/admin/rooms/EditRoom.tsx @@ -86,7 +86,7 @@ const EditRoom = ({ room, onChange, onDelete }: EditRoomProps) => { canViewReactWhenReadOnly, } = useEditAdminRoomPermissions(room); - const { roomType, readOnly, archived } = watch(); + const { roomType, readOnly, archived, isDefault } = watch(); const changeArchiving = archived !== !!room.archived; @@ -324,7 +324,7 @@ const EditRoom = ({ room, onChange, onDelete }: EditRoomProps) => { name='favorite' control={control} render={({ field: { value, ...field } }) => ( - + )} /> diff --git a/apps/meteor/tests/e2e/administration.spec.ts b/apps/meteor/tests/e2e/administration.spec.ts index dcfb85373186..23d9d5214aaf 100644 --- a/apps/meteor/tests/e2e/administration.spec.ts +++ b/apps/meteor/tests/e2e/administration.spec.ts @@ -123,6 +123,21 @@ test.describe.parallel('administration', () => { await poAdmin.getRoomRow(targetChannel).click(); await expect(poAdmin.favoriteInput).toBeChecked(); }); + + test('should see favorite switch disabled when default is not true', async () => { + await poAdmin.inputSearchRooms.type(targetChannel); + await poAdmin.getRoomRow(targetChannel).click(); + await poAdmin.defaultLabel.click(); + + await expect(poAdmin.favoriteInput).toBeDisabled(); + }); + + test('should see favorite switch enabled when default is true', async () => { + await poAdmin.inputSearchRooms.type(targetChannel); + await poAdmin.getRoomRow(targetChannel).click(); + + await expect(poAdmin.favoriteInput).toBeEnabled(); + }); }); }); diff --git a/apps/meteor/tests/end-to-end/api/09-rooms.js b/apps/meteor/tests/end-to-end/api/09-rooms.js index e60cf8c1f6b4..92b73f34557e 100644 --- a/apps/meteor/tests/end-to-end/api/09-rooms.js +++ b/apps/meteor/tests/end-to-end/api/09-rooms.js @@ -1742,7 +1742,7 @@ describe('[Rooms]', function () { }); }); - describe('/rooms.saveRoomSettings', () => { + describe('rooms.saveRoomSettings', () => { let testChannel; const randomString = `randomString${Date.now()}`; let discussion; @@ -1847,5 +1847,64 @@ describe('[Rooms]', function () { expect(res.body.room).to.have.property('fname', newDiscussionName); }); }); + + it('should mark a room as favorite', async () => { + await request + .post(api('rooms.saveRoomSettings')) + .set(credentials) + .send({ + rid: testChannel._id, + favorite: { + favorite: true, + defaultValue: true, + }, + }) + .expect('Content-Type', 'application/json') + .expect(200); + + await request + .get(api('rooms.info')) + .set(credentials) + .query({ + roomId: testChannel._id, + }) + .expect(200) + .expect((res) => { + expect(res.body).to.have.property('success', true); + expect(res.body).to.have.property('room').and.to.be.an('object'); + + expect(res.body.room).to.have.property('_id', testChannel._id); + expect(res.body.room).to.have.property('favorite', true); + }); + }); + it('should not mark a room as favorite when room is not a default room', async () => { + await request + .post(api('rooms.saveRoomSettings')) + .set(credentials) + .send({ + rid: testChannel._id, + favorite: { + favorite: true, + defaultValue: false, + }, + }) + .expect('Content-Type', 'application/json') + .expect(200); + + await request + .get(api('rooms.info')) + .set(credentials) + .query({ + roomId: testChannel._id, + }) + .expect(200) + .expect((res) => { + expect(res.body).to.have.property('success', true); + expect(res.body).to.have.property('room').and.to.be.an('object'); + + expect(res.body.room).to.have.property('_id', testChannel._id); + expect(res.body.room).to.not.have.property('favorite'); + }); + }); }); }); From c7fb2eba5db6bd3dd71c5785478600e52f33420e Mon Sep 17 00:00:00 2001 From: Martin Schoeler Date: Wed, 3 Apr 2024 19:04:02 -0300 Subject: [PATCH 67/79] test: fix `should edit name of targetChannel` flaky test (#32121) Co-authored-by: Guilherme Gazzo --- apps/meteor/tests/e2e/channel-management.spec.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/apps/meteor/tests/e2e/channel-management.spec.ts b/apps/meteor/tests/e2e/channel-management.spec.ts index efa39e0773b3..86bab6981346 100644 --- a/apps/meteor/tests/e2e/channel-management.spec.ts +++ b/apps/meteor/tests/e2e/channel-management.spec.ts @@ -130,6 +130,7 @@ test.describe.serial('channel-management', () => { await poHomeChannel.tabs.room.btnSave.click(); targetChannel = `NAME-EDITED-${targetChannel}`; + await expect(page.locator(`role=main >> role=heading[name="${targetChannel}"]`)).toBeVisible(); await poHomeChannel.sidenav.openChat(targetChannel); await expect(page).toHaveURL(`/channel/${targetChannel}`); From 3c5d4ffac539fbb59e31e98036e179123cb73594 Mon Sep 17 00:00:00 2001 From: Guilherme Gazzo Date: Wed, 3 Apr 2024 19:47:42 -0300 Subject: [PATCH 68/79] fix: search room not reactive after room name changes (#32123) --- .changeset/sweet-books-trade.md | 5 +++++ apps/meteor/client/sidebar/search/SearchList.tsx | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 .changeset/sweet-books-trade.md diff --git a/.changeset/sweet-books-trade.md b/.changeset/sweet-books-trade.md new file mode 100644 index 000000000000..be828d662f32 --- /dev/null +++ b/.changeset/sweet-books-trade.md @@ -0,0 +1,5 @@ +--- +"@rocket.chat/meteor": patch +--- + +fixed search room not showing the new name room name changes diff --git a/apps/meteor/client/sidebar/search/SearchList.tsx b/apps/meteor/client/sidebar/search/SearchList.tsx index ceb89d3d7092..d215a77ce4bd 100644 --- a/apps/meteor/client/sidebar/search/SearchList.tsx +++ b/apps/meteor/client/sidebar/search/SearchList.tsx @@ -101,7 +101,7 @@ const useSearchItems = (filterText: string): UseQueryResult<(ISubscription & IRo const getSpotlight = useMethod('spotlight'); return useQuery( - ['sidebar/search/spotlight', name, usernamesFromClient, type, localRooms.map(({ _id }) => _id)], + ['sidebar/search/spotlight', name, usernamesFromClient, type, localRooms.map(({ _id, name }) => _id + name)], async () => { if (localRooms.length === LIMIT) { return localRooms; From aee039b2a26d119f95f28b2c8ab20debf68cced2 Mon Sep 17 00:00:00 2001 From: Douglas Fabris Date: Thu, 4 Apr 2024 14:13:15 -0300 Subject: [PATCH 69/79] refactor: `TeamsChannels` to typescript (#32109) --- .../roomActions/useTeamChannelsRoomAction.ts | 2 +- .../CreateChannel/CreateChannelModal.tsx | 4 +- .../AddExistingModal/AddExistingModal.tsx | 6 +- .../channels/BaseTeamsChannels.tsx | 156 ------------- .../ConfirmationModal/ConfirmationModal.tsx | 41 ---- .../channels/ConfirmationModal/index.ts | 1 - .../contextualBar/channels/RoomActions.js | 154 ------------- .../views/teams/contextualBar/channels/Row.js | 13 -- ...amsChannelItem.js => TeamsChannelItem.tsx} | 23 +- .../channels/TeamsChannelItemMenu.tsx | 59 +++++ .../contextualBar/channels/TeamsChannels.tsx | 218 +++++++++++------- .../channels/TeamsChannelsWithData.tsx | 73 ++++++ .../channels/hooks/useRemoveRoomFromTeam.tsx | 43 ++++ .../channels/hooks/useToggleAutoJoin.tsx | 23 ++ .../teams/contextualBar/channels/index.ts | 2 +- packages/i18n/src/locales/af.i18n.json | 1 - packages/i18n/src/locales/ar.i18n.json | 1 - packages/i18n/src/locales/az.i18n.json | 1 - packages/i18n/src/locales/be-BY.i18n.json | 1 - packages/i18n/src/locales/bg.i18n.json | 1 - packages/i18n/src/locales/bs.i18n.json | 1 - packages/i18n/src/locales/ca.i18n.json | 1 - packages/i18n/src/locales/cs.i18n.json | 1 - packages/i18n/src/locales/cy.i18n.json | 1 - packages/i18n/src/locales/da.i18n.json | 1 - packages/i18n/src/locales/de-AT.i18n.json | 1 - packages/i18n/src/locales/de-IN.i18n.json | 1 - packages/i18n/src/locales/de.i18n.json | 1 - packages/i18n/src/locales/el.i18n.json | 1 - packages/i18n/src/locales/en.i18n.json | 1 - packages/i18n/src/locales/eo.i18n.json | 1 - packages/i18n/src/locales/es.i18n.json | 1 - packages/i18n/src/locales/fa.i18n.json | 1 - packages/i18n/src/locales/fi.i18n.json | 1 - packages/i18n/src/locales/fr.i18n.json | 1 - packages/i18n/src/locales/he.i18n.json | 1 - packages/i18n/src/locales/hr.i18n.json | 1 - packages/i18n/src/locales/hu.i18n.json | 1 - packages/i18n/src/locales/id.i18n.json | 1 - packages/i18n/src/locales/it.i18n.json | 1 - packages/i18n/src/locales/ja.i18n.json | 1 - packages/i18n/src/locales/ka-GE.i18n.json | 1 - packages/i18n/src/locales/km.i18n.json | 1 - packages/i18n/src/locales/ko.i18n.json | 1 - packages/i18n/src/locales/ku.i18n.json | 1 - packages/i18n/src/locales/lo.i18n.json | 1 - packages/i18n/src/locales/lt.i18n.json | 1 - packages/i18n/src/locales/lv.i18n.json | 1 - packages/i18n/src/locales/mn.i18n.json | 1 - packages/i18n/src/locales/ms-MY.i18n.json | 1 - packages/i18n/src/locales/nl.i18n.json | 1 - packages/i18n/src/locales/no.i18n.json | 1 - packages/i18n/src/locales/pl.i18n.json | 1 - packages/i18n/src/locales/pt-BR.i18n.json | 1 - packages/i18n/src/locales/pt.i18n.json | 1 - packages/i18n/src/locales/ro.i18n.json | 1 - packages/i18n/src/locales/ru.i18n.json | 1 - packages/i18n/src/locales/sk-SK.i18n.json | 1 - packages/i18n/src/locales/sl-SI.i18n.json | 1 - packages/i18n/src/locales/sq.i18n.json | 1 - packages/i18n/src/locales/sr.i18n.json | 1 - packages/i18n/src/locales/sv.i18n.json | 1 - packages/i18n/src/locales/ta-IN.i18n.json | 1 - packages/i18n/src/locales/th-TH.i18n.json | 1 - packages/i18n/src/locales/tr.i18n.json | 1 - packages/i18n/src/locales/ug.i18n.json | 1 - packages/i18n/src/locales/uk.i18n.json | 1 - packages/i18n/src/locales/vi-VN.i18n.json | 1 - packages/i18n/src/locales/zh-HK.i18n.json | 1 - packages/i18n/src/locales/zh-TW.i18n.json | 1 - packages/i18n/src/locales/zh.i18n.json | 1 - 71 files changed, 362 insertions(+), 512 deletions(-) delete mode 100644 apps/meteor/client/views/teams/contextualBar/channels/BaseTeamsChannels.tsx delete mode 100644 apps/meteor/client/views/teams/contextualBar/channels/ConfirmationModal/ConfirmationModal.tsx delete mode 100644 apps/meteor/client/views/teams/contextualBar/channels/ConfirmationModal/index.ts delete mode 100644 apps/meteor/client/views/teams/contextualBar/channels/RoomActions.js delete mode 100644 apps/meteor/client/views/teams/contextualBar/channels/Row.js rename apps/meteor/client/views/teams/contextualBar/channels/{TeamsChannelItem.js => TeamsChannelItem.tsx} (77%) create mode 100644 apps/meteor/client/views/teams/contextualBar/channels/TeamsChannelItemMenu.tsx create mode 100644 apps/meteor/client/views/teams/contextualBar/channels/TeamsChannelsWithData.tsx create mode 100644 apps/meteor/client/views/teams/contextualBar/channels/hooks/useRemoveRoomFromTeam.tsx create mode 100644 apps/meteor/client/views/teams/contextualBar/channels/hooks/useToggleAutoJoin.tsx diff --git a/apps/meteor/client/hooks/roomActions/useTeamChannelsRoomAction.ts b/apps/meteor/client/hooks/roomActions/useTeamChannelsRoomAction.ts index 5876a88f2985..6fddd89f2dce 100644 --- a/apps/meteor/client/hooks/roomActions/useTeamChannelsRoomAction.ts +++ b/apps/meteor/client/hooks/roomActions/useTeamChannelsRoomAction.ts @@ -2,7 +2,7 @@ import { lazy, useMemo } from 'react'; import type { RoomToolboxActionConfig } from '../../views/room/contexts/RoomToolboxContext'; -const TeamsChannels = lazy(() => import('../../views/teams/contextualBar/channels/TeamsChannels')); +const TeamsChannels = lazy(() => import('../../views/teams/contextualBar/channels')); export const useTeamChannelsRoomAction = () => { return useMemo( diff --git a/apps/meteor/client/sidebar/header/CreateChannel/CreateChannelModal.tsx b/apps/meteor/client/sidebar/header/CreateChannel/CreateChannelModal.tsx index cd5e19947991..5738798f194e 100644 --- a/apps/meteor/client/sidebar/header/CreateChannel/CreateChannelModal.tsx +++ b/apps/meteor/client/sidebar/header/CreateChannel/CreateChannelModal.tsx @@ -35,6 +35,7 @@ import { useEncryptedRoomDescription } from '../hooks/useEncryptedRoomDescriptio type CreateChannelModalProps = { teamId?: string; onClose: () => void; + reload?: () => void; }; type CreateChannelModalPayload = { @@ -58,7 +59,7 @@ const getFederationHintKey = (licenseModule: ReturnType { +const CreateChannelModal = ({ teamId = '', onClose, reload }: CreateChannelModalProps): ReactElement => { const t = useTranslation(); const canSetReadOnly = usePermissionWithScopedRoles('set-readonly', ['owner']); const e2eEnabled = useSetting('E2E_Enable'); @@ -173,6 +174,7 @@ const CreateChannelModal = ({ teamId = '', onClose }: CreateChannelModalProps): } dispatchToastMessage({ type: 'success', message: t('Room_has_been_created') }); + reload?.(); } catch (error) { dispatchToastMessage({ type: 'error', message: error }); } finally { diff --git a/apps/meteor/client/views/teams/contextualBar/channels/AddExistingModal/AddExistingModal.tsx b/apps/meteor/client/views/teams/contextualBar/channels/AddExistingModal/AddExistingModal.tsx index 4fa5828d462f..4917304f33fe 100644 --- a/apps/meteor/client/views/teams/contextualBar/channels/AddExistingModal/AddExistingModal.tsx +++ b/apps/meteor/client/views/teams/contextualBar/channels/AddExistingModal/AddExistingModal.tsx @@ -8,9 +8,10 @@ import RoomsAvailableForTeamsAutoComplete from './RoomsAvailableForTeamsAutoComp type AddExistingModalProps = { teamId: string; onClose: () => void; + reload?: () => void; }; -const AddExistingModal = ({ onClose, teamId }: AddExistingModalProps) => { +const AddExistingModal = ({ teamId, onClose, reload }: AddExistingModalProps) => { const t = useTranslation(); const dispatchToastMessage = useToastMessageDispatch(); @@ -31,13 +32,14 @@ const AddExistingModal = ({ onClose, teamId }: AddExistingModalProps) => { }); dispatchToastMessage({ type: 'success', message: t('Channels_added') }); + reload?.(); } catch (error) { dispatchToastMessage({ type: 'error', message: error }); } finally { onClose(); } }, - [addRoomEndpoint, teamId, onClose, dispatchToastMessage, t], + [addRoomEndpoint, teamId, onClose, dispatchToastMessage, reload, t], ); return ( diff --git a/apps/meteor/client/views/teams/contextualBar/channels/BaseTeamsChannels.tsx b/apps/meteor/client/views/teams/contextualBar/channels/BaseTeamsChannels.tsx deleted file mode 100644 index ed0a83d39fce..000000000000 --- a/apps/meteor/client/views/teams/contextualBar/channels/BaseTeamsChannels.tsx +++ /dev/null @@ -1,156 +0,0 @@ -import type { IRoom } from '@rocket.chat/core-typings'; -import type { SelectOption } from '@rocket.chat/fuselage'; -import { Box, Icon, TextInput, Margins, Select, Throbber, ButtonGroup, Button } from '@rocket.chat/fuselage'; -import { useMutableCallback, useAutoFocus, useDebouncedCallback } from '@rocket.chat/fuselage-hooks'; -import { useTranslation } from '@rocket.chat/ui-contexts'; -import type { ChangeEvent, Dispatch, SetStateAction, SyntheticEvent } from 'react'; -import React, { useMemo } from 'react'; -import { Virtuoso } from 'react-virtuoso'; - -import { - ContextualbarHeader, - ContextualbarIcon, - ContextualbarTitle, - ContextualbarClose, - ContextualbarContent, - ContextualbarFooter, - ContextualbarEmptyContent, -} from '../../../../components/Contextualbar'; -import { VirtuosoScrollbars } from '../../../../components/CustomScrollbars'; -import InfiniteListAnchor from '../../../../components/InfiniteListAnchor'; -import Row from './Row'; - -type BaseTeamsChannelsProps = { - loading: boolean; - channels: IRoom[]; - text: string; - type: 'all' | 'autoJoin'; - setType: Dispatch>; - setText: (e: ChangeEvent) => void; - onClickClose: () => void; - onClickAddExisting: false | ((e: SyntheticEvent) => void); - onClickCreateNew: false | ((e: SyntheticEvent) => void); - total: number; - loadMoreItems: (start: number, end: number) => void; - onClickView: (room: IRoom) => void; - reload: () => void; -}; - -const BaseTeamsChannels = ({ - loading, - channels = [], - text, - type, - setText, - setType, - onClickClose, - onClickAddExisting, - onClickCreateNew, - total, - loadMoreItems, - onClickView, - reload, -}: BaseTeamsChannelsProps) => { - const t = useTranslation(); - const inputRef = useAutoFocus(true); - - const options: SelectOption[] = useMemo( - () => [ - ['all', t('All')], - ['autoJoin', t('Team_Auto-join')], - ], - [t], - ); - - const lm = useMutableCallback((start) => !loading && loadMoreItems(start, Math.min(50, total - start))); - - const loadMoreChannels = useDebouncedCallback( - () => { - if (channels.length >= total) { - return; - } - - lm(channels.length); - }, - 300, - [lm, channels], - ); - - return ( - <> - - - {t('Team_Channels')} - {onClickClose && } - - - - - - - } - /> - - setType(val as 'all' | 'autoJoin')} value={type} options={options} /> + + + + + {loading && ( + + + + )} + {!loading && channels.length === 0 && } + {!loading && channels.length > 0 && ( + <> + + + {t('Showing')}: {channels.length} + + + + {t('Total')}: {total} + + + + }} + itemContent={(index, data) => } + /> + + + )} + + {(onClickAddExisting || onClickCreateNew) && ( + + + {onClickAddExisting && ( + + )} + {onClickCreateNew && ( + + )} + + + )} + ); }; diff --git a/apps/meteor/client/views/teams/contextualBar/channels/TeamsChannelsWithData.tsx b/apps/meteor/client/views/teams/contextualBar/channels/TeamsChannelsWithData.tsx new file mode 100644 index 000000000000..965414400ee5 --- /dev/null +++ b/apps/meteor/client/views/teams/contextualBar/channels/TeamsChannelsWithData.tsx @@ -0,0 +1,73 @@ +import type { IRoom } from '@rocket.chat/core-typings'; +import { useLocalStorage, useDebouncedValue, useEffectEvent } from '@rocket.chat/fuselage-hooks'; +import { useSetModal, usePermission } from '@rocket.chat/ui-contexts'; +import React, { useCallback, useMemo, useState } from 'react'; + +import { useRecordList } from '../../../../hooks/lists/useRecordList'; +import { AsyncStatePhase } from '../../../../lib/asyncState'; +import { roomCoordinator } from '../../../../lib/rooms/roomCoordinator'; +import CreateChannelWithData from '../../../../sidebar/header/CreateChannel'; +import { useRoom } from '../../../room/contexts/RoomContext'; +import { useRoomToolbox } from '../../../room/contexts/RoomToolboxContext'; +import AddExistingModal from './AddExistingModal'; +import TeamsChannels from './TeamsChannels'; +import { useTeamsChannelList } from './hooks/useTeamsChannelList'; + +const TeamsChannelsWithData = () => { + const room = useRoom(); + const setModal = useSetModal(); + const { closeTab } = useRoomToolbox(); + const canAddExistingTeam = usePermission('add-team-channel', room._id); + + const { teamId } = room; + + if (!teamId) { + throw new Error('Invalid teamId'); + } + + const [type, setType] = useLocalStorage<'all' | 'autoJoin'>('channels-list-type', 'all'); + const [text, setText] = useState(''); + const debouncedText = useDebouncedValue(text, 800); + + const { teamsChannelList, loadMoreItems, reload } = useTeamsChannelList( + useMemo(() => ({ teamId, text: debouncedText, type }), [teamId, debouncedText, type]), + ); + + const { phase, items, itemCount: total } = useRecordList(teamsChannelList); + + const handleTextChange = useCallback((event) => { + setText(event.currentTarget.value); + }, []); + + const handleAddExisting = useEffectEvent(() => { + setModal( setModal(null)} reload={reload} />); + }); + + const handleCreateNew = useEffectEvent(() => { + setModal( setModal(null)} reload={reload} />); + }); + + const goToRoom = useEffectEvent((room: IRoom) => { + roomCoordinator.openRouteLink(room.t, room); + }); + + return ( + + ); +}; + +export default TeamsChannelsWithData; diff --git a/apps/meteor/client/views/teams/contextualBar/channels/hooks/useRemoveRoomFromTeam.tsx b/apps/meteor/client/views/teams/contextualBar/channels/hooks/useRemoveRoomFromTeam.tsx new file mode 100644 index 000000000000..de68070d2061 --- /dev/null +++ b/apps/meteor/client/views/teams/contextualBar/channels/hooks/useRemoveRoomFromTeam.tsx @@ -0,0 +1,43 @@ +import type { IRoom } from '@rocket.chat/core-typings'; +import { useEndpoint, usePermission, useSetModal, useToastMessageDispatch, useTranslation } from '@rocket.chat/ui-contexts'; +import React from 'react'; + +import GenericModal from '../../../../../components/GenericModal'; +import { roomCoordinator } from '../../../../../lib/rooms/roomCoordinator'; + +export const useRemoveRoomFromTeam = (room: IRoom, { reload }: { reload?: () => void }) => { + const t = useTranslation(); + const setModal = useSetModal(); + const dispatchToastMessage = useToastMessageDispatch(); + const canRemoveTeamChannel = usePermission('remove-team-channel', room._id); + + const removeRoomEndpoint = useEndpoint('POST', '/v1/teams.removeRoom'); + + const handleRemoveRoom = () => { + const onConfirmAction = async () => { + if (!room.teamId) { + return; + } + + try { + await removeRoomEndpoint({ teamId: room.teamId, roomId: room._id }); + dispatchToastMessage({ type: 'error', message: t('Room_has_been_removed') }); + reload?.(); + } catch (error) { + dispatchToastMessage({ type: 'error', message: error }); + } finally { + setModal(null); + } + }; + + return setModal( + setModal(null)} onConfirm={onConfirmAction} confirmText={t('Remove')}> + {t('Team_Remove_from_team_modal_content', { + teamName: roomCoordinator.getRoomName(room.t, room), + })} + , + ); + }; + + return { handleRemoveRoom, canRemoveTeamChannel }; +}; diff --git a/apps/meteor/client/views/teams/contextualBar/channels/hooks/useToggleAutoJoin.tsx b/apps/meteor/client/views/teams/contextualBar/channels/hooks/useToggleAutoJoin.tsx new file mode 100644 index 000000000000..3a437cd8e5c7 --- /dev/null +++ b/apps/meteor/client/views/teams/contextualBar/channels/hooks/useToggleAutoJoin.tsx @@ -0,0 +1,23 @@ +import type { IRoom } from '@rocket.chat/core-typings'; +import { useEndpoint, usePermission, useToastMessageDispatch } from '@rocket.chat/ui-contexts'; + +export const useToggleAutoJoin = (room: IRoom, { reload }: { reload?: () => void }) => { + const dispatchToastMessage = useToastMessageDispatch(); + const updateRoomEndpoint = useEndpoint('POST', '/v1/teams.updateRoom'); + const canEditTeamChannel = usePermission('edit-team-channel', room._id); + + const handleToggleAutoJoin = async () => { + try { + await updateRoomEndpoint({ + roomId: room._id, + isDefault: !room.teamDefault, + }); + dispatchToastMessage({ type: 'success', message: room.teamDefault ? 'channel set as non autojoin' : 'channel set as autojoin' }); + reload?.(); + } catch (error) { + dispatchToastMessage({ type: 'error', message: error }); + } + }; + + return { handleToggleAutoJoin, canEditTeamChannel }; +}; diff --git a/apps/meteor/client/views/teams/contextualBar/channels/index.ts b/apps/meteor/client/views/teams/contextualBar/channels/index.ts index 12523fd3815d..cd6564dfd512 100644 --- a/apps/meteor/client/views/teams/contextualBar/channels/index.ts +++ b/apps/meteor/client/views/teams/contextualBar/channels/index.ts @@ -1 +1 @@ -export { default } from './TeamsChannels'; +export { default } from './TeamsChannelsWithData'; diff --git a/packages/i18n/src/locales/af.i18n.json b/packages/i18n/src/locales/af.i18n.json index 05926a54689a..992c74fa1174 100644 --- a/packages/i18n/src/locales/af.i18n.json +++ b/packages/i18n/src/locales/af.i18n.json @@ -2102,7 +2102,6 @@ "Room_default_change_to_private_will_be_default_no_more": "Dit is 'n verstekkanaal en verander dit na 'n privaat groep. Dit sal veroorsaak dat dit nie meer 'n verstekkanaal is nie. Wil jy voortgaan?", "Room_description_changed_successfully": "Kamerbeskrywing suksesvol verander", "Room_has_been_archived": "Kamer is geargiveer", - "Room_has_been_deleted": "Kamer is verwyder", "Room_has_been_unarchived": "Kamer is gearchiveer", "Room_Info": "Kamerinligting", "room_is_blocked": "Hierdie kamer is geblokkeer", diff --git a/packages/i18n/src/locales/ar.i18n.json b/packages/i18n/src/locales/ar.i18n.json index 214a1940a388..64772c8f495d 100644 --- a/packages/i18n/src/locales/ar.i18n.json +++ b/packages/i18n/src/locales/ar.i18n.json @@ -3618,7 +3618,6 @@ "room_disallowed_reacting": "غير مسموح لـ Room بالتفاعل من قِبل {{user_by}}", "Room_Edit": "تحرير Room", "Room_has_been_archived": "تمت أرشفة Room", - "Room_has_been_deleted": "تم حذف Room", "Room_has_been_removed": "تمت إزالة Room", "Room_has_been_unarchived": "تم إلغاء أرشفة Room", "Room_Info": "معلومات Room", diff --git a/packages/i18n/src/locales/az.i18n.json b/packages/i18n/src/locales/az.i18n.json index 513bd976f2f6..a61bb8bbff00 100644 --- a/packages/i18n/src/locales/az.i18n.json +++ b/packages/i18n/src/locales/az.i18n.json @@ -2102,7 +2102,6 @@ "Room_default_change_to_private_will_be_default_no_more": "Bu standart bir kanaldır və onu xüsusi bir qrupa dəyişir, artıq bir default kanal olmayacaq. Davam etmək istəyirsinizmi?", "Room_description_changed_successfully": "Otaq təsviri uğurla dəyişdi", "Room_has_been_archived": "Otaq arxivləşdirildi", - "Room_has_been_deleted": "Otaq silindi", "Room_has_been_unarchived": "Otaq arxivləşdirilmişdir", "Room_Info": "Otaq məlumatı", "room_is_blocked": "Bu otaq blokdur", diff --git a/packages/i18n/src/locales/be-BY.i18n.json b/packages/i18n/src/locales/be-BY.i18n.json index 5c9fb33cc0d8..865efa0f9c5a 100644 --- a/packages/i18n/src/locales/be-BY.i18n.json +++ b/packages/i18n/src/locales/be-BY.i18n.json @@ -2119,7 +2119,6 @@ "Room_default_change_to_private_will_be_default_no_more": "Гэта канал па змаўчанні і змяніць яго да прыватнай групе прымусіць яго больш не будзе каналам па змаўчанні. Вы хочаце працягнуць?", "Room_description_changed_successfully": "Апісанне нумароў паспяхова зменены", "Room_has_been_archived": "Нумар знаходзіцца ў архіве", - "Room_has_been_deleted": "Нумар быў выдалены", "Room_has_been_unarchived": "Нумар быў разархіваваць", "Room_Info": "пакой інфармацыя", "room_is_blocked": "Гэты нумар заблякаваны", diff --git a/packages/i18n/src/locales/bg.i18n.json b/packages/i18n/src/locales/bg.i18n.json index 171f8c32ce4f..318a310eed56 100644 --- a/packages/i18n/src/locales/bg.i18n.json +++ b/packages/i18n/src/locales/bg.i18n.json @@ -2099,7 +2099,6 @@ "Room_default_change_to_private_will_be_default_no_more": "Това е канал по подразбиране и ако го промените на частна група, той вече няма да бъде канал по подразбиране. Искаш ли да продължиш?", "Room_description_changed_successfully": "Описание на стаята се промени успешно", "Room_has_been_archived": "Стаята е архивирана", - "Room_has_been_deleted": "Стаята е изтрита", "Room_has_been_unarchived": "Стаята е деархивирана", "Room_Info": "Информация за стаята", "room_is_blocked": "Тази стая е блокирана", diff --git a/packages/i18n/src/locales/bs.i18n.json b/packages/i18n/src/locales/bs.i18n.json index 4fe15d1e24ae..86fd7083b2ce 100644 --- a/packages/i18n/src/locales/bs.i18n.json +++ b/packages/i18n/src/locales/bs.i18n.json @@ -2095,7 +2095,6 @@ "Room_default_change_to_private_will_be_default_no_more": "To je zadani kanal i mijenja se u privatnu grupu, jer više neće biti zadani kanal. Želiš li nastaviti?", "Room_description_changed_successfully": "Opis sobe je uspješno promjenjen", "Room_has_been_archived": "Soba je arhivirana", - "Room_has_been_deleted": "Soba je obrisana", "Room_has_been_unarchived": "Soba je vraćena iz arhive", "Room_Info": "Info Sobe", "room_is_blocked": "Ova soba je blokirana", diff --git a/packages/i18n/src/locales/ca.i18n.json b/packages/i18n/src/locales/ca.i18n.json index 56b5713d155d..834ad853ff0f 100644 --- a/packages/i18n/src/locales/ca.i18n.json +++ b/packages/i18n/src/locales/ca.i18n.json @@ -3553,7 +3553,6 @@ "room_disallowed_reacting": "Room no permesa reaccionant per {{user_by}}", "Room_Edit": "Editar Room ", "Room_has_been_archived": "La sala s'ha arxivat", - "Room_has_been_deleted": "La sala s'ha eliminat", "Room_has_been_removed": "Room ha estat eliminat", "Room_has_been_unarchived": "La Room s'ha desarxivat", "Room_Info": "Informació de la Room", diff --git a/packages/i18n/src/locales/cs.i18n.json b/packages/i18n/src/locales/cs.i18n.json index 32a127396509..4f1eb948651b 100644 --- a/packages/i18n/src/locales/cs.i18n.json +++ b/packages/i18n/src/locales/cs.i18n.json @@ -3024,7 +3024,6 @@ "Room_default_change_to_private_will_be_default_no_more": "Tato místnost je výchozí a pokud bude změněna na privátní, již nebude moci být mezi výchozími. Přesto změnit?", "Room_description_changed_successfully": "Popis místnosti změněn", "Room_has_been_archived": "Místnost byla archivována", - "Room_has_been_deleted": "Místnost smazána", "Room_has_been_unarchived": "Místnost již není archivována", "Room_Info": "Informace o místnosti", "room_is_blocked": "Místnost je blokována", diff --git a/packages/i18n/src/locales/cy.i18n.json b/packages/i18n/src/locales/cy.i18n.json index 38cb42a46eb3..f9f99d0e6423 100644 --- a/packages/i18n/src/locales/cy.i18n.json +++ b/packages/i18n/src/locales/cy.i18n.json @@ -2097,7 +2097,6 @@ "Room_default_change_to_private_will_be_default_no_more": "Sianel ddiofyn yw hon a'i newid i grŵp preifat fydd yn achosi iddo beidio â bod yn sianel ddiofyn mwyach. Ydych chi am fynd ymlaen?", "Room_description_changed_successfully": "Newidiodd disgrifiad ystafell yn llwyddiannus", "Room_has_been_archived": "Mae'r ystafell wedi'i archifo", - "Room_has_been_deleted": "Mae'r ystafell wedi'i ddileu", "Room_has_been_unarchived": "Mae'r ystafell wedi ei anwybyddu", "Room_Info": "Gwybodaeth Ystafell", "room_is_blocked": "Mae'r ystafell hon wedi'i rhwystro", diff --git a/packages/i18n/src/locales/da.i18n.json b/packages/i18n/src/locales/da.i18n.json index 748e6e3f1fc1..789fa5347410 100644 --- a/packages/i18n/src/locales/da.i18n.json +++ b/packages/i18n/src/locales/da.i18n.json @@ -3125,7 +3125,6 @@ "Room_default_change_to_private_will_be_default_no_more": "Dette er en standardkanal og ændrer den til en privat gruppe, fordi den ikke længere er en standardkanal. Vil du fortsætte?", "Room_description_changed_successfully": "Værelsesbeskrivelsen er ændret", "Room_has_been_archived": "Værelset er blevet arkiveret", - "Room_has_been_deleted": "Værelset er blevet slettet", "Room_has_been_unarchived": "Værelset er blevet arkiveret", "Room_Info": "Info om rummet", "room_is_blocked": "Dette rum er blokeret", diff --git a/packages/i18n/src/locales/de-AT.i18n.json b/packages/i18n/src/locales/de-AT.i18n.json index b4073551357c..b41505392150 100644 --- a/packages/i18n/src/locales/de-AT.i18n.json +++ b/packages/i18n/src/locales/de-AT.i18n.json @@ -2105,7 +2105,6 @@ "Room_default_change_to_private_will_be_default_no_more": "Dies ist ein Standardkanal und wenn Sie ihn in eine private Gruppe ändern, wird er nicht mehr als Standardkanal angezeigt. Willst du fortfahren?", "Room_description_changed_successfully": "Raumbeschreibung erfolgreich geändert", "Room_has_been_archived": "Das Zimmer wurde archiviert", - "Room_has_been_deleted": "Der Raum wurde gelöscht.", "Room_has_been_unarchived": "Der Raum wurde entfernt", "Room_Info": "Raum", "room_is_blocked": "Dieser Raum ist blockiert", diff --git a/packages/i18n/src/locales/de-IN.i18n.json b/packages/i18n/src/locales/de-IN.i18n.json index 109df203897a..719cfe9da4fd 100644 --- a/packages/i18n/src/locales/de-IN.i18n.json +++ b/packages/i18n/src/locales/de-IN.i18n.json @@ -2390,7 +2390,6 @@ "Room_default_change_to_private_will_be_default_no_more": "Das ist ein Standardkanal. Die Änderung zu einem privaten Kanal führt dazu, dass er dies nicht mehr ist. Willst Du das?", "Room_description_changed_successfully": "Raumbeschreibung erfolgreich geändert", "Room_has_been_archived": "Der Raum wurde archiviert", - "Room_has_been_deleted": "Der Raum wurde gelöscht", "Room_has_been_unarchived": "Der Raum wurde aus dem Archiv geholt", "Room_Info": "Rauminformation", "room_is_blocked": "Der Raum ist blockiert", diff --git a/packages/i18n/src/locales/de.i18n.json b/packages/i18n/src/locales/de.i18n.json index 2ce24e2aa0e4..64e30aeec0fc 100644 --- a/packages/i18n/src/locales/de.i18n.json +++ b/packages/i18n/src/locales/de.i18n.json @@ -4062,7 +4062,6 @@ "Room_has_been_archived": "Der Room wurde archiviert", "Room_has_been_converted": "Room wurde konvertiert", "Room_has_been_created": "Room wurde erstellt", - "Room_has_been_deleted": "Der Room wurde gelöscht", "Room_has_been_removed": "Raum wurde entfernt", "Room_has_been_unarchived": "Der Room wurde aus dem Archiv geholt", "Room_Info": "Room-Information", diff --git a/packages/i18n/src/locales/el.i18n.json b/packages/i18n/src/locales/el.i18n.json index 0c52b2df3259..4cf3b7764dd0 100644 --- a/packages/i18n/src/locales/el.i18n.json +++ b/packages/i18n/src/locales/el.i18n.json @@ -2110,7 +2110,6 @@ "Room_default_change_to_private_will_be_default_no_more": "Αυτό είναι ένα προεπιλεγμένο κανάλι και η αλλαγή του σε μια ιδιωτική ομάδα θα το κάνει να μην είναι πλέον προεπιλεγμένο κανάλι. Θέλετε να συνεχίσετε?", "Room_description_changed_successfully": "Η περιγραφή δωματίου άλλαξε με επιτυχία", "Room_has_been_archived": "Η αίθουσα έχει αρχειοθετηθεί", - "Room_has_been_deleted": "Δωμάτιο έχει διαγραφεί", "Room_has_been_unarchived": "Η αίθουσα έχει αφαιρεθεί", "Room_Info": "Πληροφορίες δωματίου", "room_is_blocked": "Αυτό το δωμάτιο έχει αποκλειστεί", diff --git a/packages/i18n/src/locales/en.i18n.json b/packages/i18n/src/locales/en.i18n.json index bd3222cdce93..bfdb3aa65236 100644 --- a/packages/i18n/src/locales/en.i18n.json +++ b/packages/i18n/src/locales/en.i18n.json @@ -4519,7 +4519,6 @@ "Room_has_been_archived": "Room has been archived", "Room_has_been_converted": "Room has been converted", "Room_has_been_created": "Room has been created", - "Room_has_been_deleted": "Room has been deleted", "Room_has_been_removed": "Room has been removed", "Room_has_been_unarchived": "Room has been unarchived", "Room_Info": "Room Information", diff --git a/packages/i18n/src/locales/eo.i18n.json b/packages/i18n/src/locales/eo.i18n.json index f20d82eb9682..5631b9240ffa 100644 --- a/packages/i18n/src/locales/eo.i18n.json +++ b/packages/i18n/src/locales/eo.i18n.json @@ -2102,7 +2102,6 @@ "Room_default_change_to_private_will_be_default_no_more": "Ĉi tiu estas defaŭlta kanalo kaj ŝanĝanta ĝin al privata grupo kaŭzos ke ĝi ne plu estos normala kanalo. Ĉu vi volas daŭrigi?", "Room_description_changed_successfully": "Salono priskribo ŝanĝiĝis sukcese", "Room_has_been_archived": "Salono estis arkivita", - "Room_has_been_deleted": "Salono estis forigita", "Room_has_been_unarchived": "Salono estis neatendita", "Room_Info": "Salono Informoj", "room_is_blocked": "Ĉi tiu ĉambro estas blokita", diff --git a/packages/i18n/src/locales/es.i18n.json b/packages/i18n/src/locales/es.i18n.json index 8eca2a2aec15..9bb24537f555 100644 --- a/packages/i18n/src/locales/es.i18n.json +++ b/packages/i18n/src/locales/es.i18n.json @@ -3605,7 +3605,6 @@ "room_disallowed_reacting": "Room no permite reacciones por {{user_by}}", "Room_Edit": "Editar Room ", "Room_has_been_archived": "La Room se ha archivado", - "Room_has_been_deleted": "La Room se ha eliminado", "Room_has_been_removed": "La Room se ha eliminado", "Room_has_been_unarchived": "La Room se ha desarchivado", "Room_Info": "Información de Room", diff --git a/packages/i18n/src/locales/fa.i18n.json b/packages/i18n/src/locales/fa.i18n.json index cfeb59e37ddd..c812d39a543a 100644 --- a/packages/i18n/src/locales/fa.i18n.json +++ b/packages/i18n/src/locales/fa.i18n.json @@ -2413,7 +2413,6 @@ "Room_default_change_to_private_will_be_default_no_more": "این یک کانال پیشفرض است و تغییر آن به یک گروه خصوصی سبب میشود دیگر کانال پیشفرض نباشد. آیا شما می خواهید ادامه دهید؟", "Room_description_changed_successfully": "توضیحات اتاق با موفقیت تغییر کرد", "Room_has_been_archived": "اتاق بایگانی شده است", - "Room_has_been_deleted": "اتاق حذف شده است", "Room_has_been_unarchived": "اتاق آرام شده است", "Room_Info": "اطلاعات اتاق", "room_is_blocked": "این اتاق مسدود شده است", diff --git a/packages/i18n/src/locales/fi.i18n.json b/packages/i18n/src/locales/fi.i18n.json index 7cc44651e568..53f1c0cb4dc1 100644 --- a/packages/i18n/src/locales/fi.i18n.json +++ b/packages/i18n/src/locales/fi.i18n.json @@ -4143,7 +4143,6 @@ "Room_has_been_archived": "Huone on arkistoitu", "Room_has_been_converted": "Huone on muunnettu", "Room_has_been_created": "Huone on luotu", - "Room_has_been_deleted": "Huone on poistettu", "Room_has_been_removed": "Huone on poistettu", "Room_has_been_unarchived": "Huone on palautettu arkistosta", "Room_Info": "Huoneen tiedot", diff --git a/packages/i18n/src/locales/fr.i18n.json b/packages/i18n/src/locales/fr.i18n.json index b8c6ee5b6414..2bcbb3e78a62 100644 --- a/packages/i18n/src/locales/fr.i18n.json +++ b/packages/i18n/src/locales/fr.i18n.json @@ -3607,7 +3607,6 @@ "room_disallowed_reacting": "Salon non autorisé à réagir par {{user_by}}", "Room_Edit": "Modifier le salon", "Room_has_been_archived": "Le salon a été archivé", - "Room_has_been_deleted": "Le salon a été supprimé", "Room_has_been_removed": "Le salon a été supprimé", "Room_has_been_unarchived": "Le salon a été désarchivé", "Room_Info": "Information sur le salon", diff --git a/packages/i18n/src/locales/he.i18n.json b/packages/i18n/src/locales/he.i18n.json index 84da76d59421..1675e10b1d8f 100644 --- a/packages/i18n/src/locales/he.i18n.json +++ b/packages/i18n/src/locales/he.i18n.json @@ -1146,7 +1146,6 @@ "Room_archived": "חדר בארכיון", "room_changed_privacy": "סוג החדר השנה ל:{{room_type}} ע\"י {{user_by}}", "room_changed_topic": "נושא החדר שונה ל:{{room_topic}} ע\"י {{user_by}}", - "Room_has_been_deleted": "חדר נמחק", "Room_Info": "פרטי החדר", "Room_name_changed": "שם החדר שונה ל: {{room_name}} על ידי המשתמש {{user_by}}", "Room_name_changed_successfully": "שם החדר שונה בהצלחה", diff --git a/packages/i18n/src/locales/hr.i18n.json b/packages/i18n/src/locales/hr.i18n.json index 5f3f16e6ed67..e88c450fc6ce 100644 --- a/packages/i18n/src/locales/hr.i18n.json +++ b/packages/i18n/src/locales/hr.i18n.json @@ -2235,7 +2235,6 @@ "Room_default_change_to_private_will_be_default_no_more": "To je zadani kanal i mijenja se u privatnu grupu, jer više neće biti zadani kanal. Želiš li nastaviti?", "Room_description_changed_successfully": "Opis sobe je uspješno promjenjen", "Room_has_been_archived": "Soba je arhivirana", - "Room_has_been_deleted": "Soba je obrisana", "Room_has_been_unarchived": "Soba je vraćena iz arhive", "Room_Info": "Info Sobe", "room_is_blocked": "Ova soba je blokirana", diff --git a/packages/i18n/src/locales/hu.i18n.json b/packages/i18n/src/locales/hu.i18n.json index 69afdb75f233..d352ad6492a3 100644 --- a/packages/i18n/src/locales/hu.i18n.json +++ b/packages/i18n/src/locales/hu.i18n.json @@ -3983,7 +3983,6 @@ "Room_Edit": "Szoba szerkesztése", "Room_has_been_archived": "A szoba archiválva lett", "Room_has_been_created": "A szoba létre lett hozva", - "Room_has_been_deleted": "A szoba törölve lett", "Room_has_been_removed": "A szoba el lett távolítva", "Room_has_been_unarchived": "A szoba archiválása meg lett szüntetve", "Room_Info": "Szobainformációk", diff --git a/packages/i18n/src/locales/id.i18n.json b/packages/i18n/src/locales/id.i18n.json index db105e17538e..e0656e017425 100644 --- a/packages/i18n/src/locales/id.i18n.json +++ b/packages/i18n/src/locales/id.i18n.json @@ -2110,7 +2110,6 @@ "Room_default_change_to_private_will_be_default_no_more": "Ini adalah saluran default dan mengubahnya menjadi grup pribadi akan menyebabkannya menjadi saluran default. Apakah kamu ingin melanjutkan?", "Room_description_changed_successfully": "Deskripsi kamar berubah dengan sukses", "Room_has_been_archived": "Kamar telah diarsipkan", - "Room_has_been_deleted": "Kamar telah dihapus", "Room_has_been_unarchived": "Kamar telah diarsipkan", "Room_Info": "Info kamar", "room_is_blocked": "Ruangan ini diblokir", diff --git a/packages/i18n/src/locales/it.i18n.json b/packages/i18n/src/locales/it.i18n.json index 79dcaded9d78..315780095cd9 100644 --- a/packages/i18n/src/locales/it.i18n.json +++ b/packages/i18n/src/locales/it.i18n.json @@ -2622,7 +2622,6 @@ "Room_default_change_to_private_will_be_default_no_more": "Questo è un canale predefinito e cambiandolo a un gruppo privato non causerà più un canale predefinito. Vuoi procedere?", "Room_description_changed_successfully": "Descrizione del canale cambiata con successo", "Room_has_been_archived": "La stanza è stata archiviata", - "Room_has_been_deleted": "Il canale è stato eliminato", "Room_has_been_unarchived": "La stanza è stata tolta dall'archivio", "Room_Info": "Informazioni canale", "room_is_blocked": "La stanza è sbloccata", diff --git a/packages/i18n/src/locales/ja.i18n.json b/packages/i18n/src/locales/ja.i18n.json index 2e50c926f7bb..27a99598d88d 100644 --- a/packages/i18n/src/locales/ja.i18n.json +++ b/packages/i18n/src/locales/ja.i18n.json @@ -3568,7 +3568,6 @@ "room_disallowed_reacting": "Roomで{{user_by}}による応答が禁止されました", "Room_Edit": "Roomの編集", "Room_has_been_archived": "Roomはアーカイブされました", - "Room_has_been_deleted": "Roomが削除されました", "Room_has_been_removed": "Roomが削除されました", "Room_has_been_unarchived": "Roomのアーカイブが解除されました", "Room_Info": "Room情報", diff --git a/packages/i18n/src/locales/ka-GE.i18n.json b/packages/i18n/src/locales/ka-GE.i18n.json index 7fab42bd2f14..7e28a9792559 100644 --- a/packages/i18n/src/locales/ka-GE.i18n.json +++ b/packages/i18n/src/locales/ka-GE.i18n.json @@ -2816,7 +2816,6 @@ "Room_default_change_to_private_will_be_default_no_more": "ეს არის დეფაულტ არხი და პირად ჯგუფად გადაკეთების შემთხვევაში აღარ იქნება დეფაულტ არხი.გსურთ გაგრძელება?", "Room_description_changed_successfully": "ოთახის აღწერა წარმატებით შეიცვალა", "Room_has_been_archived": "ოთახი დაარქივებულია", - "Room_has_been_deleted": "ოთახი წაიშალა", "Room_has_been_unarchived": "ოთახი ამოარქივდა", "Room_Info": "ოთახის ინფორმაცია", "room_is_blocked": "ოთახი დაბლოკილია", diff --git a/packages/i18n/src/locales/km.i18n.json b/packages/i18n/src/locales/km.i18n.json index 116fbfc12d6a..f995ba297bd0 100644 --- a/packages/i18n/src/locales/km.i18n.json +++ b/packages/i18n/src/locales/km.i18n.json @@ -2420,7 +2420,6 @@ "Room_default_change_to_private_will_be_default_no_more": "នេះជាឆានែលលំនាំដើមហើយការប្តូរវាទៅជាក្រុមឯកជននឹងធ្វើឱ្យវាលែងក្លាយជាឆានែលលំនាំដើម។ តើអ្នកចង់បន្តទេ?", "Room_description_changed_successfully": "ការពិពណ៌នាបន្ទប់បានផ្លាស់ប្ដូរដោយជោគជ័យ", "Room_has_been_archived": "បន្ទប់ត្រូវបានទុកក្នុងប័ណ្ណសារ", - "Room_has_been_deleted": "បន្ទប់ត្រូវបានលុបចោល", "Room_has_been_unarchived": "បន្ទប់មិនត្រូវបានទុកក្នុងប័ណ្ណសារ", "Room_Info": "ព័តមានបន្ទប់", "room_is_blocked": "បន្ទប់នេះត្រូវបានទប់ស្កាត់", diff --git a/packages/i18n/src/locales/ko.i18n.json b/packages/i18n/src/locales/ko.i18n.json index 468da203f883..7f1fae38eda4 100644 --- a/packages/i18n/src/locales/ko.i18n.json +++ b/packages/i18n/src/locales/ko.i18n.json @@ -3077,7 +3077,6 @@ "Room_default_change_to_private_will_be_default_no_more": "이 채널은 기본 채널이며 비공개 그룹으로 변경하면 더 이상 기본 채널이 될 수 없습니다. 진행하시겠습니까?", "Room_description_changed_successfully": "대화방 설명을 변경했습니다.", "Room_has_been_archived": "대화방이 보관되었습니다.", - "Room_has_been_deleted": "대화방이 삭제되었습니다.", "Room_has_been_unarchived": "대화방 보관이 해제되었습니다.", "Room_Info": "대화방 정보", "room_is_blocked": "이 대화방은 차단되었습니다.", diff --git a/packages/i18n/src/locales/ku.i18n.json b/packages/i18n/src/locales/ku.i18n.json index b5b69caa0143..ccf008f20b78 100644 --- a/packages/i18n/src/locales/ku.i18n.json +++ b/packages/i18n/src/locales/ku.i18n.json @@ -2096,7 +2096,6 @@ "Room_default_change_to_private_will_be_default_no_more": "Ev kanalek navekî ye û guhartin bi komê taybet re dê bibe sedema kanalek navekî. Ma hûn dixwazin pêşniyar bikin?", "Room_description_changed_successfully": "Pirtûka jor bi serkeftî guhertin", "Room_has_been_archived": "Room tête arşîvkirin", - "Room_has_been_deleted": "Room hatiye jêbirin", "Room_has_been_unarchived": "Room unarchived", "Room_Info": "Info room", "room_is_blocked": "Ev odeyê hate asteng kirin", diff --git a/packages/i18n/src/locales/lo.i18n.json b/packages/i18n/src/locales/lo.i18n.json index 7bcd89dc402a..ce86290fe61e 100644 --- a/packages/i18n/src/locales/lo.i18n.json +++ b/packages/i18n/src/locales/lo.i18n.json @@ -2140,7 +2140,6 @@ "Room_default_change_to_private_will_be_default_no_more": "ນີ້ແມ່ນຊ່ອງທາງເລີ່ມຕົ້ນແລະການປ່ຽນແປງມັນກັບກຸ່ມເອກະຊົນຈະເຮັດໃຫ້ມັນບໍ່ກາຍເປັນຊ່ອງທາງເລີ່ມຕົ້ນ. ທ່ານຕ້ອງການດໍາເນີນການ?", "Room_description_changed_successfully": "ລາຍະການຫ້ອງປ່ຽນແປງຢ່າງລວດໄວ", "Room_has_been_archived": "ຫ້ອງພັກໄດ້ຖືກເກັບໄວ້", - "Room_has_been_deleted": "ຫ້ອງໄດ້ຖືກລຶບອອກແລ້ວ", "Room_has_been_unarchived": "ຫ້ອງໄດ້ຖືກເປີດເຜີຍ", "Room_Info": "ຂໍ້ມູນຫ້ອງ", "room_is_blocked": "ຫ້ອງນີ້ຖືກປິດ", diff --git a/packages/i18n/src/locales/lt.i18n.json b/packages/i18n/src/locales/lt.i18n.json index 3a866a790e77..350049212f85 100644 --- a/packages/i18n/src/locales/lt.i18n.json +++ b/packages/i18n/src/locales/lt.i18n.json @@ -2157,7 +2157,6 @@ "Room_default_change_to_private_will_be_default_no_more": "Tai numatytasis kanalas ir pakeičia jį į privačią grupę, todėl jis nebebus numatytasis kanalas. Ar norite testi?", "Room_description_changed_successfully": "Kambario aprašymas sėkmingai pakeistas", "Room_has_been_archived": "Kambarys buvo archyvuojamas", - "Room_has_been_deleted": "Kambarys buvo ištrintas", "Room_has_been_unarchived": "Kambarys buvo unarchyvuotas", "Room_Info": "Kambarių informacija", "room_is_blocked": "Šis kambarys yra užblokuotas", diff --git a/packages/i18n/src/locales/lv.i18n.json b/packages/i18n/src/locales/lv.i18n.json index 697c5b577600..f74ff4a62af2 100644 --- a/packages/i18n/src/locales/lv.i18n.json +++ b/packages/i18n/src/locales/lv.i18n.json @@ -2113,7 +2113,6 @@ "Room_default_change_to_private_will_be_default_no_more": "Šis ir noklusējuma kanāls, mainot to uz privātu grupu, tas vairs nebūs noklusējuma kanāls. Vai vēlaties turpināt?", "Room_description_changed_successfully": "Istabas apraksts ir veiksmīgi mainīts", "Room_has_been_archived": "Istaba ir arhivēta", - "Room_has_been_deleted": "Istaba ir dzēsta", "Room_has_been_unarchived": "Istaba ir izņemta no arhīva", "Room_Info": "Istabas informācija", "room_is_blocked": "Šī istaba ir bloķēta", diff --git a/packages/i18n/src/locales/mn.i18n.json b/packages/i18n/src/locales/mn.i18n.json index b8dd78554925..df3463de92a9 100644 --- a/packages/i18n/src/locales/mn.i18n.json +++ b/packages/i18n/src/locales/mn.i18n.json @@ -2097,7 +2097,6 @@ "Room_default_change_to_private_will_be_default_no_more": "Энэ нь анхдагч суваг бөгөөд үүнийг хувийн бүлэгт өөрчилснөөр энэ нь анхдагч суваг байхаа больсон. Та үргэлжлүүлэхийг хүсч байна уу?", "Room_description_changed_successfully": "Өрөөний тодорхойлолт амжилттай болсон", "Room_has_been_archived": "Өрөө архивлагдсан байна", - "Room_has_been_deleted": "Өрөө устгагдсан байна", "Room_has_been_unarchived": "Өрөө нь албан ёсоор бүртгэгдээгүй байна", "Room_Info": "Өрөөний мэдээлэл", "room_is_blocked": "Энэ өрөө хаагдсан", diff --git a/packages/i18n/src/locales/ms-MY.i18n.json b/packages/i18n/src/locales/ms-MY.i18n.json index 4089904315cb..065170e2ee3b 100644 --- a/packages/i18n/src/locales/ms-MY.i18n.json +++ b/packages/i18n/src/locales/ms-MY.i18n.json @@ -2109,7 +2109,6 @@ "Room_default_change_to_private_will_be_default_no_more": "Ini adalah saluran lalai dan mengubahnya ke kumpulan persendirian akan menyebabkan ia tidak lagi menjadi saluran lalai. Adakah anda mahu meneruskan?", "Room_description_changed_successfully": "Penerangan bilik berubah dengan jayanya", "Room_has_been_archived": "Bilik telah diarkibkan", - "Room_has_been_deleted": "Bilik telah dipadam", "Room_has_been_unarchived": "Bilik telah dirahsiakan", "Room_Info": "Maklumat bilik", "room_is_blocked": "Bilik ini disekat", diff --git a/packages/i18n/src/locales/nl.i18n.json b/packages/i18n/src/locales/nl.i18n.json index a5626058a8fe..93433dff0bee 100644 --- a/packages/i18n/src/locales/nl.i18n.json +++ b/packages/i18n/src/locales/nl.i18n.json @@ -3597,7 +3597,6 @@ "room_disallowed_reacting": "Reageren in kamer mag niet meer door {{user_by}}", "Room_Edit": "Kamer bewerken", "Room_has_been_archived": "Kamer is gearchiveerd", - "Room_has_been_deleted": "Kamer is verwijderd", "Room_has_been_removed": "Kamer werd verwijderd", "Room_has_been_unarchived": "Kamer is uit archief gehaald", "Room_Info": "Kamerinformatie", diff --git a/packages/i18n/src/locales/no.i18n.json b/packages/i18n/src/locales/no.i18n.json index 0397bf518f7c..769e58c1e6a8 100644 --- a/packages/i18n/src/locales/no.i18n.json +++ b/packages/i18n/src/locales/no.i18n.json @@ -3513,7 +3513,6 @@ "Room_has_been_archived": "Rom har blitt arkivert", "Room_has_been_converted": "Room er konvertert", "Room_has_been_created": "Room er opprettet", - "Room_has_been_deleted": "Rommet har blitt slettet", "Room_has_been_removed": "Room er fjernet", "Room_has_been_unarchived": "Rom har blitt arkivert", "Room_Info": "Rominformasjon", diff --git a/packages/i18n/src/locales/pl.i18n.json b/packages/i18n/src/locales/pl.i18n.json index 0d2325e2e47e..e6d04c3ae9c7 100644 --- a/packages/i18n/src/locales/pl.i18n.json +++ b/packages/i18n/src/locales/pl.i18n.json @@ -3926,7 +3926,6 @@ "Room_Edit": "Edycja Room", "Room_has_been_archived": "Pokój został zarchiwizowany", "Room_has_been_created": "Room został utworzony", - "Room_has_been_deleted": "Pokój został usunięty", "Room_has_been_removed": "Room został usunięty", "Room_has_been_unarchived": "Pokój został przywrócony", "Room_Info": "Ustawienia pokoju", diff --git a/packages/i18n/src/locales/pt-BR.i18n.json b/packages/i18n/src/locales/pt-BR.i18n.json index 4ae11215c126..5849d51cc5bb 100644 --- a/packages/i18n/src/locales/pt-BR.i18n.json +++ b/packages/i18n/src/locales/pt-BR.i18n.json @@ -3697,7 +3697,6 @@ "room_disallowed_reacting": "Permissão de reagir removida da sala por {{user_by}}", "Room_Edit": "Editar Sala", "Room_has_been_archived": "A sala foi arquivada", - "Room_has_been_deleted": "A sala foi excluída", "Room_has_been_removed": "Sala foi removida", "Room_has_been_unarchived": "A sala foi desarquivada", "Room_Info": "Informações da Sala", diff --git a/packages/i18n/src/locales/pt.i18n.json b/packages/i18n/src/locales/pt.i18n.json index d60379ef7ed9..c3bf9d739b21 100644 --- a/packages/i18n/src/locales/pt.i18n.json +++ b/packages/i18n/src/locales/pt.i18n.json @@ -2442,7 +2442,6 @@ "Room_default_change_to_private_will_be_default_no_more": "Este é um canal padrão e mudá-lo para um grupo privado fará com que ele não seja mais um canal padrão. Você quer prosseguir?", "Room_description_changed_successfully": "A descrição da sala mudou com sucesso", "Room_has_been_archived": "A sala foi arquivada", - "Room_has_been_deleted": "A sala foi removida", "Room_has_been_unarchived": "A sala foi desarquivada", "Room_Info": "Informações da sala", "room_is_blocked": "Esta sala está bloqueada", diff --git a/packages/i18n/src/locales/ro.i18n.json b/packages/i18n/src/locales/ro.i18n.json index 21e950c87678..8f6974fde123 100644 --- a/packages/i18n/src/locales/ro.i18n.json +++ b/packages/i18n/src/locales/ro.i18n.json @@ -2101,7 +2101,6 @@ "Room_default_change_to_private_will_be_default_no_more": "Acesta este un canal implicit și schimbarea acestuia într-un grup privat va determina ca acesta să nu mai fie un canal implicit. Doriți să continuați?", "Room_description_changed_successfully": "Descrierea camerei sa schimbat cu succes", "Room_has_been_archived": "Camera a fost arhivată", - "Room_has_been_deleted": "Camera a fost ștearsă", "Room_has_been_unarchived": "Camera a fost dezarhivată", "Room_Info": "Info cameră", "room_is_blocked": "Această cameră este blocată", diff --git a/packages/i18n/src/locales/ru.i18n.json b/packages/i18n/src/locales/ru.i18n.json index b014b6da9d56..affb21c147a0 100644 --- a/packages/i18n/src/locales/ru.i18n.json +++ b/packages/i18n/src/locales/ru.i18n.json @@ -3772,7 +3772,6 @@ "room_disallowed_reacting": "Пользователь {{user_by}} запретил реакции в комнате", "Room_Edit": "Редактировать чат", "Room_has_been_archived": "Комната была архивирована", - "Room_has_been_deleted": "Комната была удалена", "Room_has_been_removed": "Комната удалена", "Room_has_been_unarchived": "Канал был восстановлен", "Room_Info": "Информация о чате", diff --git a/packages/i18n/src/locales/sk-SK.i18n.json b/packages/i18n/src/locales/sk-SK.i18n.json index 8e80bd7a0aff..27100c086c67 100644 --- a/packages/i18n/src/locales/sk-SK.i18n.json +++ b/packages/i18n/src/locales/sk-SK.i18n.json @@ -2111,7 +2111,6 @@ "Room_default_change_to_private_will_be_default_no_more": "Toto je predvolený kanál a jeho zmena na súkromnú skupinu spôsobí, že už nebude predvoleným kanálom. Chcete pokračovať?", "Room_description_changed_successfully": "Popis izby sa úspešne zmenil", "Room_has_been_archived": "Izba bola archivovaná", - "Room_has_been_deleted": "Miestnosť bola vymazaná", "Room_has_been_unarchived": "Izba bola zrušená", "Room_Info": "Informácie o izbe", "room_is_blocked": "Táto miestnosť je zablokovaná", diff --git a/packages/i18n/src/locales/sl-SI.i18n.json b/packages/i18n/src/locales/sl-SI.i18n.json index d08c083ee9ce..a3630f6ce6c6 100644 --- a/packages/i18n/src/locales/sl-SI.i18n.json +++ b/packages/i18n/src/locales/sl-SI.i18n.json @@ -2091,7 +2091,6 @@ "Room_default_change_to_private_will_be_default_no_more": "To je privzeti kanal. Če ga spremenite v zasebno skupino, ne bo več privzeti kanal. Želite nadaljevati?", "Room_description_changed_successfully": "Opis sobe je uspešno spremenjen", "Room_has_been_archived": "Soba je bila arhivirana", - "Room_has_been_deleted": "Soba je bila izbrisana", "Room_has_been_unarchived": "Soba je bila odarhivirana", "Room_Info": "Informacije o sobi", "room_is_blocked": "Ta soba je blokirana", diff --git a/packages/i18n/src/locales/sq.i18n.json b/packages/i18n/src/locales/sq.i18n.json index 80ff384d4cc4..73e0ca0a56ed 100644 --- a/packages/i18n/src/locales/sq.i18n.json +++ b/packages/i18n/src/locales/sq.i18n.json @@ -2101,7 +2101,6 @@ "Room_default_change_to_private_will_be_default_no_more": "Ky është një kanal i parazgjedhur dhe ndryshimi i tij në një grup privat do të bëjë që ajo të mos jetë më një kanal i paracaktuar. A doni të vazhdoni?", "Room_description_changed_successfully": "Përshkrimi i dhomës u ndryshua me sukses", "Room_has_been_archived": "Dhoma është arkivuar", - "Room_has_been_deleted": "Dhoma është fshirë", "Room_has_been_unarchived": "Dhoma nuk është arkivuar", "Room_Info": "Room Info", "room_is_blocked": "Kjo dhomë është e bllokuar", diff --git a/packages/i18n/src/locales/sr.i18n.json b/packages/i18n/src/locales/sr.i18n.json index adec89c9568b..4a741a750d4f 100644 --- a/packages/i18n/src/locales/sr.i18n.json +++ b/packages/i18n/src/locales/sr.i18n.json @@ -1930,7 +1930,6 @@ "Room_default_change_to_private_will_be_default_no_more": "Ово је подразумевани канал, а промена у приватну групу ће више не бити подразумевани канал. Да ли желите да наставите?", "Room_description_changed_successfully": "Опис собе се успешно промјенио", "Room_has_been_archived": "Соба је архивирана", - "Room_has_been_deleted": "Соба је избрисана", "Room_has_been_unarchived": "Соба је деархивирана", "Room_Info": "Информације о соби", "room_is_blocked": "Ова просторија је блокирана", diff --git a/packages/i18n/src/locales/sv.i18n.json b/packages/i18n/src/locales/sv.i18n.json index f8eb0c610896..56cc49003941 100644 --- a/packages/i18n/src/locales/sv.i18n.json +++ b/packages/i18n/src/locales/sv.i18n.json @@ -4149,7 +4149,6 @@ "Room_has_been_archived": "Rummet har arkiverats", "Room_has_been_converted": "Rum har konverterats", "Room_has_been_created": "Rum har skapats", - "Room_has_been_deleted": "Rummet har raderats", "Room_has_been_removed": "Rummet har tagits bort", "Room_has_been_unarchived": "Rummet har tagits bort från arkivet", "Room_Info": "Rumsinformation", diff --git a/packages/i18n/src/locales/ta-IN.i18n.json b/packages/i18n/src/locales/ta-IN.i18n.json index 4ee378f67319..7ae4d9a96653 100644 --- a/packages/i18n/src/locales/ta-IN.i18n.json +++ b/packages/i18n/src/locales/ta-IN.i18n.json @@ -2102,7 +2102,6 @@ "Room_default_change_to_private_will_be_default_no_more": "இது ஒரு இயல்புநிலை சேனலாகும், மேலும் அது ஒரு தனியார் குழுவாக மாற்றப்படுவதால் இனி இயல்புநிலை சேனலாக இருக்காது. நீங்கள் தொடர விரும்புகிறீர்களா?", "Room_description_changed_successfully": "அறை விளக்கம் வெற்றிகரமாக மாற்றப்பட்டது", "Room_has_been_archived": "அறை காப்பகப்படுத்தப்பட்டுள்ளது", - "Room_has_been_deleted": "அறை நீக்கப்பட்டுள்ளது", "Room_has_been_unarchived": "அறை அகற்றப்பட்டது", "Room_Info": "அறை தகவல்", "room_is_blocked": "இந்த அறை தடுக்கப்பட்டுள்ளது", diff --git a/packages/i18n/src/locales/th-TH.i18n.json b/packages/i18n/src/locales/th-TH.i18n.json index 996333840758..e9f3705b559f 100644 --- a/packages/i18n/src/locales/th-TH.i18n.json +++ b/packages/i18n/src/locales/th-TH.i18n.json @@ -2095,7 +2095,6 @@ "Room_default_change_to_private_will_be_default_no_more": "นี่เป็นช่องทางเริ่มต้นและเปลี่ยนเป็นกลุ่มส่วนตัวจะทำให้ช่องนี้ไม่ได้เป็นช่องเริ่มต้นอีกต่อไป คุณต้องการดำเนินการต่อหรือไม่?", "Room_description_changed_successfully": "เปลี่ยนรายละเอียดห้องเรียบร้อยแล้ว", "Room_has_been_archived": "ห้องพักได้รับการเก็บถาวรแล้ว", - "Room_has_been_deleted": "ห้องถูกลบแล้ว", "Room_has_been_unarchived": "ห้องพักได้รับการยกเลิกการเก็บถาวรแล้ว", "Room_Info": "ข้อมูลห้องพัก", "room_is_blocked": "ห้องนี้ถูกบล็อก", diff --git a/packages/i18n/src/locales/tr.i18n.json b/packages/i18n/src/locales/tr.i18n.json index c4899dab439e..fbfe4c1a1d8c 100644 --- a/packages/i18n/src/locales/tr.i18n.json +++ b/packages/i18n/src/locales/tr.i18n.json @@ -2506,7 +2506,6 @@ "Room_default_change_to_private_will_be_default_no_more": "Bu varsayılan bir kanaldır ve özel bir grup olarak değiştirmek, artık varsayılan kanal olmamasına neden olacaktır. Devam etmek istiyor musunuz?", "Room_description_changed_successfully": "Oda açıklaması başarıyla değiştirildi", "Room_has_been_archived": "Oda arşivlendi", - "Room_has_been_deleted": "Oda silindi", "Room_has_been_unarchived": "Oda arşivden çıkarıldı", "Room_Info": "Oda Bilgileri", "room_is_blocked": "Bu oda engellendi", diff --git a/packages/i18n/src/locales/ug.i18n.json b/packages/i18n/src/locales/ug.i18n.json index ba8077844663..78c3650e0038 100644 --- a/packages/i18n/src/locales/ug.i18n.json +++ b/packages/i18n/src/locales/ug.i18n.json @@ -903,7 +903,6 @@ "Room_archived": "ئۆي ئاللىبۇرۇن تۈرگە ئايرىپ ساقلاندى", "room_changed_privacy": "{{room_type}}ئۆينىڭ تىپىنى بۇنداق ئۆزگەرتتى :{{user_by}}", "room_changed_topic": "{{room_topic}} ئۆينىڭ تېمىسىنى بۇنداق قىلىپ ئۆزگەرتتى:{{user_by}}", - "Room_has_been_deleted": "ئۆي ئاللىبۇرۇن يۇيۇلدى", "Room_Info": "ئۆينىڭ ئۇچۇرى", "Room_name_changed": "تىن ئۆزگەرتىلدى. {{user_by}} ،{{room_name}} پاراڭلىشىش ئۆينىڭ ئىسمى بۇنداق ئۆزگەرتىلدى", "Room_name_changed_successfully": "پاراڭلىشىش ئۆيىنىڭ ئىسمى ئۇتۇقلۇق ئۆزگەرتىلدى", diff --git a/packages/i18n/src/locales/uk.i18n.json b/packages/i18n/src/locales/uk.i18n.json index 94d470171761..0ed157a736c3 100644 --- a/packages/i18n/src/locales/uk.i18n.json +++ b/packages/i18n/src/locales/uk.i18n.json @@ -2639,7 +2639,6 @@ "Room_default_change_to_private_will_be_default_no_more": "Це типовий канал і зміна його на приватну групу призведе до того, що він більше не буде каналом за умовчанням. Ви хочете продовжити?", "Room_description_changed_successfully": "Опис номера змінено успішно", "Room_has_been_archived": "Кімната була заархівована", - "Room_has_been_deleted": "Номер був видалений", "Room_has_been_unarchived": "Номер було неархівовано", "Room_Info": "опис кімнати", "room_is_blocked": "Цей номер заблоковано", diff --git a/packages/i18n/src/locales/vi-VN.i18n.json b/packages/i18n/src/locales/vi-VN.i18n.json index a2fc50733b1e..21fc37f11f01 100644 --- a/packages/i18n/src/locales/vi-VN.i18n.json +++ b/packages/i18n/src/locales/vi-VN.i18n.json @@ -2201,7 +2201,6 @@ "Room_default_change_to_private_will_be_default_no_more": "Đây là kênh mặc định và thay đổi kênh đó thành một nhóm riêng sẽ khiến kênh đó không còn là kênh mặc định. Bạn có muốn tiếp tục?", "Room_description_changed_successfully": "Mô tả phòng đã được thay đổi thành công", "Room_has_been_archived": "Phòng đã được lưu trữ", - "Room_has_been_deleted": "Phòng đã bị xóa", "Room_has_been_unarchived": "Phòng chưa được lưu trữ", "Room_Info": "Thông tin phòng", "room_is_blocked": "Phòng này bị chặn", diff --git a/packages/i18n/src/locales/zh-HK.i18n.json b/packages/i18n/src/locales/zh-HK.i18n.json index 2f416acc4f2f..fa44a7fed369 100644 --- a/packages/i18n/src/locales/zh-HK.i18n.json +++ b/packages/i18n/src/locales/zh-HK.i18n.json @@ -2123,7 +2123,6 @@ "Room_default_change_to_private_will_be_default_no_more": "这是一个默认频道,并将其更改为专用群组将使其不再是默认频道。你想继续吗?", "Room_description_changed_successfully": "房间描述已成功更改", "Room_has_been_archived": "房间已存档", - "Room_has_been_deleted": "房间已被删除", "Room_has_been_unarchived": "房间已被取消存档", "Room_Info": "客房信息", "room_is_blocked": "这个房间被封锁了", diff --git a/packages/i18n/src/locales/zh-TW.i18n.json b/packages/i18n/src/locales/zh-TW.i18n.json index 1b9cbed4a5ee..d15e7739f226 100644 --- a/packages/i18n/src/locales/zh-TW.i18n.json +++ b/packages/i18n/src/locales/zh-TW.i18n.json @@ -3478,7 +3478,6 @@ "Room_default_change_to_private_will_be_default_no_more": "這是一個預設頻道,並將其更改為專用群組將使其不再是預設頻道。你想繼續嗎?", "Room_description_changed_successfully": "Room 描述已成功更改", "Room_has_been_archived": "Room 已封存", - "Room_has_been_deleted": "Room 已經被刪除", "Room_has_been_unarchived": "Room 已被取消封存", "Room_Info": "Room 資訊", "room_is_blocked": "這個房間被封鎖了", diff --git a/packages/i18n/src/locales/zh.i18n.json b/packages/i18n/src/locales/zh.i18n.json index 6929e3eeab8d..b5a972637d81 100644 --- a/packages/i18n/src/locales/zh.i18n.json +++ b/packages/i18n/src/locales/zh.i18n.json @@ -3150,7 +3150,6 @@ "Room_default_change_to_private_will_be_default_no_more": "将默认频道更改为私人组将使其不再是默认频道。您想继续吗?", "Room_description_changed_successfully": "聊天室描述修改成功", "Room_has_been_archived": "聊天室已归档", - "Room_has_been_deleted": "聊天室已被删除", "Room_has_been_unarchived": "已撤销Room归档", "Room_Info": "聊天室信息", "room_is_blocked": "这个聊天室已被屏蔽", From b615b24ace95dc10d011bbde13b249220fba687d Mon Sep 17 00:00:00 2001 From: Pierre Lehnen <55164754+pierre-lehnen-rc@users.noreply.github.com> Date: Thu, 4 Apr 2024 16:00:58 -0300 Subject: [PATCH 70/79] chore: changes to SAML login in anticipation of meteor 3 (#32134) --- .../client/views/root/SAMLLoginRoute.tsx | 23 ++++++++++++------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/apps/meteor/client/views/root/SAMLLoginRoute.tsx b/apps/meteor/client/views/root/SAMLLoginRoute.tsx index 9b98db663469..5bf205c1fa2a 100644 --- a/apps/meteor/client/views/root/SAMLLoginRoute.tsx +++ b/apps/meteor/client/views/root/SAMLLoginRoute.tsx @@ -1,4 +1,4 @@ -import { useRouter, useToastMessageDispatch } from '@rocket.chat/ui-contexts'; +import { useRouter, useToastMessageDispatch, useUserId } from '@rocket.chat/ui-contexts'; import { Meteor } from 'meteor/meteor'; import { useEffect } from 'react'; @@ -12,16 +12,23 @@ const SAMLLoginRoute = () => { if (error) { dispatchToastMessage({ type: 'error', message: error }); } - - router.navigate( - { - pathname: '/home', - }, - { replace: true }, - ); }); }, [dispatchToastMessage, router]); + const userId = useUserId(); + useEffect(() => { + if (!userId) { + return; + } + + router.navigate( + { + pathname: '/home', + }, + { replace: true }, + ); + }, [userId, router]); + return null; }; From ec544d6803c328ff316de323eefdc23776c0a9e9 Mon Sep 17 00:00:00 2001 From: Martin Schoeler Date: Thu, 4 Apr 2024 19:35:19 -0300 Subject: [PATCH 71/79] fix: livechat room desync on different windows (#32135) --- .changeset/wild-keys-obey.md | 5 +++++ packages/livechat/src/lib/room.js | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 .changeset/wild-keys-obey.md diff --git a/.changeset/wild-keys-obey.md b/.changeset/wild-keys-obey.md new file mode 100644 index 000000000000..9de92ee5671b --- /dev/null +++ b/.changeset/wild-keys-obey.md @@ -0,0 +1,5 @@ +--- +"@rocket.chat/livechat": patch +--- + +Fixes issue causing a desync in different browser windows when a chat is closed and started again diff --git a/packages/livechat/src/lib/room.js b/packages/livechat/src/lib/room.js index 20d86d22a5cc..2dc6a93074b2 100644 --- a/packages/livechat/src/lib/room.js +++ b/packages/livechat/src/lib/room.js @@ -348,7 +348,7 @@ export const defaultRoomParams = () => { store.on('change', ([state, prevState]) => { // Cross-tab communication // Detects when a room is created and then route to the correct container - if (!prevState.room && state.room) { + if (prevState.room?._id !== state.room?._id) { route('/'); } }); From e5bbf83adf12bec7d7962294cfe980955a77f92b Mon Sep 17 00:00:00 2001 From: Douglas Fabris Date: Fri, 5 Apr 2024 10:51:44 -0300 Subject: [PATCH 72/79] fix: Missing space between name and user name on system messages (#32136) --- .changeset/smart-squids-begin.md | 5 +++++ .../client/components/message/variants/SystemMessage.tsx | 7 ++++++- 2 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 .changeset/smart-squids-begin.md diff --git a/.changeset/smart-squids-begin.md b/.changeset/smart-squids-begin.md new file mode 100644 index 000000000000..48f3f460ea7e --- /dev/null +++ b/.changeset/smart-squids-begin.md @@ -0,0 +1,5 @@ +--- +'@rocket.chat/meteor': patch +--- + +Fixes the missing space between name and user name on system messages diff --git a/apps/meteor/client/components/message/variants/SystemMessage.tsx b/apps/meteor/client/components/message/variants/SystemMessage.tsx index d69b1ada10dc..9b1a82a156eb 100644 --- a/apps/meteor/client/components/message/variants/SystemMessage.tsx +++ b/apps/meteor/client/components/message/variants/SystemMessage.tsx @@ -85,7 +85,12 @@ const SystemMessage = ({ message, showUserAvatar, ...props }: SystemMessageProps {...triggerProps} > {getUserDisplayName(user.name, user.username, showRealName)} - {showUsername && @{user.username}} + {showUsername && ( + <> + {' '} + @{user.username} + + )} {messageType && ( Date: Fri, 5 Apr 2024 10:58:12 -0300 Subject: [PATCH 73/79] feat: `Contextualbar` resizable (#29461) Co-authored-by: Guilherme Gazzo --- .changeset/good-ghosts-doubt.md | 5 +++ .../Contextualbar/ContextualbarDialog.tsx | 13 +++++- .../Contextualbar/ContextualbarResizable.tsx | 40 +++++++++++++++++++ .../directory/CallsContextualBarDirectory.tsx | 6 +-- .../VideoConfList/VideoConfListItem.tsx | 2 +- apps/meteor/package.json | 1 + packages/i18n/src/locales/en.i18n.json | 2 + .../src/hooks/useFeaturePreviewList.ts | 10 ++++- yarn.lock | 11 +++++ 9 files changed, 83 insertions(+), 7 deletions(-) create mode 100644 .changeset/good-ghosts-doubt.md create mode 100644 apps/meteor/client/components/Contextualbar/ContextualbarResizable.tsx diff --git a/.changeset/good-ghosts-doubt.md b/.changeset/good-ghosts-doubt.md new file mode 100644 index 000000000000..5f4ed8f5a36d --- /dev/null +++ b/.changeset/good-ghosts-doubt.md @@ -0,0 +1,5 @@ +--- +'@rocket.chat/meteor': minor +--- + +Introduces a resizable Contextualbar allowing users to change the width just by dragging it diff --git a/apps/meteor/client/components/Contextualbar/ContextualbarDialog.tsx b/apps/meteor/client/components/Contextualbar/ContextualbarDialog.tsx index 087149bd4a4e..c3421f3fc9d3 100644 --- a/apps/meteor/client/components/Contextualbar/ContextualbarDialog.tsx +++ b/apps/meteor/client/components/Contextualbar/ContextualbarDialog.tsx @@ -1,4 +1,5 @@ import { Contextualbar } from '@rocket.chat/fuselage'; +import { FeaturePreview, FeaturePreviewOff, FeaturePreviewOn } from '@rocket.chat/ui-client'; import { useLayoutSizes, useLayoutContextualBarPosition } from '@rocket.chat/ui-contexts'; import type { ComponentProps, KeyboardEvent } from 'react'; import React, { useCallback, useRef } from 'react'; @@ -6,6 +7,7 @@ import type { AriaDialogProps } from 'react-aria'; import { FocusScope, useDialog } from 'react-aria'; import { useRoomToolbox } from '../../views/room/contexts/RoomToolboxContext'; +import ContextualbarResizable from './ContextualbarResizable'; type ContextualbarDialogProps = AriaDialogProps & ComponentProps; @@ -38,7 +40,16 @@ const ContextualbarDialog = (props: ContextualbarDialogProps) => { return ( - + + + + + + + + + + ); }; diff --git a/apps/meteor/client/components/Contextualbar/ContextualbarResizable.tsx b/apps/meteor/client/components/Contextualbar/ContextualbarResizable.tsx new file mode 100644 index 000000000000..05dd9bf0cf2e --- /dev/null +++ b/apps/meteor/client/components/Contextualbar/ContextualbarResizable.tsx @@ -0,0 +1,40 @@ +import { css } from '@rocket.chat/css-in-js'; +import { Palette, Box } from '@rocket.chat/fuselage'; +import { useLocalStorage } from '@rocket.chat/fuselage-hooks'; +import { Resizable } from 're-resizable'; +import type { ComponentProps } from 'react'; +import React from 'react'; + +type ContextualbarResizableProps = { defaultWidth: string } & ComponentProps; + +const ContextualbarResizable = ({ defaultWidth, children, ...props }: ContextualbarResizableProps) => { + const [contextualbarWidth, setContextualbarWidth] = useLocalStorage('contextualbarWidth', defaultWidth); + const handleStyle = css` + height: 100%; + &:hover { + background-color: ${Palette.stroke['stroke-highlight']}; + } + `; + + return ( + { + setContextualbarWidth(elRef.style.width); + }} + defaultSize={{ + width: contextualbarWidth, + height: '100%', + }} + minWidth={defaultWidth} + maxWidth='50%' + minHeight='100%' + handleStyles={{ left: { width: '3px', zIndex: '5', left: 0 } }} + handleComponent={{ left: }} + > + {children} + + ); +}; + +export default ContextualbarResizable; diff --git a/apps/meteor/client/views/omnichannel/directory/CallsContextualBarDirectory.tsx b/apps/meteor/client/views/omnichannel/directory/CallsContextualBarDirectory.tsx index 010bb5f65517..bf35c50a6bf3 100644 --- a/apps/meteor/client/views/omnichannel/directory/CallsContextualBarDirectory.tsx +++ b/apps/meteor/client/views/omnichannel/directory/CallsContextualBarDirectory.tsx @@ -20,7 +20,7 @@ const CallsContextualBarDirectory: FC = () => { const t = useTranslation(); - const handleCallsContextualbarCloseButtonClick = (): void => { + const handleClose = (): void => { directoryRoute.push({ page: 'calls' }); }; @@ -52,9 +52,7 @@ const CallsContextualBarDirectory: FC = () => { const room = data.room as unknown as IVoipRoom; // TODO Check why types are incompatible even though the endpoint returns an IVoipRooms - return ( - {bar === 'info' && } - ); + return {bar === 'info' && }; }; export default CallsContextualBarDirectory; diff --git a/apps/meteor/client/views/room/contextualBar/VideoConference/VideoConfList/VideoConfListItem.tsx b/apps/meteor/client/views/room/contextualBar/VideoConference/VideoConfList/VideoConfListItem.tsx index 0e155bc2b0b6..194380f2955e 100644 --- a/apps/meteor/client/views/room/contextualBar/VideoConference/VideoConfList/VideoConfListItem.tsx +++ b/apps/meteor/client/views/room/contextualBar/VideoConference/VideoConfList/VideoConfListItem.tsx @@ -54,7 +54,7 @@ const VideoConfListItem = ({ return ( feature.enabled); diff --git a/yarn.lock b/yarn.lock index ba550482d119..8993ef8f84cb 100644 --- a/yarn.lock +++ b/yarn.lock @@ -9465,6 +9465,7 @@ __metadata: query-string: ^7.1.3 queue-fifo: ^0.2.6 rc-scrollbars: ^1.1.6 + re-resizable: ^6.9.9 react: ~17.0.2 react-aria: ~3.23.1 react-docgen-typescript-plugin: ^1.0.5 @@ -34700,6 +34701,16 @@ __metadata: languageName: node linkType: hard +"re-resizable@npm:^6.9.9": + version: 6.9.9 + resolution: "re-resizable@npm:6.9.9" + peerDependencies: + react: ^16.13.1 || ^17.0.0 || ^18.0.0 + react-dom: ^16.13.1 || ^17.0.0 || ^18.0.0 + checksum: a2c8bfe86646fb02d5c9c624b1da26f9e6a5e2f552cd96ce4db690588bee6b21177065ce8e98646c6ca0b1a9c4ce233824b75eb346800d8248ac8a87b40f1b28 + languageName: node + linkType: hard + "react-aria@npm:~3.23.1": version: 3.23.1 resolution: "react-aria@npm:3.23.1" From 11d65a546cfb8207874674ec6a8d9193cf8d7e64 Mon Sep 17 00:00:00 2001 From: Diego Sampaio Date: Fri, 5 Apr 2024 12:21:04 -0300 Subject: [PATCH 74/79] ci: fix services container not building in build step (#32075) --- .github/actions/build-docker/action.yml | 16 ++++++---------- .github/workflows/ci-test-e2e.yml | 8 ++++++++ .github/workflows/ci.yml | 4 ++-- 3 files changed, 16 insertions(+), 12 deletions(-) diff --git a/.github/actions/build-docker/action.yml b/.github/actions/build-docker/action.yml index 284a0985b78e..364957ecdf01 100644 --- a/.github/actions/build-docker/action.yml +++ b/.github/actions/build-docker/action.yml @@ -13,6 +13,10 @@ inputs: required: false description: 'Platform' type: string + build-containers: + required: false + description: 'Containers to build along with Rocket.Chat' + type: string runs: using: composite @@ -54,11 +58,7 @@ runs: - name: Build Docker images shell: bash run: | - args=(rocketchat) - - if [[ '${{ inputs.platform }}' = 'alpine' ]]; then - args+=($SERVICES_PUBLISH) - fi; + args=(rocketchat ${{ inputs.build-containers }}) docker compose -f docker-compose-ci.yml build "${args[@]}" @@ -66,10 +66,6 @@ runs: if: (github.event.pull_request.head.repo.full_name == github.repository || github.event_name == 'release' || github.ref == 'refs/heads/develop') shell: bash run: | - args=(rocketchat) - - if [[ '${{ inputs.platform }}' = 'alpine' ]]; then - args+=($SERVICES_PUBLISH) - fi; + args=(rocketchat ${{ inputs.build-containers }}) docker compose -f docker-compose-ci.yml push "${args[@]}" diff --git a/.github/workflows/ci-test-e2e.yml b/.github/workflows/ci-test-e2e.yml index 1d953b9eb01f..12bb361d76f2 100644 --- a/.github/workflows/ci-test-e2e.yml +++ b/.github/workflows/ci-test-e2e.yml @@ -86,6 +86,14 @@ jobs: name: MongoDB ${{ matrix.mongodb-version }} (${{ matrix.shard }}/${{ inputs.total-shard }}) steps: + - name: Login to GitHub Container Registry + if: (github.event.pull_request.head.repo.full_name == github.repository || github.event_name == 'release' || github.ref == 'refs/heads/develop') + uses: docker/login-action@v2 + with: + registry: ghcr.io + username: ${{ secrets.CR_USER }} + password: ${{ secrets.CR_PAT }} + - name: Launch MongoDB uses: supercharge/mongodb-github-action@v1.10.0 with: diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2a78ca940d03..51e034505a85 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -219,7 +219,6 @@ jobs: RC_DOCKER_TAG: ${{ matrix.platform == 'alpine' && needs.release-versions.outputs.rc-docker-tag-alpine || needs.release-versions.outputs.rc-docker-tag }} DOCKER_TAG: ${{ needs.release-versions.outputs.gh-docker-tag }} LOWERCASE_REPOSITORY: ${{ needs.release-versions.outputs.lowercase-repo }} - SERVICES_PUBLISH: 'authorization-service account-service ddp-streamer-service presence-service stream-hub-service' strategy: fail-fast: false @@ -237,6 +236,7 @@ jobs: CR_PAT: ${{ secrets.CR_PAT }} node-version: ${{ needs.release-versions.outputs.node-version }} platform: ${{ matrix.platform }} + build-containers: ${{ matrix.platform == 'alpine' && 'authorization-service account-service ddp-streamer-service presence-service stream-hub-service queue-worker-service omnichannel-transcript-service' || '' }} build-gh-docker: name: 🚢 Build Docker Images for Production @@ -248,7 +248,6 @@ jobs: RC_DOCKER_TAG: ${{ matrix.platform == 'alpine' && needs.release-versions.outputs.rc-docker-tag-alpine || needs.release-versions.outputs.rc-docker-tag }} DOCKER_TAG: ${{ needs.release-versions.outputs.gh-docker-tag }} LOWERCASE_REPOSITORY: ${{ needs.release-versions.outputs.lowercase-repo }} - SERVICES_PUBLISH: 'authorization-service account-service ddp-streamer-service presence-service stream-hub-service' strategy: fail-fast: false @@ -264,6 +263,7 @@ jobs: CR_PAT: ${{ secrets.CR_PAT }} node-version: ${{ needs.release-versions.outputs.node-version }} platform: ${{ matrix.platform }} + build-containers: ${{ matrix.platform == 'alpine' && 'authorization-service account-service ddp-streamer-service presence-service stream-hub-service queue-worker-service omnichannel-transcript-service' || '' }} - name: Rename official Docker tag to GitHub Container Registry if: matrix.platform == 'official' From 4aba7c8a263e11ba04f8c82322fe493850b3912e Mon Sep 17 00:00:00 2001 From: Allan RIbeiro <35040806+AllanPazRibeiro@users.noreply.github.com> Date: Fri, 5 Apr 2024 13:20:07 -0300 Subject: [PATCH 75/79] feat: allowing forward to offline dep (#31976) Co-authored-by: Guilherme Gazzo --- .changeset/strange-rivers-live.md | 8 + apps/meteor/app/livechat/server/lib/Helper.ts | 23 ++- .../app/livechat/server/lib/RoutingManager.ts | 8 +- .../livechat/server/methods/saveDepartment.ts | 1 + .../departments/EditDepartment.tsx | 14 ++ .../server/lib/LivechatEnterprise.ts | 1 + apps/meteor/tests/data/livechat/department.ts | 52 +++++-- apps/meteor/tests/data/livechat/users.ts | 20 ++- .../tests/end-to-end/api/livechat/00-rooms.ts | 138 +++++++++++++++++- .../end-to-end/api/livechat/10-departments.ts | 13 +- .../core-typings/src/ILivechatDepartment.ts | 2 + packages/i18n/src/locales/en.i18n.json | 2 + 12 files changed, 260 insertions(+), 22 deletions(-) create mode 100644 .changeset/strange-rivers-live.md diff --git a/.changeset/strange-rivers-live.md b/.changeset/strange-rivers-live.md new file mode 100644 index 000000000000..b1ebd05c284d --- /dev/null +++ b/.changeset/strange-rivers-live.md @@ -0,0 +1,8 @@ +--- +'@rocket.chat/core-typings': minor +'@rocket.chat/i18n': minor +'@rocket.chat/meteor': minor +--- + +Added support for allowing agents to forward inquiries to departments that may not have any online agents given that `Allow department to receive forwarded inquiries even when there's no available agents` is set to `true` in the department configuration. +This configuration empowers agents to seamlessly direct incoming requests to the designated department, ensuring efficient handling of queries even when departmental resources are not actively online. When an agent becomes available, any pending inquiries will be automatically routed to them if the routing algorithm supports it. diff --git a/apps/meteor/app/livechat/server/lib/Helper.ts b/apps/meteor/app/livechat/server/lib/Helper.ts index 3f9a555d6b86..3c1d601250c1 100644 --- a/apps/meteor/app/livechat/server/lib/Helper.ts +++ b/apps/meteor/app/livechat/server/lib/Helper.ts @@ -539,10 +539,24 @@ export const forwardRoomToDepartment = async (room: IOmnichannelRoom, guest: ILi agent = { agentId, username }; } - if (!RoutingManager.getConfig()?.autoAssignAgent || !(await Omnichannel.isWithinMACLimit(room))) { + const department = await LivechatDepartment.findOneById< + Pick + >(departmentId, { + projection: { + allowReceiveForwardOffline: 1, + fallbackForwardDepartment: 1, + name: 1, + }, + }); + + if ( + !RoutingManager.getConfig()?.autoAssignAgent || + !(await Omnichannel.isWithinMACLimit(room)) || + (department?.allowReceiveForwardOffline && !(await LivechatTyped.checkOnlineAgents(departmentId))) + ) { logger.debug(`Room ${room._id} will be on department queue`); await LivechatTyped.saveTransferHistory(room, transferData); - return RoutingManager.unassignAgent(inquiry, departmentId); + return RoutingManager.unassignAgent(inquiry, departmentId, true); } // Fake the department to forward the inquiry - Case the forward process does not success @@ -559,11 +573,6 @@ export const forwardRoomToDepartment = async (room: IOmnichannelRoom, guest: ILi const { servedBy, chatQueued } = roomTaken; if (!chatQueued && oldServedBy && servedBy && oldServedBy._id === servedBy._id) { - const department = departmentId - ? await LivechatDepartment.findOneById>(departmentId, { - projection: { fallbackForwardDepartment: 1, name: 1 }, - }) - : null; if (!department?.fallbackForwardDepartment?.length) { logger.debug(`Cannot forward room ${room._id}. Chat assigned to agent ${servedBy._id} (Previous was ${oldServedBy._id})`); throw new Error('error-no-agents-online-in-department'); diff --git a/apps/meteor/app/livechat/server/lib/RoutingManager.ts b/apps/meteor/app/livechat/server/lib/RoutingManager.ts index 051053f761b1..5f0a458dc314 100644 --- a/apps/meteor/app/livechat/server/lib/RoutingManager.ts +++ b/apps/meteor/app/livechat/server/lib/RoutingManager.ts @@ -46,7 +46,7 @@ type Routing = { options?: { clientAction?: boolean; forwardingToDepartment?: { oldDepartmentId?: string; transferData?: any } }, ): Promise<(IOmnichannelRoom & { chatQueued?: boolean }) | null | void>; assignAgent(inquiry: InquiryWithAgentInfo, agent: SelectedAgent): Promise; - unassignAgent(inquiry: ILivechatInquiryRecord, departmentId?: string): Promise; + unassignAgent(inquiry: ILivechatInquiryRecord, departmentId?: string, shouldQueue?: boolean): Promise; takeInquiry( inquiry: Omit< ILivechatInquiryRecord, @@ -158,7 +158,7 @@ export const RoutingManager: Routing = { return inquiry; }, - async unassignAgent(inquiry, departmentId) { + async unassignAgent(inquiry, departmentId, shouldQueue = false) { const { rid, department } = inquiry; const room = await LivechatRooms.findOneById(rid); @@ -181,6 +181,10 @@ export const RoutingManager: Routing = { const { servedBy } = room; + if (shouldQueue) { + await LivechatInquiry.queueInquiry(inquiry._id); + } + if (servedBy) { await LivechatRooms.removeAgentByRoomId(rid); await this.removeAllRoomSubscriptions(room); diff --git a/apps/meteor/app/livechat/server/methods/saveDepartment.ts b/apps/meteor/app/livechat/server/methods/saveDepartment.ts index dd83a294cb0e..45b3b2ec2168 100644 --- a/apps/meteor/app/livechat/server/methods/saveDepartment.ts +++ b/apps/meteor/app/livechat/server/methods/saveDepartment.ts @@ -21,6 +21,7 @@ declare module '@rocket.chat/ui-contexts' { chatClosingTags?: string[]; fallbackForwardDepartment?: string; departmentsAllowedToForward?: string[]; + allowReceiveForwardOffline?: boolean; }, departmentAgents?: | { diff --git a/apps/meteor/client/views/omnichannel/departments/EditDepartment.tsx b/apps/meteor/client/views/omnichannel/departments/EditDepartment.tsx index 0f64e41d242f..30cad4142ff1 100644 --- a/apps/meteor/client/views/omnichannel/departments/EditDepartment.tsx +++ b/apps/meteor/client/views/omnichannel/departments/EditDepartment.tsx @@ -73,6 +73,7 @@ export type FormValues = { fallbackForwardDepartment: string; agentList: IDepartmentAgent[]; chatClosingTags: string[]; + allowReceiveForwardOffline: boolean; }; function withDefault(key: T | undefined | null, defaultValue: T) { @@ -96,6 +97,7 @@ const getInitialValues = ({ department, agents, allowedToForwardData }: InitialV fallbackForwardDepartment: withDefault(department?.fallbackForwardDepartment, ''), chatClosingTags: department?.chatClosingTags ?? [], agentList: agents || [], + allowReceiveForwardOffline: withDefault(department?.allowReceiveForwardOffline, false), }); function EditDepartment({ data, id, title, allowedToForwardData }: EditDepartmentProps) { @@ -151,6 +153,7 @@ function EditDepartment({ data, id, title, allowedToForwardData }: EditDepartmen waitingQueueMessage, departmentsAllowedToForward, fallbackForwardDepartment, + allowReceiveForwardOffline, } = data; const payload = { @@ -169,6 +172,7 @@ function EditDepartment({ data, id, title, allowedToForwardData }: EditDepartmen waitingQueueMessage, departmentsAllowedToForward: departmentsAllowedToForward?.map((dep) => dep.value), fallbackForwardDepartment, + allowReceiveForwardOffline, }; try { @@ -214,6 +218,7 @@ function EditDepartment({ data, id, title, allowedToForwardData }: EditDepartmen const fallbackForwardDepartmentField = useUniqueId(); const requestTagBeforeClosingChatField = useUniqueId(); const chatClosingTagsField = useUniqueId(); + const allowReceiveForwardOffline = useUniqueId(); return ( @@ -424,6 +429,15 @@ function EditDepartment({ data, id, title, allowedToForwardData }: EditDepartmen + + + {t('Accept_receive_inquiry_no_online_agents')} + + + + {t('Accept_receive_inquiry_no_online_agents_Hint')} + + {requestTagBeforeClosingChat && ( diff --git a/apps/meteor/ee/app/livechat-enterprise/server/lib/LivechatEnterprise.ts b/apps/meteor/ee/app/livechat-enterprise/server/lib/LivechatEnterprise.ts index 6d0408dffc91..0e6a51cd0ff6 100644 --- a/apps/meteor/ee/app/livechat-enterprise/server/lib/LivechatEnterprise.ts +++ b/apps/meteor/ee/app/livechat-enterprise/server/lib/LivechatEnterprise.ts @@ -232,6 +232,7 @@ export const LivechatEnterprise = { chatClosingTags: Match.Optional([String]), fallbackForwardDepartment: Match.Optional(String), departmentsAllowedToForward: Match.Optional([String]), + allowReceiveForwardOffline: Match.Optional(Boolean), }; // The Livechat Form department support addition/custom fields, so those fields need to be added before validating diff --git a/apps/meteor/tests/data/livechat/department.ts b/apps/meteor/tests/data/livechat/department.ts index 3d18f9c394b9..ba0df137b567 100644 --- a/apps/meteor/tests/data/livechat/department.ts +++ b/apps/meteor/tests/data/livechat/department.ts @@ -3,7 +3,7 @@ import { expect } from 'chai'; import type { ILivechatDepartment, IUser, LivechatDepartmentDTO } from '@rocket.chat/core-typings'; import { api, credentials, methodCall, request } from '../api-data'; import { IUserCredentialsHeader } from '../user'; -import { createAnOnlineAgent } from './users'; +import { createAnOnlineAgent, createAnOfflineAgent } from './users'; import { WithRequiredProperty } from './utils'; export const NewDepartmentData = ((): Partial => ({ @@ -29,7 +29,9 @@ export const updateDepartment = async (departmentId: string, departmentData: Par return response.body.department; }; -export const createDepartmentWithMethod = (initialAgents: { agentId: string, username: string }[] = []) => +export const createDepartmentWithMethod = ( + initialAgents: { agentId: string, username: string }[] = [], + allowReceiveForwardOffline = false) => new Promise((resolve, reject) => { request .post(methodCall('livechat:saveDepartment')) @@ -37,14 +39,19 @@ new Promise((resolve, reject) => { .send({ message: JSON.stringify({ method: 'livechat:saveDepartment', - params: ['', { - enabled: true, - email: faker.internet.email(), - showOnRegistration: true, - showOnOfflineForm: true, - name: `new department ${Date.now()}`, - description: 'created from api', - }, initialAgents], + params: [ + '', + { + enabled: true, + email: faker.internet.email(), + showOnRegistration: true, + showOnOfflineForm: true, + name: `new department ${Date.now()}`, + description: 'created from api', + allowReceiveForwardOffline, + }, + initialAgents, + ], id: 'id', msg: 'method', }), @@ -102,6 +109,31 @@ export const addOrRemoveAgentFromDepartment = async (departmentId: string, agent throw new Error('Failed to add or remove agent from department. Status code: ' + response.status + '\n' + response.body); } } +export const createDepartmentWithAnOfflineAgent = async ({ + allowReceiveForwardOffline = false, +}: { + allowReceiveForwardOffline: boolean; +}): Promise<{ + department: ILivechatDepartment; + agent: { + credentials: IUserCredentialsHeader; + user: WithRequiredProperty; + }; +}> => { + const { user, credentials } = await createAnOfflineAgent(); + + const department = (await createDepartmentWithMethod(undefined, allowReceiveForwardOffline)) as ILivechatDepartment; + + await addOrRemoveAgentFromDepartment(department._id, { agentId: user._id, username: user.username }, true); + + return { + department, + agent: { + credentials, + user, + }, + }; +}; export const archiveDepartment = async (departmentId: string): Promise => { await request.post(api(`livechat/department/${ departmentId }/archive`)).set(credentials).expect(200); diff --git a/apps/meteor/tests/data/livechat/users.ts b/apps/meteor/tests/data/livechat/users.ts index 3a21cbee923c..161c20749b6c 100644 --- a/apps/meteor/tests/data/livechat/users.ts +++ b/apps/meteor/tests/data/livechat/users.ts @@ -2,7 +2,7 @@ import { faker } from "@faker-js/faker"; import type { ILivechatAgent, IUser } from "@rocket.chat/core-typings"; import { IUserCredentialsHeader, password } from "../user"; import { createUser, login } from "../users.helper"; -import { createAgent, makeAgentAvailable } from "./rooms"; +import { createAgent, makeAgentAvailable, makeAgentUnavailable } from "./rooms"; import { api, credentials, request } from "../api-data"; export const createBotAgent = async (): Promise<{ @@ -57,3 +57,21 @@ export const createAnOnlineAgent = async (): Promise<{ user: agent, }; } + +export const createAnOfflineAgent = async (): Promise<{ + credentials: IUserCredentialsHeader; + user: IUser & { username: string }; +}> => { + const username = `user.test.${Date.now()}.offline`; + const email = `${username}.offline@rocket.chat`; + const { body } = await request.post(api('users.create')).set(credentials).send({ email, name: username, username, password }); + const agent = body.user; + const createdUserCredentials = await login(agent.username, password); + await createAgent(agent.username); + await makeAgentUnavailable(createdUserCredentials); + + return { + credentials: createdUserCredentials, + user: agent, + }; +}; \ No newline at end of file diff --git a/apps/meteor/tests/end-to-end/api/livechat/00-rooms.ts b/apps/meteor/tests/end-to-end/api/livechat/00-rooms.ts index 0d9e5fff0a65..e99c893abf9a 100644 --- a/apps/meteor/tests/end-to-end/api/livechat/00-rooms.ts +++ b/apps/meteor/tests/end-to-end/api/livechat/00-rooms.ts @@ -18,7 +18,7 @@ import type { Response } from 'supertest'; import type { SuccessResult } from '../../../../app/api/server/definition'; import { getCredentials, api, request, credentials, methodCall } from '../../../data/api-data'; import { createCustomField } from '../../../data/livechat/custom-fields'; -import { createDepartmentWithAnOnlineAgent } from '../../../data/livechat/department'; +import { createDepartmentWithAnOfflineAgent, createDepartmentWithAnOnlineAgent, deleteDepartment } from '../../../data/livechat/department'; import { createSLA, getRandomPriority } from '../../../data/livechat/priorities'; import { createVisitor, @@ -32,6 +32,7 @@ import { closeOmnichannelRoom, createDepartment, fetchMessages, + makeAgentUnavailable, } from '../../../data/livechat/rooms'; import { saveTags } from '../../../data/livechat/tags'; import type { DummyResponse } from '../../../data/livechat/utils'; @@ -700,6 +701,35 @@ describe('LIVECHAT - rooms', function () { await deleteUser(initialAgentAssignedToChat); await deleteUser(forwardChatToUser); }); + + (IS_EE ? it : it.skip)('should return error message when transferred to a offline agent', async () => { + await updateSetting('Livechat_Routing_Method', 'Auto_Selection'); + const { department: initialDepartment } = await createDepartmentWithAnOnlineAgent(); + const { department: forwardToOfflineDepartment } = await createDepartmentWithAnOfflineAgent({ allowReceiveForwardOffline: false }); + + const newVisitor = await createVisitor(initialDepartment._id); + const newRoom = await createLivechatRoom(newVisitor.token); + + await request + .post(api('livechat/room.forward')) + .set(credentials) + .send({ + roomId: newRoom._id, + departmentId: forwardToOfflineDepartment._id, + clientAction: true, + comment: 'test comment', + }) + .expect('Content-Type', 'application/json') + .expect(400) + .expect((res: Response) => { + expect(res.body).to.have.property('success', false); + expect(res.body).to.have.property('error', 'error-no-agents-online-in-department'); + }); + + await deleteDepartment(initialDepartment._id); + await deleteDepartment(forwardToOfflineDepartment._id); + }); + (IS_EE ? it : it.skip)('should return a success message when transferred successfully to a department', async () => { const { department: initialDepartment } = await createDepartmentWithAnOnlineAgent(); const { department: forwardToDepartment } = await createDepartmentWithAnOnlineAgent(); @@ -734,6 +764,112 @@ describe('LIVECHAT - rooms', function () { expect((latestRoom.lastMessage as any)?.transferData?.scope).to.be.equal('department'); expect((latestRoom.lastMessage as any)?.transferData?.nextDepartment?._id).to.be.equal(forwardToDepartment._id); }); + (IS_EE ? it : it.skip)( + 'should return a success message when transferred successfully to an offline department when the department accepts it', + async () => { + const { department: initialDepartment } = await createDepartmentWithAnOnlineAgent(); + const { department: forwardToOfflineDepartment } = await createDepartmentWithAnOfflineAgent({ allowReceiveForwardOffline: true }); + + const newVisitor = await createVisitor(initialDepartment._id); + const newRoom = await createLivechatRoom(newVisitor.token); + + await request + .post(api('livechat/room.forward')) + .set(credentials) + .send({ + roomId: newRoom._id, + departmentId: forwardToOfflineDepartment._id, + clientAction: true, + comment: 'test comment', + }) + .expect('Content-Type', 'application/json') + .expect(200) + .expect((res: Response) => { + expect(res.body).to.have.property('success', true); + }); + + await deleteDepartment(initialDepartment._id); + await deleteDepartment(forwardToOfflineDepartment._id); + }, + ); + (IS_EE ? it : it.skip)('inquiry should be taken automatically when agent on department is online again', async () => { + await updateSetting('Livechat_Routing_Method', 'Auto_Selection'); + const { department: initialDepartment } = await createDepartmentWithAnOnlineAgent(); + const { department: forwardToOfflineDepartment } = await createDepartmentWithAnOfflineAgent({ allowReceiveForwardOffline: true }); + + const newVisitor = await createVisitor(initialDepartment._id); + const newRoom = await createLivechatRoom(newVisitor.token); + + await request.post(api('livechat/room.forward')).set(credentials).send({ + roomId: newRoom._id, + departmentId: forwardToOfflineDepartment._id, + clientAction: true, + comment: 'test comment', + }); + + await makeAgentAvailable(); + + const latestRoom = await getLivechatRoomInfo(newRoom._id); + + expect(latestRoom).to.have.property('departmentId'); + expect(latestRoom.departmentId).to.be.equal(forwardToOfflineDepartment._id); + + expect(latestRoom).to.have.property('lastMessage'); + expect(latestRoom.lastMessage?.t).to.be.equal('livechat_transfer_history'); + expect(latestRoom.lastMessage?.u?.username).to.be.equal(adminUsername); + expect((latestRoom.lastMessage as any)?.transferData?.comment).to.be.equal('test comment'); + expect((latestRoom.lastMessage as any)?.transferData?.scope).to.be.equal('department'); + expect((latestRoom.lastMessage as any)?.transferData?.nextDepartment?._id).to.be.equal(forwardToOfflineDepartment._id); + + await updateSetting('Livechat_Routing_Method', 'Manual_Selection'); + await deleteDepartment(initialDepartment._id); + await deleteDepartment(forwardToOfflineDepartment._id); + }); + + (IS_EE ? it : it.skip)('when manager forward to offline department the inquiry should be set to the queue', async () => { + await updateSetting('Livechat_Routing_Method', 'Manual_Selection'); + const { department: initialDepartment } = await createDepartmentWithAnOnlineAgent(); + const { department: forwardToOfflineDepartment, agent: offlineAgent } = await createDepartmentWithAnOfflineAgent({ + allowReceiveForwardOffline: true, + }); + + const newVisitor = await createVisitor(initialDepartment._id); + const newRoom = await createLivechatRoom(newVisitor.token); + + await makeAgentUnavailable(offlineAgent.credentials); + + const manager: IUser = await createUser(); + const managerCredentials = await login(manager.username, password); + await createManager(manager.username); + + await request.post(api('livechat/room.forward')).set(managerCredentials).send({ + roomId: newRoom._id, + departmentId: forwardToOfflineDepartment._id, + clientAction: true, + comment: 'test comment', + }); + + await request + .get(api(`livechat/queue`)) + .set(credentials) + .query({ + count: 1, + }) + .expect('Content-Type', 'application/json') + .expect(200) + .expect((res: Response) => { + expect(res.body).to.have.property('success', true); + expect(res.body.queue).to.be.an('array'); + expect(res.body.queue[0].chats).not.to.undefined; + expect(res.body).to.have.property('offset'); + expect(res.body).to.have.property('total'); + expect(res.body).to.have.property('count'); + }); + + await deleteDepartment(initialDepartment._id); + await deleteDepartment(forwardToOfflineDepartment._id); + }); + let roomId: string; let visitorToken: string; (IS_EE ? it : it.skip)('should return a success message when transferring to a fallback department', async () => { diff --git a/apps/meteor/tests/end-to-end/api/livechat/10-departments.ts b/apps/meteor/tests/end-to-end/api/livechat/10-departments.ts index 54f8739efee3..fc9af8d4580e 100644 --- a/apps/meteor/tests/end-to-end/api/livechat/10-departments.ts +++ b/apps/meteor/tests/end-to-end/api/livechat/10-departments.ts @@ -49,7 +49,16 @@ import { IS_EE } from '../../../e2e/config/constants'; const { body } = await request .post(api('livechat/department')) .set(credentials) - .send({ department: { name: 'Test', enabled: true, showOnOfflineForm: true, showOnRegistration: true, email: 'bla@bla' } }) + .send({ + department: { + name: 'Test', + enabled: true, + showOnOfflineForm: true, + showOnRegistration: true, + email: 'bla@bla', + allowReceiveForwardOffline: true, + }, + }) .expect('Content-Type', 'application/json') .expect(200); expect(body).to.have.property('success', true); @@ -59,6 +68,8 @@ import { IS_EE } from '../../../e2e/config/constants'; expect(body.department).to.have.property('enabled', true); expect(body.department).to.have.property('showOnOfflineForm', true); expect(body.department).to.have.property('showOnRegistration', true); + expect(body.department).to.have.property('allowReceiveForwardOffline', true); + departmentId = body.department._id; }); diff --git a/packages/core-typings/src/ILivechatDepartment.ts b/packages/core-typings/src/ILivechatDepartment.ts index 8c75913dc729..a73cf55cb235 100644 --- a/packages/core-typings/src/ILivechatDepartment.ts +++ b/packages/core-typings/src/ILivechatDepartment.ts @@ -17,6 +17,7 @@ export interface ILivechatDepartment { departmentsAllowedToForward?: string[]; maxNumberSimultaneousChat?: number; ancestors?: string[]; + allowReceiveForwardOffline?: boolean; // extra optional fields [k: string]: any; } @@ -32,4 +33,5 @@ export type LivechatDepartmentDTO = { chatClosingTags?: string[] | undefined; fallbackForwardDepartment?: string | undefined; departmentsAllowedToForward?: string[] | undefined; + allowReceiveForwardOffline?: boolean; }; diff --git a/packages/i18n/src/locales/en.i18n.json b/packages/i18n/src/locales/en.i18n.json index 84cc8a1965f2..6a13985f8a27 100644 --- a/packages/i18n/src/locales/en.i18n.json +++ b/packages/i18n/src/locales/en.i18n.json @@ -4841,6 +4841,8 @@ "Show_more": "Show more", "Show_name_field": "Show name field", "show_offline_users": "show offline users", + "Accept_receive_inquiry_no_online_agents": "Allow department to receive forwarded inquiries even when there's no available agents", + "Accept_receive_inquiry_no_online_agents_Hint": "This method is effective only with automatic assignment routing methods, and does not apply to Manual Selection.", "Show_on_offline_page": "Show on offline page", "Show_on_registration_page": "Show on registration page", "Show_only_online": "Show Online Only", From a7823c1b0901c510af5bfa994e7b3f96ee10dd91 Mon Sep 17 00:00:00 2001 From: Guilherme Gazzo Date: Fri, 5 Apr 2024 16:13:16 -0300 Subject: [PATCH 76/79] chore: move imported `Apps` to proxy (#32142) --- .../authentication/server/startup/index.js | 6 +- .../app/file-upload/server/lib/FileUpload.ts | 12 +--- .../app/lib/server/functions/addUserToRoom.ts | 4 +- .../lib/server/functions/createDirectRoom.ts | 8 +-- .../app/lib/server/functions/createRoom.ts | 6 +- .../app/lib/server/functions/deleteMessage.ts | 2 +- .../server/functions/removeUserFromRoom.ts | 4 +- .../app/lib/server/functions/saveUser.js | 2 +- .../app/lib/server/functions/sendMessage.ts | 4 +- .../app/lib/server/functions/updateMessage.ts | 4 +- .../server/methods/deleteUserOwnAccount.ts | 2 +- apps/meteor/app/livechat/server/lib/Helper.ts | 6 +- .../app/livechat/server/lib/LivechatTyped.ts | 8 +-- .../app/livechat/server/lib/QueueManager.ts | 2 +- .../app/livechat/server/lib/RoutingManager.ts | 2 +- apps/meteor/app/mailer/server/api.ts | 2 +- .../app/message-pin/server/pinMessage.ts | 4 +- .../app/message-star/server/starMessage.ts | 2 +- .../app/reactions/server/setReaction.ts | 2 +- .../server/lib/getAppsStatistics.js | 6 +- .../threads/server/methods/followMessage.ts | 2 +- .../threads/server/methods/unfollowMessage.ts | 2 +- .../ee/server/apps/communication/rest.ts | 5 +- apps/meteor/ee/server/index.ts | 1 + apps/meteor/ee/server/startup/index.ts | 1 - .../server/lib/moderation/reportMessage.ts | 2 +- apps/meteor/server/methods/deleteUser.ts | 2 +- apps/meteor/server/methods/eraseRoom.ts | 4 +- apps/meteor/server/methods/logoutCleanUp.ts | 2 +- apps/meteor/server/methods/reportMessage.ts | 2 +- apps/meteor/server/methods/saveUserProfile.ts | 2 +- .../server/services/apps-engine/service.ts | 66 ++++++++++--------- .../services/video-conference/service.ts | 4 +- apps/meteor/server/startup/migrations/v291.ts | 2 +- apps/meteor/server/startup/migrations/v292.ts | 2 +- apps/meteor/server/startup/migrations/v294.ts | 2 +- packages/apps/src/orchestrator.ts | 26 +++++++- 37 files changed, 115 insertions(+), 100 deletions(-) diff --git a/apps/meteor/app/authentication/server/startup/index.js b/apps/meteor/app/authentication/server/startup/index.js index ab622be95d53..c4f568f3c4f8 100644 --- a/apps/meteor/app/authentication/server/startup/index.js +++ b/apps/meteor/app/authentication/server/startup/index.js @@ -350,8 +350,8 @@ const insertUserDocAsync = async function (options, user) { if (!options.skipAppsEngineEvent) { // `post` triggered events don't need to wait for the promise to resolve - Apps?.triggerEvent(AppEvents.IPostUserCreated, { user, performedBy: await safeGetMeteorUser() }).catch((e) => { - Apps?.getRocketChatLogger().error('Error while executing post user created event:', e); + Apps.self?.triggerEvent(AppEvents.IPostUserCreated, { user, performedBy: await safeGetMeteorUser() }).catch((e) => { + Apps.self?.getRocketChatLogger().error('Error while executing post user created event:', e); }); } @@ -424,7 +424,7 @@ const validateLoginAttemptAsync = async function (login) { */ if (login.type !== 'resume') { // App IPostUserLoggedIn event hook - await Apps?.triggerEvent(AppEvents.IPostUserLoggedIn, login.user); + await Apps.self?.triggerEvent(AppEvents.IPostUserLoggedIn, login.user); } return true; diff --git a/apps/meteor/app/file-upload/server/lib/FileUpload.ts b/apps/meteor/app/file-upload/server/lib/FileUpload.ts index 3fd00f5e3e2a..4458f9d61881 100644 --- a/apps/meteor/app/file-upload/server/lib/FileUpload.ts +++ b/apps/meteor/app/file-upload/server/lib/FileUpload.ts @@ -177,7 +177,7 @@ export const FileUpload = { // App IPreFileUpload event hook try { - await Apps?.triggerEvent(AppEvents.IPreFileUpload, { file, content: content || Buffer.from([]) }); + await Apps.self?.triggerEvent(AppEvents.IPreFileUpload, { file, content: content || Buffer.from([]) }); } catch (error: any) { if (error.name === AppsEngineException.name) { throw new Meteor.Error('error-app-prevented', error.message); @@ -587,15 +587,7 @@ export const FileUpload = { } // eslint-disable-next-line prettier/prettier - const headersToProxy = [ - 'age', - 'cache-control', - 'content-length', - 'content-type', - 'date', - 'expired', - 'last-modified', - ]; + const headersToProxy = ['age', 'cache-control', 'content-length', 'content-type', 'date', 'expired', 'last-modified']; headersToProxy.forEach((header) => { fileRes.headers[header] && res.setHeader(header, String(fileRes.headers[header])); diff --git a/apps/meteor/app/lib/server/functions/addUserToRoom.ts b/apps/meteor/app/lib/server/functions/addUserToRoom.ts index 4a70943d28e2..4506b659bf4d 100644 --- a/apps/meteor/app/lib/server/functions/addUserToRoom.ts +++ b/apps/meteor/app/lib/server/functions/addUserToRoom.ts @@ -54,7 +54,7 @@ export const addUserToRoom = async function ( } try { - await Apps?.triggerEvent(AppEvents.IPreRoomUserJoined, room, userToBeAdded, inviter); + await Apps.self?.triggerEvent(AppEvents.IPreRoomUserJoined, room, userToBeAdded, inviter); } catch (error: any) { if (error.name === AppsEngineException.name) { throw new Meteor.Error('error-app-prevented', error.message); @@ -118,7 +118,7 @@ export const addUserToRoom = async function ( // Keep the current event await callbacks.run('afterJoinRoom', userToBeAdded, room); - void Apps?.triggerEvent(AppEvents.IPostRoomUserJoined, room, userToBeAdded, inviter); + void Apps.self?.triggerEvent(AppEvents.IPostRoomUserJoined, room, userToBeAdded, inviter); }); } diff --git a/apps/meteor/app/lib/server/functions/createDirectRoom.ts b/apps/meteor/app/lib/server/functions/createDirectRoom.ts index dea6004eb4e5..c1de81332543 100644 --- a/apps/meteor/app/lib/server/functions/createDirectRoom.ts +++ b/apps/meteor/app/lib/server/functions/createDirectRoom.ts @@ -103,7 +103,7 @@ export async function createDirectRoom( _USERNAMES: usernames, }; - const prevent = await Apps?.triggerEvent(AppEvents.IPreRoomCreatePrevent, tmpRoom).catch((error) => { + const prevent = await Apps.self?.triggerEvent(AppEvents.IPreRoomCreatePrevent, tmpRoom).catch((error) => { if (error.name === AppsEngineException.name) { throw new Meteor.Error('error-app-prevented', error.message); } @@ -115,9 +115,9 @@ export async function createDirectRoom( throw new Meteor.Error('error-app-prevented', 'A Rocket.Chat App prevented the room creation.'); } - const result = await Apps?.triggerEvent( + const result = await Apps.self?.triggerEvent( AppEvents.IPreRoomCreateModify, - await Apps?.triggerEvent(AppEvents.IPreRoomCreateExtend, tmpRoom), + await Apps.self?.triggerEvent(AppEvents.IPreRoomCreateExtend, tmpRoom), ); if (typeof result === 'object') { @@ -172,7 +172,7 @@ export async function createDirectRoom( await callbacks.run('afterCreateDirectRoom', insertedRoom, { members: roomMembers, creatorId: options?.creator }); - void Apps?.triggerEvent(AppEvents.IPostRoomCreate, insertedRoom); + void Apps.self?.triggerEvent(AppEvents.IPostRoomCreate, insertedRoom); } return { diff --git a/apps/meteor/app/lib/server/functions/createRoom.ts b/apps/meteor/app/lib/server/functions/createRoom.ts index 11577a76c4fb..615a0faf8bb3 100644 --- a/apps/meteor/app/lib/server/functions/createRoom.ts +++ b/apps/meteor/app/lib/server/functions/createRoom.ts @@ -198,7 +198,7 @@ export const createRoom = async ( _USERNAMES: members, }; - const prevent = await Apps?.triggerEvent(AppEvents.IPreRoomCreatePrevent, tmp).catch((error) => { + const prevent = await Apps.self?.triggerEvent(AppEvents.IPreRoomCreatePrevent, tmp).catch((error) => { if (error.name === AppsEngineException.name) { throw new Meteor.Error('error-app-prevented', error.message); } @@ -210,7 +210,7 @@ export const createRoom = async ( throw new Meteor.Error('error-app-prevented', 'A Rocket.Chat App prevented the room creation.'); } - const eventResult = await Apps?.triggerEvent( + const eventResult = await Apps.self?.triggerEvent( AppEvents.IPreRoomCreateModify, await Apps.triggerEvent(AppEvents.IPreRoomCreateExtend, tmp), ); @@ -245,7 +245,7 @@ export const createRoom = async ( callbacks.runAsync('federation.afterCreateFederatedRoom', room, { owner, originalMemberList: members }); } - void Apps?.triggerEvent(AppEvents.IPostRoomCreate, room); + void Apps.self?.triggerEvent(AppEvents.IPostRoomCreate, room); return { rid: room._id, // backwards compatible inserted: true, diff --git a/apps/meteor/app/lib/server/functions/deleteMessage.ts b/apps/meteor/app/lib/server/functions/deleteMessage.ts index 26677bf37fff..9368787bf7ea 100644 --- a/apps/meteor/app/lib/server/functions/deleteMessage.ts +++ b/apps/meteor/app/lib/server/functions/deleteMessage.ts @@ -33,7 +33,7 @@ export async function deleteMessage(message: IMessage, user: IUser): Promise 0; const keepHistory = settings.get('Message_KeepHistory') || isThread; const showDeletedStatus = settings.get('Message_ShowDeletedStatus') || isThread; - const bridges = Apps?.isLoaded() && Apps.getBridges(); + const bridges = Apps.self?.isLoaded() && Apps.getBridges(); if (deletedMsg && bridges) { const prevent = await bridges.getListenerBridge().messageEvent(AppEvents.IPreMessageDeletePrevent, deletedMsg); diff --git a/apps/meteor/app/lib/server/functions/removeUserFromRoom.ts b/apps/meteor/app/lib/server/functions/removeUserFromRoom.ts index aaff8257f987..1cc8c4ad5432 100644 --- a/apps/meteor/app/lib/server/functions/removeUserFromRoom.ts +++ b/apps/meteor/app/lib/server/functions/removeUserFromRoom.ts @@ -20,7 +20,7 @@ export const removeUserFromRoom = async function ( } try { - await Apps?.triggerEvent(AppEvents.IPreRoomUserLeave, room, user); + await Apps.self?.triggerEvent(AppEvents.IPreRoomUserLeave, room, user); } catch (error: any) { if (error.name === AppsEngineException.name) { throw new Meteor.Error('error-app-prevented', error.message); @@ -67,5 +67,5 @@ export const removeUserFromRoom = async function ( // TODO: CACHE: maybe a queue? await afterLeaveRoomCallback.run(user, room); - await Apps?.triggerEvent(AppEvents.IPostRoomUserLeave, room, user); + await Apps.self?.triggerEvent(AppEvents.IPostRoomUserLeave, room, user); }; diff --git a/apps/meteor/app/lib/server/functions/saveUser.js b/apps/meteor/app/lib/server/functions/saveUser.js index 667b5179ceea..f34a54432c4f 100644 --- a/apps/meteor/app/lib/server/functions/saveUser.js +++ b/apps/meteor/app/lib/server/functions/saveUser.js @@ -434,7 +434,7 @@ export const saveUser = async function (userId, userData) { oldUser: oldUserData, }); - await Apps?.triggerEvent(AppEvents.IPostUserUpdated, { + await Apps.self?.triggerEvent(AppEvents.IPostUserUpdated, { user: userUpdated, previousUser: oldUserData, performedBy: await safeGetMeteorUser(), diff --git a/apps/meteor/app/lib/server/functions/sendMessage.ts b/apps/meteor/app/lib/server/functions/sendMessage.ts index 14da152c87f9..089d33f98034 100644 --- a/apps/meteor/app/lib/server/functions/sendMessage.ts +++ b/apps/meteor/app/lib/server/functions/sendMessage.ts @@ -225,7 +225,7 @@ export const sendMessage = async function (user: any, message: any, room: any, u } // For the Rocket.Chat Apps :) - if (Apps?.isLoaded()) { + if (Apps.self?.isLoaded()) { const listenerBridge = Apps.getBridges()?.getListenerBridge(); const prevent = await listenerBridge?.messageEvent('IPreMessageSentPrevent', message); @@ -275,7 +275,7 @@ export const sendMessage = async function (user: any, message: any, room: any, u message._id = insertedId; } - if (Apps?.isLoaded()) { + if (Apps.self?.isLoaded()) { // This returns a promise, but it won't mutate anything about the message // so, we don't really care if it is successful or fails void Apps.getBridges()?.getListenerBridge().messageEvent('IPostMessageSent', message); diff --git a/apps/meteor/app/lib/server/functions/updateMessage.ts b/apps/meteor/app/lib/server/functions/updateMessage.ts index 14d93d2874e9..6b3cb9ef64f5 100644 --- a/apps/meteor/app/lib/server/functions/updateMessage.ts +++ b/apps/meteor/app/lib/server/functions/updateMessage.ts @@ -23,7 +23,7 @@ export const updateMessage = async function ( let messageData: IMessage = Object.assign({}, originalMessage, message); // For the Rocket.Chat Apps :) - if (message && Apps && Apps.isLoaded()) { + if (message && Apps.self && Apps.isLoaded()) { const prevent = await Apps.getBridges().getListenerBridge().messageEvent(AppEvents.IPreMessageUpdatedPrevent, messageData); if (prevent) { throw new Meteor.Error('error-app-prevented-updating', 'A Rocket.Chat App prevented the message updating.'); @@ -76,7 +76,7 @@ export const updateMessage = async function ( }, ); - if (Apps?.isLoaded()) { + if (Apps.self?.isLoaded()) { // This returns a promise, but it won't mutate anything about the message // so, we don't really care if it is successful or fails void Apps.getBridges()?.getListenerBridge().messageEvent(AppEvents.IPostMessageUpdated, messageData); diff --git a/apps/meteor/app/lib/server/methods/deleteUserOwnAccount.ts b/apps/meteor/app/lib/server/methods/deleteUserOwnAccount.ts index f30182def68e..2d651950da19 100644 --- a/apps/meteor/app/lib/server/methods/deleteUserOwnAccount.ts +++ b/apps/meteor/app/lib/server/methods/deleteUserOwnAccount.ts @@ -66,7 +66,7 @@ Meteor.methods({ await deleteUser(uid, confirmRelinquish); // App IPostUserDeleted event hook - await Apps?.triggerEvent(AppEvents.IPostUserDeleted, { user }); + await Apps.self?.triggerEvent(AppEvents.IPostUserDeleted, { user }); return true; }, diff --git a/apps/meteor/app/livechat/server/lib/Helper.ts b/apps/meteor/app/livechat/server/lib/Helper.ts index 3c1d601250c1..453869d4425a 100644 --- a/apps/meteor/app/livechat/server/lib/Helper.ts +++ b/apps/meteor/app/livechat/server/lib/Helper.ts @@ -273,7 +273,7 @@ export const removeAgentFromSubscription = async (rid: string, { _id, username } await Message.saveSystemMessage('ul', rid, username || '', { _id: user._id, username: user.username, name: user.name }); setImmediate(() => { - void Apps?.triggerEvent(AppEvents.IPostLivechatAgentUnassigned, { room, user }); + void Apps.self?.triggerEvent(AppEvents.IPostLivechatAgentUnassigned, { room, user }); }); }; @@ -452,7 +452,7 @@ export const forwardRoomToAgent = async (room: IOmnichannelRoom, transferData: T } setImmediate(() => { - void Apps?.triggerEvent(AppEvents.IPostLivechatRoomTransferred, { + void Apps.self?.triggerEvent(AppEvents.IPostLivechatRoomTransferred, { type: LivechatTransferEventType.AGENT, room: rid, from: oldServedBy?._id, @@ -482,7 +482,7 @@ export const updateChatDepartment = async ({ ]); setImmediate(() => { - void Apps?.triggerEvent(AppEvents.IPostLivechatRoomTransferred, { + void Apps.self?.triggerEvent(AppEvents.IPostLivechatRoomTransferred, { type: LivechatTransferEventType.DEPARTMENT, room: rid, from: oldDepartmentId, diff --git a/apps/meteor/app/livechat/server/lib/LivechatTyped.ts b/apps/meteor/app/livechat/server/lib/LivechatTyped.ts index 39d3467fbaf2..dc5aa506f405 100644 --- a/apps/meteor/app/livechat/server/lib/LivechatTyped.ts +++ b/apps/meteor/app/livechat/server/lib/LivechatTyped.ts @@ -329,8 +329,8 @@ class LivechatClass { * @deprecated the `AppEvents.ILivechatRoomClosedHandler` event will be removed * in the next major version of the Apps-Engine */ - void Apps?.getBridges()?.getListenerBridge().livechatEvent(AppEvents.ILivechatRoomClosedHandler, newRoom); - void Apps?.getBridges()?.getListenerBridge().livechatEvent(AppEvents.IPostLivechatRoomClosed, newRoom); + void Apps.self?.getBridges()?.getListenerBridge().livechatEvent(AppEvents.ILivechatRoomClosedHandler, newRoom); + void Apps.self?.getBridges()?.getListenerBridge().livechatEvent(AppEvents.IPostLivechatRoomClosed, newRoom); }); if (process.env.TEST_MODE) { await callbacks.run('livechat.closeRoom', { @@ -1426,7 +1426,7 @@ class LivechatClass { const ret = await LivechatVisitors.saveGuestById(_id, updateData); setImmediate(() => { - void Apps?.triggerEvent(AppEvents.IPostLivechatGuestSaved, _id); + void Apps.self?.triggerEvent(AppEvents.IPostLivechatGuestSaved, _id); }); return ret; @@ -1792,7 +1792,7 @@ class LivechatClass { await LivechatRooms.saveRoomById(roomData); setImmediate(() => { - void Apps?.triggerEvent(AppEvents.IPostLivechatRoomSaved, roomData._id); + void Apps.self?.triggerEvent(AppEvents.IPostLivechatRoomSaved, roomData._id); }); if (guestData?.name?.trim().length) { diff --git a/apps/meteor/app/livechat/server/lib/QueueManager.ts b/apps/meteor/app/livechat/server/lib/QueueManager.ts index 8a11a36238fa..8be71aa4c991 100644 --- a/apps/meteor/app/livechat/server/lib/QueueManager.ts +++ b/apps/meteor/app/livechat/server/lib/QueueManager.ts @@ -105,7 +105,7 @@ export const QueueManager: queueManager = { throw new Error('inquiry-not-found'); } - void Apps?.triggerEvent(AppEvents.IPostLivechatRoomStarted, room); + void Apps.self?.triggerEvent(AppEvents.IPostLivechatRoomStarted, room); await LivechatRooms.updateRoomCount(); await queueInquiry(inquiry, agent); diff --git a/apps/meteor/app/livechat/server/lib/RoutingManager.ts b/apps/meteor/app/livechat/server/lib/RoutingManager.ts index 5f0a458dc314..19437d800ee2 100644 --- a/apps/meteor/app/livechat/server/lib/RoutingManager.ts +++ b/apps/meteor/app/livechat/server/lib/RoutingManager.ts @@ -154,7 +154,7 @@ export const RoutingManager: Routing = { await dispatchAgentDelegated(rid, agent.agentId); logger.debug(`Agent ${agent.agentId} assigned to inquriy ${inquiry._id}. Instances notified`); - void Apps?.getBridges()?.getListenerBridge().livechatEvent(AppEvents.IPostLivechatAgentAssigned, { room, user }); + void Apps.self?.getBridges()?.getListenerBridge().livechatEvent(AppEvents.IPostLivechatAgentAssigned, { room, user }); return inquiry; }, diff --git a/apps/meteor/app/mailer/server/api.ts b/apps/meteor/app/mailer/server/api.ts index cc2caae74ba6..e562fc8e7b39 100644 --- a/apps/meteor/app/mailer/server/api.ts +++ b/apps/meteor/app/mailer/server/api.ts @@ -170,7 +170,7 @@ export const sendNoWrap = async ({ const email = { to, from, replyTo, subject, html, text, headers }; - const eventResult = await Apps?.triggerEvent(AppEvents.IPreEmailSent, { email }); + const eventResult = await Apps.self?.triggerEvent(AppEvents.IPreEmailSent, { email }); setImmediate(() => Email.sendAsync(eventResult || email).catch((e) => console.error(e))); }; diff --git a/apps/meteor/app/message-pin/server/pinMessage.ts b/apps/meteor/app/message-pin/server/pinMessage.ts index 4887e3603122..dc17a75a0192 100644 --- a/apps/meteor/app/message-pin/server/pinMessage.ts +++ b/apps/meteor/app/message-pin/server/pinMessage.ts @@ -129,7 +129,7 @@ Meteor.methods({ } // App IPostMessagePinned event hook - await Apps?.triggerEvent(AppEvents.IPostMessagePinned, originalMessage, await Meteor.userAsync(), originalMessage.pinned); + await Apps.self?.triggerEvent(AppEvents.IPostMessagePinned, originalMessage, await Meteor.userAsync(), originalMessage.pinned); const msgId = await Message.saveSystemMessage('message_pinned', originalMessage.rid, '', me, { attachments: [ @@ -216,7 +216,7 @@ Meteor.methods({ } // App IPostMessagePinned event hook - await Apps?.triggerEvent(AppEvents.IPostMessagePinned, originalMessage, await Meteor.userAsync(), originalMessage.pinned); + await Apps.self?.triggerEvent(AppEvents.IPostMessagePinned, originalMessage, await Meteor.userAsync(), originalMessage.pinned); await Messages.setPinnedByIdAndUserId(originalMessage._id, originalMessage.pinnedBy, originalMessage.pinned); if (settings.get('Message_Read_Receipt_Store_Users')) { diff --git a/apps/meteor/app/message-star/server/starMessage.ts b/apps/meteor/app/message-star/server/starMessage.ts index 9f8ba75c4536..7ac8fd619d31 100644 --- a/apps/meteor/app/message-star/server/starMessage.ts +++ b/apps/meteor/app/message-star/server/starMessage.ts @@ -57,7 +57,7 @@ Meteor.methods({ await Rooms.updateLastMessageStar(room._id, uid, message.starred); } - await Apps?.triggerEvent(AppEvents.IPostMessageStarred, message, await Meteor.userAsync(), message.starred); + await Apps.self?.triggerEvent(AppEvents.IPostMessageStarred, message, await Meteor.userAsync(), message.starred); await Messages.updateUserStarById(message._id, uid, message.starred); diff --git a/apps/meteor/app/reactions/server/setReaction.ts b/apps/meteor/app/reactions/server/setReaction.ts index ed2271a5d4d0..36eaab695512 100644 --- a/apps/meteor/app/reactions/server/setReaction.ts +++ b/apps/meteor/app/reactions/server/setReaction.ts @@ -106,7 +106,7 @@ async function setReaction(room: IRoom, user: IUser, message: IMessage, reaction isReacted = true; } - await Apps?.triggerEvent(AppEvents.IPostMessageReacted, message, user, reaction, isReacted); + await Apps.self?.triggerEvent(AppEvents.IPostMessageReacted, message, user, reaction, isReacted); void broadcastMessageFromData({ id: message._id, diff --git a/apps/meteor/app/statistics/server/lib/getAppsStatistics.js b/apps/meteor/app/statistics/server/lib/getAppsStatistics.js index 652686e6715c..1d84bead3e85 100644 --- a/apps/meteor/app/statistics/server/lib/getAppsStatistics.js +++ b/apps/meteor/app/statistics/server/lib/getAppsStatistics.js @@ -6,10 +6,10 @@ import { Info } from '../../../utils/rocketchat.info'; export function getAppsStatistics() { return { engineVersion: Info.marketplaceApiVersion, - totalInstalled: (Apps?.isInitialized() && Apps.getManager().get().length) ?? 0, - totalActive: (Apps?.isInitialized() && Apps.getManager().get({ enabled: true }).length) ?? 0, + totalInstalled: (Apps.self?.isInitialized() && Apps.getManager().get().length) ?? 0, + totalActive: (Apps.self?.isInitialized() && Apps.getManager().get({ enabled: true }).length) ?? 0, totalFailed: - (Apps?.isInitialized() && + (Apps.self?.isInitialized() && Apps.getManager() .get({ disabled: true }) .filter(({ app: { status } }) => status !== AppStatus.MANUALLY_DISABLED).length) ?? diff --git a/apps/meteor/app/threads/server/methods/followMessage.ts b/apps/meteor/app/threads/server/methods/followMessage.ts index f6bae69b1aaa..05650d0ad2ef 100644 --- a/apps/meteor/app/threads/server/methods/followMessage.ts +++ b/apps/meteor/app/threads/server/methods/followMessage.ts @@ -44,7 +44,7 @@ Meteor.methods({ const followResult = await follow({ tmid: message.tmid || message._id, uid }); const isFollowed = true; - await Apps?.triggerEvent(AppEvents.IPostMessageFollowed, message, await Meteor.userAsync(), isFollowed); + await Apps.self?.triggerEvent(AppEvents.IPostMessageFollowed, message, await Meteor.userAsync(), isFollowed); return followResult; }, diff --git a/apps/meteor/app/threads/server/methods/unfollowMessage.ts b/apps/meteor/app/threads/server/methods/unfollowMessage.ts index b50c26508ebc..afc9206b038f 100644 --- a/apps/meteor/app/threads/server/methods/unfollowMessage.ts +++ b/apps/meteor/app/threads/server/methods/unfollowMessage.ts @@ -44,7 +44,7 @@ Meteor.methods({ const unfollowResult = await unfollow({ rid: message.rid, tmid: message.tmid || message._id, uid }); const isFollowed = false; - await Apps?.triggerEvent(AppEvents.IPostMessageFollowed, message, await Meteor.userAsync(), isFollowed); + await Apps.self?.triggerEvent(AppEvents.IPostMessageFollowed, message, await Meteor.userAsync(), isFollowed); return unfollowResult; }, diff --git a/apps/meteor/ee/server/apps/communication/rest.ts b/apps/meteor/ee/server/apps/communication/rest.ts index ea259fef5f0c..df30cccc8e73 100644 --- a/apps/meteor/ee/server/apps/communication/rest.ts +++ b/apps/meteor/ee/server/apps/communication/rest.ts @@ -534,10 +534,7 @@ export class AppsRestApi { try { const { event, externalComponent } = this.bodyParams; - const result = (Apps?.getBridges()?.getListenerBridge() as Record).externalComponentEvent( - event, - externalComponent, - ); + const result = (Apps.getBridges()?.getListenerBridge() as Record).externalComponentEvent(event, externalComponent); return API.v1.success({ result }); } catch (e: any) { diff --git a/apps/meteor/ee/server/index.ts b/apps/meteor/ee/server/index.ts index f00caa896e43..0a9ad57cb00f 100644 --- a/apps/meteor/ee/server/index.ts +++ b/apps/meteor/ee/server/index.ts @@ -12,5 +12,6 @@ import './requestSeatsRoute'; import './configuration/index'; import './local-services/ldap/service'; import './methods/getReadReceipts'; +import './apps/startup'; export { registerEEBroker } from './startup'; diff --git a/apps/meteor/ee/server/startup/index.ts b/apps/meteor/ee/server/startup/index.ts index ade83ea57227..a8091f0e9a37 100644 --- a/apps/meteor/ee/server/startup/index.ts +++ b/apps/meteor/ee/server/startup/index.ts @@ -1,4 +1,3 @@ -import '../apps/startup'; import '../../app/authorization/server'; import './apps'; import './audit'; diff --git a/apps/meteor/server/lib/moderation/reportMessage.ts b/apps/meteor/server/lib/moderation/reportMessage.ts index 710ea6e1b685..a546896b8332 100644 --- a/apps/meteor/server/lib/moderation/reportMessage.ts +++ b/apps/meteor/server/lib/moderation/reportMessage.ts @@ -49,7 +49,7 @@ export const reportMessage = async (messageId: IMessage['_id'], description: str await ModerationReports.createWithMessageDescriptionAndUserId(message, description, roomInfo, reportedBy); - await Apps?.triggerEvent(AppEvents.IPostMessageReported, message, user, description); + await Apps.self?.triggerEvent(AppEvents.IPostMessageReported, message, user, description); return true; }; diff --git a/apps/meteor/server/methods/deleteUser.ts b/apps/meteor/server/methods/deleteUser.ts index 8762cfab2437..e8b1f6eeed65 100644 --- a/apps/meteor/server/methods/deleteUser.ts +++ b/apps/meteor/server/methods/deleteUser.ts @@ -52,7 +52,7 @@ Meteor.methods({ await deleteUser(userId, confirmRelinquish, uid); // App IPostUserDeleted event hook - await Apps?.triggerEvent(AppEvents.IPostUserDeleted, { user, performedBy: await Meteor.userAsync() }); + await Apps.self?.triggerEvent(AppEvents.IPostUserDeleted, { user, performedBy: await Meteor.userAsync() }); return true; }, diff --git a/apps/meteor/server/methods/eraseRoom.ts b/apps/meteor/server/methods/eraseRoom.ts index 687b9ad66992..b9b4833ad67f 100644 --- a/apps/meteor/server/methods/eraseRoom.ts +++ b/apps/meteor/server/methods/eraseRoom.ts @@ -35,7 +35,7 @@ export async function eraseRoom(rid: string, uid: string): Promise { }); } - if (Apps?.isLoaded()) { + if (Apps.self?.isLoaded()) { const prevent = await Apps.getBridges()?.getListenerBridge().roomEvent(AppEvents.IPreRoomDeletePrevent, room); if (prevent) { throw new Meteor.Error('error-app-prevented-deleting', 'A Rocket.Chat App prevented the room erasing.'); @@ -53,7 +53,7 @@ export async function eraseRoom(rid: string, uid: string): Promise { } } - if (Apps?.isLoaded()) { + if (Apps.self?.isLoaded()) { void Apps.getBridges()?.getListenerBridge().roomEvent(AppEvents.IPostRoomDeleted, room); } } diff --git a/apps/meteor/server/methods/logoutCleanUp.ts b/apps/meteor/server/methods/logoutCleanUp.ts index 502cad3c5fbf..359933faccbd 100644 --- a/apps/meteor/server/methods/logoutCleanUp.ts +++ b/apps/meteor/server/methods/logoutCleanUp.ts @@ -22,6 +22,6 @@ Meteor.methods({ }); // App IPostUserLogout event hook - await Apps?.triggerEvent(AppEvents.IPostUserLoggedOut, user); + await Apps.self?.triggerEvent(AppEvents.IPostUserLoggedOut, user); }, }); diff --git a/apps/meteor/server/methods/reportMessage.ts b/apps/meteor/server/methods/reportMessage.ts index 44087dad0424..05ac5aaf7e7b 100644 --- a/apps/meteor/server/methods/reportMessage.ts +++ b/apps/meteor/server/methods/reportMessage.ts @@ -77,7 +77,7 @@ Meteor.methods({ await ModerationReports.createWithMessageDescriptionAndUserId(message, description, roomInfo, reportedBy); - await Apps?.triggerEvent(AppEvents.IPostMessageReported, message, await Meteor.userAsync(), description); + await Apps.self?.triggerEvent(AppEvents.IPostMessageReported, message, await Meteor.userAsync(), description); return true; }, diff --git a/apps/meteor/server/methods/saveUserProfile.ts b/apps/meteor/server/methods/saveUserProfile.ts index 695742977ad3..c2ed41adaab9 100644 --- a/apps/meteor/server/methods/saveUserProfile.ts +++ b/apps/meteor/server/methods/saveUserProfile.ts @@ -156,7 +156,7 @@ async function saveUserProfile( // App IPostUserUpdated event hook const updatedUser = await Users.findOneById(this.userId); - await Apps?.triggerEvent(AppEvents.IPostUserUpdated, { user: updatedUser, previousUser: user }); + await Apps.self?.triggerEvent(AppEvents.IPostUserUpdated, { user: updatedUser, previousUser: user }); return true; } diff --git a/apps/meteor/server/services/apps-engine/service.ts b/apps/meteor/server/services/apps-engine/service.ts index 7e36a937e6a6..41a53cf5bbb6 100644 --- a/apps/meteor/server/services/apps-engine/service.ts +++ b/apps/meteor/server/services/apps-engine/service.ts @@ -16,7 +16,7 @@ export class AppsEngineService extends ServiceClassInternal implements IAppsEngi super(); this.onEvent('presence.status', async ({ user, previousStatus }): Promise => { - await Apps?.triggerEvent(AppEvents.IPostUserStatusChanged, { + await Apps.self?.triggerEvent(AppEvents.IPostUserStatusChanged, { user, currentStatus: user.status, previousStatus, @@ -24,70 +24,72 @@ export class AppsEngineService extends ServiceClassInternal implements IAppsEngi }); this.onEvent('apps.added', async (appId: string): Promise => { - Apps?.getRocketChatLogger().debug(`"apps.added" event received for app "${appId}"`); + Apps.self?.getRocketChatLogger().debug(`"apps.added" event received for app "${appId}"`); // if the app already exists in this instance, don't load it again - const app = Apps?.getManager()?.getOneById(appId); + const app = Apps.self?.getManager()?.getOneById(appId); if (app) { - Apps?.getRocketChatLogger().info(`"apps.added" event received for app "${appId}", but it already exists in this instance`); + Apps.self?.getRocketChatLogger().info(`"apps.added" event received for app "${appId}", but it already exists in this instance`); return; } - await Apps?.getManager()?.addLocal(appId); + await Apps.self?.getManager()?.addLocal(appId); }); this.onEvent('apps.removed', async (appId: string): Promise => { - Apps?.getRocketChatLogger().debug(`"apps.removed" event received for app "${appId}"`); - const app = Apps?.getManager()?.getOneById(appId); + Apps.self?.getRocketChatLogger().debug(`"apps.removed" event received for app "${appId}"`); + const app = Apps.self?.getManager()?.getOneById(appId); if (!app) { - Apps?.getRocketChatLogger().info(`"apps.removed" event received for app "${appId}", but it couldn't be found in this instance`); + Apps.self + ?.getRocketChatLogger() + .info(`"apps.removed" event received for app "${appId}", but it couldn't be found in this instance`); return; } - await Apps?.getManager()?.removeLocal(appId); + await Apps.self?.getManager()?.removeLocal(appId); }); this.onEvent('apps.updated', async (appId: string): Promise => { - Apps?.getRocketChatLogger().debug(`"apps.updated" event received for app "${appId}"`); - const storageItem = await Apps?.getStorage()?.retrieveOne(appId); + Apps.self?.getRocketChatLogger().debug(`"apps.updated" event received for app "${appId}"`); + const storageItem = await Apps.self?.getStorage()?.retrieveOne(appId); if (!storageItem) { - Apps?.getRocketChatLogger().info(`"apps.updated" event received for app "${appId}", but it couldn't be found in the storage`); + Apps.self?.getRocketChatLogger().info(`"apps.updated" event received for app "${appId}", but it couldn't be found in the storage`); return; } - const appPackage = await Apps?.getAppSourceStorage()?.fetch(storageItem); + const appPackage = await Apps.self?.getAppSourceStorage()?.fetch(storageItem); if (!appPackage) { return; } - await Apps?.getManager()?.updateLocal(storageItem, appPackage); + await Apps.self?.getManager()?.updateLocal(storageItem, appPackage); }); this.onEvent('apps.statusUpdate', async (appId: string, status: AppStatus): Promise => { - Apps?.getRocketChatLogger().debug(`"apps.statusUpdate" event received for app "${appId}" with status "${status}"`); - const app = Apps?.getManager()?.getOneById(appId); + Apps.self?.getRocketChatLogger().debug(`"apps.statusUpdate" event received for app "${appId}" with status "${status}"`); + const app = Apps.self?.getManager()?.getOneById(appId); if (!app) { - Apps?.getRocketChatLogger().info( - `"apps.statusUpdate" event received for app "${appId}", but it couldn't be found in this instance`, - ); + Apps.self + ?.getRocketChatLogger() + .info(`"apps.statusUpdate" event received for app "${appId}", but it couldn't be found in this instance`); return; } if (app.getStatus() === status) { - Apps?.getRocketChatLogger().info(`"apps.statusUpdate" event received for app "${appId}", but the status is the same`); + Apps.self?.getRocketChatLogger().info(`"apps.statusUpdate" event received for app "${appId}", but the status is the same`); return; } if (AppStatusUtils.isEnabled(status)) { - await Apps?.getManager()?.enable(appId).catch(SystemLogger.error); + await Apps.self?.getManager()?.enable(appId).catch(SystemLogger.error); } else if (AppStatusUtils.isDisabled(status)) { - await Apps?.getManager()?.disable(appId, status, true).catch(SystemLogger.error); + await Apps.self?.getManager()?.disable(appId, status, true).catch(SystemLogger.error); } }); this.onEvent('apps.settingUpdated', async (appId: string, setting): Promise => { - Apps?.getRocketChatLogger().debug(`"apps.settingUpdated" event received for app "${appId}"`, { setting }); - const app = Apps?.getManager()?.getOneById(appId); + Apps.self?.getRocketChatLogger().debug(`"apps.settingUpdated" event received for app "${appId}"`, { setting }); + const app = Apps.self?.getManager()?.getOneById(appId); const oldSetting = app?.getStorageItem().settings[setting.id].value; // avoid updating the setting if the value is the same, @@ -96,30 +98,32 @@ export class AppsEngineService extends ServiceClassInternal implements IAppsEngi // so we need to convert it to JSON stringified to compare it if (JSON.stringify(oldSetting) === JSON.stringify(setting.value)) { - Apps?.getRocketChatLogger().info( - `"apps.settingUpdated" event received for setting ${setting.id} of app "${appId}", but the setting value is the same`, - ); + Apps.self + ?.getRocketChatLogger() + .info(`"apps.settingUpdated" event received for setting ${setting.id} of app "${appId}", but the setting value is the same`); return; } - await Apps?.getManager() + await Apps.self + ?.getManager() ?.getSettingsManager() .updateAppSetting(appId, setting as any); }); } isInitialized(): boolean { - return Boolean(Apps?.isInitialized()); + return Boolean(Apps.self?.isInitialized()); } async getApps(query: IGetAppsFilter): Promise { - return Apps?.getManager() + return Apps.self + ?.getManager() ?.get(query) .map((app) => app.getApp().getInfo()); } async getAppStorageItemById(appId: string): Promise { - const app = Apps?.getManager()?.getOneById(appId); + const app = Apps.self?.getManager()?.getOneById(appId); if (!app) { return; diff --git a/apps/meteor/server/services/video-conference/service.ts b/apps/meteor/server/services/video-conference/service.ts index 87fe279d0d94..7c7d5950cf5f 100644 --- a/apps/meteor/server/services/video-conference/service.ts +++ b/apps/meteor/server/services/video-conference/service.ts @@ -828,11 +828,11 @@ export class VideoConfService extends ServiceClassInternal implements IVideoConf } private async getProviderManager(): Promise { - if (!Apps?.isLoaded()) { + if (!Apps.self?.isLoaded()) { throw new Error('apps-engine-not-loaded'); } - const manager = Apps?.getManager()?.getVideoConfProviderManager(); + const manager = Apps.self?.getManager()?.getVideoConfProviderManager(); if (!manager) { throw new Error(availabilityErrors.NO_APP); } diff --git a/apps/meteor/server/startup/migrations/v291.ts b/apps/meteor/server/startup/migrations/v291.ts index f4fdbb743447..3f94c26dc6e0 100644 --- a/apps/meteor/server/startup/migrations/v291.ts +++ b/apps/meteor/server/startup/migrations/v291.ts @@ -12,7 +12,7 @@ addMigration({ await Settings.removeById('Apps_Framework_Development_Mode'); await Settings.removeById('Apps_Framework_enabled'); - if (!Apps) { + if (!Apps.self) { throw new Error('Apps Orchestrator not registered.'); } diff --git a/apps/meteor/server/startup/migrations/v292.ts b/apps/meteor/server/startup/migrations/v292.ts index beec6967a904..ac523f1b197e 100644 --- a/apps/meteor/server/startup/migrations/v292.ts +++ b/apps/meteor/server/startup/migrations/v292.ts @@ -9,7 +9,7 @@ addMigration({ version: 292, name: 'Add checksum signature to existing apps', async up() { - if (!Apps) { + if (!Apps.self) { throw new Error('Apps Orchestrator not registered.'); } diff --git a/apps/meteor/server/startup/migrations/v294.ts b/apps/meteor/server/startup/migrations/v294.ts index 832043740f89..8523db89e4b9 100644 --- a/apps/meteor/server/startup/migrations/v294.ts +++ b/apps/meteor/server/startup/migrations/v294.ts @@ -8,7 +8,7 @@ import { addMigration } from '../../lib/migrations'; addMigration({ version: 294, async up() { - if (!Apps) { + if (!Apps.self) { throw new Error('Apps Orchestrator not registered.'); } diff --git a/packages/apps/src/orchestrator.ts b/packages/apps/src/orchestrator.ts index 4e3a53d9d5f0..c0dee1609113 100644 --- a/packages/apps/src/orchestrator.ts +++ b/packages/apps/src/orchestrator.ts @@ -1,7 +1,29 @@ import type { IAppServerOrchestrator } from './IAppServerOrchestrator'; -export let Apps: IAppServerOrchestrator | undefined; +let app: IAppServerOrchestrator | undefined; + +type Orchestrator = { self: undefined } | (IAppServerOrchestrator & { self: IAppServerOrchestrator }); + +export const Apps = new Proxy({} as Orchestrator, { + get: (_target, nameProp: keyof IAppServerOrchestrator | 'self'): any => { + if (nameProp === 'self') { + return app; + } + + if (!app) { + throw new Error(`Orchestrator not found`); + } + + const prop = app[nameProp]; + + if (typeof prop === 'function') { + return prop.bind(app); + } + + return prop; + }, +}); export function registerOrchestrator(orch: IAppServerOrchestrator): void { - Apps = orch; + app = orch; } From 86bc4ca08cdd5aceac25bf2acba447a04400ec23 Mon Sep 17 00:00:00 2001 From: Tasso Evangelista Date: Mon, 8 Apr 2024 10:16:10 -0300 Subject: [PATCH 77/79] regression(fuselage-ui-kit): Use default translation namespace for `-core` apps (#32105) --- packages/fuselage-ui-kit/jest.config.ts | 27 ++++ packages/fuselage-ui-kit/package.json | 8 +- .../src/hooks/useAppTranslation.spec.tsx | 139 ++++++++++++++++++ .../src/hooks/useAppTranslation.ts | 2 +- yarn.lock | 78 +++++++++- 5 files changed, 250 insertions(+), 4 deletions(-) create mode 100644 packages/fuselage-ui-kit/jest.config.ts create mode 100644 packages/fuselage-ui-kit/src/hooks/useAppTranslation.spec.tsx diff --git a/packages/fuselage-ui-kit/jest.config.ts b/packages/fuselage-ui-kit/jest.config.ts new file mode 100644 index 000000000000..23a14f54fde9 --- /dev/null +++ b/packages/fuselage-ui-kit/jest.config.ts @@ -0,0 +1,27 @@ +export default { + preset: 'ts-jest', + errorOnDeprecated: true, + testEnvironment: 'jsdom', + modulePathIgnorePatterns: ['/dist/'], + transform: { + '^.+\\.(t|j)sx?$': [ + '@swc/jest', + { + sourceMaps: true, + jsc: { + parser: { + syntax: 'typescript', + tsx: true, + decorators: false, + dynamicImport: true, + }, + transform: { + react: { + runtime: 'automatic', + }, + }, + }, + }, + ], + }, +}; diff --git a/packages/fuselage-ui-kit/package.json b/packages/fuselage-ui-kit/package.json index 216efd02ef54..927948921659 100644 --- a/packages/fuselage-ui-kit/package.json +++ b/packages/fuselage-ui-kit/package.json @@ -32,6 +32,7 @@ ".:build:clean": "rimraf dist", ".:build:esm": "tsc -p tsconfig-esm.json", ".:build:cjs": "tsc -p tsconfig-cjs.json", + "test": "jest", "lint": "eslint --ext .js,.jsx,.ts,.tsx .", "typecheck": "tsc --noEmit", "docs": "cross-env NODE_ENV=production build-storybook -o ../../static/fuselage-ui-kit", @@ -81,6 +82,8 @@ "@storybook/source-loader": "~6.5.16", "@storybook/theming": "~6.5.16", "@tanstack/react-query": "^4.16.1", + "@testing-library/react": "^14.2.2", + "@testing-library/react-hooks": "^8.0.1", "@types/babel__core": "^7.20.3", "@types/babel__preset-env": "^7.9.4", "@types/react": "~17.0.69", @@ -88,14 +91,17 @@ "babel-loader": "~8.2.5", "cross-env": "^7.0.3", "eslint": "~8.45.0", + "i18next": "^23.10.1", + "jest": "^29.7.0", "normalize.css": "^8.0.1", "npm-run-all": "^4.1.5", "prettier": "~2.8.8", "react-docgen-typescript-plugin": "~1.0.5", "react-dom": "^17.0.2", - "react-i18next": "~13.2.2", + "react-i18next": "^14.1.0", "rimraf": "^3.0.2", "storybook-dark-mode": "~3.0.1", + "ts-jest": "^29.1.2", "tslib": "^2.5.3", "typescript": "~5.3.3" }, diff --git a/packages/fuselage-ui-kit/src/hooks/useAppTranslation.spec.tsx b/packages/fuselage-ui-kit/src/hooks/useAppTranslation.spec.tsx new file mode 100644 index 000000000000..fe84b1ffb771 --- /dev/null +++ b/packages/fuselage-ui-kit/src/hooks/useAppTranslation.spec.tsx @@ -0,0 +1,139 @@ +import { renderHook } from '@testing-library/react-hooks'; +import * as i18next from 'i18next'; +import type { FunctionComponent } from 'react'; +import { Suspense } from 'react'; +import { I18nextProvider, initReactI18next } from 'react-i18next'; + +import { AppIdProvider } from '../contexts/AppIdContext'; +import { useAppTranslation } from './useAppTranslation'; + +let i18n: i18next.i18n; + +beforeEach(async () => { + i18n = i18next.createInstance().use(initReactI18next); + + await i18n.init({ + lng: 'en', + resources: { + en: { + 'translation': { + test: 'a quick brown fox', + }, + 'app-test': { + test: 'jumped over the lazy dog', + }, + 'app-test-core': { + test: 'this should not be used', + }, + }, + }, + }); +}); + +it('should work with normal app ID (`test`)', async () => { + const { result } = renderHook(() => useAppTranslation().t('test'), { + wrapper: ({ children }) => ( + + {children} + + ), + }); + + expect(result.current).toBe('jumped over the lazy dog'); +}); + +it('should work with core app ID (`test-core`)', async () => { + const { result } = renderHook(() => useAppTranslation().t('test'), { + wrapper: ({ children }) => ( + + {children} + + ), + }); + + expect(result.current).toBe('a quick brown fox'); +}); + +describe('with suspense', () => { + let i18n: i18next.i18n; + + beforeEach(async () => { + i18n = i18next + .createInstance() + .use({ + type: 'backend', + init: () => undefined, + read: async (language, namespace) => { + await new Promise((resolve) => queueMicrotask(resolve)); + + if (language === 'en' && namespace === 'core') { + return { + test: 'a quick brown fox', + }; + } + + if (language === 'en' && namespace === 'app-test') { + return { + test: 'jumped over the lazy dog', + }; + } + + throw new Error(`Unexpected read request: ${language} ${namespace}`); + }, + } satisfies i18next.BackendModule) + .use(initReactI18next); + + await i18n.init({ + lng: 'en', + defaultNS: 'core', + partialBundledLanguages: true, + react: { + useSuspense: true, + }, + }); + }); + + it('should work with normal app ID (`test`)', async () => { + const FakeFallback: FunctionComponent = jest.fn(() => null); + + const { result, waitForNextUpdate } = renderHook( + () => useAppTranslation().t('test'), + { + wrapper: ({ children }) => ( + + }> + {children} + + + ), + } + ); + + await waitForNextUpdate(); + + expect(result.current).toBe('jumped over the lazy dog'); + expect(FakeFallback).toHaveBeenCalled(); + }); + + it('should work with core app ID (`test-core`)', async () => { + const FakeFallback: FunctionComponent = jest.fn(() => null); + + const { result, waitForNextUpdate } = renderHook( + () => useAppTranslation().t('test'), + { + wrapper: ({ children }) => ( + + }> + {children} + + + ), + } + ); + + await waitForNextUpdate(); + + expect(result.current).toBe('a quick brown fox'); + expect(FakeFallback).toHaveBeenCalled(); + }); +}); diff --git a/packages/fuselage-ui-kit/src/hooks/useAppTranslation.ts b/packages/fuselage-ui-kit/src/hooks/useAppTranslation.ts index c29cf0953386..5925f2fada10 100644 --- a/packages/fuselage-ui-kit/src/hooks/useAppTranslation.ts +++ b/packages/fuselage-ui-kit/src/hooks/useAppTranslation.ts @@ -5,7 +5,7 @@ import { useAppId } from '../contexts/AppIdContext'; export const useAppTranslation = () => { const appId = useAppId(); - const appNs = `app-${appId}`; + const appNs = appId.endsWith(`-core`) ? undefined : `app-${appId}`; useDebugValue(appNs); diff --git a/yarn.lock b/yarn.lock index 8993ef8f84cb..d2a910b75b9b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2946,6 +2946,15 @@ __metadata: languageName: node linkType: hard +"@babel/runtime@npm:^7.23.2, @babel/runtime@npm:^7.23.9": + version: 7.24.4 + resolution: "@babel/runtime@npm:7.24.4" + dependencies: + regenerator-runtime: ^0.14.0 + checksum: 2f27d4c0ffac7ae7999ac0385e1106f2a06992a8bdcbf3da06adcac7413863cd08c198c2e4e970041bbea849e17f02e1df18875539b6afba76c781b6b59a07c3 + languageName: node + linkType: hard + "@babel/runtime@npm:~7.22.15": version: 7.22.15 resolution: "@babel/runtime@npm:7.22.15" @@ -8751,6 +8760,8 @@ __metadata: "@storybook/source-loader": ~6.5.16 "@storybook/theming": ~6.5.16 "@tanstack/react-query": ^4.16.1 + "@testing-library/react": ^14.2.2 + "@testing-library/react-hooks": ^8.0.1 "@types/babel__core": ^7.20.3 "@types/babel__preset-env": ^7.9.4 "@types/react": ~17.0.69 @@ -8758,14 +8769,17 @@ __metadata: babel-loader: ~8.2.5 cross-env: ^7.0.3 eslint: ~8.45.0 + i18next: ^23.10.1 + jest: ^29.7.0 normalize.css: ^8.0.1 npm-run-all: ^4.1.5 prettier: ~2.8.8 react-docgen-typescript-plugin: ~1.0.5 react-dom: ^17.0.2 - react-i18next: ~13.2.2 + react-i18next: ^14.1.0 rimraf: ^3.0.2 storybook-dark-mode: ~3.0.1 + ts-jest: ^29.1.2 tslib: ^2.5.3 typescript: ~5.3.3 peerDependencies: @@ -12546,6 +12560,20 @@ __metadata: languageName: node linkType: hard +"@testing-library/react@npm:^14.2.2": + version: 14.2.2 + resolution: "@testing-library/react@npm:14.2.2" + dependencies: + "@babel/runtime": ^7.12.5 + "@testing-library/dom": ^9.0.0 + "@types/react-dom": ^18.0.0 + peerDependencies: + react: ^18.0.0 + react-dom: ^18.0.0 + checksum: cb73df588592d9101429f057eaa6f320fc12524d5eb2acc8a16002c1ee2d9422a49e44841003bba42974c9ae1ced6b134f0d647826eca42ab8f19e4592971b16 + languageName: node + linkType: hard + "@testing-library/user-event@npm:^13.2.1, @testing-library/user-event@npm:~13.5.0": version: 13.5.0 resolution: "@testing-library/user-event@npm:13.5.0" @@ -25592,6 +25620,15 @@ __metadata: languageName: node linkType: hard +"i18next@npm:^23.10.1": + version: 23.10.1 + resolution: "i18next@npm:23.10.1" + dependencies: + "@babel/runtime": ^7.23.2 + checksum: 4aec10ddb0bb841f15b9b023daa59977052bc706ca4e94643b12b17640731862bde596c9797491638f6d9e7f125722ea9b1e87394c7aebbb72f45c20396f79d9 + languageName: node + linkType: hard + "i18next@npm:~21.6.16": version: 21.6.16 resolution: "i18next@npm:21.6.16" @@ -27313,7 +27350,7 @@ __metadata: languageName: node linkType: hard -"jest-cli@npm:^29.5.0, jest-cli@npm:^29.6.4": +"jest-cli@npm:^29.5.0, jest-cli@npm:^29.6.4, jest-cli@npm:^29.7.0": version: 29.7.0 resolution: "jest-cli@npm:29.7.0" dependencies: @@ -27842,6 +27879,25 @@ __metadata: languageName: node linkType: hard +"jest@npm:^29.7.0": + version: 29.7.0 + resolution: "jest@npm:29.7.0" + dependencies: + "@jest/core": ^29.7.0 + "@jest/types": ^29.6.3 + import-local: ^3.0.2 + jest-cli: ^29.7.0 + peerDependencies: + node-notifier: ^8.0.1 || ^9.0.0 || ^10.0.0 + peerDependenciesMeta: + node-notifier: + optional: true + bin: + jest: bin/jest.js + checksum: 17ca8d67504a7dbb1998cf3c3077ec9031ba3eb512da8d71cb91bcabb2b8995c4e4b292b740cb9bf1cbff5ce3e110b3f7c777b0cefb6f41ab05445f248d0ee0b + languageName: node + linkType: hard + "jest@npm:~29.5.0": version: 29.5.0 resolution: "jest@npm:29.5.0" @@ -34903,6 +34959,24 @@ __metadata: languageName: node linkType: hard +"react-i18next@npm:^14.1.0": + version: 14.1.0 + resolution: "react-i18next@npm:14.1.0" + dependencies: + "@babel/runtime": ^7.23.9 + html-parse-stringify: ^3.0.1 + peerDependencies: + i18next: ">= 23.2.3" + react: ">= 16.8.0" + peerDependenciesMeta: + react-dom: + optional: true + react-native: + optional: true + checksum: 96fbc4b0919b9f0c639f9f3eb35eecac528174aa97e3b1af469cfdbff4b34e40ae8969c26c0b737691a5fa9b56bb13093524cfca79b93cbd58f1319530da31b2 + languageName: node + linkType: hard + "react-i18next@npm:~13.2.2": version: 13.2.2 resolution: "react-i18next@npm:13.2.2" From cc56f16de865b1956462bb9c8a49d2537b12b124 Mon Sep 17 00:00:00 2001 From: Pierre Lehnen <55164754+pierre-lehnen-rc@users.noreply.github.com> Date: Mon, 8 Apr 2024 15:37:02 -0300 Subject: [PATCH 78/79] chore: remove unused onStartup function (#32149) --- apps/meteor/server/lib/onStartup.ts | 25 ------------------------- 1 file changed, 25 deletions(-) delete mode 100644 apps/meteor/server/lib/onStartup.ts diff --git a/apps/meteor/server/lib/onStartup.ts b/apps/meteor/server/lib/onStartup.ts deleted file mode 100644 index 2f449c449f4a..000000000000 --- a/apps/meteor/server/lib/onStartup.ts +++ /dev/null @@ -1,25 +0,0 @@ -type StartupCallback = () => Promise; - -const callbackList: StartupCallback[] = []; -let hasStarted = false; - -export const onStartup = (cb: StartupCallback): void => { - if (hasStarted) { - return Promise.await(cb()); - } - - callbackList.push(cb); -}; - -const runCallbacks = async (): Promise => { - for await (const cb of callbackList) { - await cb(); - } - - callbackList.splice(0, callbackList.length); -}; - -Meteor.startup(() => { - hasStarted = true; - Promise.await(runCallbacks()); -}); From a316c2b420cf471e3db43d8b738f65aea5d60b9b Mon Sep 17 00:00:00 2001 From: Guilherme Gazzo Date: Mon, 8 Apr 2024 16:42:29 -0300 Subject: [PATCH 79/79] chore: bump to 6.8.0 (#32153) --- apps/meteor/app/utils/rocketchat.info | 2 +- apps/meteor/package.json | 2 +- package.json | 2 +- packages/core-typings/package.json | 2 +- packages/rest-typings/package.json | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/apps/meteor/app/utils/rocketchat.info b/apps/meteor/app/utils/rocketchat.info index 34642c087e2e..4eb357fe9ee6 100644 --- a/apps/meteor/app/utils/rocketchat.info +++ b/apps/meteor/app/utils/rocketchat.info @@ -1,3 +1,3 @@ { - "version": "7.0.0-develop" + "version": "6.8.0-develop" } diff --git a/apps/meteor/package.json b/apps/meteor/package.json index 55a4bb113659..77dca03343d9 100644 --- a/apps/meteor/package.json +++ b/apps/meteor/package.json @@ -1,7 +1,7 @@ { "name": "@rocket.chat/meteor", "description": "The Ultimate Open Source WebChat Platform", - "version": "7.0.0-develop", + "version": "6.8.0-develop", "private": true, "author": { "name": "Rocket.Chat", diff --git a/package.json b/package.json index 4e0b99fa9daa..240e1a9a1e02 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "rocket.chat", - "version": "7.0.0-develop", + "version": "6.8.0-develop", "description": "Rocket.Chat Monorepo", "main": "index.js", "private": true, diff --git a/packages/core-typings/package.json b/packages/core-typings/package.json index 71aa4da0906d..00db0ed2d621 100644 --- a/packages/core-typings/package.json +++ b/packages/core-typings/package.json @@ -2,7 +2,7 @@ "$schema": "https://json.schemastore.org/package", "name": "@rocket.chat/core-typings", "private": true, - "version": "7.0.0-develop", + "version": "6.8.0-develop", "devDependencies": { "@rocket.chat/eslint-config": "workspace:^", "eslint": "~8.45.0", diff --git a/packages/rest-typings/package.json b/packages/rest-typings/package.json index 3f880c5b20d3..aed48c665870 100644 --- a/packages/rest-typings/package.json +++ b/packages/rest-typings/package.json @@ -1,7 +1,7 @@ { "name": "@rocket.chat/rest-typings", "private": true, - "version": "7.0.0-develop", + "version": "6.8.0-develop", "devDependencies": { "@rocket.chat/eslint-config": "workspace:^", "@types/jest": "~29.5.7",