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

Added address book management for sending assets #422

Merged
merged 3 commits into from
Dec 17, 2017

Conversation

mhuggins
Copy link
Contributor

@mhuggins mhuggins commented Dec 16, 2017

Address Book

What current issue(s) from Trello/Github does this address?
Finishes #9.

What problem does this PR solve?
It allows users to save & name addresses that they commonly send assets to. There are simple mechanisms for saving (only valid addresses) with custom unique names, as well as deleting addresses that are no longer needed.

How did you solve this problem?
I modified the existing "Send" modal to extend the behavior of the recipient address text input. It is now composed of a more complex set of react components that represent a select input w/ drop-down of existing values (if any values have been added yet).

When the user focuses on the input, it expands the drop-down to show existing values. As the user starts typing, the values are filtered (by both address & name) to match the user's search term.

When a new address has been typed into the address input, a "save" icon is displayed so that the user can save it. If that is clicked, an interactive tooltip allows the user to enter a name for the address before saving.

When a user wishes to delete an address book entry, they can click the trash can icon that appears next to each entry in the drop-down.

How did you make sure your solution works?
I smoke tested it manually, but I did not write any automated tests for it yet.

Are there any special changes in the code that we should be aware of?

  • I widened the SendModal to ensure that the recipient address is still completely visible even when the "save" icon is displayed.
  • I removed the auto-focus of the recipient input since it automatically made the dropdown appear. If this is not desired, I can revert that change and instead not show the dropdown until the input is clicked or the user starts typing.

Is there anything else we should know?

  • I'm new to Flow, so I easily could have messed up some of the syntax around that without knowing it.
  • I added error handling to the redux actions for validation around local storage callbacks, but I didn't see this handled anywhere else. I'm sure it could use some cleanup, as there's a little bit of duplicated code with the error handling.
  • I didn't add any SCSS variables for the colors or spacing used. I can do that if the styles look good, or I can refactor the styles first.
  • This is my first contribution to a CoZ project. Is there anything else I should do as part of submitting this?
  • Unit tests written

@coveralls
Copy link

Coverage Status

Coverage decreased (-2.6%) to 36.685% when pulling 9bcb447 on neoverse:address-book into aaedb36 on CityOfZion:dev.

position: relative;

.anchor {
// TODO
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

☝️ I can remove this.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.7%) to 38.553% when pulling 6d1cc5c on neoverse:address-book into aaedb36 on CityOfZion:dev.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.3%) to 39.546% when pulling 250b970 on neoverse:address-book into aaedb36 on CityOfZion:dev.

@dvdschwrtz-zz dvdschwrtz-zz merged commit 325c5f4 into CityOfZion:dev Dec 17, 2017
@mhuggins
Copy link
Contributor Author

🎉 Thanks guys!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants