Commit Graph

382 Commits

Author SHA1 Message Date
Jaco Greeff
4f96fc0d3f
Merge next into master (#529)
* Update API deps

* Duplicate new Api from api

* Explorer renders

* Cleanup trapping

* Allow Moment values

* Vector -> Array

* Add mapping FIXME

* Updates

* proposals -> publicProposals

* QueueTx

* nonce -> accountNonce

* Cleanup (some) naming

* FIXME

* Cleanups

* cmp & isZero on UInt

* WIP... storage dropdowns may work after latest API PR...

* Misplaced .public

* Update exposed methods

* Remove getBlock checks (available in poc-3)

* Align method/section

* Align with API (method)

* api-codec -> types

* Reanme API interfaces

* Type updates, still very much a WIP

* We have updating queries... without params

* Chainstate app is working

* Get rid of some params imports

* Cleanups

* Remove app-example... outdated, non-working

* Remove app-example link from README

* Additional cleanups

* InputRpc dropdowns working

* We can make transfers (Transfer app)

* Call doesn't encode toU8a

* Cleanup to use extrinsics from Api

* Remove references to @polkadot/params

* Update deps

* Submitting transactions hsould work in app-*

* Bump

* Extrinsics app renders

* Extrinsic app can transfer

* Adapt travis.yml

* Force things to pass checks...

* Update @polkadot/dev for gh-pages -> next

* Bump dev (hopefully now gh-pages deploy)

* Default theme

* Don't skip signer for sending

* Don't throw on unknown types

* Signer queue rework

* Render input params for rpc

* Explorer click-through working

* Update deps

* WIP#327 - app-accounts with ss58 address inputs

* transformtoss58 returns valid address or null

* syntax

* app-accounts

* app-democracy

* app-extrinsics

* app-rpc

* app-staking

* app-transfer

* Generate ui-identicon from ss58 as input

currently handling null address with null return - there should be a better way to do this but it "works".

* ui-app

adapt onChange Props params

* manage identities with ss58 addresses rather than u8a.

also currently handling null value input, should be a better way to handle this but currently "works".

* ui-signer use ss58 address in keyring

* ui-signer combine duplicate imports

* ui-signer signMessage with ss58 address

derive public key by decoding ss58 input

* use 'accountId' as variable name instead of 'ss58'

* Addressing some issues

* sanity check for accountId by decoding and checking public key

* allow u8a account id types for more flexibility around short address input types in the future

* throw error on generate identicon with empty seed

* fix: accountId over publicKey

Transactions work in extrinsics and transfers.

* fix linting errors in  rpc, addresses, transfer, identicon

* accountId in stakelist

* Allow file upload for Bytes

* Extrinsic change updates correctly, Params track codec instances

* Unused import

* Cleanup conflicts, linting

* [next] Display balance with μ, k & m (#350)

* Display balance with μ, k & m

* balanceFormat to handle UInt

* let -> const

* Format static Balance properly

* Take care of new extrinsics format

* m -> M (not mili, mega)

* [next] Proposals & democracy updates (#352)

* Update README.md

* Proposals actually submit (non-valid atm)

* New API package

* Promposal propose

* Poposal decoding

* Proposal & Referendums show up

* Formats

* Proposal & voting works as expected

* Staking works as expected

* Staking & Democracy fully operational

* Update package.json

* [next] Update API deps (#354)

* Update API deps

* Update type locations

* Update api deps

* [next] Add mnemonic support from keyring (#356)

* Add mnemonic support from keyring

* Bump @polkadot/api

* Bump dependencies (#358)

* [next] Add app-settings (#359)

* [next] Add app-settings

* Update deps, cleanups

* Re-encode address for adding

* Action for seedType selection

* Revert denominations (#360)

* [next] Dependency bumps (#362)

* Bump API decoding

* Bump deps

* [next] Chain configs (#361)

* Revert denominations

* Chain Id

* Distinct colours

* Cleanup options for settings

* Adjust tests aftrer colour change

* Gated on isConnected & isReady

* Allow selection/add of AccountIndex

* Remove examples (code removed already)

* Reverse Id <-> Index lookups

* Index reverse lookups

* Usable AccountIndex

* [next] Bump API (#363)

* [next] Merge master (#364)

* Update README.md

* Re-lock account only after save

* trying to get mapping of nominators correct (#346)

* trying to get mapping of nominators correct

* changed double quote to single

* Fix for disabled chain state button bug (#351)

* merge prev and next params on Selection key change

* build error

* [next] Balance formatting (#365)

* Update README.md

* Re-lock account only after save

* trying to get mapping of nominators correct (#346)

* trying to get mapping of nominators correct

* changed double quote to single

* Fix for disabled chain state button bug (#351)

* merge prev and next params on Selection key change

* build error

* Load order (we need chain)

* Dropdown for seed type selection

* Allow SI unit selection on number inputs

* Remove unused function

* Cleanup BalanceFormatter

* Fix tests

* [next] Bump API version (#366)

* Bump API version

* Proposal construction & chain units

* Update Extrinsic -> Call

* Pass correct call params

* Cleanup linting

* Re-encode address on loading

* Bump

* Lint fix.

* [next] Import from package indexes (#370)

* [next] Import form package indexes

* Update deps, fix Transfer balance checks

* Add error on unlock

* Save account with hex encoded (not address)

* Import InputAddress for swap

* Bump @polkadot/api (staking nominators show up)

* Align api & util deps

* Bump @polkadot/api

* [next] Bump API, adjust call/method (#372)

* Bump API, adjust call/method

* Add votes correctly to yay/nay

* [next] Local Testnet

* Don't link block 0

* [next] FF Warning message (#374)

* FF Warning message

* Bump deps, massage message a bit

* Bump deps

* i18next upgrade changes

* Bump yarn to 1.10.1 in engines, travis (#379)

* [next] submitAndWatchExtrinsic for transactions (#377)

* WIP: Replace submitExtrinsic with submitAndWatchExtrinsic

TODO:
* don't `complete` when calling send, rather update as update messages come in from API
* adjust queue statuses in UI with new Status codec type from API.

* update api wrapper for subscribeAndWatch

* Update index.tsx

* subscribe to updates

* remove unneeded subscribe

* display result type

* Wrap up submitAndWatch status display

* Status background colours

* Revert indent

* Queue status icons (#380)

* [next] Bump dependencies (#383)

* Bump dependencies

* Update mock creation

* Don't mangle classes via uglify (#384)

* [next] Update status overlay styling (#385)

* Update status overlay styling

* Adjust colours for status messages

* Slight padding adjustments

* [next] refactor: Create export index files in ui-react-rx/src/{with/util} for single line destructuring imports (#388)

* refactor: Create ui-react-rx/src/with index of exports. Import single line destructuring

* refactor: Create ui-react-rx/src/util index of exports. Import single line destructuring

* refactor: Use ui-react-rx/src/ index of exports. Import single line destructuring

* refactor: Refactor to use exported index

* refactor: Refactor to use another exported index

* fix: Add missing license headers. Avoid import from index in same location

* [next] Support latest substrate master (#390)

* Update deps (api, compact support)

* Bump deps

* Update deps

* Compact<BlockNumber> for Header

* Handle Compact<*> rendering

* Cleanup warnings

* Update deps

* Not perfect, but warn on (invalid) hashes for blocks

* [next] keyring classify (#393)

* refactor: reorder imports and props alphabetically

* fix: Make class methods private

* fix: Restrict user restoring account to select only .json. Add missing withLabel

* refactor: Replace onBack with onCreateAccount and onRestoreAccount

* fix: Show console.log of error in try/catch of Backup/Restore

* fix: accountAll is array of objects

* refactor: Move Backup keyring logic into ui-keyring

* refactor: Move restoreAccount logic into ui-keyring

* refactor: Move validatePass to ui-keyring as isPassValid with MAX_PASSWORD_LEN

* refactor: Issue #138 convert closure to separate function declare, call, export

* refactor: Issue #138 convert function to ES6 class object

* refactor: Move addPair, create, createMnemonic, restore, save into Keyring class

* refactor: Move backup/encrypt/forget account, get accounts, and save account meta functions into Keyring class

* refactor: Move get address/addresses, forget/save address, and save recent functions into Keyring class

* refactor: Move isPassValid, isAvailable functions into Keyring class

* refactor: Move loadAll into Keyring class

* refactor: Move much of ui-keyring/options into Keyring class

* refactor: Move private methods to top of class

* fix: fix: Prevent creating multiple instances of Keyring class

* Prevent creating multiple instances of Keyring class. i.e. the following does not create the second instance:

```
const keyringInstance = new Keyring();
const keyringInstance2 = new Keyring();
```

* References:
	* https://codepen.io/JoeCoulam/pen/mRqbzz
	* https://medium.com/@dmnsgn/singleton-pattern-in-es6-d2d021d150ae
	* https://stackoverflow.com/questions/26205565/converting-singleton-js-objects-to-use-es6-classes/26227662#26227662

* fix: Prevent calling initOptions of Keyring singleton multiple times

* the following calls to initOptions are prevented since initOptions called when instance created with by loadAll() function:

```
const keyringInstance = new Keyring();
keyringInstance.initOptions();
keyringInstance.initOptions();
```

* test: Add test for Keyring singeton instance check and so initOptions only callable once

* feat: Move Keyring options back. Remove singleton check. Move initOptions check. Only export Keyring instance

* Move keyring options back into options folder

* Remove checking if Keyring is singleton

* Move checking if initOptions called multiple times and associated tests out of Keyring and into options folder file

* Add type to pair to fix linting

* Remove exporting Keyring class, only Keyring instance is exported

* refactor: Class-ify the Keyring options directory into a class named

* fix: Store state outside of Keyring instance

* refactor: Move keyring state into Keyring class. Add getters and setters

* Move observable accounts and addresses into Keyring class.

* Rename KeyringInstance interface to KeyringStruct (similar to app-settings)

* Add getter for keyring, accounts, and addresses to Keyring

* Add setter for keyring

* Add AccountSubject type

* Fix State type to use AccountSubject instead of AddressSubject

* Small private member tweaks

* Rework (overzealous private members)

* Fix rename in test

* [next] Block explorer event display (#392)

* Update README.md

* Re-lock account only after save

* trying to get mapping of nominators correct (#346)

* trying to get mapping of nominators correct

* changed double quote to single

* Fix for disabled chain state button bug (#351)

* merge prev and next params on Selection key change

* build error

* Updated required Node version in README (#367)

The minimum Node version is 10.1.0 as specified in the package.json 'engines'. The installation fails if the node version is below that (eg. v10.0.0 ), that's why I changed it in the README

* Simple (unformatted) event display

* section, method + types

* Display events on explorer

* Styling & overflow fixes

* Fix linting issues

* Node 10.13.0 LTS

* Revert message on block, reduce flicker

* [next] Update nvmrc version. Add missing packages to Readme. Indicate LTS required (#395)

* docs: Fix typo in Readme

* fix: Update nvmrc to version in package.json

* docs: Add missing packages to Readme. Indicate that LTS is required

* Render logs in expanded block display (#396)

* [next] Cleanup staking list balance displays (#397)

* Cleanup staking list balance displays

* Don't naked map balances (params passed)

* Cleanup block display with cleaner formatting (#398)

* Only filter dev accounts when in dev (#401)

* [next] Move BIP generation to worker (UI responsiveness) (#400)

* Move BIP generation to worker (responsive)

* Test & cleanup via local prod build

* [next] Fix length encoding for uploaded Bytes (#405)

* Fix length encoding for uploaded Bytes

* Remove addressed FIXME

* Cleanup linting, adjust encoding via helpers

* [next] Handle null nonce in extrinsics (in addition to undefined) (#407)

* Handle null nonce (in addition to undefined)

* Adjust types for partials

* Helper for submit RPC

* [next] Highlight validators (#402)

* Add isHiglight to IdentityIcon

* Display validator highlight in Address{Row,Summary}

* Highlight validators in AddressMini

* Highlight validators in AddressInput

* Display zero balalnce as 0 instead of 0.000f (#408)

* Cleanup explorer header display (#410)

* [next] Align article headers (all h3, no extra classes) (#411)

* Align article headers (all h3, no extra classes)

* Adjust overflowing columns in explorer

* Adjust app contemnt to cover screen (#412)

* [next] Retrieve hash instead of calculating (slower) (#415)

* Retrieve hash instead of calculating (slower)

* Cleanups

* Allow raw-key queries via the storage app (#416)

[next] Allow raw-key queries via the storage app

* [next] Remove IdentityIcon bond dependencies (#419)

* Remove IdentityIcon bond dependencies

* Cleanup tests

* Update README

* Update header

* Update headers

* Catch & display observable status errors (#422)

* [next] refactor: Move backup/restore functionality to Keyring. See details (#386)

* refactor: reorder imports and props alphabetically

* fix: Make class methods private

* fix: Restrict user restoring account to select only .json. Add missing withLabel

* refactor: Replace onBack with onCreateAccount and onRestoreAccount

* fix: Show console.log of error in try/catch of Backup/Restore

* fix: accountAll is array of objects

* refactor: Move Backup keyring logic into ui-keyring

* refactor: Move restoreAccount logic into ui-keyring

* refactor: Move validatePass to ui-keyring as isPassValid with MAX_PASSWORD_LEN

* fix: Change allAccounts type to SubjectInfo

* refactor: Example with clearer usage of  for React Dropzone

* [next] refactor: Issue #138. Convert closure into ES6 class object. Move methods into class (#387)

* refactor: Issue #138 convert closure to separate function declare, call, export

* refactor: Issue #138 convert function to ES6 class object

* refactor: Move addPair, create, createMnemonic, restore, save into Keyring class

* refactor: Move backup/encrypt/forget account, get accounts, and save account meta functions into Keyring class

* refactor: Move get address/addresses, forget/save address, and save recent functions into Keyring class

* refactor: Move isPassValid, isAvailable functions into Keyring class

* refactor: Move loadAll into Keyring class

* refactor: Move much of ui-keyring/options into Keyring class

* refactor: Move private methods to top of class

* fix: fix: Prevent creating multiple instances of Keyring class

* Prevent creating multiple instances of Keyring class. i.e. the following does not create the second instance:

```
const keyringInstance = new Keyring();
const keyringInstance2 = new Keyring();
```

* References:
	* https://codepen.io/JoeCoulam/pen/mRqbzz
	* https://medium.com/@dmnsgn/singleton-pattern-in-es6-d2d021d150ae
	* https://stackoverflow.com/questions/26205565/converting-singleton-js-objects-to-use-es6-classes/26227662#26227662

* fix: Prevent calling initOptions of Keyring singleton multiple times

* the following calls to initOptions are prevented since initOptions called when instance created with by loadAll() function:

```
const keyringInstance = new Keyring();
keyringInstance.initOptions();
keyringInstance.initOptions();
```

* test: Add test for Keyring singeton instance check and so initOptions only callable once

* feat: Move Keyring options back. Remove singleton check. Move initOptions check. Only export Keyring instance

* Move keyring options back into options folder

* Remove checking if Keyring is singleton

* Move checking if initOptions called multiple times and associated tests out of Keyring and into options folder file

* Add type to pair to fix linting

* Remove exporting Keyring class, only Keyring instance is exported

* refactor: Class-ify the Keyring options directory into a class named

* fix: Store state outside of Keyring instance

* refactor: Move keyring state into Keyring class. Add getters and setters

* Move observable accounts and addresses into Keyring class.

* Rename KeyringInstance interface to KeyringStruct (similar to app-settings)

* Add getter for keyring, accounts, and addresses to Keyring

* Add setter for keyring

* Add AccountSubject type

* Fix State type to use AccountSubject instead of AddressSubject

* Small private member tweaks

* Rework (overzealous private members)

* Fix rename in test

* merge latest from next. fix merge conflicts

* fix linting error

* fix: Remove unncessary code

* Bump API version (bugfixes) (#424)

* [next] Apply fee color classes correctly (#426)

* Apply fee color classes correctly

* Class ordering

* Adjust menu & IdentityIcon styling (#427)

* Cleanup proposal & referendum display (#429)

* [next] Cleanup Referendums & voting process (with Vec<KV>) (#431)

* Cleanup Referendums & voting process (with Vec<KV>)

* Remove FIXME (addressed)

* [next] Cleanup styling (#428)

* Adjust backgrounds to be slightly darker

* Cleanup validator/intentions lists

* update readme reflect removal of ui-react (#434)

* moved shared function to parent (#404)

* moved shared function to parent

* lint

* remove balance array dance

* lint

* Bump deps, metadata parsing (#436)

* article styling updates (#437)

* [next] Merge master, param change update (#438)

* Marge master, param change update

* Tie params to section.method

* [next] autoFocus app fields (#439)

* autoFocus app fields

* Toolbox autoFocus

* Cleanup warnings in staking nominate

* Align borders

* Remove unused var

* [next] Revert menu border override (#440)

* Revert menu border override

* Revert article single border

* Menu background

* Align grays

* Lighten content background

* [next] Support dynamic Tuple & Array inputs (#441)

* Allow Tuple value entry

* Fire Param events

* Remove extra debug log

* Allow entry of Array<*>

* Bump deps

* Bump deps (API d.ts fixed)

* [next] Display intention/validator name in staking list #303 (#448)

* Added getAccount() method to ui-keyring package

* Added getDisplayName function for staking accounts/ addresses

* removed deprecated argument from earlier approach

* formatting (added empty line)

* Removed unnecessary typecheck & encoding from getAccount(),

* Added getAccount to types.d.ts

* removed space

* changed type of `address` to string (failing build fix)

* [next] Backup warning modal on account creation #394 (#447)

* Added address summary and auto-download of backup file to 'create'-modal

* Removed deprecated code after falsy merge

* Fixed typo Plesae -> Please

* Move check for whenCreated property from saveAccount to separate method

* removed unnecessary return statement

* grammar fix 'was' -> 'is'

* Added Highlight to Modal class, styling adjustments

* removed surrounding <p> in modal content

* Changed Modal.Highlight to built in MUI Modal.Description

* renamed translation key of Modal.Description

* Moved timestamp creation back to save Account

* [next] Explicit Identityicon prefix (#446)

* set IdentityIcon default prefix

* Update with import from keyring

* Rework encoding/decoding of addresses

* Update keyring deps

* [next] Bump deps (#449)

* Bumpo deps, work around i18next definitions being wonky (again)

* Cleanup yarn.lock

* [next] add user notifications in App-Accounts (#391)

* add toaster for app-accounts status changes

* status notifs

* linter

* lint

* refactor with addressmini

* remove debugger statement

* fixintl, status obj creation pattern

* lint

* Track events globally, alert use (notification pop-up)  (#413)

* move Status component to ui-app

* move status stuff up the component tree

some more generalizations with action types

* global status

currently works in app-accounts and ui-signer

* I18n and linting

* lintlint

* style

* add notifs to app-address

* status notifs with backup, changepass

* addresses unnecessary translates

* lint

* Fix merge

* Vector should not render add/remove in isDisabled mode (#452)

* [next] Bump API version (#455)

* Bump API version

* Bump deps

* Update README and LICENSE

* Bump dependencies

* [next] Track extrinsics, don't allow until accountIndex is updated (#406)

* dont allow queueing until accountindex increments

* WIP: deny txn submit before account nonce increments

* readding blocked extrinsics to the queue. Still need to properly set the accountNonce though

* queue unclog

* remove unnecessary _this=this scoping dance

* Moving the need for `?:` to a separate issue

* update types to match codec, account for different accountid with same nonce

* Fix toString for undefined (#456)

[next] Fix toString for undefined

* [next] Cleanup translate HOC definitions (#457)

* Cleanup translate HOC definitions

* Alignment

* [next] Bump API for Grandpa compat (#461)

* Bump API for Grandpa compat

* Update types for new API

* [next] Handle byte display consistently (#463)

* Handle byte display consistently

* Chack blocked status against completed status

* Bump

* Democracy countdown (lauch & voting) (#464)

* Bump API to handle StorageData -> Bytes with prefix (#466)

* Bump dependencies, align with stricter TS checks (#467)

* Only remove local files, not nested (#468)

* Bump api deps (#469)

* Display nonce via toString(), cleanup blocked checks (#470)

* [next] Bump deps, update with linting rules (#472)

* Bump deps, update with linting rules

* Update root package config

* Revert testing ruleset config

* Update tslint config pulling in dev-react

* Bump deps with UI packages, remove now unused eslint config (#474)

* Move types.d.ts -> types.ts (#475)

* [next] Bump dependencies (#481)

* Bump deps

* Bump deps

* Cleanup lintin issues with 3.2.1

* Bump @polkadot/api with Tuple map support

* Format JSON results from RPC app

* [next] Make settings accessible from non-running node (#484)

* Add onCopy to IdentityIcon

* Allow settings to be accessible when no node

* Proper license naming for identicon (#488)

* [next] Split ui-{identicon,keyring,settings} into ui repo (#491)

* Split ui-{identicon,keyring,settings} into ui repo

* Correct settings import from ui-app

* Use @polkadot/ui-* split from npm

* Update with latest @polkadot/ui

* Migrate to travis-ci.com, bump deps

* Change non-local imports to direct

* #459 Add spread and copy buttons for substrate.code query (#465)

* #459 Add spread and copy buttons for substrate.code query

* fix code style checks

* render spread&copy buttons for all queries which produce byte code

* Type and name refinement

* #459 A first revision where spread functionality for Byte queries is implemented

* remove state property

* Review fixes

* Review fixes

* break query output for overflowing content

* call valueToText with -1

* Fix linter issue

* [next] Global shared status queue and consumer (#490)

* Global shared status queue and consumer

* Bump deps

* Adjust styling

* Remove copy (unimplemented), spread & concat

* [next] Display received events (balalnces.Transfer atm) (#494)

* Display received events (balalnces.Transfer atm)

* Cleanup Status class

* Keys for values in Vector

* Extra information on address decode errors (#495)

* [next] Cleanup React & API errors (#498)

* Cleanup React & API errors

* Revert value override, breaks input

* InputNumber does not switch between controlled and uncontrolled

* Status has key for entries

* Adjust receive icon

* Bump dependencies, cleanup Unknown types (#499)

* Bump dependencies, cleanup Unknown types

* Cleanup status styling, icon stretch

* [next] fix: Fixes #493. Contain logs digest item within div (#497)

* fix: Fixes #493. Contain logs digest item within div

* refactor: Remove monospace and drop-down css. Add only wrapping and space between elements

* fix: Remove AuthoritiesChange, forgotten how that got there, but not required

* Allow onCopy Status for IdentityIcon (#501)

* Allow onCopy Status for IdentityIcon

* Clanup same-package imports

* [CI Skip] Update .codeclimate.yml (#502)

* [next] Bump dependencies (#503)

* Bump dependencies

* Bump dependencies

* Downgrade react-dropzone (8.x has new context API)

* Bump deps (API types fix)

* Cater for check where key has no meta (#504)

* Align number inputs to 0 defaults (#506)

* fix InputAddress display (#509)

* [next] Bump dependencies (#512)

* Bump dependencies

* Don't change status (flicker) when completed

* Expand status timeout

* Pull svg from ui-assets (#513)

* [next] Read chain properties, inject (#514)

* Read chain properties, inject

* Linting

* Bump deps (#520)

* Bump deps

* ... and include lockfile

* [next] Support latest Polkadot types (#523)

* Bump deps, latest Polkadot types

* Rendered for ParaId

* [next] Charred Cherry support (#522)

* Charred Cherry support

* Update deps to include CC

* Update injection & new method interfaces

* Naming, extrinsic vs method

* Update ExtrinsicStatus results

* Bump deps

* [next] launguage -> language (#524)

* [next] Bump deps, support latest metadata struct (#525)

* Bump deps, support latest metadata

* Bumpdeps

* Bump dev

* Bump local deps

* Display target period * 2 (#526)

* Alexanber support (#528)

* Bump API

* Bump deps

* Fix referendums, chain id for Alexander

* Bump deps
2018-12-21 17:17:26 +01:00
Travis CI
f2ad55570f [CI Skip] 0.20.30 2018-11-26 09:12:00 +00:00
Radka Gettová
bc50ad0ad9 Make Block Hash "Hover to Copy"-able (#458) 2018-11-26 10:06:24 +01:00
Travis CI
2b76730194 [CI Skip] 0.20.29 2018-10-17 14:40:26 +00:00
Travis CI
70d9f1b169 [CI Skip] 0.20.28 2018-10-11 20:39:43 +00:00
kwingram25
31372afb31 Fix for disabled chain state button bug (#351)
* merge prev and next params on Selection key change

* build error
2018-10-11 22:34:56 +02:00
Travis CI
d8c15858dd [CI Skip] 0.20.27 2018-10-09 17:57:23 +00:00
Marni
456e6202c4 trying to get mapping of nominators correct (#346)
* trying to get mapping of nominators correct

* changed double quote to single
2018-10-09 19:51:46 +02:00
Travis CI
fe52bcb730 [CI Skip] 0.20.26 2018-10-09 15:26:16 +00:00
Jaco Greeff
0a38f454e3
Re-lock account only after save 2018-10-09 17:21:14 +02:00
Travis CI
25d57d0be3 [CI Skip] 0.20.25 2018-10-04 19:03:46 +00:00
Travis CI
a774ff9c82 [CI Skip] 0.20.24 2018-10-03 19:23:31 +00:00
YJ
9d29d9ccfc change button ordering (#345) 2018-10-03 21:17:35 +02:00
Travis CI
11ab5152a1 [CI Skip] 0.20.23 2018-09-30 11:35:30 +00:00
Luke Schoen
9a33e05d54 fix: Show errors. Add Password maxLength. Fix classes lib. Fix styles. (#335)
* Account change password

* Small cleanups

* Props, State to Component

* fix: Allow change account immediately after create account without refresh page

* fix: Add missing label prop to allow overriding default label

* feat: Add maxLength of 32 to Password component and pass prop to Input

* fix: Restricted spacebar key in Password using onKeyDown

* fix: Add missing classes library to Password component Input

* fix: Add className to ChangePass modal component using classes library

* fix: Reorder props alphabetically

* fix: Add missing  namespace to className of AddressSummary in ChangePass

* fix: Show submission errors in ChangePass modal using Semantic Message component

* fix: Add side padding to error component in ChangePass modal

* fix: Removed unused variable to fix TS lint error

* revert showing error messages

* fix: Revert restriction so allow spacebar key in Password using onKeyDown

* fix: Add className to outer Modal component
2018-09-30 13:29:08 +02:00
YJ
f32ba0f92d quickfix - typo (#342) 2018-09-30 13:24:11 +02:00
Travis CI
f47abef443 [CI Skip] 0.20.22 2018-09-30 11:07:26 +00:00
Luke Schoen
759070488a fix: Fixes #340 prevent spaces in InputNumber (#341)
* currently user cannot enter "0 ", but this prevents user from entering a space after any digit, i.e. "3 4" or "3  " or "3   3  3  "
2018-09-30 12:59:55 +02:00
Travis CI
3626705ada [CI Skip] 0.20.21 2018-09-28 16:57:13 +00:00
YJ
45790239d7 fix #266 - helpful error message when input address is not in intentions list (#338)
* helpful error message when input address is not in intentions list

* check address format is valid, set error msg if not

* fix: state validate

* fix: translatable strings, address format validation from decoded address

* Import Labelled Component for error reporting

* Translatable labelled error reporting components

* handle assertion errors when decoding nominee address

* create ui-app general InputError component

* Use Input Error component to format input errors

* edits to setting state for readability and DRYness

* edits for style guidelines, remove 'any' types
2018-09-28 18:51:00 +02:00
Travis CI
ce83d2d17c [CI Skip] 0.20.20 2018-09-26 18:31:10 +00:00
Jaco Greeff
818dfb2498
Account backup & restore functionality (#333)
* Account JSON backup & restore

* import isObject from correct package

* Fix isLocked logic

* Add "or"
2018-09-26 20:24:43 +02:00
Travis CI
e089a6c395 [CI Skip] 0.20.19 2018-09-26 14:55:30 +00:00
Luke Schoen
0c8e19911c fix: Fixes Issue #144. Extrinsics with high balance restarts webpage (#221)
* fix: Fixes Issue #144. Balance to submit with transaction changed to string

Placeholder indicates acceptable range of values to user in the interim until form validation incorporated.
Max value must be the balance of the account minus one, otherwise the Polkadot Node will give error `Runtime: proposer's balance too low`.
Min value must be above 0.000000000000001, otherwise the Polkadot Node will give error `Runtime: proposer's balance too low`

* fix: Add validations to string input. Add unit tests

Note that entering a large number after all inputs are valid (including code dragged and dropped) causes error `Uncaught Error: byte array longer than desired length`. This is because it only starts encoding after all input fields are valid, but the maximum balance is 64 bits for poc-1 and 128 bits for latest master branch

* fix: Add internationalisation, maxLength to input, validate depending on chain used

- add internationalisation
- add maxLength to input field depending on whether poc-1 (64bit) or latest (128bit) chain used
- pass down api chain data via props
- add unit tests for balance input field, new tests not all passing but don't understand why. since using unsigned 64bit and 128bit
- add balance input field validation to only accept numbers
- when i add `&& maxBN64Bit.gte(inputBN)` or `&& maxBN128Bit.gte(inputBN)` it doesn't appear
to work correctly as in the UI it doesn't allow a length as much as expected

* fix: Must pass in as string as String(xyz) converts to scientific notation x...e+21 for large numbers

* fix: Remove String(xyz) that was converting to scientific notation. Throw on it or non-string input.

* fix: Prop value is BN converted to string with toString(10) according to BN.js docs

* fix: Translate the placeholder

* refactor: Move external dependencies above local. Add missing whitespace

* fix: Scientific value detection on e+ not just letter e

* feat: Add input field validation message notification to extrinsic balance

* refactor: Move expected responses generation into enum in separate file

* WIP - trying with input type number and onKeyDown

* WIP - split into onKeyDown and onKeyUp

* feat: Add scientific notation equivalent in info message. Yet to use converted value when submit

* fix: Allow user to select all that they've entered in input field

* feat: Converts from scientific notation with submit. Need to fix input as crashes on 9e19

* fix: Remove debugging console.log so it doesn't crash

* fix: Calculate size based on actual bitlength before checking BN value against max

* fix: Allow use of decimal point only in scientific notation. Prevent successive decimal point entry

* fix: Update error message with example

* feat: Create InputNumber instead of extending Balance. Requires PR with mods to polkadot-js/apps

* fix: Remove accidently added vscode config

* fix: Remove step and min props since not using input type number

* refactor: Remove debugging console logs from extrinsics

* fix: Remove disused step

* fix: Remove comments and add whitespace

* fix: Remove unnecessary check if balance is defined when it must be

* fix: Fix logic

* fix: Show error when user enters e or e+ without a number afterwards

* test: Update existing tests. Still must add new tests

* test: Fix tests for scientific vs exponential notation

* test: Add remaining tests

* test: Refactor tests in order used

* refactor: clean up comments and duplicate code

* fix: Replace implementation with restrictions on key combos instead of horrible previous approach

* fix: Prevent notification with info from displaying when there are errors. Remove console logs

* fix: Prevent user pasting balance in exponential notation with invalid exponent. Only allow + symbol entry immediately after letter e

- Only allow user to enter + symbol immediately after letter e for exponential input.
- Prevent error when user pastes input with invalid exponent (i.e. when user pastes into the input field for Balance 232e11+ it was crashing with error `error:  RangeError: Invalid array length
    at scientificToDecimal`)

* refactor: Add comment to input cursor and move

* remove todo note

* fix: Prevent user entering 0's at start

* restore: Restore Balance instead of incorrect implementation of InputNumber

* WIP - initially add generic identity function where Balance wraps InputNumber type

* remove generic ident fn

* feat: Add GenericInputNumber

* fix: Add InputNumber generic wrapper of Input and Notification for use in Balance or elsewhere

* fix: Address review comments.

* fix: Fix linting errors and remove useless new line

* fix: Add WarnMessage. Remove UI message for it to be account balance minus 1

* fix: Fix bitLength error when small amount entered. Fix NaN test. Allow input of 0 with warning.

* fix: Allow select all, cut, copy, paste whilst preventing input of a, x, c, v

* fix: Fix linting error that appeared in CI

* fix: Remove conflicting restriction on use of 0

* test: Add enzyme test for default load of Balance component

* test: Add basic enzyme tests to simulate Info, Warning, and Error Notifications

* fix: Address some review comments. See commit details

* Refactor nested condition into `isValidLength` instead of `(values[index].type === 'Balance' ? checkValueBitLength(...`
* Fix alphabetical ordering
* Change to `Between 0 DOT` instead of `Between 1 DOT`
* Add License heaer to chainSpec.ts
* Replace `if (!(typeof input === 'string')) ` with `isString`
* Add blank lines for all blocks in isValidBalanceExpectedResponses.ts

* fix: Remove NaN check since unnecessary. Replace with test for just single e input

* Remove check for NaN since unnecessary. NaN is not string type so will show error associated with the test for string
* Add initial check for input value that contains just 'e' since it should not show same error message as say '1e'

* fix: Revert to just allow integers and decimals without scientific notation

* docs: fix comments

* refactor: Split isValid ternary across multiple lines for readability

* refactor: Remove unnecessary blank line

* fix: Remove nested if condition

* refactor: Split isCopy function definiton from function body implementation similar to in ui-signer

* refactor: Split function definition from function body for all keyboard utils

* fix: Replace event any type with KeyboardEvent type for all keyboard functions

* fix: Remove TranslateFunction with just string as type of messages

* fix: Replace deprecated keyCode and which with key.

* fix: Move isValidLength into isValidBalance

* fix: Split imported packages

* fix: Split imported packages in Balance spec

* fix: Change placeholder to request positive integer input and update messages

* refactor: Split function body onto new line

* fix: Split function body onto new line for readability

* refactor: Split ternary across multiple lines

* fix: Use BN instead of Number for info message

* fix: pass up destructured event properties

* fix: Remove SUIEvent type definition

* fix: Reduce maxLength in digits that user allowed to enter by 1

* merge latest from master

* fix: Remove transfer terminology from Balance placeholder

* Move logic to child

* fix: Remove assignment to optional

* fix: Remove DOT references since number can be anything and substrate chains have own token

* fix: Add missing blank lines and reorder alphabetically

* Non-numeric keys outright without error notification. Use MAX_SAFE_INTEGER built-in

* fix: Reordering

* fix: Remove showing error to user when they enter value over max bitlength

* fix: Restrict user enter value greater than max safe integer

* fix: Do not pass translate down from Balance. Fix tests

* test: Move tests to InputNumber

* Return only value from onChange in InputNumber. Bug since isValid keydowns allowed

* fix: Fixes review comments. See commit message details:

* `onChange` in InputNumber is just `onChange: (value: BN) => void` without an `isValid` property. `isValid` is now set to `true` in Balance as we've taken care of all the invalid cases (i.e. automatically reverting the input if the user pastes an invalid value, or preventing input of non-decimal values in keyDown)

* New input value is reverted to previous valid input field value if the input field value becames invalid (i.e. if they enter a value that's above the maximum allowable). i.e. 0.1111111111111111111111111111111 is allowed, but if any additional 1's are entered (i.e. 0.1111111111111111111111111111111111111) at the end it exceeds max for 128 bit, and we automatically prevent these invalid values from being entered (instead of informing the user through a notification).

* Refer to input as "input" instead of "balance" (i.e. for i18n keys, etc)

* Remove duplicate `KEYS.BACKSPACE`

* Add unit tests for isNonDecimal and isNonInteger

* Remove `KEYS.ZERO` from `KEYS_ALLOWED` and add to isValidDecimal and isValidInteger checks instead

* Split isValidNumber into isValidNumber and isValidKey. Since keyDown has access to the key and can prevent the input (but only has access to the previous input field value before the new key was entered), we check if the the new key entered is valid in isolation of the whole valued by calling isValidKey. Then in onChange where we have access to the new input field value we validate it calling isValidNumber.

* In InputNumber.tsx the Input component accepts `defaultValue={defaultValue || '0'}`, and also we're also overriding the value with the previous valid value with `value={revertedValue}` if the user input is found to be invalid. However React complains with the following errors in the browser Chrome Inspector:

```
Warning: Input contains an input of type text with both value and defaultValue props. Input elements must be either controlled or uncontrolled (specify either the value prop, or the defaultValue prop, but not both). Decide between using a controlled or uncontrolled input element and remove one of these props. More info: https://fb.me/react-controlled-components
```

```
Warning: A component is changing a controlled input of type text to be uncontrolled. Input elements should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled input element for the lifetime of the component.
```

I have tried as many ways as possible to just use one or the other (i.e. defaultValue or value) to resolve these warnings but so have not being able to replicate the same functionality that works.

* fix: Remove new line

* fix: Remove complexity. See detailed commit comments

Progress update:

* ASSUMPTION: InputNumber may be used in future for useful error, warning, and info messages, so leave the boilerplate props along with Notification.

* ASSUMPTION: Displaying an info message in scientific notation i.e. 3e+7
causes more confusion than benefit since most users are non-techy. In future this when we have Issue #86 Settings App, it could be added as an optional extra that could be toggled by the user along with Issue #224 E-Notation

* ACTIONS:
	* [x] - Remove display of scientific notation equivalent
	* [x] - Remove warning 'number.warn.zero' when user enters 0 value
	* [x] - Remove info notification 'number.info.scientific' when user enters valid value
	* [x] - Remove `toScientificNotation` function, which is incorrectly passed the TranslationFunction `t` anyway.
	* [x] - Remove `IsValidWithMessage` type and replace return value with just a boolean of whether its valid or not
	* [x] - Move `isValidNumber` into React componet, and do not pass the TranslationFunctio to it!
	* [x] - Move `isValidKey` into React componet, and do not pass the TranslationFunctio to it!
	* [x] - Move `isNonDecimal` into React componet, and do not pass the TranslationFunctio to it!
	* [X] - Remove `isNonInteger` and isNonInteger.ts and isNonInteger.spec.js since no longer using
	* [X] - Remove `error`, `warn`, `info` from InputNumber state, since we're filtering out everything not valid. Instead add them as optional props (so Balance or another component can display notifications if required)
	* [X] - Move tests for isValidKey into InputNumber React component, and remove isValidKey.spec.js
	* [X] - Move tests for isValidNumber into InputNumberReact component, and remove isValidNumber.spec.js
	* [X] - Move tests for isNonDecimal into InputNumberReact component, and remove isNonDecimal.spec.js
	* [X] - Update InputNumber.spec.js to remove useless tests that check that the Notification component isn't shown
	* [X] - Make methods `private` as relevant
        * [X] - move chainSpec and keyboard subfolder files into InputNumber. Move contents of constants into InputNumber except for BIT_LENGTH_128
	* [X] - Move all the different files that are only used in the number input into functions inside that input. Then we also get rid of calling external functions (like isNumberValid) with t as a param. Keep it small, keep it together.
        * [X] - Remove `cursorIndexInputField` function since we're not trying to check the current cursor position in the input field anymore
	* [X] - Assume that based on @jacogr's comment: "I'm struggling to see where we are actually now doing errors in the Balance input - it filters everything non-valid.".
          * Action: Change isValid from being true, to being assigned to the value of !isError
        * Note: DO NOT update the Extrinsics component to use the 'fees' observable (as it's used in the Transfer App) so the Balance input field is invalid (appears "red" and Submit Transaction button disabled) when the value entered plus fees exceeds the sender's balance. Reasoning: We cannot determine the size of the tx in there at all - there is a FIXME for the hardcoding of the size (already wrong for poc-3), in the Transfer App. So without the final signed size, it currently cannot be done. `fee = baseTxFee + (tx-size-in-bytes * feePerByte)`. We cannot get the tx-size-in-bytes atm. (hardcoded to 156 in Transfer, which assumes only publicKeys and is not the case when we get to poc-3). There is an issue logged that goes through all the fees. Signer needs to have a method exposed that takes all the params as given, encodes the extrinsic and returns the total fee or size. So nothing stopping us, it just has not been done properly. (Signer does not even know in the modal what the final size would be - that is the first stop, showing the fees in there. Then the apps, then maybe extrinsics if it still has a use)
	* [X] - "Seems SUI docs are currently broken. But in the cases where you absolutely need to point to an input with an attachment, their Label does exactly that and allows attachment with a pointer to an Input. So at most Notification should just warp that. And it really should only be used is completely exceptionally circumstances. (And I really couldn't see any such circumstances from playing with the actual inputs. So at this point seems like a good, although unused in practice idea.)"
          * [X] - Remove Notification component, and all the error, warn, and info props, as we won't be showing notifications
	* [ ] - Integrate into the Transfer App `send a value of` where actual transfers will be done (see @jacogr comment and screenshot). Incorporate the Balance/InputNumber into the Transfer App, which currently just uses an <Input> field and isError={!hasAvailable} to determine highlight the input field "red" and disable the Submit button when they don't have sufficient balance.
         * ACTION: Unable to get this to work. If I change the Input to Balance in Transfer.tsx to the following, then when I modify the value in the Transfer tabs "send a value of" input field, it shows an `Error: Assertion failed` in the console
```
            {/* <Input
              defaultValue='0'
              isError={!hasAvailable}
              label={t('amount', {
                defaultValue: 'send a value of'
              })}
              min={0}
              onChange={this.onChangeAmount}
              type='number'
            /> */}
            <Balance
              defaultValue={{ value: '0' }}
              isError={!hasAvailable}
              label={t('transfer.amount', {
                defaultValue: 'send a value of'
              })}
              onChange={this.onChangeAmount}
            />
```
Error mentioned above:
```
InputNumber.tsx?299c:129 Error: Assertion failed
    at assert (bn.js?cda7:6)
    at BN._initArray (bn.js?cda7:145)
    at BN.init [as _init] (bn.js?cda7:82)
    at new BN (bn.js?cda7:39)
    at Transfer.onChangeAmount.amount (Transfer.tsx?f63a:45)
    at Balance.onChange.value (Balance.tsx?8315:42)
    at InputNumber.onChange.value (InputNumber.tsx?299c:127)
    at Object.Input.onChange.event [as onChange] (Input.tsx?a939:36)
    at apply (_apply.js?59ad:15)
    at baseInvoke (_baseInvoke.js?199b:21)
```

* fix: Move BIT_LENGTH_128 into InputNumber

* refactor: Remove disused keys from constant. Remove useless isShift fn. Use Spread operator.

* refactor: Simplify comments

* refactor: remove useless maxSafeIntegerBN

* refactor: remove useless check for isZero

* refactor: Simplify isNonDecimal function

* refactor: remove maxValue from being maxLength arg. remove useless defaultMaxLength fn

* fix: Use InputNumber in Transfer instead of Balance

* refactor: move non-number specific keyboard functions to Input instead of InputNumber

* refactor: Reorder alphabetically exports

* refactor: Remove disused withApi and translate from Balance and simplify defaultValue

* refactor: spread operator to pass down props before overrides if any

* test: Add more isValidNumber tests. Add maxValue and isValidBitLength tests

* fix: fix maxValue function

* test: Add maxLength test for 128 bit

* refactor: remove unnecessary line in test

* fix: Remove support for decimals since BN.js only supports integers

* refactor: optimise by using isNaN instead of isNonInteger for single character checks

* fix: revert using spread operator to pass down props

* fix: Add bitLength prop to InputNumber. Move maxConservativeLength function. See detailed comments

* bitLength passed down as prop from Transfer and Balance to InputNumber is 128 bit for latest chain specification

* Move maxLength method out of InputNumber class and rename maxConservativeLength also to avoid name conflict with the maxLength prop

* Change argument of maxConservativeLength to the maxValueLength to simplify

* Update InputNumber tests

* Add default bit length for InputNumber is 32 bit for normal numbers

* fix: Add BitLength type and BitLengthOption enum

* fix: prevent user entering value preceded by 0

* refactor: Replace ternary with more readable

* feat: Add 8 and 16 to BitLength for future-proofing and consistency
2018-09-26 16:45:41 +02:00
Travis CI
8b9080566a [CI Skip] 0.20.18 2018-09-26 06:22:25 +00:00
Jaco Greeff
ad4e976f54
Account change password functionality (#332)
* Account change password

* Small cleanups

* Props, State to Component
2018-09-26 08:14:48 +02:00
Travis CI
0720454772 [CI Skip] 0.20.17 2018-09-21 08:38:56 +00:00
Jaco Greeff
65bc158582
Cleanup app-accounts, align with addresses (#331)
* Cleanup app-accounts, align with addresses

* Remove 'restore' action (copy gone wrong)

* Bump dependencies

* Bump deps (again, api was not included properly...)
2018-09-21 10:33:39 +02:00
Travis CI
ce091f203e [CI Skip] 0.20.16 2018-09-19 12:49:52 +00:00
Jaco Greeff
15788c1051
Check valid params fro RPC app (#321) 2018-09-19 14:42:51 +02:00
Travis CI
2195ca131d [CI Skip] 0.20.15 2018-09-19 10:49:35 +00:00
Thibaut Sardan
d58aa09cf2 modify voting button and graph colors (#328) 2018-09-19 12:43:29 +02:00
Travis CI
df03d413dd [CI Skip] 0.20.14 2018-09-19 09:52:17 +00:00
YJ
a86bcc76cf FIX#323: dont call trim on trim nonstring type value (#326) 2018-09-19 11:38:24 +02:00
Travis CI
e2f4f2de71 [CI Skip] 0.20.13 2018-09-18 14:26:41 +00:00
Pierre-Luc Gagné
678a65609d Added a warning popup at account creation for seed backup (#325)
* Added a warning popup at account creation for seed backup

* change i18n labels
2018-09-18 16:20:01 +02:00
Travis CI
8ee702a811 [CI Skip] 0.20.12 2018-09-18 08:49:02 +00:00
Travis CI
94d4a958dc [CI Skip] 0.20.11 2018-09-18 08:40:20 +00:00
Jaco Greeff
2aea3178bf
Update Api, remove poc-1 compatibility (#318)
* Update Api, remove poc-1 compatibility

* Update deps
2018-09-18 10:31:48 +02:00
Travis CI
9848ecbb65 [CI Skip] 0.20.10 2018-09-14 14:39:08 +00:00
Jaco Greeff
86a32683b3
Substrate theme with different Identicon (#313)
* Substrate theme with different Identicon

* Typo
2018-09-14 16:32:40 +02:00
Travis CI
3b768db359 [CI Skip] 0.20.9 2018-09-14 13:28:20 +00:00
Jaco Greeff
935b28c9b9
Adjust staking overview display (#312) 2018-09-14 15:20:15 +02:00
Travis CI
82be7d8905 [CI Skip] 0.20.8 2018-09-14 11:17:11 +00:00
Jaco Greeff
4364b9939d
Fix transfer copy, cleanup styles (#311) 2018-09-14 13:10:51 +02:00
Travis CI
624fe6953d [CI Skip] 0.20.7 2018-09-14 10:46:40 +00:00
Jaco Greeff
b903f63ff3
Fix Address add flicker (#309)
* Fix Address add flicker

* Clenaup unused

* use getDerivedState in Tabs

* Mark functions private

* Creator autoFocus on Input

* No extra {} on proptype
2018-09-14 12:40:35 +02:00
Travis CI
a5e1fa003d [CI Skip] 0.20.6 2018-09-13 14:37:15 +00:00
Jaco Greeff
f22189d955
Render nominators in staking view (#301)
* Add validators App

Fix #191

* Pull validator breakidown into staking overview

* Fix layout

* Add AddressRow component

* Minor CSS fix

* Use standard address components in the staking app

* Use new components and cleanup

* Refactor and layout work on the validators

* Re-use already available components

* Remove app-validators in tsconfig

* Render nominators

* Use row defaults applicable

* Small css fixes
2018-09-13 16:30:30 +02:00
Travis CI
b50a378c6f [CI Skip] 0.20.5 2018-09-13 13:57:18 +00:00