Skip to content
This repository has been archived by the owner on Nov 6, 2020. It is now read-only.

Add Email and Registry lookups to Address Selector #3992

Merged
merged 6 commits into from Dec 29, 2016

Conversation

ngotchac
Copy link
Contributor

@ngotchac ngotchac commented Dec 28, 2016

Closes #3871

Adds to the new Address Selector lookups capabilities from the Registry and the Email Verification contract.

The result is shown right under the input.

mail address selector

It also fixes some issues in the component.

@ngotchac ngotchac added A0-pleasereview 🤓 Pull request needs code review. M7-ui labels Dec 28, 2016
@coveralls
Copy link

Coverage Status

Changes Unknown when pulling 76496bb on ng-address-from-regs into ** on master**.

const { address, value } = regsitryValue;
const account = { address, name: value, index: address };

.map((regsitryValue, index) => {
Copy link
Contributor

Choose a reason for hiding this comment

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

typo. 😉

.instance
.reverse.call({}, [ sha3(value) ]);
},
describe: (value) => `${value} (from email verification)`
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd prefer "Verified using email …", as this is being shown inside and account card.

Copy link
Contributor

Choose a reason for hiding this comment

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

While we are doing this fresh, create strings with FormattedMessage so we don't need to circle back. (Also for the labels in this store)

@@ -52,6 +52,11 @@
}
}

.description {
font-size: 0.75em;
color: rgba(255, 255, 255, 0.498039);
Copy link
Contributor

Choose a reason for hiding this comment

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

Make it 0.5 alpha, Chrome creates these numbers when inspecting.

return registryInstance
.getAddress.call({}, [ sha3(value), 'A' ]);
},
describe: (value) => `${value} (from registry)`
Copy link
Contributor

Choose a reason for hiding this comment

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

<FormattedMessage
  id='addressSelect.fromRegistry'
  defaultMessage='{value} (from registry)'
  values={ {
    value
  } } />

.filterValues(category.values, value)
.map((value) => {
index++;
return { ...value, index: parseInt(index) };
Copy link
Contributor

@jacogr jacogr Dec 29, 2016

Choose a reason for hiding this comment

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

Would prefer

return {
  index: parseInt(index),
  ...value
};

}

const account = flatMap(this.initValues, (cat) => cat.values)
.find((account) => account.address.toLowerCase() === result.toLowerCase());
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we need to lowercase result each callback? Could do it outside and assign to variable being tested.


this.initValues = [
{
label: 'accounts',
Copy link
Contributor

Choose a reason for hiding this comment

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

Labels as per comment above.

return null;
}

const accounts = regsitryValues
Copy link
Contributor

Choose a reason for hiding this comment

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

registryValues (typo, also registryValue below as well as the function name)

@ngotchac
Copy link
Contributor Author

Fixed

@jacogr jacogr added A7-looksgoodtestsfail 🤖 Pull request is reviewed well, but cannot be merged due to tests failing. and removed A0-pleasereview 🤓 Pull request needs code review. labels Dec 29, 2016
@jacogr jacogr added A8-looksgood 🦄 Pull request is reviewed well. and removed A7-looksgoodtestsfail 🤖 Pull request is reviewed well, but cannot be merged due to tests failing. labels Dec 29, 2016
@coveralls
Copy link

Coverage Status

Changes Unknown when pulling 53e5b4c on ng-address-from-regs into ** on master**.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A8-looksgood 🦄 Pull request is reviewed well.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Address box should support email and registered names
5 participants