Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat!: E2EE room's Key icon no longer toggles encryption of room #33572

Merged
merged 9 commits into from
Oct 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .changeset/thick-waves-try.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@rocket.chat/meteor": major
"@rocket.chat/i18n": patch
---

Removes the ability of changing room's encryption status from the `key` icon placed on the room's header. Icon's purpose is now only informative, showing when a room uses E2EE. Use the kebab menu to enable/disable E2EE.
26 changes: 2 additions & 24 deletions apps/meteor/client/views/room/Header/icons/Encrypted.tsx
Original file line number Diff line number Diff line change
@@ -1,36 +1,14 @@
import type { IRoom } from '@rocket.chat/core-typings';
import { useMutableCallback } from '@rocket.chat/fuselage-hooks';
import colors from '@rocket.chat/fuselage-tokens/colors';
import { useSetting, usePermission, useTranslation, useEndpoint } from '@rocket.chat/ui-contexts';
import { useSetting, useTranslation } from '@rocket.chat/ui-contexts';
import React, { memo } from 'react';

import { HeaderState } from '../../../../components/Header';
import { dispatchToastMessage } from '../../../../lib/toast';

const Encrypted = ({ room }: { room: IRoom }) => {
const t = useTranslation();
const e2eEnabled = useSetting('E2E_Enable');
const toggleE2E = useEndpoint('POST', '/v1/rooms.saveRoomSettings');
const canToggleE2E = usePermission('toggle-room-e2e-encryption');
const encryptedLabel = canToggleE2E ? t('Encrypted_key_title') : t('Encrypted');
const handleE2EClick = useMutableCallback(async () => {
if (!canToggleE2E) {
return;
}

const { success } = await toggleE2E({ rid: room._id, encrypted: !room.encrypted });
if (!success) {
return;
}

dispatchToastMessage({
type: 'success',
message: t('E2E_Encryption_disabled_for_room', { roomName: room.name }),
});
});
return e2eEnabled && room?.encrypted ? (
<HeaderState title={encryptedLabel} icon='key' onClick={handleE2EClick} color={colors.g500} tiny />
) : null;
return e2eEnabled && room?.encrypted ? <HeaderState title={t('Encrypted')} icon='key' color={colors.g500} tiny /> : null;
};

export default memo(Encrypted);
26 changes: 2 additions & 24 deletions apps/meteor/client/views/room/HeaderV2/icons/Encrypted.tsx
Original file line number Diff line number Diff line change
@@ -1,36 +1,14 @@
import type { IRoom } from '@rocket.chat/core-typings';
import { useMutableCallback } from '@rocket.chat/fuselage-hooks';
import colors from '@rocket.chat/fuselage-tokens/colors';
import { useSetting, usePermission, useTranslation, useEndpoint } from '@rocket.chat/ui-contexts';
import { useSetting, useTranslation } from '@rocket.chat/ui-contexts';
import React, { memo } from 'react';

import { HeaderState } from '../../../../components/Header';
import { dispatchToastMessage } from '../../../../lib/toast';

const Encrypted = ({ room }: { room: IRoom }) => {
const t = useTranslation();
const e2eEnabled = useSetting('E2E_Enable');
const toggleE2E = useEndpoint('POST', '/v1/rooms.saveRoomSettings');
const canToggleE2E = usePermission('toggle-room-e2e-encryption');
const encryptedLabel = canToggleE2E ? t('Encrypted_key_title') : t('Encrypted');
const handleE2EClick = useMutableCallback(async () => {
if (!canToggleE2E) {
return;
}

const { success } = await toggleE2E({ rid: room._id, encrypted: !room.encrypted });
if (!success) {
return;
}

dispatchToastMessage({
type: 'success',
message: t('E2E_Encryption_disabled_for_room', { roomName: room.name }),
});
});
return e2eEnabled && room?.encrypted ? (
<HeaderState title={encryptedLabel} icon='key' onClick={handleE2EClick} color={colors.g500} tiny />
) : null;
return e2eEnabled && room?.encrypted ? <HeaderState title={t('Encrypted')} icon='key' color={colors.g500} tiny /> : null;
};

