diff --git a/.eslintrc b/.eslintrc index 2082d1ec5..08d8aeb9d 100644 --- a/.eslintrc +++ b/.eslintrc @@ -148,6 +148,7 @@ "operator-linebreak": [2, "after", { "overrides": { "?": "ignore", ":": "ignore" } }], "padded-blocks": "off", "quotes": [2, "single", {"avoidEscape": true, "allowTemplateLiterals": true}], + "react/jsx-boolean-value": 2, "react/jsx-curly-brace-presence": [2, { "props": "never", "children": "never" }], "react/jsx-equals-spacing": 2, "react/no-deprecated": 0, diff --git a/CHANGELOG.md b/CHANGELOG.md index 6efc489d3..02d6a0b64 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,15 @@ ## Current Develop Branch +## 7.6.1 Tue Nov 19 2019 +- [#7475](https://github.com/MetaMask/metamask-extension/pull/7475): Add 'Remind Me Later' to the Maker notification +- [#7436](https://github.com/MetaMask/metamask-extension/pull/7436): Add additional rpcUrl verification +- [#7468](https://github.com/MetaMask/metamask-extension/pull/7468): Show transaction fee units on approve screen + ## 7.6.0 Mon Nov 18 2019 +- [#7450](https://github.com/MetaMask/metamask-extension/pull/7450): Add migration notification for users with non-zero Sai +- [#7461](https://github.com/MetaMask/metamask-extension/pull/7461): Import styles for showing multiple notifications +- [#7451](https://github.com/MetaMask/metamask-extension/pull/7451): Add button disabled when password is empty ## 7.5.3 Fri Nov 15 2019 - [#7412](https://github.com/MetaMask/metamask-extension/pull/7412): lock eth-contract-metadata (#7412) diff --git a/app/_locales/am/messages.json b/app/_locales/am/messages.json index b122b754c..08b237aa0 100644 --- a/app/_locales/am/messages.json +++ b/app/_locales/am/messages.json @@ -1344,7 +1344,7 @@ "updatedWithDate": { "message": "የዘመነ $1" }, - "uriErrorMsg": { + "urlErrorMsg": { "message": "URIs አግባብነት ያለው የ HTTP/HTTPS ቅድመ ቅጥያ ይፈልጋል።" }, "usedByClients": { diff --git a/app/_locales/ar/messages.json b/app/_locales/ar/messages.json index 5d21df192..18b9eafa2 100644 --- a/app/_locales/ar/messages.json +++ b/app/_locales/ar/messages.json @@ -1340,7 +1340,7 @@ "updatedWithDate": { "message": "تم تحديث $1" }, - "uriErrorMsg": { + "urlErrorMsg": { "message": "تتطلب الروابط بادئة HTTP/HTTPS مناسبة." }, "usedByClients": { diff --git a/app/_locales/bg/messages.json b/app/_locales/bg/messages.json index d5ca6f5cb..799214110 100644 --- a/app/_locales/bg/messages.json +++ b/app/_locales/bg/messages.json @@ -1343,7 +1343,7 @@ "updatedWithDate": { "message": "Актуализирано $1 " }, - "uriErrorMsg": { + "urlErrorMsg": { "message": "URI изискват съответния HTTP / HTTPS префикс." }, "usedByClients": { diff --git a/app/_locales/bn/messages.json b/app/_locales/bn/messages.json index 3e7e44e2f..de1c0b6da 100644 --- a/app/_locales/bn/messages.json +++ b/app/_locales/bn/messages.json @@ -1347,7 +1347,7 @@ "updatedWithDate": { "message": "আপডেট করা $1" }, - "uriErrorMsg": { + "urlErrorMsg": { "message": "URI গুলির যথাযথ HTTP/HTTPS প্রেফিক্সের প্রয়োজন।" }, "usedByClients": { diff --git a/app/_locales/ca/messages.json b/app/_locales/ca/messages.json index a31e42357..599cb84ad 100644 --- a/app/_locales/ca/messages.json +++ b/app/_locales/ca/messages.json @@ -1316,7 +1316,7 @@ "updatedWithDate": { "message": "Actualitzat $1" }, - "uriErrorMsg": { + "urlErrorMsg": { "message": "Els URIs requereixen el prefix HTTP/HTTPS apropiat." }, "usedByClients": { diff --git a/app/_locales/cs/messages.json b/app/_locales/cs/messages.json index e3c67c300..cd768d4d8 100644 --- a/app/_locales/cs/messages.json +++ b/app/_locales/cs/messages.json @@ -529,7 +529,7 @@ "unknownNetwork": { "message": "Neznámá soukromá síť" }, - "uriErrorMsg": { + "urlErrorMsg": { "message": "URI vyžadují korektní HTTP/HTTPS prefix." }, "usedByClients": { diff --git a/app/_locales/da/messages.json b/app/_locales/da/messages.json index 1c05509c8..5a2c3c100 100644 --- a/app/_locales/da/messages.json +++ b/app/_locales/da/messages.json @@ -1313,7 +1313,7 @@ "updatedWithDate": { "message": "Opdaterede $1" }, - "uriErrorMsg": { + "urlErrorMsg": { "message": "Links kræver det rette HTTP/HTTPS-præfix." }, "usedByClients": { diff --git a/app/_locales/de/messages.json b/app/_locales/de/messages.json index 79683988b..5f241ab05 100644 --- a/app/_locales/de/messages.json +++ b/app/_locales/de/messages.json @@ -1304,7 +1304,7 @@ "updatedWithDate": { "message": "$1 aktualisiert" }, - "uriErrorMsg": { + "urlErrorMsg": { "message": "URIs benötigen die korrekten HTTP/HTTPS Präfixe." }, "usedByClients": { diff --git a/app/_locales/el/messages.json b/app/_locales/el/messages.json index 860c5a563..126b9133f 100644 --- a/app/_locales/el/messages.json +++ b/app/_locales/el/messages.json @@ -1341,7 +1341,7 @@ "updatedWithDate": { "message": "Ενημερώθηκε το $1" }, - "uriErrorMsg": { + "urlErrorMsg": { "message": "Τα URI απαιτούν το κατάλληλο πρόθεμα HTTP/HTTPS." }, "usedByClients": { diff --git a/app/_locales/en/messages.json b/app/_locales/en/messages.json index 470652fc8..f947c9e5c 100644 --- a/app/_locales/en/messages.json +++ b/app/_locales/en/messages.json @@ -2,6 +2,9 @@ "migrateSai": { "message": "A message from Maker: The new Multi-Collateral Dai token has been released. Your old tokens are now called Sai. Please upgrade your Sai tokens to the new Dai." }, + "migrateSaiInfo": { + "message": "To dismiss this notification you can migrate your tokens or hide SAI from the token list." + }, "migrate": { "message": "Migrate" }, @@ -1474,8 +1477,11 @@ "updatedWithDate": { "message": "Updated $1" }, - "uriErrorMsg": { - "message": "URIs require the appropriate HTTP/HTTPS prefix." + "urlErrorMsg": { + "message": "URLs require the appropriate HTTP/HTTPS prefix." + }, + "urlExistsErrorMsg": { + "message": "URL is already present in existing list of networks" }, "usedByClients": { "message": "Used by a variety of different clients" diff --git a/app/_locales/es/messages.json b/app/_locales/es/messages.json index 1462909d3..e503cd977 100644 --- a/app/_locales/es/messages.json +++ b/app/_locales/es/messages.json @@ -1091,7 +1091,7 @@ "updatedWithDate": { "message": "Actualizado $1" }, - "uriErrorMsg": { + "urlErrorMsg": { "message": "URI necesita el prefijo HTTP/HTTPS apropiado" }, "usedByClients": { diff --git a/app/_locales/es_419/messages.json b/app/_locales/es_419/messages.json index 244eff885..c861be81b 100644 --- a/app/_locales/es_419/messages.json +++ b/app/_locales/es_419/messages.json @@ -1326,7 +1326,7 @@ "updatedWithDate": { "message": "Actualización: $1" }, - "uriErrorMsg": { + "urlErrorMsg": { "message": "Los URI deben tener el prefijo HTTP/HTTPS apropiado." }, "usedByClients": { diff --git a/app/_locales/et/messages.json b/app/_locales/et/messages.json index 79bc3ebd4..c779dff85 100644 --- a/app/_locales/et/messages.json +++ b/app/_locales/et/messages.json @@ -1337,7 +1337,7 @@ "updatedWithDate": { "message": "Värskendatud $1" }, - "uriErrorMsg": { + "urlErrorMsg": { "message": "URI-d nõuavad sobivat HTTP/HTTPS-i prefiksit." }, "usedByClients": { diff --git a/app/_locales/fa/messages.json b/app/_locales/fa/messages.json index 848341941..5e00dde11 100644 --- a/app/_locales/fa/messages.json +++ b/app/_locales/fa/messages.json @@ -1347,7 +1347,7 @@ "updatedWithDate": { "message": "بروزرسانی شد 1$1" }, - "uriErrorMsg": { + "urlErrorMsg": { "message": "URl ها نیازمند پیشوند مناسب HTTP/HTTPS اند." }, "usedByClients": { diff --git a/app/_locales/fi/messages.json b/app/_locales/fi/messages.json index a0a0ebfe2..df4f62a19 100644 --- a/app/_locales/fi/messages.json +++ b/app/_locales/fi/messages.json @@ -1344,7 +1344,7 @@ "updatedWithDate": { "message": "$1 päivitetty" }, - "uriErrorMsg": { + "urlErrorMsg": { "message": "URI:t vaativat asianmukaisen HTTP/HTTPS-etuliitteen." }, "usedByClients": { diff --git a/app/_locales/fil/messages.json b/app/_locales/fil/messages.json index b62df2909..d00726811 100644 --- a/app/_locales/fil/messages.json +++ b/app/_locales/fil/messages.json @@ -1235,7 +1235,7 @@ "updatedWithDate": { "message": "Na-update ang $1" }, - "uriErrorMsg": { + "urlErrorMsg": { "message": "Kinakailangan ng mga URI ang naaangkop na HTTP/HTTPS prefix." }, "usedByClients": { diff --git a/app/_locales/fr/messages.json b/app/_locales/fr/messages.json index b39e6b361..98ae1576b 100644 --- a/app/_locales/fr/messages.json +++ b/app/_locales/fr/messages.json @@ -1308,7 +1308,7 @@ "updatedWithDate": { "message": "Mis à jour $1" }, - "uriErrorMsg": { + "urlErrorMsg": { "message": "Les URLs requièrent un préfixe HTTP/HTTPS approprié." }, "usedByClients": { diff --git a/app/_locales/he/messages.json b/app/_locales/he/messages.json index 64bf6a0a5..41813baf2 100644 --- a/app/_locales/he/messages.json +++ b/app/_locales/he/messages.json @@ -1341,7 +1341,7 @@ "updatedWithDate": { "message": "עודכן $1" }, - "uriErrorMsg": { + "urlErrorMsg": { "message": "כתובות URI דורשות את קידומת HTTP/HTTPS המתאימה." }, "usedByClients": { diff --git a/app/_locales/hi/messages.json b/app/_locales/hi/messages.json index f434c93b1..19834411e 100644 --- a/app/_locales/hi/messages.json +++ b/app/_locales/hi/messages.json @@ -1341,7 +1341,7 @@ "updatedWithDate": { "message": "$1 अपडेट किया गया" }, - "uriErrorMsg": { + "urlErrorMsg": { "message": "URI को उपयुक्त HTTP/HTTPS प्रीफ़िक्स की आवश्यकता होती है।" }, "usedByClients": { diff --git a/app/_locales/hn/messages.json b/app/_locales/hn/messages.json index 471776b02..91d9bde7e 100644 --- a/app/_locales/hn/messages.json +++ b/app/_locales/hn/messages.json @@ -491,7 +491,7 @@ "unknownNetwork": { "message": "अज्ञात निजी नेटवर्क" }, - "uriErrorMsg": { + "urlErrorMsg": { "message": "URI-यूआरआई को उपयुक्त HTTP / HTTPS उपसर्ग की आवश्यकता होती है।" }, "usedByClients": { diff --git a/app/_locales/hr/messages.json b/app/_locales/hr/messages.json index f022f2f80..ba64748c2 100644 --- a/app/_locales/hr/messages.json +++ b/app/_locales/hr/messages.json @@ -1337,7 +1337,7 @@ "updatedWithDate": { "message": "Ažurirano $1" }, - "uriErrorMsg": { + "urlErrorMsg": { "message": "URI-jevima se zahtijeva prikladan prefiks HTTP/HTTPS." }, "usedByClients": { diff --git a/app/_locales/ht/messages.json b/app/_locales/ht/messages.json index 3150cb14c..d973aeef5 100644 --- a/app/_locales/ht/messages.json +++ b/app/_locales/ht/messages.json @@ -851,7 +851,7 @@ "updatedWithDate": { "message": "Mete ajou $1" }, - "uriErrorMsg": { + "urlErrorMsg": { "message": "URIs mande pou apwopriye prefiks HTTP / HTTPS a." }, "usedByClients": { diff --git a/app/_locales/hu/messages.json b/app/_locales/hu/messages.json index 15a03716a..542534f32 100644 --- a/app/_locales/hu/messages.json +++ b/app/_locales/hu/messages.json @@ -1337,7 +1337,7 @@ "updatedWithDate": { "message": "$1 frissítve" }, - "uriErrorMsg": { + "urlErrorMsg": { "message": "Az URI-hez szükség van a megfelelő HTTP/HTTPS előtagra." }, "usedByClients": { diff --git a/app/_locales/id/messages.json b/app/_locales/id/messages.json index f0d55ea8a..252b7ec9f 100644 --- a/app/_locales/id/messages.json +++ b/app/_locales/id/messages.json @@ -1316,7 +1316,7 @@ "updatedWithDate": { "message": "Diperbarui $1" }, - "uriErrorMsg": { + "urlErrorMsg": { "message": "URI memerlukan awalan HTTP/HTTPS yang sesuai." }, "usedByClients": { diff --git a/app/_locales/it/messages.json b/app/_locales/it/messages.json index 57d0c6958..1d0725183 100644 --- a/app/_locales/it/messages.json +++ b/app/_locales/it/messages.json @@ -1307,7 +1307,7 @@ "updatedWithDate": { "message": "Aggiornata $1" }, - "uriErrorMsg": { + "urlErrorMsg": { "message": "Gli URI richiedono un prefisso HTTP/HTTPS." }, "usedByClients": { diff --git a/app/_locales/kn/messages.json b/app/_locales/kn/messages.json index b99bf69d7..7fc114988 100644 --- a/app/_locales/kn/messages.json +++ b/app/_locales/kn/messages.json @@ -1347,7 +1347,7 @@ "updatedWithDate": { "message": "$1 ನವೀಕರಿಸಲಾಗಿದೆ" }, - "uriErrorMsg": { + "urlErrorMsg": { "message": "URI ಗಳಿಗೆ ಸೂಕ್ತವಾದ HTTP/HTTPS ಪೂರ್ವಪ್ರತ್ಯಯದ ಅಗತ್ಯವಿದೆ." }, "usedByClients": { diff --git a/app/_locales/ko/messages.json b/app/_locales/ko/messages.json index 17b327bab..c71e3c267 100644 --- a/app/_locales/ko/messages.json +++ b/app/_locales/ko/messages.json @@ -1338,7 +1338,7 @@ "updatedWithDate": { "message": "$1에 업데이트 됨" }, - "uriErrorMsg": { + "urlErrorMsg": { "message": "URI는 HTTP/HTTPS로 시작해야 합니다." }, "usedByClients": { diff --git a/app/_locales/lt/messages.json b/app/_locales/lt/messages.json index 36e8f52dd..7e029494f 100644 --- a/app/_locales/lt/messages.json +++ b/app/_locales/lt/messages.json @@ -1347,7 +1347,7 @@ "updatedWithDate": { "message": "Atnaujinta $1" }, - "uriErrorMsg": { + "urlErrorMsg": { "message": "URI reikia atitinkamo HTTP/HTTPS priešdėlio." }, "usedByClients": { diff --git a/app/_locales/lv/messages.json b/app/_locales/lv/messages.json index 6261816be..ace47600f 100644 --- a/app/_locales/lv/messages.json +++ b/app/_locales/lv/messages.json @@ -1343,7 +1343,7 @@ "updatedWithDate": { "message": "Atjaunināts $1" }, - "uriErrorMsg": { + "urlErrorMsg": { "message": "URI jāsākas ar atbilstošo HTTP/HTTPS priedēkli." }, "usedByClients": { diff --git a/app/_locales/ms/messages.json b/app/_locales/ms/messages.json index e6227f619..03f9ac0b2 100644 --- a/app/_locales/ms/messages.json +++ b/app/_locales/ms/messages.json @@ -1315,7 +1315,7 @@ "updatedWithDate": { "message": "Dikemaskini $1" }, - "uriErrorMsg": { + "urlErrorMsg": { "message": "URI memerlukan awalan HTTP/HTTPS yang sesuai." }, "usedByClients": { diff --git a/app/_locales/nl/messages.json b/app/_locales/nl/messages.json index 9e5aed56a..ba83e37a1 100644 --- a/app/_locales/nl/messages.json +++ b/app/_locales/nl/messages.json @@ -478,7 +478,7 @@ "unknownNetwork": { "message": "Onbekend privénetwerk" }, - "uriErrorMsg": { + "urlErrorMsg": { "message": "Voor URI's is het juiste HTTP / HTTPS-voorvoegsel vereist." }, "usedByClients": { diff --git a/app/_locales/no/messages.json b/app/_locales/no/messages.json index 51f21abee..83a6f09d3 100644 --- a/app/_locales/no/messages.json +++ b/app/_locales/no/messages.json @@ -1319,7 +1319,7 @@ "updatedWithDate": { "message": "Oppdatert $1" }, - "uriErrorMsg": { + "urlErrorMsg": { "message": "URI-er krever det aktuelle HTTP/HTTPS-prefikset." }, "usedByClients": { diff --git a/app/_locales/pl/messages.json b/app/_locales/pl/messages.json index 47923983d..5ffd5585a 100644 --- a/app/_locales/pl/messages.json +++ b/app/_locales/pl/messages.json @@ -1332,7 +1332,7 @@ "updatedWithDate": { "message": "Zaktualizowano $1" }, - "uriErrorMsg": { + "urlErrorMsg": { "message": "URI wymaga prawidłowego prefiksu HTTP/HTTPS." }, "usedByClients": { diff --git a/app/_locales/pt/messages.json b/app/_locales/pt/messages.json index 5f1d914d5..70c2e52ae 100644 --- a/app/_locales/pt/messages.json +++ b/app/_locales/pt/messages.json @@ -488,7 +488,7 @@ "unknownNetwork": { "message": "Rede Privada Desconhecida" }, - "uriErrorMsg": { + "urlErrorMsg": { "message": "Links requerem o prefixo HTTP/HTTPS apropriado." }, "usedByClients": { diff --git a/app/_locales/pt_BR/messages.json b/app/_locales/pt_BR/messages.json index 0b6963d02..ecb223dcb 100644 --- a/app/_locales/pt_BR/messages.json +++ b/app/_locales/pt_BR/messages.json @@ -1326,7 +1326,7 @@ "updatedWithDate": { "message": "$1 atualizado" }, - "uriErrorMsg": { + "urlErrorMsg": { "message": "URIs exigem o devido prefixo HTTP/HTTPS." }, "usedByClients": { diff --git a/app/_locales/ro/messages.json b/app/_locales/ro/messages.json index 5d81811e9..5fed700da 100644 --- a/app/_locales/ro/messages.json +++ b/app/_locales/ro/messages.json @@ -1328,7 +1328,7 @@ "updatedWithDate": { "message": "Actualizat $1" }, - "uriErrorMsg": { + "urlErrorMsg": { "message": "URL necesită prefixul potrivit HTTP/HTTPS." }, "usedByClients": { diff --git a/app/_locales/ru/messages.json b/app/_locales/ru/messages.json index 328127903..082e450da 100644 --- a/app/_locales/ru/messages.json +++ b/app/_locales/ru/messages.json @@ -542,7 +542,7 @@ "unknownNetwork": { "message": "Неизвестная частная сеть" }, - "uriErrorMsg": { + "urlErrorMsg": { "message": "Для URI требуется соответствующий префикс HTTP/HTTPS." }, "usedByClients": { diff --git a/app/_locales/sk/messages.json b/app/_locales/sk/messages.json index a525b522e..697c58936 100644 --- a/app/_locales/sk/messages.json +++ b/app/_locales/sk/messages.json @@ -1301,7 +1301,7 @@ "updatedWithDate": { "message": "Aktualizované $1" }, - "uriErrorMsg": { + "urlErrorMsg": { "message": "URI vyžadují korektní HTTP/HTTPS prefix." }, "usedByClients": { diff --git a/app/_locales/sl/messages.json b/app/_locales/sl/messages.json index e617d7997..643e62c23 100644 --- a/app/_locales/sl/messages.json +++ b/app/_locales/sl/messages.json @@ -1329,7 +1329,7 @@ "updatedWithDate": { "message": "Posodobljeno $1" }, - "uriErrorMsg": { + "urlErrorMsg": { "message": "URI zahtevajo ustrezno HTTP/HTTPS predpono." }, "usedByClients": { diff --git a/app/_locales/sr/messages.json b/app/_locales/sr/messages.json index 01056d9e3..1cd653ed7 100644 --- a/app/_locales/sr/messages.json +++ b/app/_locales/sr/messages.json @@ -1332,7 +1332,7 @@ "updatedWithDate": { "message": "Ažuriran $1" }, - "uriErrorMsg": { + "urlErrorMsg": { "message": "URI-ovi zahtevaju odgovarajući prefiks HTTP / HTTPS." }, "usedByClients": { diff --git a/app/_locales/sv/messages.json b/app/_locales/sv/messages.json index 67a9fb94b..6d89b6e5c 100644 --- a/app/_locales/sv/messages.json +++ b/app/_locales/sv/messages.json @@ -1322,7 +1322,7 @@ "updatedWithDate": { "message": "Uppdaterat $1" }, - "uriErrorMsg": { + "urlErrorMsg": { "message": "URI:er kräver lämpligt HTTP/HTTPS-prefix." }, "usedByClients": { diff --git a/app/_locales/sw/messages.json b/app/_locales/sw/messages.json index 40aec5547..76d1897ac 100644 --- a/app/_locales/sw/messages.json +++ b/app/_locales/sw/messages.json @@ -1325,7 +1325,7 @@ "updatedWithDate": { "message": "Imesasishwa $1" }, - "uriErrorMsg": { + "urlErrorMsg": { "message": "URI huhitaji kiambishi sahihi cha HTTP/HTTPS." }, "usedByClients": { diff --git a/app/_locales/ta/messages.json b/app/_locales/ta/messages.json index b577fe695..b5be67520 100644 --- a/app/_locales/ta/messages.json +++ b/app/_locales/ta/messages.json @@ -554,7 +554,7 @@ "unknownNetwork": { "message": "அறியப்படாத தனியார் நெட்வொர்க்" }, - "uriErrorMsg": { + "urlErrorMsg": { "message": "URI கள் சரியான HTTP / HTTPS முன்னொட்டு தேவை." }, "usedByClients": { diff --git a/app/_locales/th/messages.json b/app/_locales/th/messages.json index 5f852a932..f5fcf3edf 100644 --- a/app/_locales/th/messages.json +++ b/app/_locales/th/messages.json @@ -656,7 +656,7 @@ "updatedWithDate": { "message": "อัปเดต $1 แล้ว" }, - "uriErrorMsg": { + "urlErrorMsg": { "message": "URI ต้องมีคำนำหน้าเป็น HTTP หรือ HTTPS" }, "usedByClients": { diff --git a/app/_locales/tr/messages.json b/app/_locales/tr/messages.json index dc7ca718f..fe2332f2f 100644 --- a/app/_locales/tr/messages.json +++ b/app/_locales/tr/messages.json @@ -547,7 +547,7 @@ "unknownNetwork": { "message": "Bilinmeyen özel ağ" }, - "uriErrorMsg": { + "urlErrorMsg": { "message": "URIler için HTTP/HTTPS öneki gerekmektedir." }, "usedByClients": { diff --git a/app/_locales/uk/messages.json b/app/_locales/uk/messages.json index 61be52fbe..d269044b3 100644 --- a/app/_locales/uk/messages.json +++ b/app/_locales/uk/messages.json @@ -1347,7 +1347,7 @@ "updatedWithDate": { "message": "Оновлено $1" }, - "uriErrorMsg": { + "urlErrorMsg": { "message": "URIs вимагають відповідного префікса HTTP/HTTPS." }, "usedByClients": { diff --git a/app/_locales/zh_TW/messages.json b/app/_locales/zh_TW/messages.json index c606396a1..501272799 100644 --- a/app/_locales/zh_TW/messages.json +++ b/app/_locales/zh_TW/messages.json @@ -1320,7 +1320,7 @@ "updatedWithDate": { "message": "更新時間 $1" }, - "uriErrorMsg": { + "urlErrorMsg": { "message": "URIs 需要加入適當的 HTTP/HTTPS 前綴字" }, "usedByClients": { diff --git a/app/manifest.json b/app/manifest.json index 9d0523a2a..f9e25ceda 100644 --- a/app/manifest.json +++ b/app/manifest.json @@ -1,7 +1,7 @@ { "name": "__MSG_appName__", "short_name": "__MSG_appName__", - "version": "7.6.0", + "version": "7.6.1", "manifest_version": 2, "author": "https://metamask.io", "description": "__MSG_appDescription__", diff --git a/app/scripts/controllers/app-state.js b/app/scripts/controllers/app-state.js index 9533fd458..8d67874ad 100644 --- a/app/scripts/controllers/app-state.js +++ b/app/scripts/controllers/app-state.js @@ -13,6 +13,7 @@ class AppStateController { this.onInactiveTimeout = onInactiveTimeout || (() => {}) this.store = new ObservableStore(extend({ timeoutMinutes: 0, + mkrMigrationReminderTimestamp: null, }, initState)) this.timer = null @@ -23,6 +24,12 @@ class AppStateController { this._setInactiveTimeout(preferences.autoLogoutTimeLimit) } + setMkrMigrationReminderTimestamp (timestamp) { + this.store.updateState({ + mkrMigrationReminderTimestamp: timestamp, + }) + } + /** * Sets the last active time to the current time * @return {void} diff --git a/app/scripts/metamask-controller.js b/app/scripts/metamask-controller.js index 1c607a4c6..14caf0706 100644 --- a/app/scripts/metamask-controller.js +++ b/app/scripts/metamask-controller.js @@ -508,6 +508,7 @@ module.exports = class MetamaskController extends EventEmitter { // AppStateController setLastActiveTime: nodeify(this.appStateController.setLastActiveTime, this.appStateController), + setMkrMigrationReminderTimestamp: nodeify(this.appStateController.setMkrMigrationReminderTimestamp, this.appStateController), // EnsController tryReverseResolveAddress: nodeify(this.ensController.reverseResolveAddress, this.ensController), diff --git a/test/e2e/metamask-ui.spec.js b/test/e2e/metamask-ui.spec.js index 143e274cd..a0efe56f9 100644 --- a/test/e2e/metamask-ui.spec.js +++ b/test/e2e/metamask-ui.spec.js @@ -1190,7 +1190,7 @@ describe('MetaMask', function () { await driver.wait(until.stalenessOf(gasModal)) const gasFeeInEth = await findElement(driver, By.css('.confirm-approve-content__transaction-details-content__secondary-fee')) - assert.equal(await gasFeeInEth.getText(), '0.0006') + assert.equal(await gasFeeInEth.getText(), '0.0006 ETH') }) it('edits the permission', async () => { diff --git a/ui/app/components/app/app-header/app-header.component.js b/ui/app/components/app/app-header/app-header.component.js index 7bf7a39bd..e1bc0cf24 100644 --- a/ui/app/components/app/app-header/app-header.component.js +++ b/ui/app/components/app/app-header/app-header.component.js @@ -71,7 +71,7 @@ export default class AppHeader extends PureComponent { ) @@ -92,7 +92,7 @@ export default class AppHeader extends PureComponent { className={classnames('app-header', { 'app-header--back-drop': isUnlocked })}>
history.push(DEFAULT_ROUTE)} />
diff --git a/ui/app/components/app/dai-migration-component/dai-migration-notification.component.js b/ui/app/components/app/dai-migration-component/dai-migration-notification.component.js index eebe4296a..d26358df7 100644 --- a/ui/app/components/app/dai-migration-component/dai-migration-notification.component.js +++ b/ui/app/components/app/dai-migration-component/dai-migration-notification.component.js @@ -1,3 +1,4 @@ +import { DateTime } from 'luxon' import React, { PureComponent } from 'react' import PropTypes from 'prop-types' import HomeNotification from '../home-notification' @@ -8,18 +9,37 @@ export default class DaiV1MigrationNotification extends PureComponent { } static defaultProps = { + mkrMigrationReminderTimestamp: null, string: '', symbol: '', } static propTypes = { + setMkrMigrationReminderTimestamp: PropTypes.func.isRequired, + mkrMigrationReminderTimestamp: PropTypes.string, string: PropTypes.string, symbol: PropTypes.string, } + remindMeLater = () => { + const nextWeek = DateTime.utc().plus({ + days: 7, + }) + this.props.setMkrMigrationReminderTimestamp(nextWeek.toString()) + } + render () { const { t } = this.context - const { string: balanceString, symbol } = this.props + const { mkrMigrationReminderTimestamp, string: balanceString, symbol } = this.props + + if (mkrMigrationReminderTimestamp) { + const reminderDateTime = DateTime.fromISO(mkrMigrationReminderTimestamp, { + zone: 'UTC', + }) + if (reminderDateTime > DateTime.utc()) { + return null + } + } if (!balanceString || !symbol) { return null @@ -31,15 +51,27 @@ export default class DaiV1MigrationNotification extends PureComponent { return ( + {t('migrateSai')} +   + { + window.open('https://blog.makerdao.com/multi-collateral-dai-is-live/', '_blank', 'noopener') + }} + > + {t('learnMore')}. + +
+ )} acceptText={t('migrate')} onAccept={() => { window.open('https://migrate.makerdao.com', '_blank', 'noopener') }} - ignoreText={t('learnMore')} - onIgnore={() => { - window.open('https://blog.makerdao.com/multi-collateral-dai-is-live/', '_blank', 'noopener') - }} + ignoreText={t('remindMeLater')} + onIgnore={this.remindMeLater} + infoText={t('migrateSaiInfo')} /> ) } diff --git a/ui/app/components/app/dai-migration-component/dai-migration-notification.container.js b/ui/app/components/app/dai-migration-component/dai-migration-notification.container.js index 1ea1d2fe4..175083bce 100644 --- a/ui/app/components/app/dai-migration-component/dai-migration-notification.container.js +++ b/ui/app/components/app/dai-migration-component/dai-migration-notification.container.js @@ -3,18 +3,32 @@ import { compose } from 'recompose' import DaiMigrationNotification from './dai-migration-notification.component' import withTokenTracker from '../../../helpers/higher-order-components/with-token-tracker' import { getSelectedAddress, getDaiV1Token } from '../../../selectors/selectors' +import { setMkrMigrationReminderTimestamp } from '../../../store/actions' const mapStateToProps = (state) => { + const { + metamask: { + mkrMigrationReminderTimestamp, + }, + } = state + const userAddress = getSelectedAddress(state) const oldDai = getDaiV1Token(state) return { + mkrMigrationReminderTimestamp, userAddress, token: oldDai, } } +const mapDispatchToProps = (dispatch) => { + return { + setMkrMigrationReminderTimestamp: (t) => dispatch(setMkrMigrationReminderTimestamp(t)), + } +} + export default compose( - connect(mapStateToProps), + connect(mapStateToProps, mapDispatchToProps), withTokenTracker, )(DaiMigrationNotification) diff --git a/ui/app/components/app/dropdowns/tests/menu.test.js b/ui/app/components/app/dropdowns/tests/menu.test.js index c98a829ec..6413c0c2c 100644 --- a/ui/app/components/app/dropdowns/tests/menu.test.js +++ b/ui/app/components/app/dropdowns/tests/menu.test.js @@ -11,7 +11,7 @@ describe('Dropdown Menu Components', () => { beforeEach(() => { wrapper = shallow( - + ) }) diff --git a/ui/app/components/app/gas-customization/gas-modal-page-container/advanced-tab-content/tests/advanced-tab-content-component.test.js b/ui/app/components/app/gas-customization/gas-modal-page-container/advanced-tab-content/tests/advanced-tab-content-component.test.js index 218b63763..05075f3ba 100644 --- a/ui/app/components/app/gas-customization/gas-modal-page-container/advanced-tab-content/tests/advanced-tab-content-component.test.js +++ b/ui/app/components/app/gas-customization/gas-modal-page-container/advanced-tab-content/tests/advanced-tab-content-component.test.js @@ -26,9 +26,9 @@ describe('AdvancedTabContent Component', function () { timeRemaining="21500" transactionFee="$0.25" insufficientBalance={false} - customPriceIsSafe={true} + customPriceIsSafe isSpeedUp={false} - isEthereumNetwork={true} + isEthereumNetwork />) }) diff --git a/ui/app/components/app/gas-customization/gas-modal-page-container/basic-tab-content/basic-tab-content.component.js b/ui/app/components/app/gas-customization/gas-modal-page-container/basic-tab-content/basic-tab-content.component.js index 931611460..c804abe3a 100644 --- a/ui/app/components/app/gas-customization/gas-modal-page-container/basic-tab-content/basic-tab-content.component.js +++ b/ui/app/components/app/gas-customization/gas-modal-page-container/basic-tab-content/basic-tab-content.component.js @@ -23,7 +23,7 @@ export default class BasicTabContent extends Component { {!gasPriceButtonGroupProps.loading ? : diff --git a/ui/app/components/app/gas-customization/gas-modal-page-container/gas-modal-page-container.component.js b/ui/app/components/app/gas-customization/gas-modal-page-container/gas-modal-page-container.component.js index cfabf02b9..f405cb7b9 100644 --- a/ui/app/components/app/gas-customization/gas-modal-page-container/gas-modal-page-container.component.js +++ b/ui/app/components/app/gas-customization/gas-modal-page-container/gas-modal-page-container.component.js @@ -204,7 +204,7 @@ export default class GasModalPageContainer extends Component { }} submitText={this.context.t('save')} headerCloseText={this.context.t('close')} - hideCancel={true} + hideCancel />
) diff --git a/ui/app/components/app/gas-customization/gas-modal-page-container/tests/gas-modal-page-container-component.test.js b/ui/app/components/app/gas-customization/gas-modal-page-container/tests/gas-modal-page-container-component.test.js index 4cfb1c447..3e416db49 100644 --- a/ui/app/components/app/gas-customization/gas-modal-page-container/tests/gas-modal-page-container-component.test.js +++ b/ui/app/components/app/gas-customization/gas-modal-page-container/tests/gas-modal-page-container-component.test.js @@ -200,7 +200,7 @@ describe('GasModalPageContainer Component', function () { customGasLimitInHex="mockCustomGasLimitInHex" insufficientBalance={false} disableSave={false} - hideBasic={true} + hideBasic />) const renderTabsResult = wrapper.instance().renderTabs() diff --git a/ui/app/components/app/home-notification/home-notification.component.js b/ui/app/components/app/home-notification/home-notification.component.js index cc86ef6d8..d3d0a0961 100644 --- a/ui/app/components/app/home-notification/home-notification.component.js +++ b/ui/app/components/app/home-notification/home-notification.component.js @@ -17,12 +17,12 @@ export default class HomeNotification extends PureComponent { } static propTypes = { - acceptText: PropTypes.string.isRequired, + acceptText: PropTypes.node.isRequired, onAccept: PropTypes.func, - ignoreText: PropTypes.string, + ignoreText: PropTypes.node, onIgnore: PropTypes.func, - descriptionText: PropTypes.string.isRequired, - infoText: PropTypes.string, + descriptionText: PropTypes.node.isRequired, + infoText: PropTypes.node, classNames: PropTypes.array, } diff --git a/ui/app/components/app/modal/tests/modal.component.test.js b/ui/app/components/app/modal/tests/modal.component.test.js index 5922177a6..9e964860c 100644 --- a/ui/app/components/app/modal/tests/modal.component.test.js +++ b/ui/app/components/app/modal/tests/modal.component.test.js @@ -110,7 +110,7 @@ describe('Modal Component', () => { cancelText="Cancel" onSubmit={handleSubmit} submitText="Submit" - submitDisabled={true} + submitDisabled headerText="My Header" onClose={handleCancel} /> diff --git a/ui/app/components/app/transaction-activity-log/tests/transaction-activity-log.component.test.js b/ui/app/components/app/transaction-activity-log/tests/transaction-activity-log.component.test.js index b070b76ea..6625a46a9 100644 --- a/ui/app/components/app/transaction-activity-log/tests/transaction-activity-log.component.test.js +++ b/ui/app/components/app/transaction-activity-log/tests/transaction-activity-log.component.test.js @@ -90,7 +90,7 @@ describe('TransactionActivityLog Component', () => { onCancel={() => {}} onRetry={() => {}} primaryTransactionStatus="pending" - isEarliestNonce={true} + isEarliestNonce />, { context: { t: (str1, str2) => str2 ? str1 + str2 : str1 } } ) diff --git a/ui/app/components/app/transaction-list-item-details/tests/transaction-list-item-details.component.test.js b/ui/app/components/app/transaction-list-item-details/tests/transaction-list-item-details.component.test.js index 85bd073e5..69360fec6 100644 --- a/ui/app/components/app/transaction-list-item-details/tests/transaction-list-item-details.component.test.js +++ b/ui/app/components/app/transaction-list-item-details/tests/transaction-list-item-details.component.test.js @@ -70,7 +70,7 @@ describe('TransactionListItemDetails Component', () => { const wrapper = shallow( , { context: { t: (str1, str2) => str2 ? str1 + str2 : str1 } } ) diff --git a/ui/app/components/app/transaction-view-balance/transaction-view-balance.component.js b/ui/app/components/app/transaction-view-balance/transaction-view-balance.component.js index feb701dbe..73905574e 100644 --- a/ui/app/components/app/transaction-view-balance/transaction-view-balance.component.js +++ b/ui/app/components/app/transaction-view-balance/transaction-view-balance.component.js @@ -53,7 +53,7 @@ export default class TransactionViewBalance extends PureComponent { value={balance} type={PRIMARY} ethNumberOfDecimals={4} - hideTitle={true} + hideTitle /> { balanceIsCached ? * : null @@ -69,7 +69,7 @@ export default class TransactionViewBalance extends PureComponent { value={balance} type={SECONDARY} ethNumberOfDecimals={4} - hideTitle={true} + hideTitle /> ) } diff --git a/ui/app/components/app/user-preferenced-currency-display/tests/user-preferenced-currency-display.component.test.js b/ui/app/components/app/user-preferenced-currency-display/tests/user-preferenced-currency-display.component.test.js index 51b2a3c4f..122115477 100644 --- a/ui/app/components/app/user-preferenced-currency-display/tests/user-preferenced-currency-display.component.test.js +++ b/ui/app/components/app/user-preferenced-currency-display/tests/user-preferenced-currency-display.component.test.js @@ -18,7 +18,7 @@ describe('UserPreferencedCurrencyDisplay Component', () => { it('should pass all props to the CurrencyDisplay child component', () => { const wrapper = shallow( diff --git a/ui/app/components/ui/currency-input/tests/currency-input.component.test.js b/ui/app/components/ui/currency-input/tests/currency-input.component.test.js index 6d4612e3c..43fa65d3a 100644 --- a/ui/app/components/ui/currency-input/tests/currency-input.component.test.js +++ b/ui/app/components/ui/currency-input/tests/currency-input.component.test.js @@ -130,7 +130,7 @@ describe('CurrencyInput Component', () => { fiatSuffix="USD" nativeSuffix="ETH" useFiat - hideFiat={true} + hideFiat nativeCurrency="ETH" currentCurrency="usd" conversionRate={231.06} diff --git a/ui/app/components/ui/metafox-logo/tests/metafox-logo.component.test.js b/ui/app/components/ui/metafox-logo/tests/metafox-logo.component.test.js index c794a004f..015416b97 100644 --- a/ui/app/components/ui/metafox-logo/tests/metafox-logo.component.test.js +++ b/ui/app/components/ui/metafox-logo/tests/metafox-logo.component.test.js @@ -16,7 +16,7 @@ describe('MetaFoxLogo', () => { it('does not set icon height and width when unsetIconHeight is true', () => { const wrapper = mount( - + ) assert.equal(wrapper.find('img.app-header__metafox-logo--icon').prop('width'), null) diff --git a/ui/app/components/ui/page-container/page-container-header/tests/page-container-header.component.test.js b/ui/app/components/ui/page-container/page-container-header/tests/page-container-header.component.test.js index 456e6aec7..5328451e9 100644 --- a/ui/app/components/ui/page-container/page-container-header/tests/page-container-header.component.test.js +++ b/ui/app/components/ui/page-container/page-container-header/tests/page-container-header.component.test.js @@ -13,7 +13,7 @@ describe('Page Container Header', () => { onClose = sinon.spy() wrapper = shallow(
- { fiatTransactionTotal } + { formatCurrency(fiatTransactionTotal, currentCurrency) }
- { ethTransactionTotal } + { `${ethTransactionTotal} ETH` }
diff --git a/ui/app/pages/confirm-approve/confirm-approve.component.js b/ui/app/pages/confirm-approve/confirm-approve.component.js index 2a40cfa96..e8c44cd4f 100644 --- a/ui/app/pages/confirm-approve/confirm-approve.component.js +++ b/ui/app/pages/confirm-approve/confirm-approve.component.js @@ -62,6 +62,7 @@ export default class ConfirmApprove extends Component { data, decimals, txData, + currentCurrency, ethTransactionTotal, fiatTransactionTotal, ...restProps @@ -78,7 +79,7 @@ export default class ConfirmApprove extends Component { } - hideSenderToRecipient={true} + hideSenderToRecipient customTxParamsData={customPermissionAmount ? getCustomTxParamsData(data, { customPermissionAmount, tokenAmount, decimals }) : null diff --git a/ui/app/pages/confirm-transaction-base/confirm-transaction-base.component.js b/ui/app/pages/confirm-transaction-base/confirm-transaction-base.component.js index 0b46fe9c9..44b49d697 100644 --- a/ui/app/pages/confirm-transaction-base/confirm-transaction-base.component.js +++ b/ui/app/pages/confirm-transaction-base/confirm-transaction-base.component.js @@ -261,7 +261,7 @@ export default class ConfirmTransactionBase extends Component { customGasPrice={customGas.gasPrice} customGasLimit={customGas.gasLimit} insufficientBalance={insufficientBalance} - customPriceIsSafe={true} + customPriceIsSafe isSpeedUp={false} /> : null diff --git a/ui/app/pages/create-account/create-account.component.js b/ui/app/pages/create-account/create-account.component.js index 973cb2f3e..aa05af975 100644 --- a/ui/app/pages/create-account/create-account.component.js +++ b/ui/app/pages/create-account/create-account.component.js @@ -47,17 +47,17 @@ export default class CreateAccountPage extends Component {
diff --git a/ui/app/pages/create-account/new-account.component.js b/ui/app/pages/create-account/new-account.component.js index 8f3e89f27..6dc6419b5 100644 --- a/ui/app/pages/create-account/new-account.component.js +++ b/ui/app/pages/create-account/new-account.component.js @@ -58,13 +58,13 @@ export default class NewAccountCreateForm extends Component {
diff --git a/ui/app/pages/send/account-list-item/account-list-item.component.js b/ui/app/pages/send/account-list-item/account-list-item.component.js index e6cca39b9..20ced2f09 100644 --- a/ui/app/pages/send/account-list-item/account-list-item.component.js +++ b/ui/app/pages/send/account-list-item/account-list-item.component.js @@ -83,7 +83,7 @@ export default class AccountListItem extends Component { { balanceIsCached ? * : null @@ -94,7 +94,7 @@ export default class AccountListItem extends Component { ) } diff --git a/ui/app/pages/send/send-content/send-gas-row/send-gas-row.component.js b/ui/app/pages/send/send-content/send-gas-row/send-gas-row.component.js index a770cb55e..378038f55 100644 --- a/ui/app/pages/send/send-content/send-gas-row/send-gas-row.component.js +++ b/ui/app/pages/send/send-content/send-gas-row/send-gas-row.component.js @@ -130,7 +130,7 @@ export default class SendGasRow extends Component { customGasPrice={gasPrice} customGasLimit={gasLimit} insufficientBalance={insufficientBalance} - customPriceIsSafe={true} + customPriceIsSafe isSpeedUp={false} /> { this.renderAdvancedOptionsButton() } diff --git a/ui/app/pages/send/send-content/tests/send-content-component.test.js b/ui/app/pages/send/send-content/tests/send-content-component.test.js index 479db9c18..203b9a6d4 100644 --- a/ui/app/pages/send/send-content/tests/send-content-component.test.js +++ b/ui/app/pages/send/send-content/tests/send-content-component.test.js @@ -16,7 +16,7 @@ describe('SendContent Component', function () { beforeEach(() => { wrapper = shallow( , { context: { t: str => str + '_t' } } ) diff --git a/ui/app/pages/send/send-footer/tests/send-footer-component.test.js b/ui/app/pages/send/send-footer/tests/send-footer-component.test.js index b2cf4b310..e1dd0d631 100644 --- a/ui/app/pages/send/send-footer/tests/send-footer-component.test.js +++ b/ui/app/pages/send/send-footer/tests/send-footer-component.test.js @@ -29,7 +29,7 @@ describe('SendFooter Component', function () { addToAddressBookIfNew={propsMethodSpies.addToAddressBookIfNew} amount="mockAmount" clearSend={propsMethodSpies.clearSend} - disabled={true} + disabled editingTransactionId="mockEditingTransactionId" errors={{}} from={ { address: 'mockAddress', balance: 'mockBalance' } } @@ -186,7 +186,7 @@ describe('SendFooter Component', function () { addToAddressBookIfNew={propsMethodSpies.addToAddressBookIfNew} amount="mockAmount" clearSend={propsMethodSpies.clearSend} - disabled={true} + disabled editingTransactionId="mockEditingTransactionId" errors={{}} from={ { address: 'mockAddress', balance: 'mockBalance' } } diff --git a/ui/app/pages/send/tests/send-component.test.js b/ui/app/pages/send/tests/send-component.test.js index 2676aa430..d5b43bbe4 100644 --- a/ui/app/pages/send/tests/send-component.test.js +++ b/ui/app/pages/send/tests/send-component.test.js @@ -58,7 +58,7 @@ describe('Send Component', function () { recentBlocks={['mockBlock']} selectedAddress="mockSelectedAddress" selectedToken="mockSelectedToken" - showHexData={true} + showHexData tokenBalance="mockTokenBalance" tokenContract="mockTokenContract" updateAndSetGasLimit={propsMethodSpies.updateAndSetGasLimit} diff --git a/ui/app/pages/send/to-autocomplete.component.js b/ui/app/pages/send/to-autocomplete.component.js index 252fa09c4..bb27537db 100644 --- a/ui/app/pages/send/to-autocomplete.component.js +++ b/ui/app/pages/send/to-autocomplete.component.js @@ -61,7 +61,7 @@ export default class ToAutoComplete extends Component { }} icon={this.getListItemIcon(account.address, to)} displayBalance={false} - displayAddress={true} + displayAddress /> ))}
diff --git a/ui/app/pages/settings/contact-list-tab/edit-contact/edit-contact.component.js b/ui/app/pages/settings/contact-list-tab/edit-contact/edit-contact.component.js index 218b13cdb..9373cbe6b 100644 --- a/ui/app/pages/settings/contact-list-tab/edit-contact/edit-contact.component.js +++ b/ui/app/pages/settings/contact-list-tab/edit-contact/edit-contact.component.js @@ -100,7 +100,7 @@ export default class EditContact extends PureComponent { onChange={e => this.setState({ newMemo: e.target.value })} fullWidth margin="dense" - multiline={true} + multiline rows={3} classes={{ inputMultiline: 'address-book__view-contact__text-area', diff --git a/ui/app/pages/settings/networks-tab/network-form/network-form.component.js b/ui/app/pages/settings/networks-tab/network-form/network-form.component.js index 07919f0fb..dcdd00a90 100644 --- a/ui/app/pages/settings/networks-tab/network-form/network-form.component.js +++ b/ui/app/pages/settings/networks-tab/network-form/network-form.component.js @@ -24,6 +24,7 @@ export default class NetworkForm extends PureComponent { isCurrentRpcTarget: PropTypes.bool, blockExplorerUrl: PropTypes.string, rpcPrefs: PropTypes.object, + rpcUrls: PropTypes.array, } state = { @@ -211,16 +212,28 @@ export default class NetworkForm extends PureComponent { ) } - validateUrl = (url, stateKey) => { - const invalidUrlErrorMsg = stateKey === 'rpcUrl' ? 'invalidRPC' : 'invalidBlockExplorerURL' + isValidWhenAppended = url => { + const appendedRpc = `http://${url}` + return validUrl.isWebUri(appendedRpc) && !url.match(/^https?:\/\/$/) + } - if (validUrl.isWebUri(url) || (stateKey === 'blockExplorerUrl' && url === '')) { - this.setErrorTo(stateKey, '') + validateBlockExplorerURL = (url, stateKey) => { + if (!validUrl.isWebUri(url) && url !== '') { + this.setErrorTo(stateKey, this.context.t(this.isValidWhenAppended(url) ? 'urlErrorMsg' : 'invalidBlockExplorerURL')) } else { - const appendedRpc = `http://${url}` - const validWhenAppended = validUrl.isWebUri(appendedRpc) && !url.match(/^https?:\/\/$/) + this.setErrorTo(stateKey, '') + } + } - this.setErrorTo(stateKey, this.context.t(validWhenAppended ? 'uriErrorMsg' : invalidUrlErrorMsg)) + validateUrlRpcUrl = (url, stateKey) => { + const { rpcUrls } = this.props + + if (!validUrl.isWebUri(url) && url !== '') { + this.setErrorTo(stateKey, this.context.t(this.isValidWhenAppended(url) ? 'urlErrorMsg' : 'invalidRPC')) + } else if (rpcUrls.includes(url)) { + this.setErrorTo(stateKey, this.context.t('urlExistsErrorMsg')) + } else { + this.setErrorTo(stateKey, '') } } @@ -254,7 +267,7 @@ export default class NetworkForm extends PureComponent { {this.renderFormTextField( 'rpcUrl', 'rpc-url', - this.setStateWithValue('rpcUrl', this.validateUrl), + this.setStateWithValue('rpcUrl', this.validateUrlRpcUrl), rpcUrl, )} {this.renderFormTextField( @@ -274,7 +287,7 @@ export default class NetworkForm extends PureComponent { {this.renderFormTextField( 'blockExplorerUrl', 'block-explorer-url', - this.setStateWithValue('blockExplorerUrl', this.validateUrl), + this.setStateWithValue('blockExplorerUrl', this.validateBlockExplorerURL), blockExplorerUrl, 'optionalBlockExplorerUrl', )} diff --git a/ui/app/pages/settings/networks-tab/networks-tab.component.js b/ui/app/pages/settings/networks-tab/networks-tab.component.js index 40e1a902f..4ee871a58 100644 --- a/ui/app/pages/settings/networks-tab/networks-tab.component.js +++ b/ui/app/pages/settings/networks-tab/networks-tab.component.js @@ -20,7 +20,7 @@ export default class NetworksTab extends PureComponent { location: PropTypes.object.isRequired, networkIsSelected: PropTypes.bool, networksTabIsInAddMode: PropTypes.bool, - networksToRender: PropTypes.array.isRequired, + networksToRender: PropTypes.arrayOf(PropTypes.object).isRequired, selectedNetwork: PropTypes.object, setNetworksTabAddMode: PropTypes.func.isRequired, setRpcTarget: PropTypes.func.isRequired, @@ -177,6 +177,7 @@ export default class NetworksTab extends PureComponent { editRpc, networkDefaultedToProvider, providerUrl, + networksToRender, } = this.props const envIsPopup = getEnvironmentType() === ENVIRONMENT_TYPE_POPUP @@ -189,6 +190,7 @@ export default class NetworksTab extends PureComponent { shouldRenderNetworkForm ? ( network.rpcUrl)} setRpcTarget={setRpcTarget} editRpc={editRpc} networkName={label || labelKey && t(labelKey) || ''} diff --git a/ui/app/store/actions.js b/ui/app/store/actions.js index f76024590..2642e89e9 100644 --- a/ui/app/store/actions.js +++ b/ui/app/store/actions.js @@ -367,6 +367,7 @@ var actions = { // AppStateController-related actions SET_LAST_ACTIVE_TIME: 'SET_LAST_ACTIVE_TIME', setLastActiveTime, + setMkrMigrationReminderTimestamp, getContractMethodData, loadingMethoDataStarted, @@ -2755,6 +2756,16 @@ function setLastActiveTime () { } } +function setMkrMigrationReminderTimestamp (timestamp) { + return (dispatch) => { + background.setMkrMigrationReminderTimestamp(timestamp, (err) => { + if (err) { + return dispatch(actions.displayWarning(err.message)) + } + }) + } +} + function loadingMethoDataStarted () { return { type: actions.LOADING_METHOD_DATA_STARTED,