From dd0844e200f3d866f502880a0f9e181f33e06056 Mon Sep 17 00:00:00 2001 From: amerkadicE <97883527+amerkadicE@users.noreply.github.com> Date: Wed, 30 Nov 2022 16:34:50 +0100 Subject: [PATCH] Add signature request warning modal (#16225) * Add signature request warning modal Fix e2e tests Fix e2e tests Remove warning message from eth sign request Remove unused locales Fix e2e test Fix e2e test * Run pipeline * Fix locales: ? * Add unit tests --- app/_locales/am/messages.json | 3 - app/_locales/ar/messages.json | 3 - app/_locales/bg/messages.json | 3 - app/_locales/bn/messages.json | 3 - app/_locales/ca/messages.json | 3 - app/_locales/cs/messages.json | 3 - app/_locales/da/messages.json | 3 - app/_locales/de/messages.json | 3 - app/_locales/el/messages.json | 3 - app/_locales/en/messages.json | 9 +- app/_locales/es/messages.json | 3 - app/_locales/es_419/messages.json | 3 - app/_locales/et/messages.json | 3 - app/_locales/fa/messages.json | 3 - app/_locales/fi/messages.json | 3 - app/_locales/fil/messages.json | 3 - app/_locales/fr/messages.json | 3 - app/_locales/he/messages.json | 3 - app/_locales/hi/messages.json | 3 - app/_locales/hn/messages.json | 3 - app/_locales/hr/messages.json | 3 - app/_locales/ht/messages.json | 3 - app/_locales/hu/messages.json | 3 - app/_locales/id/messages.json | 3 - app/_locales/it/messages.json | 3 - app/_locales/ja/messages.json | 3 - app/_locales/kn/messages.json | 3 - app/_locales/ko/messages.json | 3 - app/_locales/lt/messages.json | 3 - app/_locales/lv/messages.json | 3 - app/_locales/ms/messages.json | 3 - app/_locales/nl/messages.json | 3 - app/_locales/no/messages.json | 3 - app/_locales/ph/messages.json | 3 - app/_locales/pl/messages.json | 3 - app/_locales/pt/messages.json | 3 - app/_locales/pt_BR/messages.json | 3 - app/_locales/ro/messages.json | 3 - app/_locales/ru/messages.json | 3 - app/_locales/sk/messages.json | 3 - app/_locales/sl/messages.json | 3 - app/_locales/sr/messages.json | 3 - app/_locales/sv/messages.json | 3 - app/_locales/sw/messages.json | 3 - app/_locales/ta/messages.json | 3 - app/_locales/th/messages.json | 3 - app/_locales/tl/messages.json | 3 - app/_locales/tr/messages.json | 3 - app/_locales/uk/messages.json | 3 - app/_locales/vi/messages.json | 3 - app/_locales/zh_CN/messages.json | 3 - app/_locales/zh_TW/messages.json | 3 - test/e2e/tests/eth-sign.spec.js | 4 +- ui/components/app/app-components.scss | 1 + .../signature-request-original.test.js.snap | 9 +- .../app/signature-request-original/index.scss | 4 - .../index.js | 1 + .../index.scss | 27 +++++ .../signature-request-original-warning.js | 113 ++++++++++++++++++ .../signature-request-original.component.js | 102 ++++++++++------ .../signature-request-original.test.js | 51 ++++++-- 61 files changed, 259 insertions(+), 215 deletions(-) create mode 100644 ui/components/app/signature-request-original/signature-request-original-warning/index.js create mode 100644 ui/components/app/signature-request-original/signature-request-original-warning/index.scss create mode 100644 ui/components/app/signature-request-original/signature-request-original-warning/signature-request-original-warning.js diff --git a/app/_locales/am/messages.json b/app/_locales/am/messages.json index 569051949..eedc83dc1 100644 --- a/app/_locales/am/messages.json +++ b/app/_locales/am/messages.json @@ -810,9 +810,6 @@ "sign": { "message": "ፈርም" }, - "signNotice": { - "message": "ይህን መልዕክት መፈረም አደገኛ ውጤቶች \nሊኖሩት ይችላሉ። በሙሉ መለያዎ ሙሉ በሙሉ ከሚያምኗቸው\nድረ ገጾች የሚመጡ መልዕክቶችን ብቻ ይፈርሙ።\nይህ አደገኛ ዘዴ ከወደፊት ስሪት ይወገዳል።" - }, "signatureRequest": { "message": "የፊርማ ጥያቄ" }, diff --git a/app/_locales/ar/messages.json b/app/_locales/ar/messages.json index f06f120ba..4167cd899 100644 --- a/app/_locales/ar/messages.json +++ b/app/_locales/ar/messages.json @@ -826,9 +826,6 @@ "sign": { "message": "توقيع" }, - "signNotice": { - "message": "توقيع هذه الرسالة يمكن أن يكون له\nآثار جانبية خطيرة. قم فقط بتوقيع الرسائل من\nالمواقع التي تثق بها تماماً في التعامل مع حسابك بالكامل.\n  ستتم إزالة هذه الطريقة الخطيرة في إصدار مستقبلي." - }, "signatureRequest": { "message": "طلب التوقيع" }, diff --git a/app/_locales/bg/messages.json b/app/_locales/bg/messages.json index 3de720189..d89764d36 100644 --- a/app/_locales/bg/messages.json +++ b/app/_locales/bg/messages.json @@ -821,9 +821,6 @@ "sign": { "message": "Подпис" }, - "signNotice": { - "message": "Подписването на това съобщение може да има\nопасни странични ефекти. Подписвайте само съобщения от\nсайтове, на които имате пълно доверие с целия си акаунт.\nТози опасен метод ще бъде премахнат в бъдеща версия." - }, "signatureRequest": { "message": "Заявка за подпис" }, diff --git a/app/_locales/bn/messages.json b/app/_locales/bn/messages.json index 5df4a9ba7..0a7e588cd 100644 --- a/app/_locales/bn/messages.json +++ b/app/_locales/bn/messages.json @@ -825,9 +825,6 @@ "sign": { "message": "স্বাক্ষর করুন" }, - "signNotice": { - "message": "এই বার্তাটিতে সাইন আইন করার \nবিপজ্জনক পার্শ্ব প্রতিক্রিয়া থাকতে পারে। আপনি সম্পূর্ণ বিশ্বাস করেন শুধুমাত্র সেই \nসাইটের থেকে আসা বার্তাগুলিতেই আপনার সামগ্রিক অ্যাকাউন্টের মাধ্যমে সাইন করুন।\n এই বিপজ্জনক পদ্ধতিটি পরবর্তী সংস্করণে অপসারণ করা হবে। " - }, "signatureRequest": { "message": "স্বাক্ষরের অনুরোধ" }, diff --git a/app/_locales/ca/messages.json b/app/_locales/ca/messages.json index 1c3c0f055..2ecc619dd 100644 --- a/app/_locales/ca/messages.json +++ b/app/_locales/ca/messages.json @@ -803,9 +803,6 @@ "sign": { "message": "Signar" }, - "signNotice": { - "message": "Signar aquest missatge pot tenir efectes secundaris perillosos. Signa només els missatges de llocs en els quals confiïs plenament amb la totalitat del teu compte. Aquest mètode perillós serà retirat en versions posteriors." - }, "signatureRequest": { "message": "Sol·licitud de Signatura" }, diff --git a/app/_locales/cs/messages.json b/app/_locales/cs/messages.json index 35146b89f..06ebb3026 100644 --- a/app/_locales/cs/messages.json +++ b/app/_locales/cs/messages.json @@ -334,9 +334,6 @@ "sign": { "message": "Podepsat" }, - "signNotice": { - "message": "Podepsání zprávy může mít \nnebezpečný vedlejší učinek. Podepisujte zprávy pouze ze \nstránek, kterým plně důvěřujete celým svým účtem.\n Tato nebezpečná metoda bude odebrána v budoucí verzi. " - }, "signatureRequest": { "message": "Požadavek podpisu" }, diff --git a/app/_locales/da/messages.json b/app/_locales/da/messages.json index 762aab73d..4343361f5 100644 --- a/app/_locales/da/messages.json +++ b/app/_locales/da/messages.json @@ -803,9 +803,6 @@ "sign": { "message": "Underskriv" }, - "signNotice": { - "message": "Underskrivning af denne besked kan have farlige sideeffekter. Skriv kun under på beskeder fra sider, du har fuld tillid til med hele din konto.\nDenne farlige metode bliver fjernet i en fremtidig version." - }, "signatureRequest": { "message": "Signaturforespørgsel" }, diff --git a/app/_locales/de/messages.json b/app/_locales/de/messages.json index 42aa54bfd..2cd0bb066 100644 --- a/app/_locales/de/messages.json +++ b/app/_locales/de/messages.json @@ -3139,9 +3139,6 @@ "sign": { "message": "Unterschreiben" }, - "signNotice": { - "message": "Das Unterschreiben dieser Nachricht kann gefährliche Nebeneffekte haben. Bitte nur Nachrichten von Webseiten unterschreiben denen du deinen vollständigen Account anvertrauen würdest. Diese gefährliche Variante wird in zukünftigen Versionen entfernt werden." - }, "signatureRequest": { "message": "Unterschriftsanfrage" }, diff --git a/app/_locales/el/messages.json b/app/_locales/el/messages.json index 51ca24c9d..6aeb29ed9 100644 --- a/app/_locales/el/messages.json +++ b/app/_locales/el/messages.json @@ -3139,9 +3139,6 @@ "sign": { "message": "Υπογραφή" }, - "signNotice": { - "message": "Η υπογραφή αυτού του μηνύματος μπορεί να έχει\nεπικίνδυνες παρενέργειες. Υπογράφετε μηνύματα μόνο από\nτοποθεσίες που εμπιστεύεστε πλήρως με ολόκληρο τον λογαριασμό σας.\n  Αυτή η επικίνδυνη μέθοδος θα καταργηθεί σε μια μελλοντική έκδοση." - }, "signatureRequest": { "message": "Αίτημα Υπογραφής" }, diff --git a/app/_locales/en/messages.json b/app/_locales/en/messages.json index 2ea13311a..99e5f76b5 100644 --- a/app/_locales/en/messages.json +++ b/app/_locales/en/messages.json @@ -3276,15 +3276,15 @@ "sign": { "message": "Sign" }, - "signNotice": { - "message": "Signing this message can be dangerous. This signature could potentially perform any operation on your account's behalf, including granting complete control of your account and all of its assets to the requesting site. Only sign this message if you know what you're doing or completely trust the requesting site." - }, "signatureRequest": { "message": "Signature request" }, "signatureRequest1": { "message": "Message" }, + "signatureRequestWarning": { + "message": "Signing this message could be dangerous. You may be giving total control of your account and assets to the party on the other end of this message. That means they could drain your account at any time. Proceed with caution. $1." + }, "signed": { "message": "Signed" }, @@ -4484,6 +4484,9 @@ "youSign": { "message": "You are signing" }, + "yourFundsMayBeAtRisk": { + "message": "Your funds may be at risk" + }, "yourPrivateSeedPhrase": { "message": "Your private Secret Recovery Phrase" }, diff --git a/app/_locales/es/messages.json b/app/_locales/es/messages.json index 1737b1fb1..60a9bb372 100644 --- a/app/_locales/es/messages.json +++ b/app/_locales/es/messages.json @@ -3139,9 +3139,6 @@ "sign": { "message": "Firmar" }, - "signNotice": { - "message": "Firmar este mensaje puede tener \nefectos secundarios peligrosos. Firme solo los mensajes de \nsitios en los que confía totalmente con toda su cuenta.\n Este método peligroso se quitará en una versión futura. " - }, "signatureRequest": { "message": "Solicitud de firma" }, diff --git a/app/_locales/es_419/messages.json b/app/_locales/es_419/messages.json index 1051bb56a..06e1ed52c 100644 --- a/app/_locales/es_419/messages.json +++ b/app/_locales/es_419/messages.json @@ -2418,9 +2418,6 @@ "sign": { "message": "Firmar" }, - "signNotice": { - "message": "Firmar este mensaje puede ser peligroso. Esta firma podría realizar potencialmente cualquier operación en nombre de su cuenta, incluida la concesión del control total de tu cuenta y de todos sus activos al sitio solicitante. Solo firme este mensaje si sabe lo que está haciendo o confía plenamente en el sitio solicitante." - }, "signatureRequest": { "message": "Solicitud de firma" }, diff --git a/app/_locales/et/messages.json b/app/_locales/et/messages.json index 3badd5681..64d0fd71a 100644 --- a/app/_locales/et/messages.json +++ b/app/_locales/et/messages.json @@ -815,9 +815,6 @@ "sign": { "message": "Allkirjasta" }, - "signNotice": { - "message": "Selle sõnumi allkirjastamisel \nvõib olla ohtlikke kõrvaltoimeid. Allkirjastage sõnumeid vaid \nsaitidelt, mida te kogu kontoga usaldate.\n See ohtlik meetod eemaldatakse uues versioonis." - }, "signatureRequest": { "message": "Allkirja taotlus" }, diff --git a/app/_locales/fa/messages.json b/app/_locales/fa/messages.json index c154b4cff..50ef3b2ab 100644 --- a/app/_locales/fa/messages.json +++ b/app/_locales/fa/messages.json @@ -825,9 +825,6 @@ "sign": { "message": "علامت" }, - "signNotice": { - "message": "علامت کردن این پیام میتواند\nعوارض جانبی داشته باشد. تنها پیام های را که\nاز سایت های که کاملًا اعتماد داشته باشید با حساب خود علامت بزنید.\nاین روش خطرناک در نسخه آینده از بین برده خواهد شد." - }, "signatureRequest": { "message": "درخواست امضاء" }, diff --git a/app/_locales/fi/messages.json b/app/_locales/fi/messages.json index 3d623bfaa..7493e4c62 100644 --- a/app/_locales/fi/messages.json +++ b/app/_locales/fi/messages.json @@ -822,9 +822,6 @@ "sign": { "message": "Allekirjoita" }, - "signNotice": { - "message": "Tämän viestin allekirjoittamisella voi olla\nvaarallisia sivuvaikutuksia. Allekirjoita viestejä ainoastaan\nsivustoilta, joihin luotat täysin koko tililläsi.\n Tällainen vaarallinen menetelmä poistetaan tulevista versioista." - }, "signatureRequest": { "message": "Allekirjoitus pyydetään" }, diff --git a/app/_locales/fil/messages.json b/app/_locales/fil/messages.json index b357f4547..ed0f56bd7 100644 --- a/app/_locales/fil/messages.json +++ b/app/_locales/fil/messages.json @@ -749,9 +749,6 @@ "sign": { "message": "I-sign" }, - "signNotice": { - "message": "Kapag na-sign ang mensaheng ito, maaaring magkaroon \nng mapapanganib na side effect. Mag-sign lang ng mga mensaheng mula \nsa mga site na ganap mong pinagkakatiwalaang gumamit sa iyong account.\n Isa itong mapanganib na method na aalisin sa isang bersyon sa hinaharap. " - }, "signed": { "message": "Na-sign" }, diff --git a/app/_locales/fr/messages.json b/app/_locales/fr/messages.json index 4207d700a..505b366fd 100644 --- a/app/_locales/fr/messages.json +++ b/app/_locales/fr/messages.json @@ -3139,9 +3139,6 @@ "sign": { "message": "Signer" }, - "signNotice": { - "message": "La signature de ce message peut avoir des effets secondaires dangereux, interférant en votre nom via le contrôle de votre compte et de ses actifs par le site demandeur. Signez uniquement les messages de sites auxquels vous faites entièrement confiance." - }, "signatureRequest": { "message": "Demande de Signature" }, diff --git a/app/_locales/he/messages.json b/app/_locales/he/messages.json index 4ea03d383..967668e39 100644 --- a/app/_locales/he/messages.json +++ b/app/_locales/he/messages.json @@ -822,9 +822,6 @@ "sign": { "message": "חתימה" }, - "signNotice": { - "message": "לחתימה על הודעה זו יכולות להיות תוצאות לוואי מסוכנות. מומלץ לחתום רק הודעות מאתרים שיש לך אמון מלא בהם והפקדת את כל החשבון שלך בידיהם. השיטה המסוכנת תוסר בגרסה עתידית." - }, "signatureRequest": { "message": "בקשת חתימה" }, diff --git a/app/_locales/hi/messages.json b/app/_locales/hi/messages.json index 21bf38605..dcf55c173 100644 --- a/app/_locales/hi/messages.json +++ b/app/_locales/hi/messages.json @@ -3139,9 +3139,6 @@ "sign": { "message": "हस्ताक्षर करें" }, - "signNotice": { - "message": "इस संदेश पर हस्ताक्षर करना खतरनाक हो सकता है। यह हस्ताक्षर संभावित रूप से आपके खाते की ओर से कोई भी संचालन कर सकता है, जिसमें अनुरोध करने वाली साइट को आपके खाते और उसकी सभी संपत्तियों पर पूर्ण नियंत्रण प्रदान करना शामिल है। इस संदेश पर केवल तभी हस्ताक्षर करें जब आप जानते हों कि आप क्या कर रहे हैं या अनुरोध करने वाली साइट पर पूरा भरोसा है" - }, "signatureRequest": { "message": "हस्ताक्षर का अनुरोध" }, diff --git a/app/_locales/hn/messages.json b/app/_locales/hn/messages.json index 8e42dd052..84a330cec 100644 --- a/app/_locales/hn/messages.json +++ b/app/_locales/hn/messages.json @@ -308,9 +308,6 @@ "sign": { "message": "हस्ताक्षर" }, - "signNotice": { - "message": "इस संदेश पर हस्ताक्षर करने से \n साइड इफेक्ट हो सकते हैं। \n केवल अपने पूरे खाते के साथ पूरी तरह से भरोसेमंद \n साइटों से संदेश पर हस्ताक्षर करें। \n यह खतरनाक विधि भविष्य के संस्करण में निकाल दी जाएगी।" - }, "stateLogs": { "message": "स्थिति संदेश" }, diff --git a/app/_locales/hr/messages.json b/app/_locales/hr/messages.json index 253993929..b70742173 100644 --- a/app/_locales/hr/messages.json +++ b/app/_locales/hr/messages.json @@ -818,9 +818,6 @@ "sign": { "message": "Potpis" }, - "signNotice": { - "message": "Potpisivanje ove poruke može\nimati opasne neželjene učinke. Samo potpisujte poruke\ns mrežnih mjesta u koja imate potpuno povjerenje kada je riječ o vašem cijelom računu.\nOvaj se opasni način uklanja u sljedećoj inačici." - }, "signatureRequest": { "message": "Zahtjev za potpisom" }, diff --git a/app/_locales/ht/messages.json b/app/_locales/ht/messages.json index 815e89d26..5e7a30150 100644 --- a/app/_locales/ht/messages.json +++ b/app/_locales/ht/messages.json @@ -536,9 +536,6 @@ "sign": { "message": "Siyen" }, - "signNotice": { - "message": "Lè w siyen mesaj sa a ka gen efè segondè ki \ndanjere. Sèlman \nsit mesaj ki soti nan sit ou konplètman fè konfyans ak tout kont ou. \n Metòd danjere sa yo pral retire nan yon vèsyon fiti. " - }, "signatureRequest": { "message": "Siyati Mande" }, diff --git a/app/_locales/hu/messages.json b/app/_locales/hu/messages.json index dfcec73f3..1dd7c9171 100644 --- a/app/_locales/hu/messages.json +++ b/app/_locales/hu/messages.json @@ -818,9 +818,6 @@ "sign": { "message": "Aláír" }, - "signNotice": { - "message": "Az üzenet aláírása veszélyes következményekkel járhat. Csak olyan webhely üzenetét írja alá, amelyben teljes mértékben és a teljes fiókjával megbízik. Ezt a veszélyes módszert egy későbbi verzióból eltávolítjuk." - }, "signatureRequest": { "message": "Aláírási kérelem" }, diff --git a/app/_locales/id/messages.json b/app/_locales/id/messages.json index b96e385c9..a7cfc0788 100644 --- a/app/_locales/id/messages.json +++ b/app/_locales/id/messages.json @@ -3139,9 +3139,6 @@ "sign": { "message": "Tanda tangan" }, - "signNotice": { - "message": "Menandatangani pesan ini bisa berakibat fatal. Tanda tangan ini berpotensi melakukan operasi atas nama akun Anda, termasuk memberikan kendali penuh atas akun Anda dan semua asetnya ke situs yang meminta tindakan ini. Hanya tanda tangani pesan ini jika Anda tahu apa yang Anda lakukan atau sepenuhnya memercayai situs yang meminta." - }, "signatureRequest": { "message": "Permintaan tanda tangan" }, diff --git a/app/_locales/it/messages.json b/app/_locales/it/messages.json index 02235aa3f..0d3208f43 100644 --- a/app/_locales/it/messages.json +++ b/app/_locales/it/messages.json @@ -1787,9 +1787,6 @@ "sign": { "message": "Firma" }, - "signNotice": { - "message": "Firmare questo messaggio può avere effetti collaterali pericolosi. \nFirma messaggi da siti di cui ti fidi totalmente. \nQuesto metodo pericoloso sarà rimosso in versioni future." - }, "signatureRequest": { "message": "Firma Richiesta" }, diff --git a/app/_locales/ja/messages.json b/app/_locales/ja/messages.json index 0cd2ad431..ebd9cfe7c 100644 --- a/app/_locales/ja/messages.json +++ b/app/_locales/ja/messages.json @@ -3139,9 +3139,6 @@ "sign": { "message": "署名" }, - "signNotice": { - "message": "このメッセージに署名すると、危険な可能性があります。この署名により、要求しているサイトへのアカウントやアカウントのアセットの完全な管理権の付与を含め、アカウントに代わり操作が行われる可能性があります。完全に状況を把握している場合、または要求しているサイトを完全に信頼している場合を除き、このメッセージには署名しないでください。" - }, "signatureRequest": { "message": "署名の要求" }, diff --git a/app/_locales/kn/messages.json b/app/_locales/kn/messages.json index 4ffb4e464..2a8d9966a 100644 --- a/app/_locales/kn/messages.json +++ b/app/_locales/kn/messages.json @@ -825,9 +825,6 @@ "sign": { "message": "ಸಹಿ" }, - "signNotice": { - "message": "ಈ ಸಂದೇಶಕ್ಕೆ ಸಹಿ ಮಾಡುವಿಕೆಯು \nಅಪಾಯಕಾರಿ ಅಡ್ಡಪರಿಣಾಮಗಳನ್ನು ಹೊಂದಿರಬಹುದು. ನಿಮ್ಮ ಸಂಪೂರ್ಣ ಖಾತೆಯೊಂದಿಗೆ ನೀವು ಸಂಪೂರ್ಣವಾಗಿ ನಂಬುವ ಸೈಟ್‌ಗಳಿಂದ\nಮಾತ್ರ ಸಂದೇಶಗಳಿಗೆ ಸಹಿ ಮಾಡಿ.\nಭವಿಷ್ಯದ ಆವೃತ್ತಿಯಲ್ಲಿ ಈ ಅಪಾಯಕಾರಿ ವಿಧಾನವನ್ನು ತೆಗೆದುಹಾಕಲಾಗುತ್ತದೆ." - }, "signatureRequest": { "message": "ಸಹಿಯ ವಿನಂತಿ" }, diff --git a/app/_locales/ko/messages.json b/app/_locales/ko/messages.json index ca183dfdc..54fdd8d8f 100644 --- a/app/_locales/ko/messages.json +++ b/app/_locales/ko/messages.json @@ -3139,9 +3139,6 @@ "sign": { "message": "서명" }, - "signNotice": { - "message": "본 메시지에 서명하는 행위는 위험의 가능성을 내포하고 있습니다. 본 서명을 이용하여 사이트에 요청하면 귀하의 계정 및 모든 자산에 대해 완전한 권한을 부여함은 물론 귀하의 계정과 관련된 실질적 모든 작업을 수행할 가능성이 있기 때문입니다. 완전히 신뢰할 수 있는 사이트에서 확실한 작업을 수행할 경우에만 본 메시지에 서명하십시오." - }, "signatureRequest": { "message": "서명 요청" }, diff --git a/app/_locales/lt/messages.json b/app/_locales/lt/messages.json index 18227752e..97e1e65ef 100644 --- a/app/_locales/lt/messages.json +++ b/app/_locales/lt/messages.json @@ -825,9 +825,6 @@ "sign": { "message": "Prisijunkite" }, - "signNotice": { - "message": "Pasirašant šį pranešimą gali būti \npavojingų šalutinių efektų. Pasirašykite tik pranešimus iš vietų,\nkuriomis visiškai pasitikite su visomis savo paskyromis.\nŠis pavojingas būdas bus pašalintas ateities versijoje. " - }, "signatureRequest": { "message": "Parašo užklausa" }, diff --git a/app/_locales/lv/messages.json b/app/_locales/lv/messages.json index 745aef836..f93d90ee8 100644 --- a/app/_locales/lv/messages.json +++ b/app/_locales/lv/messages.json @@ -821,9 +821,6 @@ "sign": { "message": "Parakstīt" }, - "signNotice": { - "message": "Šī ziņojuma parakstīšana var radīt \nbīstamas blaknes. Parakstiet tikai tādus ziņojumus,\nkuriem pilnībā uzticaties ar savu konta informāciju.\n Turpmākajās versijās šī bīstamā metode tiks noņemta. " - }, "signatureRequest": { "message": "Paraksta pieprasījums" }, diff --git a/app/_locales/ms/messages.json b/app/_locales/ms/messages.json index 81b001a71..c53fcdd57 100644 --- a/app/_locales/ms/messages.json +++ b/app/_locales/ms/messages.json @@ -805,9 +805,6 @@ "sign": { "message": "Tandatangan" }, - "signNotice": { - "message": "Menandatangani mesej ini boleh menyebabkan kesan sampingan yang berbahaya. Hanya tandatangan mesej daripada tapak yang anda percayai sepenuhnya dengan seluruh akaun anda. Kaedah berbahaya ini akan dibuang dalam versi akan datang." - }, "signatureRequest": { "message": "Permintaan Tandatangan" }, diff --git a/app/_locales/nl/messages.json b/app/_locales/nl/messages.json index 085ef891d..af77e0c55 100644 --- a/app/_locales/nl/messages.json +++ b/app/_locales/nl/messages.json @@ -298,9 +298,6 @@ "sign": { "message": "Teken" }, - "signNotice": { - "message": "Het ondertekenen van dit bericht kan hebben \ngevaarlijke bijwerkingen. Meld alleen berichten van \nsites die u volledig vertrouwt met uw volledige account.\n Deze gevaarlijke methode wordt in een toekomstige versie verwijderd." - }, "signatureRequest": { "message": "Ondertekeningsverzoek" }, diff --git a/app/_locales/no/messages.json b/app/_locales/no/messages.json index 06b98d531..212ed5088 100644 --- a/app/_locales/no/messages.json +++ b/app/_locales/no/messages.json @@ -809,9 +809,6 @@ "sign": { "message": "Undertegn" }, - "signNotice": { - "message": "Signering av denne meldingen kan ha\nfarlige konsekvenser. Signér kun meldinger fra\nnettsteder du stoler fullt og helt på med hele kontoen din. Denne farlige metoden vil bli fjernet i en fremtidig versjon." - }, "signatureRequest": { "message": "Signaturforespørsel" }, diff --git a/app/_locales/ph/messages.json b/app/_locales/ph/messages.json index f1a2bc71f..c605c3d51 100644 --- a/app/_locales/ph/messages.json +++ b/app/_locales/ph/messages.json @@ -1552,9 +1552,6 @@ "sign": { "message": "Lumagda" }, - "signNotice": { - "message": "Puwedeng may mga \nmapanganib na side effect ang paglagda sa mensaheng ito. Lagdaan lang ang mga mensahe mula sa \nmga site na pinagkakatiwalaan mo para sa buong account mo.\n Aalisin ang mapanganib na paraang ito sa bersyon sa hinaharap. " - }, "signatureRequest": { "message": "Request ng Signature" }, diff --git a/app/_locales/pl/messages.json b/app/_locales/pl/messages.json index 03929a328..002cc793b 100644 --- a/app/_locales/pl/messages.json +++ b/app/_locales/pl/messages.json @@ -819,9 +819,6 @@ "sign": { "message": "Podpisz" }, - "signNotice": { - "message": "Podpisanie tej wiadomości może mieć \nniebezpieczne skutki uboczne. Podpisuj wiadomości \ntylko ze stron, którym chcesz udostępnić swoje konto.\nTa niebezpieczna metoda będzie usunięta w przyszłych wersjach. " - }, "signatureRequest": { "message": "Prośba o podpis" }, diff --git a/app/_locales/pt/messages.json b/app/_locales/pt/messages.json index 122d69b45..b92986cd2 100644 --- a/app/_locales/pt/messages.json +++ b/app/_locales/pt/messages.json @@ -3139,9 +3139,6 @@ "sign": { "message": "Assinar" }, - "signNotice": { - "message": "Assinar esta mensagem pode ter \nefeitos laterais perigosos. Apenas assine mensagens de sites que \ntotalmente confia com a sua conta total.\n Este método perigoso será removido numa versão posterior." - }, "signatureRequest": { "message": "Pedido de assinatura" }, diff --git a/app/_locales/pt_BR/messages.json b/app/_locales/pt_BR/messages.json index 0f4b63ef3..decaf2f96 100644 --- a/app/_locales/pt_BR/messages.json +++ b/app/_locales/pt_BR/messages.json @@ -2402,9 +2402,6 @@ "sign": { "message": "Assinar" }, - "signNotice": { - "message": "Assinar essa mensagem pode ser perigoso. Essa assinatura pode potencialmente realizar qualquer operação em seu nome, incluindo a concessão do controle total da sua conta e de todos os seus ativos ao site solicitante. Apenas assine essa mensagem se você sabe o que está fazendo ou se confia plenamente no site solicitante." - }, "signatureRequest": { "message": "Solicitação de assinatura" }, diff --git a/app/_locales/ro/messages.json b/app/_locales/ro/messages.json index cfe91a352..0496b4535 100644 --- a/app/_locales/ro/messages.json +++ b/app/_locales/ro/messages.json @@ -812,9 +812,6 @@ "sign": { "message": "Semnați" }, - "signNotice": { - "message": "Semnarea acestui mesaj poate avea efecte secundare periculoase. Semnați mesajele numai de pe site-urile în care aveți încredere deplină să vă acceseze întregul cont. Această metodă periculoasă va fi eliminată într-o versiune viitoare." - }, "signatureRequest": { "message": "Cerere semnătură" }, diff --git a/app/_locales/ru/messages.json b/app/_locales/ru/messages.json index b354c2f9b..2e79fe002 100644 --- a/app/_locales/ru/messages.json +++ b/app/_locales/ru/messages.json @@ -3139,9 +3139,6 @@ "sign": { "message": "Подписать" }, - "signNotice": { - "message": "Подписание этого сообщения может быть опасным. Эта подпись потенциально позволяет выполнить любую операцию от имени вашего счета, включая предоставление полного контроля над вашим счетом и всеми его активами запрашивающему сайту. Подписывайте это сообщение, только если вы знаете, что делаете, или полностью доверяете запрашивающему сайту." - }, "signatureRequest": { "message": "Запрос подписи" }, diff --git a/app/_locales/sk/messages.json b/app/_locales/sk/messages.json index 2f4fb2e9a..b4a44465e 100644 --- a/app/_locales/sk/messages.json +++ b/app/_locales/sk/messages.json @@ -797,9 +797,6 @@ "sign": { "message": "Podepsat" }, - "signNotice": { - "message": "Podepsání zprávy může mít \nnebezpečný vedlejší učinek. Podepisujte zprávy pouze ze \nstránek, kterým plně důvěřujete celým svým účtem.\n Tato nebezpečná metoda bude odebrána v budoucí verzi. " - }, "signatureRequest": { "message": "Požadavek podpisu" }, diff --git a/app/_locales/sl/messages.json b/app/_locales/sl/messages.json index f3fd82b89..abc1d93d3 100644 --- a/app/_locales/sl/messages.json +++ b/app/_locales/sl/messages.json @@ -813,9 +813,6 @@ "sign": { "message": "Podpiši" }, - "signNotice": { - "message": "To podpisovanje lahko povzroči \nnevarne stranske učinke. Podpisujte samo sporočila \nstrani, ki jim zaupate s svojim celotnim računom.\n Ta nevarna funkcija bo odstranjena v prihodnji različici. " - }, "signatureRequest": { "message": "Zahteva za podpis" }, diff --git a/app/_locales/sr/messages.json b/app/_locales/sr/messages.json index c51f8d3a9..c422416ec 100644 --- a/app/_locales/sr/messages.json +++ b/app/_locales/sr/messages.json @@ -816,9 +816,6 @@ "sign": { "message": "Potpišite" }, - "signNotice": { - "message": "Potpisivanje ove poruke može imati \nopasne neželjene efekte. Potpisujte samo poruke sa \nsajtova u koje imate potpuno poverenje u pogledu svog naloga.\n Ovaj opasan metod će biti uklonjen u budućoj verziji." - }, "signatureRequest": { "message": "Zahtev za potpis" }, diff --git a/app/_locales/sv/messages.json b/app/_locales/sv/messages.json index 161261870..a80973dbb 100644 --- a/app/_locales/sv/messages.json +++ b/app/_locales/sv/messages.json @@ -809,9 +809,6 @@ "sign": { "message": "Signera" }, - "signNotice": { - "message": "Att signera det här meddelandet kan få farliga följder. Signera endast meddelanden från sidor du vågar anförtro hela ditt konto åt. Den här farliga metoden kommer att avlägsnas i kommande versioner." - }, "signatureRequest": { "message": "Signaturbegäran" }, diff --git a/app/_locales/sw/messages.json b/app/_locales/sw/messages.json index ac48f06de..22e6a5aa4 100644 --- a/app/_locales/sw/messages.json +++ b/app/_locales/sw/messages.json @@ -803,9 +803,6 @@ "sign": { "message": "Ingia kwenye akaunti" }, - "signNotice": { - "message": "Kusaini ujumbe huu kunaweza kuwa \nmadhara hatari. Saini ujumbe kutoka kwenye\ntovuti unazoziamini kabisa na akaunti yako yote tu.\nNjia hii ya hatari itaondolewa kwenye toleo la baadaye." - }, "signatureRequest": { "message": "Ombi la Saini" }, diff --git a/app/_locales/ta/messages.json b/app/_locales/ta/messages.json index 5c4f63430..3e111ce88 100644 --- a/app/_locales/ta/messages.json +++ b/app/_locales/ta/messages.json @@ -410,9 +410,6 @@ "sign": { "message": "உள்நுழை" }, - "signNotice": { - "message": "இந்த செய்தியில் கையொப்பமிடலாம் \nஆபத்தான பக்க விளைவுகள் இருக்கலாம். \n உங்கள் மொத்த கணக்கில் முழுமையாக நம்பக்கூடிய தளங்களில் செய்திகளை மட்டுமே கையொப்பமிடுங்கள். \n இந்த ஆபத்தான முறை எதிர்கால பதிப்பில் அகற்றப்படும்." - }, "signed": { "message": "கையொப்பமிடப்பட்ட" }, diff --git a/app/_locales/th/messages.json b/app/_locales/th/messages.json index 347176fea..89b070522 100644 --- a/app/_locales/th/messages.json +++ b/app/_locales/th/messages.json @@ -404,9 +404,6 @@ "sign": { "message": "เซ็นชื่อ" }, - "signNotice": { - "message": "การเซ็นชื่อในข้อความนี้อาจจะเป็นอันตรายได้ \nเซ็นชื่อเฉพาะข้อความจากแหล่งที่คุณไว้วางใจได้จริง ๆ เท่านั้น \nวิธีที่อันตรายนี้จะถูกลบออกในอนาคต" - }, "signatureRequest": { "message": "ขอลายเซ็น" }, diff --git a/app/_locales/tl/messages.json b/app/_locales/tl/messages.json index a5167c5c9..9ed06fc11 100644 --- a/app/_locales/tl/messages.json +++ b/app/_locales/tl/messages.json @@ -3139,9 +3139,6 @@ "sign": { "message": "Lumagda" }, - "signNotice": { - "message": "Maaaring may mga \nmapanganib na side effect ang paglagda sa mensaheng ito. Lagdaan lang ang mga mensahe mula sa \nmga site na pinagkakatiwalaan mo para sa buong account mo.\n Tatanggalin ang mapanganib na paraang ito sa bersyon sa hinaharap." - }, "signatureRequest": { "message": "Request na Paglagda" }, diff --git a/app/_locales/tr/messages.json b/app/_locales/tr/messages.json index 71d8b4c85..57de8e9d6 100644 --- a/app/_locales/tr/messages.json +++ b/app/_locales/tr/messages.json @@ -3139,9 +3139,6 @@ "sign": { "message": "İmza" }, - "signNotice": { - "message": "Bu mesajı imzalamak tehlikeli olabilir. Bu imza, hesabınızın tüm kontrolünü ve tüm varlıklarını talepte bulunan siteye vermek de dahil olmak üzere hesabınızın adına potansiyel olarak herhangi bir işlem gerçekleştirebilir. Sadece ne yaptığınızı biliyorsanız veya talepte bulunan siteye tamamen güveniyorsanız bu mesajı imzalayın." - }, "signatureRequest": { "message": "İmza Talebi" }, diff --git a/app/_locales/uk/messages.json b/app/_locales/uk/messages.json index 14a340c55..50ae1ec26 100644 --- a/app/_locales/uk/messages.json +++ b/app/_locales/uk/messages.json @@ -825,9 +825,6 @@ "sign": { "message": "Підписати" }, - "signNotice": { - "message": "Підписування цього повідомлення може мати небезпечний побічний ефект. Підписуйте тільки повідомлення від сайтів, яким ви повністю довіряєте весь ваш обліковий запис. Цей небезпечний метод буде усунуто у майбутній версії." - }, "signatureRequest": { "message": "Запит підпису" }, diff --git a/app/_locales/vi/messages.json b/app/_locales/vi/messages.json index f50799c83..9f930e022 100644 --- a/app/_locales/vi/messages.json +++ b/app/_locales/vi/messages.json @@ -3139,9 +3139,6 @@ "sign": { "message": "Ký" }, - "signNotice": { - "message": "Việc ký vào thông báo này có thể gây nguy hiểm. Chữ ký này có thể được dùng để thực hiện bất kỳ hành động nào thay mặt cho tài khoản của bạn, bao gồm cả cấp toàn quyền kiểm soát tài khoản và tất cả tài sản bên trong cho trang web yêu cầu. Chỉ ký vào thông báo này nếu bạn biết mình đang làm gì hoặc hoàn toàn tin tưởng trang web yêu cầu." - }, "signatureRequest": { "message": "Yêu cầu chữ ký" }, diff --git a/app/_locales/zh_CN/messages.json b/app/_locales/zh_CN/messages.json index d517d3b2e..47d6a2d92 100644 --- a/app/_locales/zh_CN/messages.json +++ b/app/_locales/zh_CN/messages.json @@ -3139,9 +3139,6 @@ "sign": { "message": "签名" }, - "signNotice": { - "message": "谨慎行事。此操作有可能用来从您的账户提取资产。确保您信任此站点。" - }, "signatureRequest": { "message": "签名请求" }, diff --git a/app/_locales/zh_TW/messages.json b/app/_locales/zh_TW/messages.json index 19e8a579b..bb85c6027 100644 --- a/app/_locales/zh_TW/messages.json +++ b/app/_locales/zh_TW/messages.json @@ -1441,9 +1441,6 @@ "sign": { "message": "簽署" }, - "signNotice": { - "message": "簽署此訊息可能會產生危險的副作用。\n請只從您完全信任的網站上簽署。\n這種危險的方法將在未來的版本中被移除。" - }, "signatureRequest": { "message": "請求簽署" }, diff --git a/test/e2e/tests/eth-sign.spec.js b/test/e2e/tests/eth-sign.spec.js index 5bd90cea6..58c3e6114 100644 --- a/test/e2e/tests/eth-sign.spec.js +++ b/test/e2e/tests/eth-sign.spec.js @@ -55,7 +55,9 @@ describe('Eth sign', function () { assert.equal(personalMessage, expectedPersonalMessage); await driver.clickElement('[data-testid="request-signature__sign"]'); - + await driver.clickElement( + '.signature-request-warning__footer__sign-button', + ); // Switch to the Dapp await driver.waitUntilXWindowHandles(2); windowHandles = await driver.getAllWindowHandles(); diff --git a/ui/components/app/app-components.scss b/ui/components/app/app-components.scss index 0b457c66c..303b045e2 100644 --- a/ui/components/app/app-components.scss +++ b/ui/components/app/app-components.scss @@ -63,6 +63,7 @@ @import 'signature-request/index'; @import 'signature-request-siwe/index'; @import 'signature-request-original/index'; +@import 'signature-request-original/signature-request-original-warning/index'; @import 'srp-input/srp-input'; @import 'tab-bar/index'; @import 'token-cell/token-cell'; diff --git a/ui/components/app/signature-request-original/__snapshots__/signature-request-original.test.js.snap b/ui/components/app/signature-request-original/__snapshots__/signature-request-original.test.js.snap index a8967d174..227cf4d2e 100644 --- a/ui/components/app/signature-request-original/__snapshots__/signature-request-original.test.js.snap +++ b/ui/components/app/signature-request-original/__snapshots__/signature-request-original.test.js.snap @@ -143,14 +143,9 @@ exports[`SignatureRequestOriginal should match snapshot 1`] = `
- Signing this message can be dangerous. This signature could potentially perform any operation on your account's behalf, including granting complete control of your account and all of its assets to the requesting site. Only sign this message if you know what you're doing or completely trust the requesting site. - - Learn more - + You are signing:
{ + const t = useI18nContext(); + + return ( + + + + + {t('yourFundsMayBeAtRisk')} + + + + + + + {name} {` (${shortenAddress(senderAddress)})`} + + + + + + {t('signatureRequestWarning', [ + + {t('learnMoreUpperCase')} + , + ])} + + + + + + + + ); +}; + +SignatureRequestOriginalWarning.propTypes = { + senderAddress: PropTypes.string, + name: PropTypes.string, + onSubmit: PropTypes.func, + onCancel: PropTypes.func, +}; + +export default SignatureRequestOriginalWarning; diff --git a/ui/components/app/signature-request-original/signature-request-original.component.js b/ui/components/app/signature-request-original/signature-request-original.component.js index 57b3d0e3d..6470cec08 100644 --- a/ui/components/app/signature-request-original/signature-request-original.component.js +++ b/ui/components/app/signature-request-original/signature-request-original.component.js @@ -14,6 +14,7 @@ import { stripHexPrefix } from '../../../../shared/modules/hexstring-utils'; import Button from '../../ui/button'; import SiteIcon from '../../ui/site-icon'; import SiteOrigin from '../../ui/site-origin'; +import SignatureRequestOriginalWarning from './signature-request-original-warning'; export default class SignatureRequestOriginal extends Component { static contextTypes = { @@ -46,6 +47,7 @@ export default class SignatureRequestOriginal extends Component { state = { fromAccount: this.props.fromAccount, + showSignatureRequestWarning: false, }; renderHeader = () => { @@ -195,7 +197,7 @@ export default class SignatureRequestOriginal extends Component { renderBody = () => { let rows; - let notice = `${this.context.t('youSign')}:`; + const notice = `${this.context.t('youSign')}:`; const { txData } = this.props; const { @@ -211,32 +213,13 @@ export default class SignatureRequestOriginal extends Component { rows = data; } else if (type === MESSAGE_TYPE.ETH_SIGN) { rows = [{ name: this.context.t('message'), value: data }]; - notice = this.context.t('signNotice'); } return (
{this.renderAccountInfo()} {this.renderOriginInfo()} -
- {notice} - {type === MESSAGE_TYPE.ETH_SIGN ? ( - { - global.platform.openTab({ - url: 'https://consensys.net/blog/metamask/the-seal-of-approval-know-what-youre-consenting-to-with-permissions-and-approvals-in-metamask/', - }); - }} - > - {this.context.t('learnMoreUpperCase')} - - ) : null} -
+
{notice}
{rows.map(({ name, value }, index) => { if (typeof value === 'boolean') { @@ -258,13 +241,51 @@ export default class SignatureRequestOriginal extends Component { ); }; + onSubmit = async (event) => { + const { clearConfirmTransaction, history, mostRecentOverviewPage, sign } = + this.props; + const { trackEvent, type } = this.context; + + await sign(event); + trackEvent({ + category: EVENT.CATEGORIES.TRANSACTIONS, + event: 'Confirm', + properties: { + action: 'Sign Request', + legacy_event: true, + type, + }, + }); + clearConfirmTransaction(); + history.push(mostRecentOverviewPage); + }; + + onCancel = async (event) => { + const { clearConfirmTransaction, history, mostRecentOverviewPage, cancel } = + this.props; + const { trackEvent, type } = this.context; + + await cancel(event); + trackEvent({ + category: EVENT.CATEGORIES.TRANSACTIONS, + event: 'Cancel', + properties: { + action: 'Sign Request', + legacy_event: true, + type, + }, + }); + clearConfirmTransaction(); + history.push(mostRecentOverviewPage); + }; + renderFooter = () => { const { cancel, + sign, clearConfirmTransaction, history, mostRecentOverviewPage, - sign, txData: { type }, hardwareWalletRequiresConnection, } = this.props; @@ -300,18 +321,22 @@ export default class SignatureRequestOriginal extends Component { className="request-signature__footer__sign-button" disabled={hardwareWalletRequiresConnection} onClick={async (event) => { - await sign(event); - trackEvent({ - category: EVENT.CATEGORIES.TRANSACTIONS, - event: 'Confirm', - properties: { - action: 'Sign Request', - legacy_event: true, - type, - }, - }); - clearConfirmTransaction(); - history.push(mostRecentOverviewPage); + if (type === MESSAGE_TYPE.ETH_SIGN) { + this.setState({ showSignatureRequestWarning: true }); + } else { + await sign(event); + trackEvent({ + category: EVENT.CATEGORIES.TRANSACTIONS, + event: 'Confirm', + properties: { + action: 'Sign Request', + legacy_event: true, + type, + }, + }); + clearConfirmTransaction(); + history.push(mostRecentOverviewPage); + } }} > {t('sign')} @@ -343,6 +368,7 @@ export default class SignatureRequestOriginal extends Component { render = () => { const { messagesCount } = this.props; + const { showSignatureRequestWarning, fromAccount } = this.state; const { t } = this.context; const rejectNText = t('rejectRequestsN', [messagesCount]); return ( @@ -354,6 +380,14 @@ export default class SignatureRequestOriginal extends Component {
) : null} + {showSignatureRequestWarning && ( + await this.onSubmit(event)} + onCancel={async (event) => await this.onCancel(event)} + /> + )} {this.renderFooter()} {messagesCount > 1 ? (