Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
1340ca6
Add preimage button to externals (#2228)
jacogr Feb 3, 2020
7a970a6
[CI Skip] 0.40.0-beta.2
actions-user Feb 3, 2020
1493a8f
Bump deps (#2229)
jacogr Feb 3, 2020
40d47a8
[CI Skip] 0.40.0-beta.3
actions-user Feb 3, 2020
ec4d7ad
Change dockerfile to use local version as opposed to cloning polkadot…
philipstanislaus Feb 3, 2020
ff8675a
[CI Skip] 0.40.0-beta.4
actions-user Feb 3, 2020
a4393d1
Add Centrifuge Endpoints
philipstanislaus Jan 28, 2020
a4159f2
Add amber endpoint
philipstanislaus Feb 2, 2020
7ca229f
Add preimage button to externals (#2228)
jacogr Feb 3, 2020
7013b8f
[CI Skip] 0.40.0-beta.2
actions-user Feb 3, 2020
bfb3b2d
Bump deps (#2229)
jacogr Feb 3, 2020
ee9d268
[CI Skip] 0.40.0-beta.3
actions-user Feb 3, 2020
0143d40
Change dockerfile to use local version as opposed to cloning polkadot…
philipstanislaus Feb 3, 2020
e8b7f65
[CI Skip] 0.40.0-beta.4
actions-user Feb 3, 2020
48accfb
Merge commit 'e8b7f658dea7a610ca68ea596a45bc1b37c1311c' into update
philipstanislaus Feb 3, 2020
fdd66e7
Build only apps component via docker (#2231)
jacogr Feb 4, 2020
11d8d66
[CI Skip] 0.40.0-beta.5
actions-user Feb 4, 2020
8b69b54
Bump deps (#2232)
jacogr Feb 4, 2020
c181747
[CI Skip] 0.40.0-beta.6
actions-user Feb 4, 2020
07f5aea
Display day breakdown for voting locks (#2234)
jacogr Feb 5, 2020
80ddb3e
[CI Skip] 0.40.0-beta.7
actions-user Feb 5, 2020
911045d
Bump deps (#2238)
jacogr Feb 5, 2020
9e19a52
[CI Skip] 0.40.0-beta.8
actions-user Feb 5, 2020
b6d94c5
Merge branch 'master' into update
philipstanislaus Feb 5, 2020
f1bb6cd
Add type to support old balance lock functionality
philipstanislaus Feb 5, 2020
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
9 changes: 4 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,18 @@ RUN apt-get update && apt-get install -y curl git gnupg
RUN curl -sL https://deb.nodesource.com/setup_10.x | bash -
RUN apt-get install -y nodejs

WORKDIR /app
RUN git clone https://github.com/polkadot-js/apps
WORKDIR /apps
COPY . .

WORKDIR /app/apps
RUN npm install yarn -g
RUN yarn
RUN NODE_ENV=production yarn build
RUN NODE_ENV=production yarn build:www

FROM ubuntu:18.04

RUN apt-get update && apt-get -y install nginx

COPY --from=builder /app/apps/packages/apps/build /var/www/html
COPY --from=builder /apps/packages/apps/build /var/www/html

EXPOSE 80

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.40.0-beta.1"
"version": "0.40.0-beta.8"
}
17 changes: 9 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "0.40.0-beta.1",
"version": "0.40.0-beta.8",
"private": true,
"engines": {
"node": ">=10.13.0",
Expand All @@ -10,20 +10,21 @@
"packages/*"
],
"resolutions": {
"@polkadot/api": "^1.1.0-beta.8",
"@polkadot/api-contract": "^1.1.0-beta.8",
"@polkadot/keyring": "^2.0.1",
"@polkadot/types": "^1.1.0-beta.8",
"@polkadot/util": "^2.0.1",
"@polkadot/util-crypto": "^2.0.1",
"@polkadot/api": "^1.1.0-beta.19",
"@polkadot/api-contract": "^1.1.0-beta.19",
"@polkadot/keyring": "^2.1.1",
"@polkadot/types": "^1.1.0-beta.19",
"@polkadot/util": "^2.1.1",
"@polkadot/util-crypto": "^2.1.1",
"babel-core": "^7.0.0-bridge.0",
"typescript": "^3.7.5"
},
"scripts": {
"analyze": "yarn run build && cd packages/apps && yarn run source-map-explorer build/main.*.js",
"build": "yarn run build:code && yarn run build:i18n",
"build": "yarn run build:i18n && yarn run build:code",
"build:code": "NODE_ENV=production polkadot-dev-build-ts",
"build:i18n": "i18next-scanner --config i18next-scanner.config.js",
"build:www": "rm -rf packages/apps/build && mkdir -p packages/apps/build && yarn run build:i18n && cd packages/apps && NODE_ENV=production webpack --config webpack.config.js",
"docs": "echo \"skipping docs\"",
"clean": "polkadot-dev-clean-build",
"clean:i18n": "rm -rf packages/apps/public/locales/en && mkdir -p packages/apps/public/locales/en",
Expand Down
4 changes: 2 additions & 2 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.40.0-beta.1",
"version": "0.40.0-beta.8",
"description": "A basic app that shows the ropes on customisation",
"main": "index.js",
"scripts": {},
Expand All @@ -11,6 +11,6 @@
"license": "Apache-2.0",
"dependencies": {
"@babel/runtime": "^7.8.3",
"@polkadot/react-components": "^0.40.0-beta.1"
"@polkadot/react-components": "^0.40.0-beta.8"
}
}
6 changes: 3 additions & 3 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.40.0-beta.1",
"version": "0.40.0-beta.8",
"main": "index.js",
"repository": "https://github.com/polkadot-js/apps.git",
"author": "Jaco Greeff <jacogr@gmail.com>",
Expand All @@ -11,8 +11,8 @@
"license": "Apache-2.0",
"dependencies": {
"@babel/runtime": "^7.8.3",
"@polkadot/react-components": "^0.40.0-beta.1",
"@polkadot/react-qr": "^0.48.1",
"@polkadot/react-components": "^0.40.0-beta.8",
"@polkadot/react-qr": "^0.49.0-beta.1",
"@types/file-saver": "^2.0.0",
"@types/yargs": "^15.0.2",
"detect-browser": "^4.8.0",
Expand Down
4 changes: 2 additions & 2 deletions packages/app-address-book/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@polkadot/app-address-book",
"version": "0.40.0-beta.1",
"version": "0.40.0-beta.8",
"main": "index.js",
"repository": "https://github.com/polkadot-js/apps.git",
"author": "Jaco Greeff <jacogr@gmail.com>",
Expand All @@ -11,6 +11,6 @@
"license": "Apache-2.0",
"dependencies": {
"@babel/runtime": "^7.8.3",
"@polkadot/react-components": "^0.40.0-beta.1"
"@polkadot/react-components": "^0.40.0-beta.8"
}
}
2 changes: 1 addition & 1 deletion packages/app-address-book/src/Overview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ function Overview ({ className, onStatusChange }: Props): React.ReactElement<Pro
</Table>
</>
)
: t('no contracts yet, add an existing contact')
: t('no addresses saved yet, add any existing address')
}
</div>
);
Expand Down
4 changes: 2 additions & 2 deletions packages/app-claims/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@polkadot/app-claims",
"version": "0.40.0-beta.1",
"version": "0.40.0-beta.8",
"description": "An app for claiming Polkadot tokens",
"main": "index.js",
"scripts": {},
Expand All @@ -12,7 +12,7 @@
"license": "Apache-2.0",
"dependencies": {
"@babel/runtime": "^7.8.3",
"@polkadot/react-components": "^0.40.0-beta.1",
"@polkadot/react-components": "^0.40.0-beta.8",
"secp256k1": "^3.8.0"
}
}
4 changes: 2 additions & 2 deletions packages/app-contracts/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@polkadot/app-contracts",
"version": "0.40.0-beta.1",
"version": "0.40.0-beta.8",
"description": "Deployment and management of substrate contracts",
"main": "index.js",
"scripts": {},
Expand All @@ -11,6 +11,6 @@
"license": "Apache-2.0",
"dependencies": {
"@babel/runtime": "^7.8.3",
"@polkadot/api-contract": "^1.1.0-beta.8"
"@polkadot/api-contract": "^1.1.0-beta.19"
}
}
6 changes: 3 additions & 3 deletions packages/app-council/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@polkadot/app-council",
"version": "0.40.0-beta.1",
"version": "0.40.0-beta.8",
"description": "Council",
"main": "index.js",
"scripts": {},
Expand All @@ -11,7 +11,7 @@
"license": "Apache-2.0",
"dependencies": {
"@babel/runtime": "^7.8.3",
"@polkadot/react-components": "^0.40.0-beta.1",
"@polkadot/react-query": "^0.40.0-beta.1"
"@polkadot/react-components": "^0.40.0-beta.8",
"@polkadot/react-query": "^0.40.0-beta.8"
}
}
7 changes: 4 additions & 3 deletions packages/app-council/src/Motions/Propose.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@
// This software may be modified and distributed under the terms
// of the Apache-2.0 license. See the LICENSE file for details.

import { SubmittableExtrinsic } from '@polkadot/api/types';
import { ApiProps } from '@polkadot/react-api/types';
import { Call, Proposal } from '@polkadot/types/interfaces';
import { Proposal } from '@polkadot/types/interfaces';

import BN from 'bn.js';
import React from 'react';
Expand All @@ -20,7 +21,7 @@ interface Props extends TxModalProps, ApiProps {
}

interface State extends TxModalState {
method: Call | null;
method: SubmittableExtrinsic<'promise'> | null;
threshold: BN | null;
}

Expand Down Expand Up @@ -122,7 +123,7 @@ class Propose extends TxModal<Props, State> {
this.setState({ threshold });
}

private onChangeExtrinsic = (method?: Call): void => {
private onChangeExtrinsic = (method?: SubmittableExtrinsic<'promise'>): void => {
if (!method) {
return;
}
Expand Down
6 changes: 3 additions & 3 deletions packages/app-dashboard/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@polkadot/app-dashboard",
"version": "0.40.0-beta.1",
"version": "0.40.0-beta.8",
"description": "Dashboard for all apps, allowing for an overview and quick navigation",
"main": "index.js",
"scripts": {},
Expand All @@ -11,7 +11,7 @@
"license": "Apache-2.0",
"dependencies": {
"@babel/runtime": "^7.8.3",
"@polkadot/apps-routing": "^0.40.0-beta.1",
"@polkadot/react-components": "^0.40.0-beta.1"
"@polkadot/apps-routing": "^0.40.0-beta.8",
"@polkadot/react-components": "^0.40.0-beta.8"
}
}
6 changes: 3 additions & 3 deletions packages/app-democracy/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@polkadot/app-democracy",
"version": "0.40.0-beta.1",
"version": "0.40.0-beta.8",
"description": "A referendum & proposal app",
"main": "index.js",
"scripts": {},
Expand All @@ -11,7 +11,7 @@
"license": "Apache-2.0",
"dependencies": {
"@babel/runtime": "^7.8.3",
"@polkadot/react-components": "^0.40.0-beta.1",
"@polkadot/react-query": "^0.40.0-beta.1"
"@polkadot/react-components": "^0.40.0-beta.8",
"@polkadot/react-query": "^0.40.0-beta.8"
}
}
8 changes: 8 additions & 0 deletions packages/app-democracy/src/Overview/Externals.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import { FormatBalance } from '@polkadot/react-query';
import { Bytes, Option } from '@polkadot/types';

import { useTranslation } from '../translate';
import PreImageButton from './PreImageButton';
import ProposalCell from './ProposalCell';

interface Props {
Expand Down Expand Up @@ -70,6 +71,13 @@ export default function Externals ({ className }: Props): React.ReactElement<Pro
proposalHash={hash}
proposal={expanded?.proposal}
/>
<td className='together number top'>
<PreImageButton
hash={hash}
proposal={expanded?.proposal}
withoutOr
/>
</td>
</tr>
</Table.Body>
</Table>
Expand Down
28 changes: 19 additions & 9 deletions packages/app-democracy/src/Overview/Voting.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { PropIndex, Proposal } from '@polkadot/types/interfaces';

import React, { useMemo, useState } from 'react';
import { Button, Dropdown, Modal, ProposedAction, VoteAccount, VoteActions, VoteToggle } from '@polkadot/react-components';
import { useAccounts, useToggle } from '@polkadot/react-hooks';
import { useAccounts, useApi, useToggle } from '@polkadot/react-hooks';
import { isBoolean } from '@polkadot/util';

import { useTranslation } from '../translate';
Expand All @@ -16,22 +16,32 @@ interface Props {
referendumId: PropIndex;
}

const CONVICTIONS: [number, number][] = [1, 2, 4, 8, 16, 32].map((lock, index) => [index + 1, lock]);

export default function Voting ({ proposal, referendumId }: Props): React.ReactElement<Props> | null {
const { t } = useTranslation();
const { api } = useApi();
const { hasAccounts } = useAccounts();
const [accountId, setAccountId] = useState<string | null>(null);
const [conviction, setConviction] = useState(0);
const [isVotingOpen, toggleVoting] = useToggle();
const [aye, setVoteValue] = useState(true);
const [enact] = useState(
(api.consts.democracy.enactmentPeriod.toNumber() * api.consts.timestamp.minimumPeriod.toNumber() / 1000 * 2) / 60 / 60 / 24
);
const convictionOpts = useMemo(() => [
{ text: t('0.1x of voting balance, no lockup period'), value: 0 },
{ text: t('1x of voting balance, locked for 1x enactment'), value: 1 },
{ text: t('2x of voting balance, locked for 2x enactment'), value: 2 },
{ text: t('3x of voting balance, locked for 4x enactment'), value: 3 },
{ text: t('4x of voting balance, locked for 8x enactment'), value: 4 },
{ text: t('5x of voting balance, locked for 16x enactment'), value: 5 },
{ text: t('6x of voting balance, locked for 32x enactment'), value: 6 }
], [t]);
{ text: t('0.1x voting balance, no lockup period'), value: 0 },
...CONVICTIONS.map(([value, lock]): { text: string; value: number } => ({
text: t('{{value}}x voting balance, locked for {{lock}}x enactment ({{period}} days)', {
replace: {
lock,
period: (enact * lock).toFixed(2),
value
}
}),
value
}))
], [t, enact]);

if (!hasAccounts) {
return null;
Expand Down
4 changes: 2 additions & 2 deletions packages/app-explorer/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@polkadot/app-explorer",
"version": "0.40.0-beta.1",
"version": "0.40.0-beta.8",
"main": "index.js",
"repository": "https://github.com/polkadot-js/apps.git",
"author": "Jaco Greeff <jacogr@gmail.com>",
Expand All @@ -11,6 +11,6 @@
"license": "Apache-2.0",
"dependencies": {
"@babel/runtime": "^7.8.3",
"@polkadot/react-components": "^0.40.0-beta.1"
"@polkadot/react-components": "^0.40.0-beta.8"
}
}
8 changes: 4 additions & 4 deletions packages/app-extrinsics/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@polkadot/app-extrinsics",
"version": "0.40.0-beta.1",
"version": "0.40.0-beta.8",
"main": "index.js",
"repository": "https://github.com/polkadot-js/apps.git",
"author": "Jaco Greeff <jacogr@gmail.com>",
Expand All @@ -11,8 +11,8 @@
"license": "Apache-2.0",
"dependencies": {
"@babel/runtime": "^7.8.3",
"@polkadot/react-components": "^0.40.0-beta.1",
"@polkadot/react-params": "^0.40.0-beta.1",
"@polkadot/react-signer": "^0.40.0-beta.1"
"@polkadot/react-components": "^0.40.0-beta.8",
"@polkadot/react-params": "^0.40.0-beta.8",
"@polkadot/react-signer": "^0.40.0-beta.8"
}
}
10 changes: 4 additions & 6 deletions packages/app-extrinsics/src/Selection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,10 @@
// This software may be modified and distributed under the terms
// of the Apache-2.0 license. See the LICENSE file for details.

