Skip to content

Commit e286051

Browse files
authored
Merge branch 'chore/todo' into chore/todo-2
2 parents c75a0b4 + bfe5f82 commit e286051

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

74 files changed

+67102
-66443
lines changed

apps/meteor/app/livechat/server/lib/departmentsLib.ts

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -161,17 +161,23 @@ export async function archiveDepartment(_id: string) {
161161
throw new Error('department-not-found');
162162
}
163163

164-
await afterDepartmentArchived(department);
164+
const status = await LivechatDepartment.archiveDepartment(department._id);
165+
if (status.modifiedCount) {
166+
await afterDepartmentArchived(department);
167+
}
165168
}
166169

167170
export async function unarchiveDepartment(_id: string) {
168-
const department = await LivechatDepartment.findOneById(_id, { projection: { _id: 1 } });
171+
const department = await LivechatDepartment.findOneById<Pick<ILivechatDepartment, '_id'>>(_id, { projection: { _id: 1 } });
169172

170173
if (!department) {
171174
throw new Meteor.Error('department-not-found');
172175
}
173176

174-
await afterDepartmentUnarchived(department);
177+
const status = await LivechatDepartment.unarchiveDepartment(department._id);
178+
if (status.modifiedCount) {
179+
await afterDepartmentUnarchived(department);
180+
}
175181
}
176182

177183
export async function saveDepartmentAgents(

apps/meteor/app/livechat/server/lib/guests.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ export async function saveGuest(
4646
...(name && { name }),
4747
...(email && { email }),
4848
...(phone && { phone }),
49-
...(livechatData && { livechatData: {} }),
49+
livechatData: {},
5050
};
5151

5252
const customFields: Record<string, any> = {};

apps/meteor/app/livechat/server/lib/hooks.ts

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { ILivechatAgentStatus } from '@rocket.chat/core-typings';
22
import type { AtLeast, ILivechatDepartment, IUser } from '@rocket.chat/core-typings';
3-
import { LivechatDepartmentAgents, LivechatDepartment } from '@rocket.chat/models';
3+
import { LivechatDepartmentAgents } from '@rocket.chat/models';
44

55
import { setUserStatusLivechat } from './utils';
66
import { callbacks } from '../../../../lib/callbacks';
@@ -26,21 +26,15 @@ export async function afterRemoveAgent(user: AtLeast<IUser, '_id' | 'username'>)
2626
}
2727

2828
export async function afterDepartmentArchived(department: AtLeast<ILivechatDepartment, '_id' | 'businessHourId'>) {
29-
await Promise.all([
30-
LivechatDepartmentAgents.disableAgentsByDepartmentId(department._id),
31-
LivechatDepartment.archiveDepartment(department._id),
32-
]);
29+
await LivechatDepartmentAgents.disableAgentsByDepartmentId(department._id);
3330

3431
void notifyOnLivechatDepartmentAgentChangedByDepartmentId(department._id);
3532

3633
await callbacks.run('livechat.afterDepartmentArchived', department);
3734
}
3835

3936
export async function afterDepartmentUnarchived(department: AtLeast<ILivechatDepartment, '_id' | 'businessHourId'>) {
40-
await Promise.all([
41-
LivechatDepartmentAgents.enableAgentsByDepartmentId(department._id),
42-
LivechatDepartment.unarchiveDepartment(department._id),
43-
]);
37+
await LivechatDepartmentAgents.enableAgentsByDepartmentId(department._id);
4438

4539
void notifyOnLivechatDepartmentAgentChangedByDepartmentId(department._id);
4640
}

apps/meteor/app/livechat/server/lib/messages.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,8 +143,9 @@ export async function sendMessage({
143143
agent?: SelectedAgent;
144144
}) {
145145
const { room, newRoom } = await getRoom(guest, message, roomInfo, agent);
146-
return Object.assign(await sendMessageFunc(guest, { ...message, token: guest.token, ...(guest.name && { alias: guest.name }) }, room), {
146+
return {
147+
...(await sendMessageFunc(guest, { ...message, token: guest.token, ...(guest.name && { alias: guest.name }) }, room)),
147148
newRoom,
148149
showConnecting: showConnecting(),
149-
});
150+
};
150151
}

apps/meteor/app/livechat/server/lib/omni-users.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ export async function addAgent(username: string) {
5757
}
5858

