Allow Call as param expansion (like Proposal) (#2260)

This commit is contained in:
Jaco Greeff 2020-02-11 11:45:24 +01:00 committed by GitHub
parent 973dcc7cf8
commit 15701ce25b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
51 changed files with 39 additions and 16 deletions

View File

@ -38,7 +38,7 @@
"@babel/core": "^7.8.3",
"@babel/register": "^7.7.7",
"@babel/runtime": "^7.8.3",
"@polkadot/dev-react": "^0.33.3",
"@polkadot/dev-react": "^0.33.4",
"@polkadot/ts": "^0.2.1",
"autoprefixer": "^9.7.4",
"empty": "^0.10.1",

View File

View File

@ -1,5 +1,6 @@
{
"name": "@polkadot/app-123code",
"private": true,
"version": "0.40.0-beta.19",
"description": "A basic app that shows the ropes on customisation",
"main": "index.js",

View File

View File

@ -1,5 +1,6 @@
{
"name": "@polkadot/app-accounts",
"private": true,
"version": "0.40.0-beta.19",
"main": "index.js",
"repository": "https://github.com/polkadot-js/apps.git",

View File

View File

@ -1,5 +1,6 @@
{
"name": "@polkadot/app-address-book",
"private": true,
"version": "0.40.0-beta.19",
"main": "index.js",
"repository": "https://github.com/polkadot-js/apps.git",

View File

View File

@ -1,5 +1,6 @@
{
"name": "@polkadot/app-claims",
"private": true,
"version": "0.40.0-beta.19",
"description": "An app for claiming Polkadot tokens",
"main": "index.js",

View File

View File

@ -1,5 +1,6 @@
{
"name": "@polkadot/app-contracts",
"private": true,
"version": "0.40.0-beta.19",
"description": "Deployment and management of substrate contracts",
"main": "index.js",

View File

View File

@ -1,5 +1,6 @@
{
"name": "@polkadot/app-council",
"private": true,
"version": "0.40.0-beta.19",
"description": "Council",
"main": "index.js",

View File

View File

@ -1,5 +1,6 @@
{
"name": "@polkadot/app-dashboard",
"private": true,
"version": "0.40.0-beta.19",
"description": "Dashboard for all apps, allowing for an overview and quick navigation",
"main": "index.js",

View File

View File

@ -1,5 +1,6 @@
{
"name": "@polkadot/app-democracy",
"private": true,
"version": "0.40.0-beta.19",
"description": "A referendum & proposal app",
"main": "index.js",

View File

View File

@ -1,5 +1,6 @@
{
"name": "@polkadot/app-explorer",
"private": true,
"version": "0.40.0-beta.19",
"main": "index.js",
"repository": "https://github.com/polkadot-js/apps.git",

View File

View File

@ -1,5 +1,6 @@
{
"name": "@polkadot/app-extrinsics",
"private": true,
"version": "0.40.0-beta.19",
"main": "index.js",
"repository": "https://github.com/polkadot-js/apps.git",

View File

View File

@ -1,5 +1,6 @@
{
"name": "@polkadot/app-generic-asset",
"private": true,
"version": "0.40.0-beta.19",
"description": "A basic GenericAsset transfer app",
"main": "index.js",

0
packages/app-js/.npmskip Normal file
View File

View File

@ -1,5 +1,6 @@
{
"name": "@polkadot/app-js",
"private": true,
"version": "0.40.0-beta.19",
"description": "A simple JavaScript console for playing with the API",
"main": "index.js",

View File

View File

@ -1,5 +1,6 @@
{
"name": "@polkadot/app-parachains",
"private": true,
"version": "0.40.0-beta.19",
"description": "Parachains",
"main": "index.js",

View File

View File

@ -1,5 +1,6 @@
{
"name": "@polkadot/app-settings",
"private": true,
"version": "0.40.0-beta.19",
"description": "Settings management",
"main": "index.js",

View File

View File

@ -1,5 +1,6 @@
{
"name": "@polkadot/app-society",
"private": true,
"version": "0.40.0-beta.19",
"description": "A society",
"main": "index.js",

View File

View File

@ -1,5 +1,6 @@
{
"name": "@polkadot/app-staking",
"private": true,
"version": "0.40.0-beta.19",
"description": "A basic staking app",
"main": "index.js",

View File

View File

@ -1,5 +1,6 @@
{
"name": "@polkadot/app-storage",
"private": true,
"version": "0.40.0-beta.19",
"main": "index.js",
"repository": "https://github.com/polkadot-js/apps.git",

View File

View File

@ -1,5 +1,6 @@
{
"name": "@polkadot/app-sudo",
"private": true,
"version": "0.40.0-beta.19",
"description": "A basic app that shows the ropes on customisation",
"main": "index.js",

View File

View File

@ -1,5 +1,6 @@
{
"name": "@polkadot/app-tech-comm",
"private": true,
"version": "0.40.0-beta.19",
"description": "Council",
"main": "index.js",

View File

View File

@ -1,5 +1,6 @@
{
"name": "@polkadot/app-toolbox",
"private": true,
"version": "0.40.0-beta.19",
"main": "index.js",
"repository": "https://github.com/polkadot-js/apps.git",

View File

View File

View File

@ -1,5 +1,6 @@
{
"name": "@polkadot/app-treasury",
"private": true,
"version": "0.40.0-beta.19",
"description": "A referendum & proposal app",
"main": "index.js",

View File

View File

@ -1,5 +1,6 @@
{
"name": "@polkadot/apps-routing",
"private": true,
"version": "0.40.0-beta.19",
"main": "index.js",
"repository": "https://github.com/polkadot-js/apps.git",

0
packages/apps/.npmskip Normal file
View File

View File

@ -1,5 +1,6 @@
{
"name": "@polkadot/apps",
"private": true,
"version": "0.40.0-beta.19",
"description": "An Apps portal into the Polkadot network",
"main": "index.js",

View File

@ -13,7 +13,7 @@ import { classes } from '@polkadot/react-components/util';
import Bare from './Bare';
import Unknown from './Unknown';
export default function Proposal (props: Props): React.ReactElement<Props> {
export default function CallDisplay (props: Props): React.ReactElement<Props> {
const { className, defaultValue: { value }, isDisabled, label, style, withLabel } = props;
if (!isDisabled) {
@ -22,8 +22,8 @@ export default function Proposal (props: Props): React.ReactElement<Props> {
);
}
const proposal = value as Extrinsic;
const { method, section } = registry.findMetaCall(proposal.callIndex);
const call = value as Extrinsic;
const { method, section } = registry.findMetaCall(call.callIndex);
return (
<Bare>
@ -35,7 +35,7 @@ export default function Proposal (props: Props): React.ReactElement<Props> {
>
{section}.{method}
</Static>
<Call value={proposal} />
<Call value={call} />
</Bare>
);
}

View File

@ -14,6 +14,7 @@ import Amount from './Amount';
import Balance from './Balance';
import Bool from './Bool';
import Bytes from './Bytes';
import Call from './Call';
import Code from './Code';
import DispatchError from './DispatchError';
import Enum from './Enum';
@ -22,7 +23,6 @@ import Hash512 from './Hash512';
import KeyValue from './KeyValue';
import KeyValueArray from './KeyValueArray';
import Moment from './Moment';
import Proposal from './Proposal';
import Null from './Null';
import Option from './Option';
import Raw from './Raw';
@ -45,6 +45,7 @@ const components: ComponentMap = ([
{ c: Balance, t: ['Amount', 'AssetOf', 'Balance', 'BalanceOf'] },
{ c: Bool, t: ['bool'] },
{ c: Bytes, t: ['Bytes'] },
{ C: Call, t: ['Call', 'Proposal'] },
{ c: Code, t: ['Code'] },
{ c: DispatchError, t: ['DispatchError'] },
{ c: Raw, t: ['Raw', 'Keys'] },
@ -56,7 +57,6 @@ const components: ComponentMap = ([
{ c: Moment, t: ['Moment', 'MomentOf'] },
{ c: Null, t: ['Null'] },
{ c: Option, t: ['Option'] },
{ c: Proposal, t: ['Proposal'] },
{ c: Text, t: ['String', 'Text'] },
{ c: Struct, t: ['Struct'] },
{ c: Tuple, t: ['Tuple'] },

View File

@ -2241,14 +2241,14 @@
"@polkadot/types" "^1.2.0-beta.7"
"@polkadot/util-crypto" "^2.2.1"
"@polkadot/dev-react@^0.33.3":
version "0.33.3"
resolved "https://registry.yarnpkg.com/@polkadot/dev-react/-/dev-react-0.33.3.tgz#6f80ef104e10276239cb7b09c607635ba624b2b5"
integrity sha512-wgYK/coMpVm6PSpjDMyixAkiBuQ9twxiZeyCfXeNAt11bYP6wIf31JRzp6hBeh5eOpSanNqK8XfawZJKdAiJMQ==
"@polkadot/dev-react@^0.33.4":
version "0.33.4"
resolved "https://registry.yarnpkg.com/@polkadot/dev-react/-/dev-react-0.33.4.tgz#86b26f88f8552f5084b156b40c46acfb304a7dfb"
integrity sha512-lQyZaTP/DmXD5kJNPXXCH69bXtgyu7pG0E7gQpiRvvGko5odhNdfhPRNg0JpftV60d8hL0VJWZX2uPnMSkQgUA==
dependencies:
"@babel/core" "^7.8.3"
"@babel/preset-react" "^7.8.3"
"@polkadot/dev" "^0.33.3"
"@polkadot/dev" "^0.33.4"
"@types/react" "^16.9.19"
"@types/react-dom" "^16.9.5"
"@types/react-native" "^0.61.7"
@ -2278,10 +2278,10 @@
webpack-serve "^3.2.0"
worker-loader "^2.0.0"
"@polkadot/dev@^0.33.3":
version "0.33.3"
resolved "https://registry.yarnpkg.com/@polkadot/dev/-/dev-0.33.3.tgz#a5ee8990ea240c655b0b1c065a53518d0fab3c86"
integrity sha512-AruWNAIAjbweoDUJAX4SSSgzbtsxZkociPAitcXBFul6XSU4eMJiyc68o0ZiQOXt/T9TWUjuVMSLEkcuNh536Q==
"@polkadot/dev@^0.33.4":
version "0.33.4"
resolved "https://registry.yarnpkg.com/@polkadot/dev/-/dev-0.33.4.tgz#68b34dda81fded696b3b41b91defb485d5e844dd"
integrity sha512-mBLYQxiIwT66c9DVwRudm23WBZGr8WnqX83otpzRJOYmriNJ5EApJRTvAk/FriM0/4gLQ7HBATJ1uaa1vVdqPA==
dependencies:
"@babel/cli" "^7.8.3"
"@babel/core" "^7.8.3"