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

Allow to set recovery phone when creating account #29

Merged
merged 22 commits into from
May 14, 2019
Merged

Conversation

vgrichina
Copy link
Contributor

No description provided.

@vgrichina vgrichina changed the title WIP: Allow to set recovery phone Allow to set recovery phone when creating account May 11, 2019
@vgrichina vgrichina requested a review from janedegtiareva May 11, 2019 05:55
@@ -41,6 +43,17 @@ export function handleRefreshAccount(wallet, history) {
})
.catch(e => {
console.log(e)

if (e.message && e.message.indexOf('is not valid') !== -1) {
Copy link
Contributor

Choose a reason for hiding this comment

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

pull 'is not valid' into a constant somewhere?

Copy link
Contributor

Choose a reason for hiding this comment

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

or better yet this function might be good as a util function

Copy link
Contributor Author

Choose a reason for hiding this comment

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

proper way to fix this would be to haver error codes returned by nearcore. This works as a temporary kludge as is.

}))
}

isLegitField(name, value) {
Copy link
Contributor

Choose a reason for hiding this comment

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

let's rename legit to something else, maybe valid?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

this seems subjective, Legit is used in all other code in wallet.

</Header>
<Header as='h3' className='color-blue'>
You can skip this if you plan to backup account keys manually.
We won't be able to help you with account recovery otherwise.
Copy link
Contributor

@janedegtiareva janedegtiareva May 13, 2019

Choose a reason for hiding this comment

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

Is this text from the official UX? I think the sentence should read as "You can skip this blah blah... If you do skip this, we won't be able to help with your account recovery" or something similar. Right now it reads as having the opposite meaning of what we want to say.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There is no official UX for now, going to update text after comments from Jake and Erik

<Grid.Row className='disclaimer border-top-bold'>
<Grid.Column computer={16} tablet={16} mobile={16} className=''>
<span className='disclaimer-info'>DISCLAIMER: </span>
This is a developers&apos; preview Wallet. It should be used for
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this still true about the preview?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes

import styled from 'styled-components'

const RecoveryInfoForm = styled(Form)`
&&& input {
Copy link
Contributor

Choose a reason for hiding this comment

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

is it normal in react to have css inline? I definitely prefer separate css files

Choose a reason for hiding this comment

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

is it normal in react to have css inline? I definitely prefer separate css files

This is somewhat common in react for component-level styles that aren't going to be reused elsewhere to avoid css anti-pattern of overriding, then overriding again with !important. I'm not personally a fan, but this is pretty widely accepted.

Choose a reason for hiding this comment

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

That being said, this is a big enough block of style that I would argue it should be taken out of here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

that's normal pattern, the way to refactor it is to cut components into smaller pieces

the good part about this is that it's scoped by component, so very easy to manage vs global styles which can get applied to whatever

return false
}

const { dispatch } = this.props;
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's start adding tests for the wallet code. This looks like it doesn't have a lot of UI logic, so should be possible to write unit tests for this.

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 plan to add integration tests for contract helper and end-to-end tests for wallet.

Unit tests are going to be easy to write for Redux-based app, but I don't think they are going to be very useful. Most of our real world problems are with broken integrations.

Copy link
Contributor

@janedegtiareva janedegtiareva left a comment

Choose a reason for hiding this comment

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

Requested changes:

  • review the text
  • some small nits (can be addressed in follow up if needed)
  • let's add some unit tests

@vgrichina vgrichina mentioned this pull request May 14, 2019
@vgrichina vgrichina merged commit d6b10ae into react May 14, 2019
@MaximusHaximus MaximusHaximus deleted the set-recovery branch July 24, 2021 02:20
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.

3 participants