export default memo(Encrypted);
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export class HomeContent {
}

get encryptedRoomHeaderIcon(): Locator {
return this.page.locator('.rcx-room-header button > i.rcx-icon--name-key');
return this.page.locator('.rcx-room-header i.rcx-icon--name-key');
}

get lastIgnoredUserMessage(): Locator {
Expand Down
3 changes: 1 addition & 2 deletions packages/i18n/src/locales/ar.i18n.json
Original file line number Diff line number Diff line change
Expand Up @@ -1603,7 +1603,6 @@
"Enabled": "تم التمكين",
"Encrypted": "مشفر",
"Encrypted_channel_Description": "القناة المشفرة بين النهايات. لن يعمل البحث مع الفِرَق المشفرة وقد لا تعرض الإشعارات محتوى الرسائل.",
"Encrypted_key_title": "انقر هنا لتعطيل التشفير بين النهايات لهذه القناة (يتطلب إذن التشفير بين النهايات)",
"Encrypted_message": "رسالة مشفرة",
"Encrypted_setting_changed_successfully": "تم تغيير الإعداد المشفر بنجاح!",
"Encrypted_not_available": "غير متاح لـ Channel العامة",
Expand Down Expand Up @@ -4885,4 +4884,4 @@
"Enterprise": "مؤسسة",
"UpgradeToGetMore_engagement-dashboard_Title": "التحليلات",
"UpgradeToGetMore_auditing_Title": "تدقيق الرسائل"
}
}
3 changes: 1 addition & 2 deletions packages/i18n/src/locales/ca.i18n.json
Original file line number Diff line number Diff line change
Expand Up @@ -1586,7 +1586,6 @@
"Enabled": "Activa",
"Encrypted": "Xifrat",
"Encrypted_channel_Description": "Canal xifrat d'extrem a extrem. La cerca no funcionarà amb canals xifrats i és possible que les notificacions no mostrin el contingut dels missatges.",
"Encrypted_key_title": "Feu clic aquí per desactivar el xifratge d'extrem a extrem per a aquest canal (requereix permís e2ee)",
"Encrypted_message": "Missatge xifrat",
"Encrypted_setting_changed_successfully": "La configuració encriptada es va canviar correctament",
"Encrypted_not_available": "No disponible per a Channels públics",
Expand Down Expand Up @@ -4687,4 +4686,4 @@
"Enterprise": "Empresa",
"UpgradeToGetMore_engagement-dashboard_Title": "Analítiques",
"UpgradeToGetMore_auditing_Title": "Auditoria de missatges"
}
}
3 changes: 1 addition & 2 deletions packages/i18n/src/locales/de.i18n.json
Original file line number Diff line number Diff line change
Expand Up @@ -1796,7 +1796,6 @@
"Enabled": "Aktiviert",
"Encrypted": "Verschlüsselt",
"Encrypted_channel_Description": "Ende-zu-Ende verschlüsselter Kanal. Die Suche funktioniert nicht mit verschlüsselten Channels. In Benachrichtigungen wird der Inhalt der Nachricht möglicherweise nicht angezeigt.",
"Encrypted_key_title": "Klicken Sie hier, um die Ende-zu-Ende-Verschlüsselung für diesen Kanal zu deaktivieren (e2ee-Berechtigung erforderlich)",
"Encrypted_message": "Verschlüsselte Nachricht",
"Encrypted_setting_changed_successfully": "Die Verschlüsselungseinstellungen wurden gespeichert ",
"Encrypted_not_available": "Für öffentliche Kanäle nicht verfügbar",
Expand Down Expand Up @@ -5523,4 +5522,4 @@
"Enterprise": "Unternehmen",
"UpgradeToGetMore_engagement-dashboard_Title": "Analytics",
"UpgradeToGetMore_auditing_Title": "Nachrichtenüberprüfung"
}
}
1 change: 0 additions & 1 deletion packages/i18n/src/locales/en.i18n.json
Original file line number Diff line number Diff line change
Expand Up @@ -1978,7 +1978,6 @@
"Encrypted": "Encrypted",
"Encrypted_channel_Description": "Messages are end-to-end encrypted, search will not work and notifications may not show message content",
"Encrypted_content_cannot_be_searched": "Encrypted content cannot be searched.",
"Encrypted_key_title": "Click here to disable end-to-end encryption for this channel (requires e2ee-permission)",
"Encrypted_message": "Encrypted message",
"Encrypted_RoomType": "Encrypted {{roomType}}",
"Encrypted_message_preview_unavailable": "Encrypted message, preview unavailable",
Expand Down
1 change: 0 additions & 1 deletion packages/i18n/src/locales/es.i18n.json
Original file line number Diff line number Diff line change
Expand Up @@ -1608,7 +1608,6 @@
"Enabled": "Habilitada",
"Encrypted": "Cifrado",
"Encrypted_channel_Description": "Canal cifrado de extremo a extremo. La búsqueda no funcionará con canales cifrados y es posible que las notificaciones no muestren el contenido de los mensajes.",
"Encrypted_key_title": "Haz clic aquí para deshabilitar el cifrado de extremo a extremo para este canal (requiere permiso de E2EE)",
"Encrypted_message": "Mensaje cifrado",
"Encrypted_setting_changed_successfully": "Configuración cifrada cambiada correctamente",
"Encrypted_not_available": "No disponible para Channels públicos",
Expand Down
3 changes: 1 addition & 2 deletions packages/i18n/src/locales/fi.i18n.json
Original file line number Diff line number Diff line change
Expand Up @@ -1818,7 +1818,6 @@
"Enabled": "Käytössä",
"Encrypted": "Salattu",
"Encrypted_channel_Description": "Täysin salattu kanava. Haku ei toimi salatuilla kanavilla, ja ilmoituksissa ei välttämättä näy viestien sisältöä.",
"Encrypted_key_title": "Poista käytöstä tämän kanavan täysi salaus napsauttamalla tätä (edellyttää e2ee-oikeutta)",
"Encrypted_message": "Salattu viesti",
"Encrypted_setting_changed_successfully": "Salausasetus on muutettu",
"Encrypted_not_available": "Ei saatavilla ylesellä kanavalla Channel",
Expand Down Expand Up @@ -5741,4 +5740,4 @@
"Theme_Appearence": "Teeman ulkoasu",
"Enterprise": "Yritys",
"UpgradeToGetMore_engagement-dashboard_Title": "Analytics"
}
}
3 changes: 1 addition & 2 deletions packages/i18n/src/locales/fr.i18n.json
Original file line number Diff line number Diff line change
Expand Up @@ -1601,7 +1601,6 @@
"Enabled": "Activé",
"Encrypted": "Chiffré",
"Encrypted_channel_Description": "Canal chiffré de bout en bout. La recherche ne fonctionne pas avec les canaux chiffrés et les notifications peuvent ne pas afficher le contenu des messages.",
"Encrypted_key_title": "Cliquez ici pour désactiver le chiffrement de bout en bout pour ce canal (nécessite l'autorisation E2EE)",
"Encrypted_message": "Message chiffré",
"Encrypted_setting_changed_successfully": "Le paramètre chiffré a été modifié",
"Encrypted_not_available": "Non disponible pour les canaux publics",
Expand Down Expand Up @@ -4880,4 +4879,4 @@
"Enterprise": "Entreprise",
"UpgradeToGetMore_engagement-dashboard_Title": "Analyses",
"UpgradeToGetMore_auditing_Title": "Audit des messages"
}
}
3 changes: 1 addition & 2 deletions packages/i18n/src/locales/hi-IN.i18n.json
Original file line number Diff line number Diff line change
Expand Up @@ -1867,7 +1867,6 @@
"Enabled": "सक्रिय",
"Encrypted": "कूट रूप दिया गया",
"Encrypted_channel_Description": "एंड-टू-एंड एन्क्रिप्टेड चैनल। खोज एन्क्रिप्टेड चैनलों के साथ काम नहीं करेगी और सूचनाएं संदेश सामग्री नहीं दिखा सकती हैं।",
"Encrypted_key_title": "इस चैनल के लिए एंड-टू-एंड एन्क्रिप्शन अक्षम करने के लिए यहां क्लिक करें (e2ee-अनुमति की आवश्यकता है)",
"Encrypted_message": "एन्क्रिप्टेड संदेश",
"Encrypted_setting_changed_successfully": "एन्क्रिप्टेड सेटिंग सफलतापूर्वक बदल दी गई",
"Encrypted_not_available": "सार्वजनिक चैनलों के लिए उपलब्ध नहीं है",
Expand Down Expand Up @@ -6123,4 +6122,4 @@
"Unlimited_seats": "असीमित सीटें",
"Unlimited_MACs": "असीमित एमएसी",
"Unlimited_seats_MACs": "असीमित सीटें और एमएसी"
}
}
3 changes: 1 addition & 2 deletions packages/i18n/src/locales/hu.i18n.json
Original file line number Diff line number Diff line change
Expand Up @@ -1762,7 +1762,6 @@
"Enabled": "Engedélyezve",
"Encrypted": "Titkosítva",
"Encrypted_channel_Description": "Végpontok között titkosított csatorna. A keresés nem fog működni a titkosított csatornákkal, és az értesítések esetleg nem jelenítik meg az üzenetek tartalmát.",
"Encrypted_key_title": "Kattintson ide a csatorna végpontok közötti titkosításának letiltásához (végpontok közötti titkosítás jogosultságot igényel)",
"Encrypted_message": "Titkosított üzenet",
"Encrypted_setting_changed_successfully": "A titkosított beállítás sikeresen megváltoztatva",
"Encrypted_not_available": "Nem érhető el nyilvános csatornáknál",
Expand Down Expand Up @@ -5420,4 +5419,4 @@
"Enterprise": "Vállalati",
"UpgradeToGetMore_engagement-dashboard_Title": "Analitika",
"UpgradeToGetMore_auditing_Title": "Üzenet ellenőrzés"
}
}
3 changes: 1 addition & 2 deletions packages/i18n/src/locales/ja.i18n.json
Original file line number Diff line number Diff line change
Expand Up @@ -1579,7 +1579,6 @@
"Enabled": "有効",
"Encrypted": "暗号化済み",
"Encrypted_channel_Description": "エンドツーエンドの暗号化チャネル。検索は暗号化されたチャネルでは機能せず、通知にメッセージの内容が表示されないことがあります。",
"Encrypted_key_title": "このチャネルのエンドツーエンド暗号化を無効にするには、ここをクリックしてください(e2ee-permissionが必要です)",
"Encrypted_message": "暗号化されたメッセージ",
"Encrypted_setting_changed_successfully": "暗号化の設定が正常に変更されました",
"Encrypted_not_available": "パブリックChannelsには利用できません",
Expand Down Expand Up @@ -4823,4 +4822,4 @@
"Enterprise": "エンタープライズ",
"UpgradeToGetMore_engagement-dashboard_Title": "分析",
"UpgradeToGetMore_auditing_Title": "メッセージ監査"
}
}
3 changes: 1 addition & 2 deletions packages/i18n/src/locales/nl.i18n.json
Original file line number Diff line number Diff line change
Expand Up @@ -1593,7 +1593,6 @@
"Enabled": "Ingeschakeld",
"Encrypted": "Versleuteld",
"Encrypted_channel_Description": "End-to-end gecodeerd kanaal. Zoeken werkt niet met gecodeerde kanalen en meldingen geven de inhoud van het bericht mogelijk niet weer.",
"Encrypted_key_title": "Klik hier om end-to-end encryptie voor dit kanaal uit te schakelen (vereist e2ee-toestemming)",
"Encrypted_message": "Gecodeerd bericht",
"Encrypted_setting_changed_successfully": "Versleutelde instelling is succesvol gewijzigd",
"Encrypted_not_available": "Niet beschikbaar voor openbare kanalen",
Expand Down Expand Up @@ -4865,4 +4864,4 @@
"Enterprise": "Onderneming",
"UpgradeToGetMore_engagement-dashboard_Title": "Analytics",
"UpgradeToGetMore_auditing_Title": "Bericht auditing"
}
}
3 changes: 1 addition & 2 deletions packages/i18n/src/locales/nn.i18n.json
Original file line number Diff line number Diff line change
Expand Up @@ -1677,7 +1677,6 @@
"Enabled": "aktivert",
"Encrypted": "Kryptert",
"Encrypted_channel_Description": "Ende-til-ende kryptert kanal. Søk fungerer ikke med krypterte kanaler, og varsler viser kanskje ikke meldingsinnholdet.",
"Encrypted_key_title": "Klikk her for å deaktivere ende-til-ende-kryptering for denne kanalen (krever e2e-tillatelse)",
"Encrypted_message": "Kryptert melding",
"Encrypted_not_available": "Ikke tilgjengelig for offentlige Channel",
"Encryption_key_saved_successfully": "Krypteringsnøkkelen din ble lagret.",
Expand Down Expand Up @@ -4576,4 +4575,4 @@
"free_per_month_user": "$0 per måned per bruker",
"UpgradeToGetMore_engagement-dashboard_Title": "Analytics",
"Buy_more": "Kjøp mer"
}
}
3 changes: 1 addition & 2 deletions packages/i18n/src/locales/no.i18n.json
Original file line number Diff line number Diff line change
Expand Up @@ -1677,7 +1677,6 @@
"Enabled": "aktivert",
"Encrypted": "Kryptert",
"Encrypted_channel_Description": "Ende-til-ende kryptert kanal. Søk fungerer ikke med krypterte kanaler, og varsler viser kanskje ikke meldingsinnholdet.",
"Encrypted_key_title": "Klikk her for å deaktivere ende-til-ende-kryptering for denne kanalen (krever e2e-tillatelse)",
"Encrypted_message": "Kryptert melding",
"Encrypted_not_available": "Ikke tilgjengelig for offentlige Channel",
"Encryption_key_saved_successfully": "Krypteringsnøkkelen din ble lagret.",
Expand Down Expand Up @@ -4576,4 +4575,4 @@
"free_per_month_user": "$0 per måned per bruker",
"UpgradeToGetMore_engagement-dashboard_Title": "Analytics",
"Buy_more": "Kjøp mer"
}
}
2 changes: 0 additions & 2 deletions packages/i18n/src/locales/pl.i18n.json
Original file line number Diff line number Diff line change
Expand Up @@ -1795,8 +1795,6 @@
"Enabled": "Włączone",
"Encrypted": "Szyfrowane",
"Encrypted_channel_Description": "Kanał zaszyfrowany od końca do końca. Wyszukiwanie nie działa z szyfrowanymi kanałami, a powiadomienia mogą nie wyświetlać treści wiadomości.",
"Encrypted_key_title": "Kliknij tutaj, aby wyłączyć szyfrowanie od końca do końca dla tego kanału (wymaga uprawnień e2ee-permission)",
"Encrypted_message": "Zaszyfrowana wiadomość",
"Encrypted_setting_changed_successfully": "Ustawienia szyfrowania zostały pomyślnie zmienione",
"Encrypted_not_available": "Niedostępne dla publicznych {{roomType}}",
"Encryption_key_saved_successfully": "Twój klucz szyfrowania został zapisany pomyślnie.",
Expand Down
1 change: 0 additions & 1 deletion packages/i18n/src/locales/pt-BR.i18n.json
Original file line number Diff line number Diff line change
Expand Up @@ -1653,7 +1653,6 @@
"Enabled": "Ativado",
"Encrypted": "Criptografado",
"Encrypted_channel_Description": "Canal criptografado de ponta a ponta. A pesquisa não funcionará com canais criptografados e as notificações podem não mostrar o conteúdo das mensagens.",
"Encrypted_key_title": "Clique aqui para desabilitar a criptografia de ponta a ponta para esse canal (exige e2ee-permission)",
"Encrypted_message": "Mensagem criptografada",
"Encrypted_setting_changed_successfully": "Configuração de criptografia alterada com sucesso",
"Encrypted_not_available": "Indisponível para canais públicos",
Expand Down
1 change: 0 additions & 1 deletion packages/i18n/src/locales/ru.i18n.json
Original file line number Diff line number Diff line change
Expand Up @@ -1738,7 +1738,6 @@
"Enabled": "Включено",
"Encrypted": "Зашифрованный",
"Encrypted_channel_Description": "Полностью зашифрованный канал. Поиск не будет работать с зашифрованными каналами, и уведомления могут не показать содержание сообщений.",
"Encrypted_key_title": "Нажмите здесь, чтобы отключить сквозное шифрование для этого канала (требуется разрешение E2EE)",
"Encrypted_message": "Зашифрованное сообщение",
"Encrypted_setting_changed_successfully": "Зашифрованный параметр успешно изменен",
"Encrypted_not_available": "Недоступно для публичных каналов",
Expand Down
3 changes: 1 addition & 2 deletions packages/i18n/src/locales/se.i18n.json
Original file line number Diff line number Diff line change
Expand Up @@ -1974,7 +1974,6 @@
"Encrypted": "Encrypted",
"Encrypted_channel_Description": "Messages are end-to-end encrypted, search will not work and notifications may not show message content",
"Encrypted_content_cannot_be_searched": "Encrypted content cannot be searched.",
"Encrypted_key_title": "Click here to disable end-to-end encryption for this channel (requires e2ee-permission)",
"Encrypted_message": "Encrypted message",
"Encrypted_RoomType": "Encrypted {{roomType}}",
"Encrypted_message_preview_unavailable": "Encrypted message, preview unavailable",
Expand Down Expand Up @@ -6604,4 +6603,4 @@
"Sidepanel_navigation_description": "Display channels and/or discussions associated with teams by default. This allows team owners to customize communication methods to best meet their team’s needs. This is currently in feature preview and will be a premium capability once fully released.",
"Show_channels_description": "Show team channels in second sidebar",
"Show_discussions_description": "Show team discussions in second sidebar"
}
}
1 change: 0 additions & 1 deletion packages/i18n/src/locales/sv.i18n.json
Original file line number Diff line number Diff line change
Expand Up @@ -1820,7 +1820,6 @@
"Enabled": "Aktiverad",
"Encrypted": "Krypterad",
"Encrypted_channel_Description": "End-to-end-krypterad kanal. Sökfunktionen fungerar inte för krypterade kanaler och meddelandeinnehållet kanske inte visas i meddelanden.",
"Encrypted_key_title": "Klicka här om du vill inaktivera end-to-end-kryptering för den här kanalen (e2ee-behörighet krävs)",
"Encrypted_message": "Krypterat meddelande",
"Encrypted_setting_changed_successfully": "Krypteringsinställningen har ändrats",
"Encrypted_not_available": "Inte tillgängligt för offentliga kanaler",
Expand Down
1 change: 0 additions & 1 deletion packages/i18n/src/locales/zh-TW.i18n.json
Original file line number Diff line number Diff line change
Expand Up @@ -1576,7 +1576,6 @@
"Enabled": "已啟用",
"Encrypted": "已加密",
"Encrypted_channel_Description": "點對點加密頻道。搜尋無法在加密頻道上工作且通知可能也不會顯示訊息內容。",
"Encrypted_key_title": "按一下這裡即可針對此頻道停用端對端加密 (需要 e2ee 權限)",
"Encrypted_message": "加密訊息",
"Encrypted_setting_changed_successfully": "加密設定已變更成功",
"Encrypted_not_available": "不可以用在公開 Channel",
Expand Down
Loading