5959
export async function removeAgent(id: IUser['_id']) {
60-
const user = await Users.findOneById(id, { projection: { _id: 1, username: 1 } });
60+
const user = await Users.findOneById<Pick<IUser, '_id' | 'username'>>(id, { projection: { _id: 1, username: 1 } });
6161

6262
if (!user) {
6363
throw new Error('error-invalid-user');
@@ -72,7 +72,7 @@ export async function removeAgent(id: IUser['_id']) {
7272
}
7373

7474
export async function removeManager(id: IUser['_id']) {
75-
const user = await Users.findOneById(id, { projection: { _id: 1, username: 1 } });
75+
const user = await Users.findOneById<Pick<IUser, '_id' | 'username'>>(id, { projection: { _id: 1 } });
7676

7777
if (!user) {
7878
throw new Error('error-invalid-user');

packages/i18n/src/locales/af.i18n.json

Lines changed: 786 additions & 778 deletions
Large diffs are not rendered by default.

packages/i18n/src/locales/ar.i18n.json

Lines changed: 21 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{
22
"500": "خطأ محلي في الخادم",
3+
"files": "الملفات",
34
"#channel": "‎#channel",
45
"%_of_conversations": "% من المحادثات",
56
"0_Errors_Only": "0 - الأخطاء فقط",
@@ -1258,6 +1259,7 @@
12581259
"Delete_all_closed_chats": "حذف كل الدردشات المغلقة",
12591260
"Delete_message": "حذف رسالة",
12601261
"Delete_my_account": "حذف حسابي",
1262+
"Delete_roomType_description": "سيترتب على حذف الغرفة حذف جميع الرسائل المنشورة. لا يمكن التراجع عن هذا الإجراء.",
12611263
"Deleted": "تم الحذف!",
12621264
"Deleted__roomName__": "<strong>تم حذف</strong> #{{roomName}}",
12631265
"Deleting": "يتم الحذف",
@@ -1279,6 +1281,7 @@
12791281
"Desktop_Notifications_Enabled": "إشعارات سطح المكتب ممكّنة",
12801282
"Desktop_Notifications_Not_Enabled": "إشعارات سطح المكتب غير ممكّنة",
12811283
"Details": "التفاصيل",
1284+
"Device_Management_Device_Unknown": "غير معروف",
12821285
"Device_Management_IP": " عنوان IP",
12831286
"Different_Style_For_User_Mentions": "نمط مختلف لإشارات المستخدم",
12841287
"Direct": "مباشر",
@@ -1303,6 +1306,7 @@
13031306
"Direct_Reply_Separator_Description": "[يمكنك التعديل فقط إذا كنت تعرف بالضبط ما تفعله، راجع المستندات] \nالفاصل بين الجزء الأساسي وجزء العلامة من البريد الإلكتروني",
13041307
"Direct_Reply_Username": "اسم المستخدم",
13051308
"Direct_Reply_Username_Description": "يرجى استخدام البريد الإلكتروني المطلق، لا يسمح بوضع العلامات، سيتم تجاوزه",
1309+
"Direct_message": "رسالة مباشرة",
13061310
"Direct_message_creation_description": "أنت على وشك إنشاء دردشة مع عدة مستخدمين. أضف الأشخاص الذين تود التحدث إليهم، كل شخص في المكان نفسه، باستخدام الرسائل المباشرة.",
13071311
"Direct_message_someone": "رسالة مباشرة لشخص ما",
13081312
"Direct_message_you_have_joined": "لقد انضممت إلى رسالة مباشرة جديدة مع ",
@@ -1439,6 +1443,7 @@
14391443
"Enable_Svg_Favicon": "تفعيل رمز مفضلة SVG ",
14401444
"Enable_inquiry_fetch_by_stream": "تمكين جلب بيانات الاستعلام من الخادم باستخدام الدفق",
14411445
"Enable_omnichannel_auto_close_abandoned_rooms": "تمكين الإغلاق التلقائي للغرف التي هجرها الزائر",
1446+
"Enable_two-factor_authentication": "تمكين المصادقة الثنائية عبر TOTP",
14421447
"Enabled": "تم التمكين",
14431448
"Encrypted": "مشفر",
14441449
"Encrypted_channel_Description": "القناة المشفرة بين النهايات. لن يعمل البحث مع الفِرَق المشفرة وقد لا تعرض الإشعارات محتوى الرسائل.",
@@ -2522,6 +2527,7 @@
25222527
"Message_has_been_unpinned": "تم إلغاء تثبيت الرسالة",
25232528
"Message_has_been_unstarred": "تم إلغاء تمييز الرسالة بنجمة",
25242529
"Message_info": "معلومات الرسالة",
2530+
"Message_is_removed": "تمت إزالة الرسالة",
25252531
"Message_pinning": "تثبيت الرسالة",
25262532
"Message_removed": "تمت إزالة الرسالة",
25272533
"Message_sent_by_email": "تم إرسال الرسالة عبر البريد الإلكتروني",
@@ -2830,6 +2836,7 @@
28302836
"Pages": "صفحات",
28312837
"Paid_Apps": "تطبيقات مدفوعة",
28322838
"Parent_channel_doesnt_exist": "Channel غير موجودة.",
2839+
"Parent_channel_or_team": "القناة أو المجموعة الأصلية",
28332840
"Participants": "المشاركون",
28342841
"Password": "كلمة المرور",
28352842
"Password_Change_Disabled": "قام مسؤول Rocket.Chat بتعطيل تغيير كلمات المرور",
@@ -2850,6 +2857,7 @@
28502857
"Payload": "الحمولة",
28512858
"Peer_Password": "كلمة مرور النظير",
28522859
"People": "الأشخاص",
2860+
"People_can_only_join_by_being_invited": "يمكن فقط للأشخاص المدعوين الانضمام",
28532861
"Permalink": "الرابط الثابت",
28542862
"Permissions": "الأذونات",
28552863
"Personal_Access_Tokens": "الرموز المميزة للوصول الشخصي",
@@ -2907,6 +2915,7 @@
29072915
"Post_to_s_as_s": "الترحيل إلى <strong>%s</strong> كـ <strong>%s</strong>",
29082916
"Preferences": "التفضيلات",
29092917
"Preferences_saved": "تم حفظ التفضيلات",
2918+
"Premium": "مؤسسة",
29102919
"Preparing_data_for_import_process": "تجهيز البيانات لعملية الاستيراد",
29112920
"Preparing_list_of_channels": "تجهيز قائمة القنوات",
29122921
"Preparing_list_of_messages": "تجهيز قائمة الرسائل",
@@ -4010,6 +4019,7 @@
40104019
"VoIP_Server_Name": "اسم الخادم",
40114020
"VoIP_Server_Websocket_Path": "مسار Websocket",
40124021
"VoIP_Server_Websocket_Port": "منفذ Websocket",
4022+
"VoIP_TeamCollab_Enabled": "تم التمكين",
40134023
"Voice_Call": "مكالمة صوتية",
40144024
"Voip_Server_Configuration": "تكوين الخادم",
40154025
"Voip_call_declined": "تم إنهاء المكالمة من قِبل الوكيل",
@@ -4147,10 +4157,6 @@
41474157
"Your_temporary_password_is_password": "كلمة المرور المؤقتة الخاصة بك هي <strong>[password]</strong>.",
41484158
"Your_workspace_is_ready": "مساحة العمل الخاصة بك جاهزة للاستخدام 🎉",
41494159
"Zapier": "Zapier",
4150-
"__count__empty_rooms_will_be_removed_automatically": "ستتم إزالة {{count}} من الغرف الفارغة تلقائيًا.",
4151-
"__count__empty_rooms_will_be_removed_automatically__rooms__": "ستتم إزالة {{count}} من الغرف الفارغة تلقائيًا: <br/> {{rooms}}",
4152-
"__username__is_no_longer__role__defined_by__user_by_": "لم يعد {{username}} في دور {{role}} من قِبل {{user_by}}",
4153-
"__username__was_set__role__by__user_by_": "تم تعيين {{username}} في دور {{role}} من قِبل {{user_by}}",
41544160
"access-mailer": "الوصول إلى شاشة مرسل البريد",
41554161
"access-mailer_description": "إذن لإرسال بريد إلكتروني جماعي إلى كل المستخدمين.",
41564162
"access-permissions": "شاشة أذونات الوصول",
@@ -4274,6 +4280,7 @@
42744280
"email_plain_text_only": "إرسال رسائل بريد إلكتروني بنص عادي فقط",
42754281
"email_style_description": "تجنب المحدِّدات المتداخلة",
42764282
"email_style_label": "نمط البريد الإلكتروني",
4283+
"ensure_email_address_valid": "عنوان بريد إلكتروني غير صالح",
42774284
"error-action-not-allowed": "{{action}} غير مسموح به",
42784285
"error-agent-offline": "الوكيل غير متصل",
42794286
"error-agent-status-service-offline": "حالة الوكيل غير متصل أو خدمة القناة متعددة الاتجاهات غير نشطة",
@@ -4426,7 +4433,6 @@
44264433
"except_pinned": "(باستثناء المثبتة)",
44274434
"expression": "التعبير",
44284435
"file_pruned": "تم تنقيح الملف",
4429-
"files": "الملفات",
44304436
"force-delete-message": "فرض حذف رسالة",
44314437
"force-delete-message_description": "إذن لحذف رسالة بتخطي كل القيود",
44324438
"get-password-policy-forbidRepeatingCharacters": "يجب ألا تحتوي كلمة المرور على رموز متكررة",
@@ -4519,10 +4525,10 @@
45194525
"message": "رسالة",
45204526
"message-impersonate": "انتحال صفة مستخدمين آخرين",
45214527
"message-impersonate_description": "إذن لانتحال صفة مستخدمين آخرين باستخدام الاسم المستعار للرسالة",
4522-
"message_counter_few": "{{count}} رسائل",
4523-
"message_counter_many": "{{count}} رسائل",
45244528
"message_counter_one": "{{count}} رسالة",
45254529
"message_counter_other": "{{count}} رسائل",
4530+
"message_counter_many": "{{count}} رسائل",
4531+
"message_counter_few": "{{count}} رسائل",
45264532
"message_counter_two": "{{count}} رسائل",
45274533
"message_counter_zero": "{{count}} رسائل",
45284534
"message_pruned": "تم تنقيح الرسالة",
@@ -4532,10 +4538,10 @@
45324538
"meteor_status_connecting": "يتم الاتصال الآن...",
45334539
"meteor_status_failed": "فشل الاتصال بالخادم",
45344540
"meteor_status_offline": "وضع عدم الاتصال.",
4535-
"meteor_status_reconnect_in_few": "المحاولة مرة أخرى خلال {{count}} من الثواني...",
4536-
"meteor_status_reconnect_in_many": "المحاولة مرة أخرى خلال {{count}} من الثواني...",
45374541
"meteor_status_reconnect_in_one": "المحاولة مرة أخرى خلال ثانية واحدة...",
45384542
"meteor_status_reconnect_in_other": "المحاولة مرة أخرى خلال {{count}} من الثواني...",
4543+
"meteor_status_reconnect_in_many": "المحاولة مرة أخرى خلال {{count}} من الثواني...",
4544+
"meteor_status_reconnect_in_few": "المحاولة مرة أخرى خلال {{count}} من الثواني...",
45394545
"meteor_status_reconnect_in_two": "المحاولة مرة أخرى خلال {{count}} من الثواني...",
45404546
"meteor_status_reconnect_in_zero": "المحاولة مرة أخرى خلال {{count}} من الثواني...",
45414547
"meteor_status_try_now_offline": "الاتصال مرة أخرى",
@@ -4865,5 +4871,9 @@
48654871
"you_are_in_preview_mode_of": "أنت في وضع المعاينة لقناة #<strong>{{room_name}}</strong>",
48664872
"you_are_in_preview_mode_of_incoming_livechat": "أنت في وضع المعاينة لهذه الدردشة",
48674873
"your_message": "رسالتك",
4868-
"your_message_optional": "رسالتك (اختياري)"
4869-
}
4874+
"your_message_optional": "رسالتك (اختياري)",
4875+
"__count__empty_rooms_will_be_removed_automatically": "ستتم إزالة {{count}} من الغرف الفارغة تلقائيًا.",
4876+
"__count__empty_rooms_will_be_removed_automatically__rooms__": "ستتم إزالة {{count}} من الغرف الفارغة تلقائيًا: <br/> {{rooms}}",
4877+
"__username__is_no_longer__role__defined_by__user_by_": "لم يعد {{username}} في دور {{role}} من قِبل {{user_by}}",
4878+
"__username__was_set__role__by__user_by_": "تم تعيين {{username}} في دور {{role}} من قِبل {{user_by}}"
4879+
}

0 commit comments

Comments
 (0)