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

Add operator #3

Merged
merged 94 commits into from
Nov 20, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
94 commits
Select commit Hold shift + click to select a range
6a053c2
Change selection for council votes (#1865)
jacogr Nov 11, 2019
6ddfaf0
[CI Skip] 0.37.0-beta.66
actions-user Nov 11, 2019
2a52609
Add staking favorites (top of list) (#1866)
jacogr Nov 11, 2019
25c5057
[CI Skip] 0.37.0-beta.67
actions-user Nov 11, 2019
a3b3eb9
Small fav display tweaks (#1868)
jacogr Nov 11, 2019
c27bed0
[CI Skip] 0.37.0-beta.68
actions-user Nov 11, 2019
5ec79fa
Add fav & current as nominations (#1869)
jacogr Nov 11, 2019
043b4ca
[CI Skip] 0.37.0-beta.69
actions-user Nov 11, 2019
94a5c70
Add treasury balance (#1870)
jacogr Nov 12, 2019
e15b69e
[CI Skip] 0.37.0-beta.70
actions-user Nov 12, 2019
2b9dd5b
Blocks per session graph (hidden) (#1871)
jacogr Nov 12, 2019
76e116a
[CI Skip] 0.37.0-beta.71
actions-user Nov 12, 2019
7e65066
Functional InputNumber with fixed bugs (#1820)
kwingram25 Nov 12, 2019
c9e9fc5
[CI Skip] 0.37.0-beta.72
actions-user Nov 12, 2019
e7e4efe
Enable validator overview (#1872)
jacogr Nov 12, 2019
8ba40ae
[CI Skip] 0.37.0-beta.73
actions-user Nov 12, 2019
03158fb
Add useFavorites hook (incl. react-hooks package) (#1873)
jacogr Nov 12, 2019
117903c
[CI Skip] 0.37.0-beta.74
actions-user Nov 12, 2019
84f6c00
Add elected stake (#1874)
jacogr Nov 12, 2019
4f01688
[CI Skip] 0.37.0-beta.75
actions-user Nov 12, 2019
9035b80
Bump deps (#1876)
jacogr Nov 13, 2019
fd8427d
[CI Skip] 0.37.0-beta.76
actions-user Nov 13, 2019
5e19af9
Extract getHistory query (re-use) (#1877)
jacogr Nov 13, 2019
c666a9f
[CI Skip] 0.37.0-beta.77
actions-user Nov 13, 2019
c05c1b8
Adjust extrinsic selection display, UI alignment (#1878)
jacogr Nov 14, 2019
c85062d
[CI Skip] 0.37.0-beta.78
actions-user Nov 14, 2019
918822f
Auto-populate Vote balance (#1879)
jacogr Nov 14, 2019
6a92aea
[CI Skip] 0.37.0-beta.79
actions-user Nov 14, 2019
be039f9
Fix InputBalance default display (#1880)
jacogr Nov 14, 2019
7236bf3
[CI Skip] 0.37.0-beta.80
actions-user Nov 14, 2019
cf67b1e
Bump deps (#1881)
jacogr Nov 14, 2019
7a10113
[CI Skip] 0.37.0-beta.81
actions-user Nov 14, 2019
39dcdca
Staker breakdown graph (#1882)
jacogr Nov 14, 2019
45a54bc
[CI Skip] 0.37.0-beta.82
actions-user Nov 14, 2019
2663a42
Bump API, display vested (#1883)
jacogr Nov 14, 2019
99e70df
[CI Skip] 0.37.0-beta.83
actions-user Nov 14, 2019
77907d5
Fix validatorPrefs (don't pull defaults) (#1885)
jacogr Nov 14, 2019
c5d1245
[CI Skip] 0.37.0-beta.84
actions-user Nov 14, 2019
03a3336
Add slashing graph (#1886)
jacogr Nov 14, 2019
4241653
[CI Skip] 0.37.0-beta.85
actions-user Nov 14, 2019
87dbcd2
Align graph lengths (#1887)
jacogr Nov 15, 2019
c0ab721
[CI Skip] 0.37.0-beta.86
actions-user Nov 15, 2019
db891aa
Small chart label adjustments (#1888)
jacogr Nov 15, 2019
999f706
[CI Skip] 0.37.0-beta.87
actions-user Nov 15, 2019
c167227
Add useApiContext (#1890)
jacogr Nov 15, 2019
d585743
[CI Skip] 0.37.0-beta.88
actions-user Nov 15, 2019
488bfef
Add trackStream, impl. in staking overview (#1891)
jacogr Nov 15, 2019
6a27dba
[CI Skip] 0.37.0-beta.89
actions-user Nov 15, 2019
e8745b4
Map non-account stashes (#1892)
jacogr Nov 15, 2019
dbafe44
[CI Skip] 0.37.0-beta.90
actions-user Nov 15, 2019
2954a86
Bump api (#1895)
jacogr Nov 15, 2019
de9b36f
[CI Skip] 0.37.0-beta.91
actions-user Nov 15, 2019
032f46c
Popup menu expansion for account/address (#1896)
jacogr Nov 15, 2019
786fcf9
[CI Skip] 0.37.0-beta.92
actions-user Nov 15, 2019
bffa658
Add currency indicator to staking charts (#1897)
jacogr Nov 15, 2019
ce141a4
[CI Skip] 0.37.0-beta.93
actions-user Nov 15, 2019
e0acd15
useAccounts hook (#1898)
jacogr Nov 16, 2019
ebdbadc
[CI Skip] 0.37.0-beta.94
actions-user Nov 16, 2019
971c514
Allow basic chart display w/ non-archive (#1899)
jacogr Nov 16, 2019
0f75bbb
[CI Skip] 0.37.0-beta.95
actions-user Nov 16, 2019
4f2729f
add routing
satellitex Nov 16, 2019
ef396cc
add app-operator apps
satellitex Nov 16, 2019
c3e16ac
s/useApiContext/useApi/ (#1900)
jacogr Nov 16, 2019
f71c9fd
[CI Skip] 0.37.0-beta.96
actions-user Nov 16, 2019
8fd7df9
add operator
satellitex Nov 16, 2019
2c8f1b7
WIP: change operator
satellitex Nov 17, 2019
ae6b453
Disable stash operations (when not own) (#1901)
jacogr Nov 17, 2019
a64dcb8
[CI Skip] 0.37.0-beta.97
actions-user Nov 17, 2019
b82b769
Cleanup reward graphs (#1904)
jacogr Nov 17, 2019
8f25962
[CI Skip] 0.37.0-beta.98
actions-user Nov 17, 2019
dc58883
Small query cleanups (historic) (#1905)
jacogr Nov 17, 2019
7b2e299
[CI Skip] 0.37.0-beta.99
actions-user Nov 17, 2019
c337e4d
Show rotate keys (as available) (#1906)
jacogr Nov 18, 2019
353331e
[CI Skip] 0.37.0-beta.100
actions-user Nov 18, 2019
2648ee3
Bump API (#1907)
jacogr Nov 19, 2019
f4105fb
[CI Skip] 0.37.0-beta.101
actions-user Nov 19, 2019
6486d2d
Fix old v1 queryStorage results (#1909)
jacogr Nov 19, 2019
6cf65d0
[CI Skip] 0.37.0-beta.102
actions-user Nov 19, 2019
458e30f
Subscribe to runtimeVersion in UI display (#1910)
jacogr Nov 19, 2019
76081cb
[CI Skip] 0.37.0-beta.103
actions-user Nov 19, 2019
a95d7a4
Bump API (#1911)
jacogr Nov 19, 2019
04f1fca
[CI Skip] 0.37.0-beta.104
actions-user Nov 19, 2019
d64f682
Allow zero values for rewards (#1913)
jacogr Nov 19, 2019
33a4800
[CI Skip] 0.37.0-beta.105
actions-user Nov 19, 2019
1916207
Adjust staking (#1914)
jacogr Nov 19, 2019
29870c5
[CI Skip] 0.37.0-beta.106
actions-user Nov 19, 2019
9cce909
Bump API (available calcs) (#1915)
jacogr Nov 19, 2019
11c8745
[CI Skip] 0.37.0-beta.107
actions-user Nov 19, 2019
8dfd36f
Fix Vec<u8> issue (#1916)
kwingram25 Nov 20, 2019
df5a0b5
[CI Skip] 0.37.0-beta.108
actions-user Nov 20, 2019
5a57f0a
fix yarn upgrade
satellitex Nov 20, 2019
cc0b2d9
update and merged main/master
satellitex Nov 20, 2019
fb504ef
add change operator
satellitex Nov 20, 2019
1235d41
fix SturctParam
satellitex Nov 20, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ In addition the following libraries are also included in the repo. These are to

Contributions are welcome!

To start off, this repo (along with others in the [@polkadot](https://github.com/polkadot-js/) family) uses yarn workspaces to organise the code. As such, after cloning dependencies _should_ be installed via `yarn`, not via npm, the latter will result in broken dependencies.
To start off, this repo (along with others in the [@polkadot](https://github.com/polkadot-js/) family) uses yarn workspaces to organize the code. As such, after cloning dependencies _should_ be installed via `yarn`, not via npm, the latter will result in broken dependencies.

To get started -

Expand All @@ -55,7 +55,7 @@ To get started -

## I want to code around

There is a base template availble [app-123code](packages/app-123code/) that acts as a simple starting point for adding additional apps to the UI. Alternatively if you just want some place where you can write some code, it does the trick.
There is a base template available [app-123code](packages/app-123code/) that acts as a simple starting point for adding additional apps to the UI. Alternatively if you just want some place where you can write some code, it does the trick.

While it is hidden from the sidebar, it is accessible via [http://127.0.0.1:3000/#/123code](http://127.0.0.1:3000/#/123code)

Expand Down
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@
"packages": [
"packages/*"
],
"version": "0.37.0-beta.72"
"version": "0.37.0-beta.108"
}
30 changes: 19 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "0.37.0-beta.72",
"version": "0.37.0-beta.108",
"private": true,
"engines": {
"node": ">=10.13.0",
Expand All @@ -10,12 +10,12 @@
"packages/*"
],
"resolutions": {
"@polkadot/api": "^0.97.0-beta.2",
"@polkadot/api-contract": "^0.97.0-beta.2",
"@polkadot/keyring": "^1.7.0-beta.6",
"@polkadot/types": "^0.97.0-beta.2",
"@polkadot/util": "^1.7.0-beta.6",
"@polkadot/util-crypto": "^1.7.0-beta.6",
"@polkadot/api": "^0.97.0-beta.16",
"@polkadot/api-contract": "^0.97.0-beta.16",
"@polkadot/keyring": "^1.7.0-beta.7",
"@polkadot/types": "^0.97.0-beta.16",
"@polkadot/util": "^1.7.0-beta.7",
"@polkadot/util-crypto": "^1.7.0-beta.7",
"babel-core": "^7.0.0-bridge.0",
"typescript": "^3.7.2"
},
Expand All @@ -34,10 +34,10 @@
"start": "cd packages/apps && webpack --config webpack.config.js"
},
"devDependencies": {
"@babel/core": "^7.7.0",
"@babel/runtime": "^7.7.1",
"@polkadot/dev-react": "^0.32.0-beta.13",
"@polkadot/ts": "^0.1.84",
"@babel/core": "^7.7.2",
"@babel/runtime": "^7.7.2",
"@polkadot/dev-react": "^0.32.0-beta.14",
"@polkadot/ts": "^0.1.85",
"autoprefixer": "^9.7.1",
"empty": "^0.10.1",
"html-loader": "^0.5.5",
Expand All @@ -53,5 +53,13 @@
"postcss-simple-vars": "^5.0.0",
"precss": "^4.0.0",
"source-map-explorer": "^2.1.0"
},
"dependencies": {
"@polkadot/api": "^0.97.0-beta.2",
"@polkadot/api-contract": "^0.97.0-beta.2",
"@polkadot/keyring": "^1.7.0-beta.6",
"@polkadot/types": "^0.97.0-beta.16",
"@polkadot/util": "^1.7.0-beta.6",
"@polkadot/util-crypto": "^1.7.0-beta.6"
}
}
6 changes: 3 additions & 3 deletions packages/app-123code/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@polkadot/app-123code",
"version": "0.37.0-beta.72",
"version": "0.37.0-beta.108",
"description": "A basic app that shows the ropes on customisation",
"main": "index.js",
"scripts": {},
Expand All @@ -10,7 +10,7 @@
],
"license": "Apache-2.0",
"dependencies": {
"@babel/runtime": "^7.7.1",
"@polkadot/react-components": "^0.37.0-beta.72"
"@babel/runtime": "^7.7.2",
"@polkadot/react-components": "^0.37.0-beta.108"
}
}
7 changes: 4 additions & 3 deletions packages/app-123code/src/SummaryBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@ import { AccountId } from '@polkadot/types/interfaces';
import { BareProps, I18nProps } from '@polkadot/react-components/types';

import BN from 'bn.js';
import React, { useContext } from 'react';
import { ApiContext, withCalls } from '@polkadot/react-api';
import React from 'react';
import { withCalls } from '@polkadot/react-api';
import { Bubble, IdentityIcon } from '@polkadot/react-components';
import { useApi } from '@polkadot/react-hooks';
import { formatBalance, formatNumber } from '@polkadot/util';

import translate from './translate';
Expand All @@ -22,7 +23,7 @@ interface Props extends BareProps, I18nProps {
}

function SummaryBar ({ balances_totalIssuance, chain_bestNumber, chain_bestNumberLag, staking_validators }: Props): React.ReactElement<Props> {
const { api, systemChain, systemName, systemVersion } = useContext(ApiContext);
const { api, systemChain, systemName, systemVersion } = useApi();

return (
<summary>
Expand Down
8 changes: 4 additions & 4 deletions packages/app-accounts/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@polkadot/app-accounts",
"version": "0.37.0-beta.72",
"version": "0.37.0-beta.108",
"main": "index.js",
"repository": "https://github.com/polkadot-js/apps.git",
"author": "Jaco Greeff <jacogr@gmail.com>",
Expand All @@ -10,9 +10,9 @@
"contributors": [],
"license": "Apache-2.0",
"dependencies": {
"@babel/runtime": "^7.7.1",
"@polkadot/react-components": "^0.37.0-beta.72",
"@polkadot/react-qr": "^0.47.0-beta.5",
"@babel/runtime": "^7.7.2",
"@polkadot/react-components": "^0.37.0-beta.108",
"@polkadot/react-qr": "^0.47.0-beta.6",
"@types/file-saver": "^2.0.0",
"@types/yargs": "^13.0.2",
"babel-plugin-module-resolver": "^3.1.1",
Expand Down
123 changes: 55 additions & 68 deletions packages/app-accounts/src/Account.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,8 @@ import { ActionStatus } from '@polkadot/react-components/Status/types';
import { I18nProps } from '@polkadot/react-components/types';

import React, { useState, useEffect } from 'react';
import { Popup } from 'semantic-ui-react';
import styled from 'styled-components';
import { AddressCard, AddressInfo, Button, ChainLock, Forget, Menu } from '@polkadot/react-components';
import { AddressCard, AddressInfo, Button, ChainLock, Forget, Menu, Popup } from '@polkadot/react-components';
import keyring from '@polkadot/ui-keyring';

import Backup from './modals/Backup';
Expand Down Expand Up @@ -47,8 +46,8 @@ function Account ({ address, className, t }: Props): React.ReactElement<Props> {
const _toggleDerive = (): void => setIsDeriveOpen(!isDeriveOpen);
const _toggleForget = (): void => setIsForgetOpen(!isForgetOpen);
const _togglePass = (): void => setIsPasswordOpen(!isPasswordOpen);
const _toggleTransfer = (): void => setIsTransferOpen(!isTransferOpen);
const _toggleSettingPopup = (): void => setIsSettingPopupOpen(!isSettingPopupOpen);
const _toggleTransfer = (): void => setIsTransferOpen(!isTransferOpen);
const _onForget = (): void => {
if (!address) {
return;
Expand Down Expand Up @@ -83,33 +82,6 @@ function Account ({ address, className, t }: Props): React.ReactElement<Props> {
buttons={
<div className='accounts--Account-buttons buttons'>
<div className='actions'>
{isEditable && !isDevelopment && (
<Button
isNegative
onClick={_toggleForget}
icon='trash'
size='small'
tooltip={t('Forget this account')}
/>
)}
{isEditable && !isExternal && !isDevelopment && (
<>
<Button
icon='cloud download'
isPrimary
onClick={_toggleBackup}
size='small'
tooltip={t('Create a backup file for this account')}
/>
<Button
icon='key'
isPrimary
onClick={_togglePass}
size='small'
tooltip={t("Change this account's password")}
/>
</>
)}
<Button
icon='paper plane'
isPrimary
Expand All @@ -118,42 +90,62 @@ function Account ({ address, className, t }: Props): React.ReactElement<Props> {
size='small'
tooltip={t('Send funds from this account')}
/>
{isEditable && !isExternal && (
<Popup
onClose={_toggleSettingPopup}
open={isSettingPopupOpen}
position='bottom left'
trigger={
<Button
icon='setting'
onClick={_toggleSettingPopup}
size='small'
/>
}
>
<Menu
vertical
text
<Popup
className='theme--default'
onClose={_toggleSettingPopup}
open={isSettingPopupOpen}
position='bottom right'
trigger={
<Button
icon='setting'
onClick={_toggleSettingPopup}
size='small'
/>
}
>
<Menu
vertical
text
onClick={_toggleSettingPopup}
>
<Menu.Item
disabled={!isEditable || isExternal}
onClick={_toggleDerive}
>
{t('Derive account from source')}
</Menu.Item>
<Menu.Item disabled>
{t('Change on-chain nickname')}
</Menu.Item>
<Menu.Item
disabled={!isEditable || isExternal || isDevelopment}
onClick={_toggleBackup}
>
{t('Create a backup file for this account')}
</Menu.Item>
<Menu.Item
disabled={!isEditable || isExternal || isDevelopment}
onClick={_togglePass}
>
{t("Change this account's password")}
</Menu.Item>
<Menu.Item
disabled={!isEditable || isDevelopment}
onClick={_toggleForget}
>
<Menu.Item onClick={_toggleDerive}>
{t('Derive account from source')}
</Menu.Item>
<Menu.Item disabled>
{t('Change on-chain nickname')}
</Menu.Item>
</Menu>
</Popup>
)}
{t('Forget this account')}
</Menu.Item>
<Menu.Divider />
<ChainLock
className='accounts--network-toggle'
genesisHash={genesisHash}
isDisabled={!isEditable || isExternal}
onChange={_onGenesisChange}
preventDefault
/>
</Menu>
</Popup>
</div>
{isEditable && !isExternal && (
<div className='others'>
<ChainLock
genesisHash={genesisHash}
onChange={_onGenesisChange}
/>
</div>
)}
</div>
}
className={className}
Expand Down Expand Up @@ -217,11 +209,6 @@ export default translate(
styled(Account)`
.accounts--Account-buttons {
text-align: right;

.others {
margin-right: 0.125rem;
margin-top: 0.25rem;
}
}
`
);
19 changes: 7 additions & 12 deletions packages/app-accounts/src/Overview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,12 @@
// of the Apache-2.0 license. See the LICENSE file for details.

import { I18nProps } from '@polkadot/react-components/types';
import { SubjectInfo } from '@polkadot/ui-keyring/observable/types';
import { ComponentProps } from './types';

import React, { useState } from 'react';
import keyring from '@polkadot/ui-keyring';
import accountObservable from '@polkadot/ui-keyring/observable/accounts';
import { getLedger, isLedger, withMulti, withObservable } from '@polkadot/react-api';
import { getLedger, isLedger } from '@polkadot/react-api';
import { useAccounts } from '@polkadot/react-hooks';
import { Button, CardGrid } from '@polkadot/react-components';

import CreateModal from './modals/Create';
Expand All @@ -20,7 +19,6 @@ import Banner from './Banner';
import translate from './translate';

interface Props extends ComponentProps, I18nProps {
accounts?: SubjectInfo[];
}

// query the ledger for the address, adding it to the keyring
Expand All @@ -36,11 +34,12 @@ async function queryLedger (): Promise<void> {
}
}

function Overview ({ accounts, onStatusChange, t }: Props): React.ReactElement<Props> {
function Overview ({ onStatusChange, t }: Props): React.ReactElement<Props> {
const { allAccounts, hasAccounts } = useAccounts();
const [isCreateOpen, setIsCreateOpen] = useState(false);
const [isImportOpen, setIsImportOpen] = useState(false);
const [isQrOpen, setIsQrOpen] = useState(false);
const emptyScreen = !(isCreateOpen || isImportOpen || isQrOpen) && accounts && (Object.keys(accounts).length === 0);
const emptyScreen = !(isCreateOpen || isImportOpen || isQrOpen) && !hasAccounts;

const _toggleCreate = (): void => setIsCreateOpen(!isCreateOpen);
const _toggleImport = (): void => setIsImportOpen(!isImportOpen);
Expand Down Expand Up @@ -105,7 +104,7 @@ function Overview ({ accounts, onStatusChange, t }: Props): React.ReactElement<P
onStatusChange={onStatusChange}
/>
)}
{accounts && Object.keys(accounts).map((address): React.ReactNode => (
{allAccounts.map((address): React.ReactNode => (
<Account
address={address}
key={address}
Expand All @@ -115,8 +114,4 @@ function Overview ({ accounts, onStatusChange, t }: Props): React.ReactElement<P
);
}

export default withMulti(
Overview,
translate,
withObservable(accountObservable.subject, { propName: 'accounts' })
);
export default translate(Overview);
Loading