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

Add a password strength component #4153

Merged
merged 3 commits into from
Jan 13, 2017
Merged

Add a password strength component #4153

merged 3 commits into from
Jan 13, 2017

Conversation

ngotchac
Copy link
Contributor

Closes #4130

Add it to the account creation modals, and to the change password modal

@ngotchac ngotchac added A0-pleasereview 🤓 Pull request needs code review. M7-ui labels Jan 12, 2017
@jacogr
Copy link
Contributor

jacogr commented Jan 12, 2017

Would prefer https://github.com/ethcore/parity/pull/3988 in first for the creation part since it reworks everything into a store. (Need to get through 1.5 release first before final checks on that one)

@ngotchac
Copy link
Contributor Author

@jacogr Well it's only a new Component that adds one line to each Accounts render, so I guess it wouldn't be affected by this #3988 update

@jacogr
Copy link
Contributor

jacogr commented Jan 12, 2017

The branches are not a clean merge at all, it has been completely re-done. (I18n, imports, formatting, store)

Alternatively don't touch createAccount here and just do change as step 1.

};

export default class PasswordStrength extends Component {

Copy link
Contributor

Choose a reason for hiding this comment

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

Extra unneeded line.

<div className={ styles.strength }>
<label className={ styles.label }>
<FormattedMessage
id='passwordStrength.label'
Copy link
Contributor

Choose a reason for hiding this comment

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

prefer ui.passwordStrength.label (top-level names reserved for views/modals, there is a lot of overlap with component-names)

}

// Note that the suggestions are in english, thus it wouldn't
// make sense to add translations to surrounding words
Copy link
Contributor

Choose a reason for hiding this comment

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

We cannot be 99.9% and once in we shouldn't need to come back. What are the alternatives?

Copy link
Contributor

Choose a reason for hiding this comment

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

To clarify the above - at the very least all our text should be i18n. (3rd party could be non - for now). So the below should either just display the library hint or split it such that our part is translatable and their part a variable input.

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 has been taken care of)

return 'orange';

default:
case 0:
Copy link
Contributor

Choose a reason for hiding this comment

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

case 0:
default:

(Or remove 0)

describe('rendering', () => {
it('renders', () => {
expect(render({ input: INPUT_A })).to.be.ok;
expect(render({ input: INPUT_A }).find('LinearProgress')).to.be.ok;
Copy link
Contributor

Choose a reason for hiding this comment

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

Prefer seperate it blocks, otherwise you need to go by line to find the failure - one tests the component, the second parts of the component.

import React, { Component, PropTypes } from 'react';
import { debounce } from 'lodash';
import { LinearProgress } from 'material-ui';
import { FormattedMessage } from 'react-intl';
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 in this file and it is new, alphabetical order.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Well it is, except for React which is the main dependency of this module, I don't think it's necessarily bad to have it on top.

Copy link
Contributor

Choose a reason for hiding this comment

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

Would have expected at least the react-releated stuff to follow react, hence making exceptions jumbles it up and seems random. i.e. we typically do (not the case here)

import React from 'react';
import { FormattedMessage } from 'react-intl';

(grouped above, easy to see relations)

Here React is the exception, the rest sorted so it is a mix-match. Small thing (and driving me crazy), but like with everything, allows us to not have to think "in this case we do it differently".

Not a crisis, still worth being consistent about.

@ngotchac
Copy link
Contributor Author

Okay, fixed grumbles and removed the PasswordStrength component from the New Accounts modal.

@coveralls
Copy link

Coverage Status

Changes Unknown when pulling 74dc32d on ng-password-strengh into ** on master**.

@jacogr
Copy link
Contributor

jacogr commented Jan 13, 2017

@gavofyork on your B0 -

  1. As this PR stands now it only covers the change area, hence not everywhere as it stands
  2. To get it covered, @ngotchac would need to revert some of his latest changes - simple enough (If we desperately want this in, should do that, even it is going to create issues for us backporting future 1.5/1.6 fixes related to this)
  3. Generally I prefer not putting in last-minute functionality changes when testing is underway, but up to you

@jacogr jacogr added A8-looksgood 🦄 Pull request is reviewed well. and removed A0-pleasereview 🤓 Pull request needs code review. labels Jan 13, 2017
@jacogr jacogr merged commit 4a714d4 into master Jan 13, 2017
@jacogr jacogr deleted the ng-password-strengh branch January 13, 2017 14:52
arkpar pushed a commit that referenced this pull request Jan 16, 2017
* Added new PasswordStrength Component

* Added tests

* PR Grumbles
gavofyork pushed a commit that referenced this pull request Jan 16, 2017
* verification: check if server is running (#4140)

* verification: check if server is running

See also ethcore/email-verification#67c6466 and ethcore/sms-verification#a585e42.

* verification: show in the UI if server is running

* verification: code style ✨, more i18n

* fix i18n key

* Optimized hash lookups (#4144)

* Optimize hash comparison

* Use libc

* Ropsten fork detection (#4163)

* Stop flickering + added loader in AddressSelector (#4149)

* Stop UI flickering + added loader to AddressSelector #4103

* PR Grumbles

* Add a password strength component (#4153)

* Added new PasswordStrength Component

* Added tests

* PR Grumbles

* icarus -> update, increase web timeout. (#4165)

* icarus -> update, increase web timeout.

* Fix estimate gas

* Fix token images // Error in Contract Queries (#4169)

* Fix dapps not loading (#4170)

* Add secure to dappsreg

* Remove trailing slash // fix dapps
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.

4 participants