feat: add ability to export network specifications from network setting screen#2360
Conversation
jacogr
left a comment
There was a problem hiding this comment.
Will take a look when CI is happy, atm seems like a draft, so probably too early.
|
yeah, it is work in progress, I will update it in the weekend. |
c785ace to
59f8eb6
Compare
jacogr
left a comment
There was a problem hiding this comment.
Will go through, but I must admit that I am completely at a loss here. So we are generating a screen with random inputs that is not way tied to anything on chain and then get a QR to scan this?
|
The idea is if user is using their own node, and want to export the network information to Signer (related issue ) they will need to get the networrk info. It is convienient and trusted to directly use Polkadot.js to get these info. Network info mainly can not be changed, whereas user is still capable to change name, path id and color. |
|
Ok, the issues is that all that info is available in chain properties, ss58, decimals, etc. - yet we expect the user to input these? Does not make any sense to me. |
|
|
|
Ok, so what is color meant to be? PathId? (Colors are aligned with Polkascan based on chain only in apps, pathId has no meaning) |
|
I did not realize that there is already Path ID is special for Signer, when user derive a network for an identity, the derived account will automatically prefixed with its |
|
The "special to signer" stuff I would remove here. Atm it has not context in the Apps UI (paths are on the list somewhere here, as in the extension, but it really is app-specific. Passing stuff along is fine, but it needs to be known on both sides) PS: Sorry fo the stoopid questions earlier, I missed the initial screenshot - and then (mistake #2), also missed the |
|
Removed the pathId in commit 71effda , building test cannot pass because polkadot-js/ui#299 is not merged. |
71effda to
741d91a
Compare
|
Refactor Modal into "Metadata" tab, see the updated screenshot in PR description. Thanks for adding |
| const _onSetRandomColor = (): void => setNetworkSpecs({ color: getRandomColor() }); | ||
| const _checkColorValid = (): boolean => /^#[\da-fA-F]{6}|#[\da-fA-F]{3}$/.test(networkSpecs.color); | ||
|
|
||
| return <div |
There was a problem hiding this comment.
Can we just adapt this form to be -
return (
<div className={className}>
...Co-Authored-By: Jaco Greeff <jacogr@gmail.com>
…ps into hanwen-exportNetworkSpecs
|
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
It would be nice if we could have an additional button to export the current network specifications to QR code, which could be used for Signer or otther places.
It rely on the PR on Polkadot.js/UI for display the networkSpecs QR code : polkadot-js/ui#299
How it works
After node connected, user could click the button, and the current network specs will be shown.
User could set the color with a 6-digit hex text input, or use a
generate randombutton.How to Test
Sidebar Select "Settings" Button -> Select "Metadata" Tab