[IMPROVE] Sync message actions order with web app (#4672)

This commit is contained in:
Diego Mello 2022-11-10 16:48:52 -03:00
parent 2b5803980d
commit 1f0af922fc
17 changed files with 51 additions and 59 deletions

View File

@ -342,18 +342,7 @@ const MessageActions = React.memo(
};
const getOptions = (message: TAnyMessageModel) => {
let options: TActionSheetOptionsItem[] = [];
// Reply
if (!isReadOnly && !tmid) {
options = [
{
title: I18n.t('Reply_in_Thread'),
icon: 'threads',
onPress: () => handleReply(message)
}
];
}
const options: TActionSheetOptionsItem[] = [];
// Quote
if (!isReadOnly) {
@ -364,6 +353,15 @@ const MessageActions = React.memo(
});
}
// Reply
if (!isReadOnly && !tmid) {
options.push({
title: I18n.t('Reply_in_Thread'),
icon: 'threads',
onPress: () => handleReply(message)
});
}
// Reply in DM
if (room.t !== 'd' && room.t !== 'l' && createDirectMessagePermission) {
options.push({
@ -373,22 +371,6 @@ const MessageActions = React.memo(
});
}
// Edit
if (allowEdit(message)) {
options.push({
title: I18n.t('Edit'),
icon: 'edit',
onPress: () => handleEdit(message)
});
}
// Permalink
options.push({
title: I18n.t('Permalink'),
icon: 'link',
onPress: () => handlePermalink(message)
});
// Create Discussion
options.push({
title: I18n.t('Start_a_Discussion'),
@ -396,14 +378,12 @@ const MessageActions = React.memo(
onPress: () => handleCreateDiscussion(message)
});
// Mark as unread
if (message.u && message.u._id !== user.id) {
options.push({
title: I18n.t('Mark_unread'),
icon: 'flag',
onPress: () => handleUnread(message)
});
}
// Permalink
options.push({
title: I18n.t('Get_link'),
icon: 'link',
onPress: () => handlePermalink(message)
});
// Copy
options.push({
@ -419,12 +399,12 @@ const MessageActions = React.memo(
onPress: () => handleShare(message)
});
// Star
if (Message_AllowStarring) {
// Edit
if (allowEdit(message)) {
options.push({
title: I18n.t(message.starred ? 'Unstar' : 'Star'),
icon: message.starred ? 'star-filled' : 'star',
onPress: () => handleStar(message)
title: I18n.t('Edit'),
icon: 'edit',
onPress: () => handleEdit(message)
});
}
@ -437,6 +417,24 @@ const MessageActions = React.memo(
});
}
// Star
if (Message_AllowStarring) {
options.push({
title: I18n.t(message.starred ? 'Unstar' : 'Star'),
icon: message.starred ? 'star-filled' : 'star',
onPress: () => handleStar(message)
});
}
// Mark as unread
if (message.u && message.u._id !== user.id) {
options.push({
title: I18n.t('Mark_unread'),
icon: 'flag',
onPress: () => handleUnread(message)
});
}
// Read Receipts
if (Message_Read_Receipt_Store_Users) {
options.push({

View File

@ -157,7 +157,6 @@
"Copied_to_clipboard": "تم النسخ للحافظة!",
"Copy": "نسخ",
"Conversation": "محادثة",
"Permalink": "رابط ثابت",
"Certificate_password": "الرقم السري للشهادة",
"Clear_cache": "امسح ذاكرة التخزين المؤقتة للخادم",
"Clear_cache_loading": "يتم مسح ذاكرة التخزين",

View File

@ -168,7 +168,6 @@
"Copied_to_clipboard": "In die Zwischenablage kopiert!",
"Copy": "Kopieren",
"Conversation": "Konversationen",
"Permalink": "Permalink",
"Certificate_password": "Zertifikats-Passwort",
"Clear_cache": "Lokalen Server-Cache leeren",
"Clear_cache_loading": "Leere Cache.",

View File

@ -168,7 +168,6 @@
"Copied_to_clipboard": "Copied to clipboard!",
"Copy": "Copy",
"Conversation": "Conversation",
"Permalink": "Permalink",
"Certificate_password": "Certificate Password",
"Clear_cache": "Clear local server cache",
"Clear_cache_loading": "Clearing cache.",
@ -257,6 +256,7 @@
"Forward_to_user": "Forward to user",
"Full_table": "Click to see full table",
"Generate_New_Link": "Generate New Link",
"Get_link": "Get Link",
"User_joined_the_channel": "joined the channel",
"User_joined_the_conversation": "joined the conversation",
"User_joined_the_team": "joined this team",

View File

@ -137,7 +137,6 @@
"Continue_with": "Continuar con",
"Copied_to_clipboard": "¡Copiado al portapapeles!",
"Copy": "Copiar",
"Permalink": "Enlace permanente",
"Certificate_password": "Contraseña del certificado",
"Whats_the_password_for_your_certificate": "¿Cuál es la contraseña de tu certificado?",
"Create_account": "Crear una cuenta",
@ -424,5 +423,6 @@
"Server_selection_numbers": "Seleccionar servidor 1...9",
"Add_server": "Añadir servidor",
"New_line": "Nueva línea",
"Broadcast_hint": "Sólo los usuarios autorizados pueden escribir nuevos mensajes, el resto podrán responder sobre los mismos."
"Broadcast_hint": "Sólo los usuarios autorizados pueden escribir nuevos mensajes, el resto podrán responder sobre los mismos.",
"Get_link": "Obtener enlace"
}

View File

@ -161,7 +161,6 @@
"Copied_to_clipboard": "Copié dans le presse-papier !",
"Copy": "Copier",
"Conversation": "Conversation",
"Permalink": "Lien permanent",
"Certificate_password": "Mot de passe du certificat",
"Clear_cache": "Effacer le cache du serveur local",
"Clear_cache_loading": "Effacement du cache.",
@ -248,6 +247,7 @@
"Forward_to_user": "Transmettre à l'utilisateur",
"Full_table": "Cliquez pour voir le tableau complet",
"Generate_New_Link": "Générer un nouveau lien",
"Get_link": "Obtenir le lien",
"Has_left_the_team": "a quitté l'équipe",
"Hide_System_Messages": "Masquer les messages système",
"Hide_type_messages": "Masquer les messages \"{{type}}\"",

View File

@ -168,7 +168,6 @@
"Copied_to_clipboard": "Copiato negli appunti!",
"Copy": "Copia",
"Conversation": "Conversazione",
"Permalink": "Permalink",
"Certificate_password": "Password certificato",
"Clear_cache": "Cancella la cache locale",
"Clear_cache_loading": "Cancellando la cache.",
@ -256,6 +255,7 @@
"Forward_to_user": "Inoltra ad udente",
"Full_table": "Clicca per la tabella completa",
"Generate_New_Link": "Genera nuovo link",
"Get_link": "Ottieni link",
"Has_left_the_team": "Ha lasciato il team",
"Hide_System_Messages": "Nascondi messaggi di sistema",
"Hide_type_messages": "Nascondi messaggi di \"{{type}}\"",

View File

@ -159,7 +159,6 @@
"Copied_to_clipboard": "クリップボードにコピー!",
"Copy": "コピー",
"Conversation": "会話",
"Permalink": "パーマリンク",
"Certificate_password": "パスワード証明書",
"Clear_cache": "ローカルのサーバーキャッシュをクリア",
"Clear_cache_loading": "キャッシュをクリアしています。",

View File

@ -161,7 +161,6 @@
"Copied_to_clipboard": "Gekopieerd naar klembord!",
"Copy": "Kopiëren",
"Conversation": "Conversatie",
"Permalink": "Permalink",
"Certificate_password": "Certificaat wachtwoord",
"Clear_cache": "Lokale server cache wissen",
"Clear_cache_loading": "Cache wissen.",
@ -248,6 +247,7 @@
"Forward_to_user": "Doorsturen naar gebruiker",
"Full_table": "Klik om de volledige tabel te zien",
"Generate_New_Link": "Nieuwe link genereren",
"Get_link": "Link krijgen",
"Has_left_the_team": "heeft het team verlaten",
"Hide_System_Messages": "Verberg systeemberichten",
"Hide_type_messages": "Verberg \"{{type}}\" berichten",

View File

@ -163,7 +163,6 @@
"Copied_to_clipboard": "Copiado para a área de transferência!",
"Copy": "Copiar",
"Conversation": "Conversação",
"Permalink": "Link-Permanente",
"Clear_cache_loading": "Limpando cache.",
"Create_account": "Criar conta",
"Create_Channel": "Criar Canal",
@ -248,6 +247,7 @@
"Forward_to_user": "Encaminhar para usuário",
"Full_table": "Clique para ver a tabela completa",
"Generate_New_Link": "Gerar novo convite",
"Get_link": "Obter link",
"Has_left_the_team": "saiu da equipe",
"Hide_System_Messages": "Esconder mensagens do sistema",
"Hide_type_messages": "Esconder mensagens de \"{{type}}\"",

View File

@ -158,7 +158,6 @@
"Copied_to_clipboard": "Copiado para a área de transferência!",
"Copy": "Copiar",
"Conversation": "Conversa",
"Permalink": "Link permanente",
"Certificate_password": "Senha do Certificado",
"Clear_cache": "Limpar a cache do servidor local",
"Clear_cache_loading": "A limpar a cache.",
@ -245,6 +244,7 @@
"Forward_to_user": "Reencaminhar para o utilizador",
"Full_table": "Clique para ver a tabela completa",
"Generate_New_Link": "Gerar Novo Link",
"Get_link": "Obter Ligação",
"Hide_System_Messages": "Esconder mensagens do sistema",
"Hide_type_messages": "Esconder mensagens \"{{type}}\"",
"How_It_Works": "Como Funciona",

View File

@ -168,7 +168,6 @@
"Copied_to_clipboard": "Скопировано в буфер обмена!",
"Copy": "Копировать",
"Conversation": "Диалог",
"Permalink": "Постоянная ссылка",
"Certificate_password": "Пароль сертификата",
"Clear_cache": "Очистить локальный кэш сервера",
"Clear_cache_loading": "Очистка кэша.",

View File

@ -170,7 +170,6 @@
"Copied_to_clipboard": "Kopirano v odložišče!",
"Copy": "Kopiraj",
"Conversation": "Pogovor",
"Permalink": "Permalink",
"Certificate_password": "Geslo potrdila",
"Clear_cache": "Počistite predpomnilnik lokalnega strežnika",
"Clear_cache_loading": "Čiščenje predpomnilnika.",

View File

@ -155,7 +155,6 @@
"Copied_to_clipboard": "Panoya kopyalandı!",
"Copy": "Kopyala",
"Conversation": "Sohbet",
"Permalink": "Kalıcı bağlantı",
"Certificate_password": "Sertifika Şifresi",
"Clear_cache": "Yerel sunucu önbelleğini temizleyin",
"Clear_cache_loading": "Önbellek temizleniyor.",
@ -240,6 +239,7 @@
"Forward_to_user": "Kullanıcıya İlet",
"Full_table": "Tam tabloyu görmek için tıklayın",
"Generate_New_Link": "Yeni Bağlantı Oluştur",
"Get_link": "Bağlantıyı Al",
"Hide_System_Messages": "Sistem İletilerını Gizle",
"Hide_type_messages": "\"{{type}}\" iletilerini gizle",
"How_It_Works": "Nasıl Çalışır",

View File

@ -155,7 +155,6 @@
"Copied_to_clipboard": "复制到剪贴板",
"Copy": "复制",
"Conversation": "对话",
"Permalink": "永久链接",
"Certificate_password": "凭证密码",
"Clear_cache": "清除本机资料",
"Clear_cache_loading": "清除快取",

View File

@ -156,7 +156,6 @@
"Copied_to_clipboard": "複製到剪貼簿",
"Copy": "複製",
"Conversation": "對話",
"Permalink": "永久連結",
"Certificate_password": "憑證密碼",
"Clear_cache": "清除本機資料",
"Clear_cache_loading": "清除快取",
@ -241,6 +240,7 @@
"Forward_to_user": "轉發給使用者",
"Full_table": "點擊以查看完整表格",
"Generate_New_Link": "產生新的連結",
"Get_link": "取得連結",
"Hide_System_Messages": "隱藏系統訊息",
"Hide_type_messages": "隱藏 '{{type}}' 訊息",
"How_It_Works": "運作方式",

View File

@ -298,7 +298,7 @@ describe('Room screen', () => {
});
describe('Message', () => {
it('should copy permalink', async () => {
it('should copy link', async () => {
await element(by[textMatcher](`${data.random}message`))
.atIndex(0)
.longPress();
@ -307,7 +307,7 @@ describe('Room screen', () => {
.withTimeout(2000);
await expect(element(by.id('action-sheet-handle'))).toBeVisible();
await element(by.id('action-sheet-handle')).swipe('up', 'fast', 0.5);
await element(by[textMatcher]('Permalink')).atIndex(0).tap();
await element(by[textMatcher]('Get Link')).atIndex(0).tap();
// TODO: test clipboard
});
it('should copy message', async () => {