From e9c7df28ed88f6dc3a5074cf873f3920429d1803 Mon Sep 17 00:00:00 2001 From: Dan J Miller Date: Wed, 31 Jul 2019 17:26:44 -0230 Subject: Address book send plus contact list (#6914) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Style Send Header * Move Send to-row to send view and restyle * Add "Recents" group to select recipient view * Rename SendToRow to AddRecipient * Basic UI and Layout * New ENSInput component * wip - fuzzy search for input * small refactor * Add Dialog * contact list initial * initial error on invalid address * clean up edit * Click to open modal * Create AddToAddressBookModal component * Modal styling and layout * modal i18n * Add to Addressbook * ens wip * ens wip * ENS Resolution * Reset input * Send to explicit address * Happy Path Complete * Add back error checking * Reset send-to when emptying input * Add back warning object * Fix linter * Fix unit test #1 - fix import paths * Remove dead tests * One more to go * Fix all unit tests * add unit test for reducers and actions * test rendering AddRecipient * Add tests for dialog boxes in AddRecipient * Add test for validating * Fix linter * Fix e2e tests * Token send e2e fix * Style View Contact * Style edit-contact * Fix e2e * Fix from-import-beta-ui e2e spec * Make section header say "add recipient” by default * Auto-focus add recipient input * Update placeholder text * Update input title font size * Auto advance to next step if user paste a valid address * Ellipsify address when recipient is selected * Fix app header background color on desktop * Give each form row a margin of 16px * Use .container/.component naming pattern for ens-input * Auto-focus on input when add to addressbook modal is opened; Save on Enter * Fix and add unit test * Fix selectors name in e2e tests * Correct e2e test token amount for address-book-send changes * Adds e2e test for editing a transaction * Delete test/integration/lib/send-new-ui.js * Add tests for amount max button and high value error on send screen to test/e2e/metamask-ui.spec.js * lint and revert to address as object keys * add chainId based on current network to address book entry * fix test * only display contacts for the current network * Improve ENS message when not found on current network * Add error to indicate when network does not support ENS * bump gaba * address book, resolve comments * Move contact-list to its own component * De-duplicate getaddressbook selector and refactor name selection logic in contact-list-tab/ * Use contact-list component in contact-list-tab.component (i.e. in settings) * Improve/fix settings headers for popup and browser views * Lint fixes related to address book updates * Add 'My accounts' page to settings address book * Update add new contact button in settings to match floating circular design * Improve styles of view contact page * Improve styles and labels of the add-contact.component * Further lint fixes related to address book updates * Update unit tests as per address book updates * Ensure that contact list groups are sorted alphabetically * Refactor settings component to use a container for connection to redux; allow display of addressbook name in settings header * Decouple ens-input.component from send context * Add ens resolution to add contact screen in settings * Switching networks when an ens address is shown on send form removes the ens address. * Resolve send screen search for ensAddress to matching address book entry if it exists * Show resolved ens icon and address if exists (settings: add-contact.component) * Make the displayed and copied address in view-contact.component the checksummed address * Default alias state prop in AddToAddressBookModal to empty string * Use keyCode to detect enter key in AddToAddressBookModal * Ensure add-contact component properly updates after QR code detection * Fix display of all recents after clicking 'Load More' in contact list * Fix send screen contact searching after network switching * Code cleanup related to address book changes * Update unit tests for address book changes * Update ENS name not found on network message * Add ens registration error message * Cancel on edit mode takes user back to view screen * Adds support for memo to settings contact list view and edit screens * Modify designs of edit and view contact in popup environment * Update settings content list UX to show split columns in fullscreen and proper internal navigation * Correct background address book API usages in UI --- app/_locales/en/messages.json | 81 ++++++++++++++++++++++++++++++++++++++ app/images/check-green-solid.svg | 4 ++ app/images/close-gray.svg | 4 ++ app/images/qr-blue.svg | 7 ++++ app/images/search-black.svg | 4 ++ app/scripts/metamask-controller.js | 1 + 6 files changed, 101 insertions(+) create mode 100644 app/images/check-green-solid.svg create mode 100755 app/images/close-gray.svg create mode 100644 app/images/qr-blue.svg create mode 100644 app/images/search-black.svg (limited to 'app') diff --git a/app/_locales/en/messages.json b/app/_locales/en/messages.json index e69b3dc36..1f60bfa57 100644 --- a/app/_locales/en/messages.json +++ b/app/_locales/en/messages.json @@ -80,12 +80,21 @@ "activityLog": { "message": "activity log" }, + "add": { + "message": "Add" + }, "address": { "message": "Address" }, "addNetwork": { "message": "Add Network" }, + "addRecipient": { + "message": "Add Recipient" + }, + "addressBook": { + "message": "Address Book" + }, "advanced": { "message": "Advanced" }, @@ -98,6 +107,18 @@ "addCustomToken": { "message": "Add custom token" }, + "addToAddressBook": { + "message": "Add to address book" + }, + "addToAddressBookModalPlaceholder": { + "message": "e.g. John D." + }, + "addAlias": { + "message": "Add alias" + }, + "addEthAddress": { + "message": "Add an Ethereum address" + }, "addToken": { "message": "Add Token" }, @@ -172,6 +193,9 @@ "back": { "message": "Back" }, + "backToAll": { + "message": "Back to All" + }, "balance": { "message": "Balance" }, @@ -354,6 +378,12 @@ "connectToTrezor": { "message": "Connect to Trezor" }, + "contactList": { + "message": "Contact List" + }, + "contactListDescription": { + "message": "Add, edit, remove, and manage your contacts" + }, "continue": { "message": "Continue" }, @@ -463,6 +493,9 @@ "delete": { "message": "Delete" }, + "deleteAccount": { + "message": "Delete Account" + }, "denExplainer": { "message": "Your DEN is your password-encrypted storage within MetaMask." }, @@ -529,6 +562,9 @@ "editAccountName": { "message": "Edit Account Name" }, + "editContact":{ + "message": "Edit Contact" + }, "editingTransaction": { "message": "Make changes to your transaction" }, @@ -571,6 +607,15 @@ "ensNameNotFound": { "message": "ENS name not found" }, + "ensRegistrationError": { + "message": "Error in ENS name registration" + }, + "ensNotFoundOnCurrentNetwork": { + "message": "ENS name not found on the current network. Try switching to Main Ethereum Network." + }, + "enterAnAlias": { + "message": "Enter an alias" + }, "enterPassword": { "message": "Enter password" }, @@ -583,6 +628,9 @@ "eth": { "message": "ETH" }, + "ethereumPublicAddress": { + "message": "Ethereum Public Address" + }, "etherscanView": { "message": "View account on Etherscan" }, @@ -893,6 +941,9 @@ "loadingTokens": { "message": "Loading Tokens..." }, + "loadMore": { + "message": "Load More" + }, "localhost": { "message": "Localhost 8545" }, @@ -914,6 +965,9 @@ "memorizePhrase": { "message": "Memorize this phrase." }, + "memo": { + "message": "memo" + }, "menu": { "message": "Menu" }, @@ -947,6 +1001,12 @@ "myAccounts": { "message": "My Accounts" }, + "myWalletAccounts": { + "message": "My Wallet Accounts" + }, + "myWalletAccountsDescription": { + "message": "All of your MetaMask created accounts will automatically be added to this section." + }, "mustSelectOne": { "message": "Must select at least 1 token." }, @@ -979,10 +1039,16 @@ "newAccount": { "message": "New Account" }, + "newAccountDetectedDialogMessage": { + "message": "New address detected! Click here to add to your address book." + }, "newAccountNumberName": { "message": "Account $1", "description": "Default name of next account to be created on create account screen" }, + "newContact": { + "message": "New Contact" + }, "newContract": { "message": "New Contract" }, @@ -1193,9 +1259,15 @@ "receive": { "message": "Receive" }, + "recents": { + "message": "Recents" + }, "recipientAddress": { "message": "Recipient Address" }, + "recipientAddressPlaceholder": { + "message": "Search, public address (0x), or ENS" + }, "refundAddress": { "message": "Your Refund Address" }, @@ -1670,6 +1742,9 @@ "transfer": { "message": "Transfer" }, + "transferBetweenAccounts": { + "message": "Transfer between my accounts" + }, "transferFrom": { "message": "Transfer From" }, @@ -1750,6 +1825,9 @@ "useOldUI": { "message": "Use old UI" }, + "userName":{ + "message": "Username" + }, "validFileImport": { "message": "You must select a valid file to import." }, @@ -1762,6 +1840,9 @@ "viewinExplorer": { "message": "View in Explorer" }, + "viewContact": { + "message": "View Contact" + }, "viewOnCustomBlockExplorer": { "message": "View at $1" }, diff --git a/app/images/check-green-solid.svg b/app/images/check-green-solid.svg new file mode 100644 index 000000000..3e58e8dcc --- /dev/null +++ b/app/images/check-green-solid.svg @@ -0,0 +1,4 @@ + + + + diff --git a/app/images/close-gray.svg b/app/images/close-gray.svg new file mode 100755 index 000000000..fca1c4740 --- /dev/null +++ b/app/images/close-gray.svg @@ -0,0 +1,4 @@ + + + + diff --git a/app/images/qr-blue.svg b/app/images/qr-blue.svg new file mode 100644 index 000000000..54434295a --- /dev/null +++ b/app/images/qr-blue.svg @@ -0,0 +1,7 @@ + + + + + + + diff --git a/app/images/search-black.svg b/app/images/search-black.svg new file mode 100644 index 000000000..7b7db5124 --- /dev/null +++ b/app/images/search-black.svg @@ -0,0 +1,4 @@ + + + + diff --git a/app/scripts/metamask-controller.js b/app/scripts/metamask-controller.js index 84a25b008..8ab2bc5dc 100644 --- a/app/scripts/metamask-controller.js +++ b/app/scripts/metamask-controller.js @@ -460,6 +460,7 @@ module.exports = class MetamaskController extends EventEmitter { // AddressController setAddressBook: this.addressBookController.set.bind(this.addressBookController), + removeFromAddressBook: this.addressBookController.delete.bind(this.addressBookController), // AppStateController setLastActiveTime: nodeify(this.appStateController.setLastActiveTime, this.appStateController), -- cgit