import { Call } from '@polkadot/types/interfaces';
import { I18nProps } from '@polkadot/react-components/types';
import { QueueTxExtrinsicAdd } from '@polkadot/react-components/Status/types';
import { ApiProps } from '@polkadot/react-api/types';
import { SubmittableExtrinsic } from '@polkadot/api/promise/types';
import { SubmittableExtrinsic } from '@polkadot/api/types';

import React from 'react';
import { Button, Extrinsic, InputAddress, TxButton, TxComponent } from '@polkadot/react-components';
Expand All @@ -22,7 +21,7 @@ interface Props extends ApiProps, I18nProps {
interface State {
isValid: boolean;
isValidUnsigned: boolean;
method: Call | null;
method: SubmittableExtrinsic<'promise'> | null;
accountId?: string | null;
}

Expand Down Expand Up @@ -71,7 +70,6 @@ class Selection extends TxComponent<Props, State> {
icon='sign-in'
extrinsic={extrinsic}
ref={this.button}
withSpinner
/>
</Button.Group>
</div>
Expand All @@ -98,15 +96,15 @@ class Selection extends TxComponent<Props, State> {
);
}

private onChangeExtrinsic = (method: Call | null = null): void => {
private onChangeExtrinsic = (method: SubmittableExtrinsic<'promise'> | null = null): void => {
this.nextState({ method });
}

private onChangeSender = (accountId: string | null): void => {
this.nextState({ accountId });
}

private getExtrinsic (): SubmittableExtrinsic | null {
private getExtrinsic (): SubmittableExtrinsic<'promise'> | null {
const { api } = this.props;
const { method } = this.state;

Expand Down
Loading