Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Address book send plus contact list #6914

Merged
merged 99 commits into from
Jul 31, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
99 commits
Select commit Hold shift + click to select a range
775210b
Style Send Header
chikeichan Jun 4, 2019
1a6a547
Move Send to-row to send view and restyle
chikeichan Jun 4, 2019
3d187c3
Add "Recents" group to select recipient view
chikeichan Jun 4, 2019
882a698
Rename SendToRow to AddRecipient
chikeichan Jun 4, 2019
2cae0bf
Basic UI and Layout
chikeichan Jun 5, 2019
b42bd35
New ENSInput component
chikeichan Jun 5, 2019
e71a968
wip - fuzzy search for input
chikeichan Jun 6, 2019
e044048
small refactor
chikeichan Jun 6, 2019
16daeba
Add Dialog
chikeichan Jun 19, 2019
a382284
Click to open modal
chikeichan Jun 19, 2019
de0fe63
Create AddToAddressBookModal component
chikeichan Jun 19, 2019
fc2a016
Modal styling and layout
chikeichan Jun 20, 2019
ac13173
modal i18n
chikeichan Jun 20, 2019
de54a02
Add to Addressbook
chikeichan Jun 20, 2019
3d16c15
ens wip
chikeichan Jun 20, 2019
04eb279
ens wip
chikeichan Jun 20, 2019
cd3503d
ENS Resolution
chikeichan Jun 24, 2019
1ff0b1b
Reset input
chikeichan Jun 24, 2019
8ecf10c
Send to explicit address
chikeichan Jun 24, 2019
e6e3c26
Happy Path Complete
chikeichan Jun 24, 2019
ffb9296
Add back error checking
chikeichan Jun 25, 2019
88a6a36
Reset send-to when emptying input
chikeichan Jun 25, 2019
3ad4a2d
Add back warning object
chikeichan Jun 25, 2019
bb88718
Fix linter
chikeichan Jun 25, 2019
04a345f
Fix unit test #1 - fix import paths
chikeichan Jun 25, 2019
a678c43
Remove dead tests
chikeichan Jun 25, 2019
cc6fb6d
One more to go
chikeichan Jun 25, 2019
04319f0
Fix all unit tests
chikeichan Jun 25, 2019
4720338
add unit test for reducers and actions
chikeichan Jun 25, 2019
a3d745b
test rendering AddRecipient
chikeichan Jun 25, 2019
de58e5b
Add tests for dialog boxes in AddRecipient
chikeichan Jun 25, 2019
1dac267
Add test for validating
chikeichan Jun 25, 2019
c43c6cb
Fix linter
chikeichan Jun 25, 2019
fb13b3e
Fix e2e tests
chikeichan Jun 25, 2019
c2d9eeb
Token send e2e fix
chikeichan Jun 25, 2019
620877f
Fix e2e
chikeichan Jun 26, 2019
39ac0dc
Fix from-import-beta-ui e2e spec
chikeichan Jun 26, 2019
0cf7c88
Make section header say "add recipient” by default
chikeichan Jul 3, 2019
2574050
Auto-focus add recipient input
chikeichan Jul 3, 2019
0a13fde
Update placeholder text
chikeichan Jul 3, 2019
afe04b1
Update input title font size
chikeichan Jul 3, 2019
2da7143
Auto advance to next step if user paste a valid address
chikeichan Jul 3, 2019
d5c0ff4
Ellipsify address when recipient is selected
chikeichan Jul 3, 2019
d15c3a3
Fix app header background color on desktop
chikeichan Jul 3, 2019
7d508d3
Give each form row a margin of 16px
chikeichan Jul 3, 2019
483fc82
Use .container/.component naming pattern for ens-input
chikeichan Jul 3, 2019
2e6edca
Auto-focus on input when add to addressbook modal is opened; Save on …
chikeichan Jul 3, 2019
134165d
Fix and add unit test
chikeichan Jul 3, 2019
d881872
Fix selectors name in e2e tests
chikeichan Jul 3, 2019
c6ada01
Correct e2e test token amount for address-book-send changes
danjm Jul 5, 2019
a62ca89
Adds e2e test for editing a transaction
danjm Jul 5, 2019
fcb47fd
Delete test/integration/lib/send-new-ui.js
danjm Jul 5, 2019
08fe250
Add tests for amount max button and high value error on send screen t…
danjm Jul 5, 2019
0911925
Improve ENS message when not found on current network
danjm Jul 24, 2019
e24e7c9
Add error to indicate when network does not support ENS
danjm Jul 24, 2019
35f0acb
contact list initial
jennypollack Jun 3, 2019
307bdd8
initial error on invalid address
jennypollack Jun 6, 2019
b01d81b
clean up edit
jennypollack Jun 10, 2019
0e6091a
Style View Contact
chikeichan Jun 26, 2019
d1904ee
Style edit-contact
chikeichan Jun 26, 2019
2ee5543
lint and revert to address as object keys
jennypollack Jul 10, 2019
b561e80
add chainId based on current network to address book entry
jennypollack Jul 10, 2019
25936d1
fix test
jennypollack Jul 10, 2019
fd2995c
only display contacts for the current network
jennypollack Jul 11, 2019
5a7089b
bump gaba
jennypollack Jul 11, 2019
696c8eb
address book, resolve comments
jennypollack Jul 22, 2019
f890674
Move contact-list to its own component
danjm Jul 24, 2019
719ee19
De-duplicate getaddressbook selector and refactor name selection logi…
danjm Jul 24, 2019
bdbf15d
Use contact-list component in contact-list-tab.component (i.e. in set…
danjm Jul 24, 2019
919908d
Improve/fix settings headers for popup and browser views
danjm Jul 24, 2019
065a9cf
Lint fixes related to address book updates
danjm Jul 24, 2019
efff104
Add 'My accounts' page to settings address book
danjm Jul 24, 2019
7e9db74
Update add new contact button in settings to match floating circular …
danjm Jul 24, 2019
5675986
Improve styles of view contact page
danjm Jul 24, 2019
b4ae768
Improve styles and labels of the add-contact.component
danjm Jul 24, 2019
a915fd9
Further lint fixes related to address book updates
danjm Jul 24, 2019
adad62e
Update unit tests as per address book updates
danjm Jul 24, 2019
39b2405
Ensure that contact list groups are sorted alphabetically
danjm Jul 25, 2019
057cb32
Refactor settings component to use a container for connection to redu…
danjm Jul 25, 2019
63a356d
Decouple ens-input.component from send context
danjm Jul 25, 2019
9439730
Add ens resolution to add contact screen in settings
danjm Jul 25, 2019
3461311
Switching networks when an ens address is shown on send form removes …
danjm Jul 25, 2019
13a548c
Resolve send screen search for ensAddress to matching address book en…
danjm Jul 25, 2019
5d1483a
Show resolved ens icon and address if exists (settings: add-contact.c…
danjm Jul 25, 2019
623ea6f
Make the displayed and copied address in view-contact.component the c…
danjm Jul 25, 2019
5ca4ad0
Default alias state prop in AddToAddressBookModal to empty string
danjm Jul 25, 2019
1dc96f0
Use keyCode to detect enter key in AddToAddressBookModal
danjm Jul 25, 2019
006bb78
Ensure add-contact component properly updates after QR code detection
danjm Jul 25, 2019
26a217b
Fix display of all recents after clicking 'Load More' in contact list
danjm Jul 25, 2019
bd145f7
Fix send screen contact searching after network switching
danjm Jul 25, 2019
4f8bbf2
Code cleanup related to address book changes
danjm Jul 25, 2019
df7f29d
Update unit tests for address book changes
danjm Jul 26, 2019
7327cb8
Update ENS name not found on network message
danjm Jul 30, 2019
e4dd6dc
Add ens registration error message
danjm Jul 30, 2019
6de7221
Cancel on edit mode takes user back to view screen
danjm Jul 30, 2019
9438adf
Adds support for memo to settings contact list view and edit screens
danjm Jul 30, 2019
0552b13
Modify designs of edit and view contact in popup environment
danjm Jul 31, 2019
8ebdf9f
Update settings content list UX to show split columns in fullscreen a…
danjm Jul 31, 2019
e8baae8
Correct background address book API usages in UI
whymarrh Jul 31, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
81 changes: 81 additions & 0 deletions app/_locales/en/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
},
Expand All @@ -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"
},
Expand Down Expand Up @@ -172,6 +193,9 @@
"back": {
"message": "Back"
},
"backToAll": {
"message": "Back to All"
},
"balance": {
"message": "Balance"
},
Expand Down Expand Up @@ -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"
},
Expand Down Expand Up @@ -463,6 +493,9 @@
"delete": {
"message": "Delete"
},
"deleteAccount": {
"message": "Delete Account"
},
"denExplainer": {
"message": "Your DEN is your password-encrypted storage within MetaMask."
},
Expand Down Expand Up @@ -529,6 +562,9 @@
"editAccountName": {
"message": "Edit Account Name"
},
"editContact":{
"message": "Edit Contact"
},
"editingTransaction": {
"message": "Make changes to your transaction"
},
Expand Down Expand Up @@ -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"
},
Expand All @@ -583,6 +628,9 @@
"eth": {
"message": "ETH"
},
"ethereumPublicAddress": {
"message": "Ethereum Public Address"
},
"etherscanView": {
"message": "View account on Etherscan"
},
Expand Down Expand Up @@ -893,6 +941,9 @@
"loadingTokens": {
"message": "Loading Tokens..."
},
"loadMore": {
"message": "Load More"
},
"localhost": {
"message": "Localhost 8545"
},
Expand All @@ -914,6 +965,9 @@
"memorizePhrase": {
"message": "Memorize this phrase."
},
"memo": {
"message": "memo"
},
"menu": {
"message": "Menu"
},
Expand Down Expand Up @@ -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."
},
Expand Down Expand Up @@ -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"
},
Expand Down Expand Up @@ -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"
},
Expand Down Expand Up @@ -1670,6 +1742,9 @@
"transfer": {
"message": "Transfer"
},
"transferBetweenAccounts": {
"message": "Transfer between my accounts"
},
"transferFrom": {
"message": "Transfer From"
},
Expand Down Expand Up @@ -1750,6 +1825,9 @@
"useOldUI": {
"message": "Use old UI"
},
"userName":{
"message": "Username"
},
"validFileImport": {
"message": "You must select a valid file to import."
},
Expand All @@ -1762,6 +1840,9 @@
"viewinExplorer": {
"message": "View in Explorer"
},
"viewContact": {
"message": "View Contact"
},
"viewOnCustomBlockExplorer": {
"message": "View at $1"
},
Expand Down
4 changes: 4 additions & 0 deletions app/images/check-green-solid.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions app/images/close-gray.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 7 additions & 0 deletions app/images/qr-blue.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions app/images/search-black.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions app/scripts/metamask-controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@
"extensionizer": "^1.0.1",
"fast-json-patch": "^2.0.4",
"fuse.js": "^3.2.0",
"gaba": "^1.4.1",
"gaba": "^1.5.0",
"human-standard-token-abi": "^2.0.0",
"jazzicon": "^1.2.0",
"json-rpc-engine": "^4.0.0",
Expand Down
3 changes: 2 additions & 1 deletion test/data/mock-state.json
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,8 @@
"addressBook": [
{
"address": "0xc42edfcc21ed14dda456aa0756c153f7985d8813",
"name": ""
"name": "",
"chainId": 4
}
],
"selectedTokenAddress": "0x108cf70c7d384c552f42c07c41c0e1e46d77ea0d",
Expand Down
9 changes: 7 additions & 2 deletions test/e2e/from-import-ui.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -255,9 +255,14 @@ describe('Using MetaMask with an existing account', function () {
await sendButton.click()
await delay(regularDelayMs)

const inputAddress = await findElement(driver, By.css('input[placeholder="Recipient Address"]'))
const inputAmount = await findElement(driver, By.css('.unit-input__input'))
const inputAddress = await findElement(driver, By.css('input[placeholder="Search, public address (0x), or ENS"]'))
await inputAddress.sendKeys('0x2f318C334780961FB129D2a6c30D0763d9a5C970')

const recipientRow = await findElement(driver, By.css('.send__select-recipient-wrapper__group-item'))
await recipientRow.click()
await delay(regularDelayMs)

const inputAmount = await findElement(driver, By.css('.unit-input__input'))
await inputAmount.sendKeys('1')

// Set the gas limit
Expand Down
9 changes: 7 additions & 2 deletions test/e2e/metamask-responsive-ui.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -276,9 +276,14 @@ describe('MetaMask', function () {
await sendButton.click()
await delay(regularDelayMs)

const inputAddress = await findElement(driver, By.css('input[placeholder="Recipient Address"]'))
const inputAmount = await findElement(driver, By.css('.unit-input__input'))
const inputAddress = await findElement(driver, By.css('input[placeholder="Search, public address (0x), or ENS"]'))
await inputAddress.sendKeys('0x2f318C334780961FB129D2a6c30D0763d9a5C970')

const recipientRow = await findElement(driver, By.css('.send__select-recipient-wrapper__group-item'))
await recipientRow.click()
await delay(regularDelayMs)

const inputAmount = await findElement(driver, By.css('.unit-input__input'))
await inputAmount.sendKeys('1')

const inputValue = await inputAmount.getAttribute('value')
Expand Down
65 changes: 56 additions & 9 deletions test/e2e/metamask-ui.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -322,12 +322,44 @@ describe('MetaMask', function () {
await sendButton.click()
await delay(regularDelayMs)

const inputAddress = await findElement(driver, By.css('input[placeholder="Recipient Address"]'))
const inputAmount = await findElement(driver, By.css('.unit-input__input'))
const inputAddress = await findElement(driver, By.css('input[placeholder="Search, public address (0x), or ENS"]'))
await inputAddress.sendKeys('0x2f318C334780961FB129D2a6c30D0763d9a5C970')

const recipientRow = await findElement(driver, By.css('.send__select-recipient-wrapper__group-item'))
await recipientRow.click()
await delay(regularDelayMs)

const inputAmount = await findElement(driver, By.css('.unit-input__input'))
await inputAmount.sendKeys('1000')

const errorAmount = await findElement(driver, By.css('.send-v2__error-amount'))
assert.equal(await errorAmount.getText(), 'Insufficient funds.', 'send screen should render an insufficient fund error message')

await inputAmount.sendKeys(Key.BACK_SPACE)
await delay(50)
await inputAmount.sendKeys(Key.BACK_SPACE)
await delay(50)
await inputAmount.sendKeys(Key.BACK_SPACE)
await delay(tinyDelayMs)

await assertElementNotPresent(webdriver, driver, By.css('.send-v2__error-amount'))

const amountMax = await findElement(driver, By.css('.send-v2__amount-max'))
await amountMax.click()

assert.equal(await inputAmount.isEnabled(), false)

let inputValue = await inputAmount.getAttribute('value')

assert(Number(inputValue) > 99)

await amountMax.click()

assert.equal(await inputAmount.isEnabled(), true)

await inputAmount.sendKeys('1')

const inputValue = await inputAmount.getAttribute('value')
inputValue = await inputAmount.getAttribute('value')
assert.equal(inputValue, '1')
await delay(regularDelayMs)

Expand Down Expand Up @@ -360,9 +392,14 @@ describe('MetaMask', function () {
await sendButton.click()
await delay(regularDelayMs)

const inputAddress = await findElement(driver, By.css('input[placeholder="Recipient Address"]'))
const inputAmount = await findElement(driver, By.css('.unit-input__input'))
const inputAddress = await findElement(driver, By.css('input[placeholder="Search, public address (0x), or ENS"]'))
await inputAddress.sendKeys('0x2f318C334780961FB129D2a6c30D0763d9a5C970')

const recipientRow = await findElement(driver, By.css('.send__select-recipient-wrapper__group-item'))
await recipientRow.click()
await delay(regularDelayMs)

const inputAmount = await findElement(driver, By.css('.unit-input__input'))
await inputAmount.sendKeys('1')

const inputValue = await inputAmount.getAttribute('value')
Expand Down Expand Up @@ -402,9 +439,14 @@ describe('MetaMask', function () {
await sendButton.click()
await delay(regularDelayMs)

const inputAddress = await findElement(driver, By.css('input[placeholder="Recipient Address"]'))
const inputAmount = await findElement(driver, By.css('.unit-input__input'))
const inputAddress = await findElement(driver, By.css('input[placeholder="Search, public address (0x), or ENS"]'))
await inputAddress.sendKeys('0x2f318C334780961FB129D2a6c30D0763d9a5C970')

const recipientRow = await findElement(driver, By.css('.send__select-recipient-wrapper__group-item'))
await recipientRow.click()
await delay(regularDelayMs)

const inputAmount = await findElement(driver, By.css('.unit-input__input'))
await inputAmount.sendKeys('1')

const inputValue = await inputAmount.getAttribute('value')
Expand Down Expand Up @@ -1005,9 +1047,14 @@ describe('MetaMask', function () {
await sendButton.click()
await delay(regularDelayMs)

const inputAddress = await findElement(driver, By.css('input[placeholder="Recipient Address"]'))
const inputAmount = await findElement(driver, By.css('.unit-input__input'))
const inputAddress = await findElement(driver, By.css('input[placeholder="Search, public address (0x), or ENS"]'))
await inputAddress.sendKeys('0x2f318C334780961FB129D2a6c30D0763d9a5C970')

const recipientRow = await findElement(driver, By.css('.send__select-recipient-wrapper__group-item'))
await recipientRow.click()
await delay(regularDelayMs)

const inputAmount = await findElement(driver, By.css('.unit-input__input'))
await inputAmount.sendKeys('1')

// Set the gas limit
Expand Down
Loading