From e6455e92ae86ed0f94035784fb0cefcb83ec27e4 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ant=C3=B3nio=20Regadas?=
Date: Thu, 27 Apr 2023 11:27:31 +0100
Subject: [PATCH] [MMI] custody page component (#18688)
---
app/_locales/en/messages.json | 30 +
.../__snapshots__/jwt-url-form.test.js.snap | 1 -
.../jwt-url-form/jwt-url-form.js | 2 -
.../jwt-url-form/jwt-url-form.scss | 1 +
ui/helpers/constants/routes.ts | 10 +-
.../__snapshots__/account-list.test.js.snap | 8 +-
.../connect-custody/account-list.js | 24 +-
.../connect-custody/account-list.stories.js | 0
.../connect-custody/account-list.test.js | 0
.../institutional/connect-custody/index.js | 0
.../institutional/connect-custody/index.scss | 0
.../__snapshots__/custody.test.js.snap | 174 ++++++
ui/pages/institutional/custody/custody.js | 591 ++++++++++++++++++
.../institutional/custody/custody.stories.js | 52 ++
.../institutional/custody/custody.test.js | 113 ++++
ui/pages/institutional/custody/index.js | 1 +
ui/pages/institutional/custody/index.scss | 14 +
ui/pages/pages.scss | 6 +-
ui/selectors/institutional/selectors.js | 2 +-
19 files changed, 1004 insertions(+), 25 deletions(-)
rename ui/pages/{create-account => }/institutional/connect-custody/__snapshots__/account-list.test.js.snap (95%)
rename ui/pages/{create-account => }/institutional/connect-custody/account-list.js (90%)
rename ui/pages/{create-account => }/institutional/connect-custody/account-list.stories.js (100%)
rename ui/pages/{create-account => }/institutional/connect-custody/account-list.test.js (100%)
rename ui/pages/{create-account => }/institutional/connect-custody/index.js (100%)
rename ui/pages/{create-account => }/institutional/connect-custody/index.scss (100%)
create mode 100644 ui/pages/institutional/custody/__snapshots__/custody.test.js.snap
create mode 100644 ui/pages/institutional/custody/custody.js
create mode 100644 ui/pages/institutional/custody/custody.stories.js
create mode 100644 ui/pages/institutional/custody/custody.test.js
create mode 100644 ui/pages/institutional/custody/index.js
create mode 100644 ui/pages/institutional/custody/index.scss
diff --git a/app/_locales/en/messages.json b/app/_locales/en/messages.json
index 9a4cec433..def53a578 100644
--- a/app/_locales/en/messages.json
+++ b/app/_locales/en/messages.json
@@ -333,6 +333,12 @@
"alerts": {
"message": "Alerts"
},
+ "allCustodianAccountsConnectedSubtitle": {
+ "message": "You have either already connected all your custodian accounts or don’t have any account to connect to MetaMask Institutional."
+ },
+ "allCustodianAccountsConnectedTitle": {
+ "message": "No accounts available to connect"
+ },
"allOfYour": {
"message": "All of your $1",
"description": "$1 is the symbol or name of the token that the user is approving spending"
@@ -724,6 +730,12 @@
"connectAccountOrCreate": {
"message": "Connect account or create new"
},
+ "connectCustodialAccountMsg": {
+ "message": "Please choose the custodian you want to connect in order to add or refresh a token."
+ },
+ "connectCustodialAccountTitle": {
+ "message": "Custodial Accounts"
+ },
"connectHardwareWallet": {
"message": "Connect hardware wallet"
},
@@ -950,6 +962,9 @@
"custodianReplaceRefreshTokenTitle": {
"message": "Replace custodian token"
},
+ "custodyApiUrl": {
+ "message": "$1 API URL"
+ },
"custodyDeeplinkDescription": {
"message": "Approve the transaction in the $1 app. Once all required custody approvals have been performed the transaction will complete. Check your $1 app for status."
},
@@ -1388,6 +1403,9 @@
"enterANumber": {
"message": "Enter a number"
},
+ "enterCustodianToken": {
+ "message": "Enter your $1 token or add a new token"
+ },
"enterMaxSpendLimit": {
"message": "Enter max spend limit"
},
@@ -2909,6 +2927,9 @@
"passwordsDontMatch": {
"message": "Passwords don't match"
},
+ "pasteJWTToken": {
+ "message": "Paste or drop your token here:"
+ },
"pastePrivateKey": {
"message": "Enter your private key string here:",
"description": "For importing an account from a private key"
@@ -3519,18 +3540,27 @@
"seedPhraseWriteDownHeader": {
"message": "Write down your Secret Recovery Phrase"
},
+ "select": {
+ "message": "Select"
+ },
"selectAccounts": {
"message": "Select the account(s) to use on this site"
},
"selectAll": {
"message": "Select all"
},
+ "selectAllAccounts": {
+ "message": "Select all accounts"
+ },
"selectAnAccount": {
"message": "Select an account"
},
"selectAnAccountAlreadyConnected": {
"message": "This account has already been connected to MetaMask"
},
+ "selectAnAccountHelp": {
+ "message": "Select the custodian accounts to use in MetaMask Institutional."
+ },
"selectHdPath": {
"message": "Select HD path"
},
diff --git a/ui/components/institutional/jwt-url-form/__snapshots__/jwt-url-form.test.js.snap b/ui/components/institutional/jwt-url-form/__snapshots__/jwt-url-form.test.js.snap
index cdf419d89..c84e7439d 100644
--- a/ui/components/institutional/jwt-url-form/__snapshots__/jwt-url-form.test.js.snap
+++ b/ui/components/institutional/jwt-url-form/__snapshots__/jwt-url-form.test.js.snap
@@ -17,7 +17,6 @@ exports[`JwtUrlForm shows JWT text area when no jwt token exists 1`] = `
input text