Conversation
It looks like @CraigglesO hasn'signed our Contributor License Agreement, yet.
You can read and sign our full Contributor License Agreement at the following URL: https://cla.ethcore.io Once you've signed, plesae reply to this thread with Many thanks, Parity Technologies CLA Bot |
[clabot:check] |
It looks like @CraigglesO signed our Contributor License Agreement. 👍 Many thanks, Parity Technologies CLA Bot |
Marked onice for merging until #4967 merged/available. |
Closes #4824 |
As discussed - We need this on the Account page as well, i.e. going into account, being a able to export from there. |
accounts: PropTypes.object.isRequired, | ||
balances: PropTypes.object.isRequired, | ||
newError: PropTypes.func.isRequired, | ||
personalAccountsInfo: PropTypes.func.isRequired, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we keep this as accountsInfo
(just consistent with what we have everywhere else)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pesonalAccountsInfo? It's a redux action pulled in connect->dispatch. Lol, it does look like I added it in though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We are not using this anywhere? (Should be removed)
|
||
static ExportStore = ExportStore; | ||
|
||
componentDidMount () { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove if not used.
onClose: PropTypes.func.isRequired | ||
}; | ||
|
||
static ExportStore = ExportStore; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a specific reason this is not on the instance? Basically doing it twice will (on the second run), have the same selection/values as on the first.
.then((content) => { | ||
const text = JSON.stringify(content, null, 4); | ||
const blob = new Blob([ text ], { type: 'application/json' }); | ||
const filename = accounts[account].name; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should stick to the UUID naming as per Parity for the sake of consistency.
const { parity } = this.context.api; | ||
const { accounts, newError } = this.props; | ||
|
||
parity.exportAccount(account, password) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would move the interaction to the store. (As well as onExport, i.e. all logic in the actual store as opposed to the component)
js/src/ui/AccountCard/accountCard.js
Outdated
@@ -32,19 +34,22 @@ export default class AccountCard extends Component { | |||
className: PropTypes.string, | |||
disableAddressClick: PropTypes.bool, | |||
onClick: PropTypes.func, | |||
onFocus: PropTypes.func | |||
onFocus: PropTypes.func, | |||
password: PropTypes.bool, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
showPassword
? (On first read-through it looked like passing the actual password)
js/src/ui/AccountCard/accountCard.js
Outdated
@@ -88,6 +93,7 @@ export default class AccountCard extends Component { | |||
className={ styles.balance } | |||
showOnlyEth | |||
/> | |||
{ (password) ? this.renderPassword() : null } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ngotchac Happy with the approach or would passing children from the renderer be more appropriate? (Not unhappy, just concerned that this may blow up as we add more stuff - and currently the password is a single-instance use as well)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was thinking about this too. Should really just do children, as I could see in the future using accountCards in this way.
Some grumbles around the store and moving the actual RPCs there, in addition one question for @ngotchac around the password, may possibly be better to have a more generic |
const { passwordHint } = meta; | ||
|
||
this._newError({ | ||
message: `[${err.code}] Account "${name}" - Incorrect password. (Password Hint: ${passwordHint})` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should rather have this string in the view or make it and explicit FormattedMessage here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dunno. None of this code works anymore with the latest updates.
_pollStatus TypeError: Cannot convert undefined or null to object
Unable to update callback for subscriptionId 2 TypeError: Cannot convert undefined or null to object
Warning: Failed prop type: The prop 'balances' is marked as required in 'ExportAccount', but its value is 'undefined'.
So. It's a little more complicated then just a newError.
Although. I tried FormattedMessage and the newError ui does not handle it. Nor multiple errors.
https://github.com/paritytech/parity/blob/master/js/src/ui/Errors/errors.js#L59-L77
LGTM, just one message to move. |
All errors are fixed. As discussed on riot, I don't know how to fix newError, it's an action that takes an object and the errors ui component requires message to be a string.... If you want me to change the way errors is built, can I do that in a separate PR and than just update this one? |
Export accounts as json files
JS from #4967
some typos and need to finish adding in the api. Super close.