diff --git a/js/src/modals/CreateWallet/WalletDetails/walletDetails.js b/js/src/modals/CreateWallet/WalletDetails/walletDetails.js
index c4291b003..48a2fc3ec 100644
--- a/js/src/modals/CreateWallet/WalletDetails/walletDetails.js
+++ b/js/src/modals/CreateWallet/WalletDetails/walletDetails.js
@@ -14,8 +14,9 @@
// You should have received a copy of the GNU General Public License
// along with Parity. If not, see .
-import React, { Component, PropTypes } from 'react';
import { omitBy } from 'lodash';
+import React, { Component, PropTypes } from 'react';
+import { FormattedMessage } from 'react-intl';
import { Form, TypedInput, Input, AddressSelect, InputAddress } from '~/ui';
@@ -46,24 +47,54 @@ export default class WalletDetails extends Component {
return (
diff --git a/js/src/modals/CreateWallet/WalletDetails/walletDetails.spec.js b/js/src/modals/CreateWallet/WalletDetails/walletDetails.spec.js
new file mode 100644
index 000000000..6518e6893
--- /dev/null
+++ b/js/src/modals/CreateWallet/WalletDetails/walletDetails.spec.js
@@ -0,0 +1,49 @@
+// Copyright 2015-2017 Parity Technologies (UK) Ltd.
+// This file is part of Parity.
+
+// Parity is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+
+// Parity is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License
+// along with Parity. If not, see .
+
+import { shallow } from 'enzyme';
+import React from 'react';
+import sinon from 'sinon';
+
+import WalletDetails from './';
+
+import { ACCOUNTS } from '../createWallet.test.js';
+
+let component;
+let onChange;
+
+function render (walletType = 'MULTISIG') {
+ onChange = sinon.stub();
+ component = shallow(
+
+ );
+
+ return component;
+}
+
+describe('WalletDetails', () => {
+ it('renders defaults', () => {
+ expect(render()).to.be.ok;
+ });
+});
diff --git a/js/src/modals/CreateWallet/WalletInfo/walletInfo.js b/js/src/modals/CreateWallet/WalletInfo/walletInfo.js
index e893f450d..bd65a2470 100644
--- a/js/src/modals/CreateWallet/WalletInfo/walletInfo.js
+++ b/js/src/modals/CreateWallet/WalletInfo/walletInfo.js
@@ -15,9 +15,10 @@
// along with Parity. If not, see .
import React, { Component, PropTypes } from 'react';
+import { FormattedMessage } from 'react-intl';
-import { CompletedStep, IdentityIcon, CopyToClipboard } from '~/ui';
import { fromWei } from '~/api/util/wei';
+import { CompletedStep, IdentityIcon, CopyToClipboard } from '~/ui';
import styles from '../createWallet.css';
@@ -48,24 +49,73 @@ export default class WalletInfo extends Component {
return (
- { name }
- has been
- { deployed ? 'deployed' : 'added' } at
+
+ { name },
+ deployedOrAdded: deployed
+ ? (
+
+ )
+ : (
+
+ )
+ } }
+ />
+
-
-
+
+ }
+ />
+
{ address }
-
with the following owners
+
+
+
{ this.renderOwners() }
- { required } owners are required to confirm a transaction.
+ { required }
+ } }
+ />
- The daily limit is set to { fromWei(daylimit).toFormat() } ETH.
+ { fromWei(daylimit).toFormat() }
+ } }
+ />
+ );
+ });
}
addressToString (address) {
diff --git a/js/src/modals/CreateWallet/WalletInfo/walletInfo.spec.js b/js/src/modals/CreateWallet/WalletInfo/walletInfo.spec.js
new file mode 100644
index 000000000..9237659b0
--- /dev/null
+++ b/js/src/modals/CreateWallet/WalletInfo/walletInfo.spec.js
@@ -0,0 +1,46 @@
+// Copyright 2015-2017 Parity Technologies (UK) Ltd.
+// This file is part of Parity.
+
+// Parity is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+
+// Parity is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License
+// along with Parity. If not, see .
+
+import { shallow } from 'enzyme';
+import React from 'react';
+
+import WalletInfo from './';
+
+import { ACCOUNTS } from '../createWallet.test.js';
+
+let component;
+
+function render () {
+ component = shallow(
+
+ );
+
+ return component;
+}
+
+describe('WalletInfo', () => {
+ it('renders defaults', () => {
+ expect(render()).to.be.ok;
+ });
+});
diff --git a/js/src/modals/CreateWallet/WalletType/walletType.js b/js/src/modals/CreateWallet/WalletType/walletType.js
index 5b2b7df6a..bbf55965b 100644
--- a/js/src/modals/CreateWallet/WalletType/walletType.js
+++ b/js/src/modals/CreateWallet/WalletType/walletType.js
@@ -15,11 +15,53 @@
// along with Parity. If not, see .
import React, { Component, PropTypes } from 'react';
+import { FormattedMessage } from 'react-intl';
-import { RadioButtons } from '~/ui';
import { walletSourceURL } from '~/contracts/code/wallet';
+import { RadioButtons } from '~/ui';
-// import styles from '../createWallet.css';
+const TYPES = [
+ {
+ label: (
+
+ ),
+ key: 'MULTISIG',
+ description: (
+
+
+
+ )
+ } }
+ />
+ )
+ },
+ {
+ label: (
+
+ ),
+ key: 'WATCH',
+ description: (
+
+ )
+ }
+];
export default class WalletType extends Component {
static propTypes = {
@@ -33,34 +75,13 @@ export default class WalletType extends Component {
return (
);
}
- getTypes () {
- return [
- {
- label: 'Multi-Sig wallet', key: 'MULTISIG',
- description: (
-
- Create/Deploy a
-
- standard multi-signature
-
- Wallet
-
- )
- },
- {
- label: 'Watch a wallet', key: 'WATCH',
- description: 'Add an existing wallet to your accounts'
- }
- ];
- }
-
onTypeChange = (type) => {
this.props.onChange(type.key);
}
diff --git a/js/src/modals/CreateWallet/WalletType/walletType.spec.js b/js/src/modals/CreateWallet/WalletType/walletType.spec.js
new file mode 100644
index 000000000..2c9d56220
--- /dev/null
+++ b/js/src/modals/CreateWallet/WalletType/walletType.spec.js
@@ -0,0 +1,42 @@
+// Copyright 2015-2017 Parity Technologies (UK) Ltd.
+// This file is part of Parity.
+
+// Parity is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+
+// Parity is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License
+// along with Parity. If not, see .
+
+import { shallow } from 'enzyme';
+import React from 'react';
+import sinon from 'sinon';
+
+import WalletType from './';
+
+let component;
+let onChange;
+
+function render (walletType = 'MULTISIG') {
+ onChange = sinon.stub();
+ component = shallow(
+
+ );
+
+ return component;
+}
+
+describe('WalletType', () => {
+ it('renders defaults', () => {
+ expect(render()).to.be.ok;
+ });
+});
diff --git a/js/src/modals/CreateWallet/createWallet.js b/js/src/modals/CreateWallet/createWallet.js
index 72f2c17e7..659899dc0 100644
--- a/js/src/modals/CreateWallet/createWallet.js
+++ b/js/src/modals/CreateWallet/createWallet.js
@@ -14,20 +14,17 @@
// You should have received a copy of the GNU General Public License
// along with Parity. If not, see .
-import React, { Component, PropTypes } from 'react';
import { observer } from 'mobx-react';
-
-import ActionDone from 'material-ui/svg-icons/action/done';
-import ContentClear from 'material-ui/svg-icons/content/clear';
-import NavigationArrowForward from 'material-ui/svg-icons/navigation/arrow-forward';
+import React, { Component, PropTypes } from 'react';
+import { FormattedMessage } from 'react-intl';
import { Button, Modal, TxHash, BusyStep } from '~/ui';
+import { CancelIcon, DoneIcon, NextIcon } from '~/ui/Icons';
import WalletType from './WalletType';
import WalletDetails from './WalletDetails';
import WalletInfo from './WalletInfo';
import CreateWalletStore from './createWalletStore';
-// import styles from './createWallet.css';
@observer
export default class CreateWallet extends Component {
@@ -49,12 +46,27 @@ export default class CreateWallet extends Component {
return (
+ }
actions={ this.renderDialogActions() }
>
+ }
+ state={
+
+ }
/>
);
@@ -65,7 +77,7 @@ export default class CreateWallet extends Component {
visible
actions={ this.renderDialogActions() }
current={ stage }
- steps={ steps.map((s) => s.title) }
+ steps={ steps.map((step) => step.title) }
waiting={ waiting }
>
{ this.renderPage() }
@@ -81,10 +93,19 @@ export default class CreateWallet extends Component {
case 'DEPLOYMENT':
return (
+ }
state={ this.store.deployState }
>
- { this.store.txhash ? () : null }
+ {
+ this.store.txhash
+ ?
+ : null
+ }
);
@@ -92,15 +113,13 @@ export default class CreateWallet extends Component {
return (
);
@@ -108,10 +127,10 @@ export default class CreateWallet extends Component {
return (
);
@@ -131,40 +150,65 @@ export default class CreateWallet extends Component {
const cancelBtn = (
}
- label='Cancel'
+ icon={ }
+ label={
+
+ }
onClick={ this.onClose }
/>
);
const closeBtn = (
}
- label='Close'
+ icon={ }
+ label={
+
+ }
onClick={ this.onClose }
/>
);
const doneBtn = (
}
- label='Done'
+ icon={ }
+ label={
+
+ }
onClick={ this.onClose }
/>
);
const sendingBtn = (
}
- label='Sending...'
+ icon={ }
+ label={
+
+ }
disabled
/>
);
const nextBtn = (
}
- label='Next'
+ icon={ }
+ label={
+
+ }
onClick={ onNext }
/>
);
@@ -184,9 +228,14 @@ export default class CreateWallet extends Component {
if (this.store.walletType === 'WATCH') {
return [ cancelBtn, (
}
- label='Add'
disabled={ hasErrors }
+ icon={ }
+ label={
+
+ }
onClick={ onAdd }
/>
) ];
@@ -194,9 +243,14 @@ export default class CreateWallet extends Component {
return [ cancelBtn, (
}
- label='Create'
disabled={ hasErrors }
+ icon={ }
+ label={
+
+ }
onClick={ onCreate }
/>
) ];
diff --git a/js/src/modals/CreateWallet/createWallet.spec.js b/js/src/modals/CreateWallet/createWallet.spec.js
new file mode 100644
index 000000000..2a9e9a558
--- /dev/null
+++ b/js/src/modals/CreateWallet/createWallet.spec.js
@@ -0,0 +1,54 @@
+// Copyright 2015-2017 Parity Technologies (UK) Ltd.
+// This file is part of Parity.
+
+// Parity is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+
+// Parity is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License
+// along with Parity. If not, see .
+
+import { shallow } from 'enzyme';
+import React from 'react';
+import sinon from 'sinon';
+
+import CreateWallet from './';
+
+import { ACCOUNTS } from './createWallet.test.js';
+
+let api;
+let component;
+let onClose;
+
+function createApi () {
+ api = {};
+
+ return api;
+}
+
+function render () {
+ onClose = sinon.stub();
+ component = shallow(
+ ,
+ {
+ context: { api: createApi() }
+ }
+ );
+
+ return component;
+}
+
+describe('CreateWallet', () => {
+ it('renders defaults', () => {
+ expect(render()).to.be.ok;
+ });
+});
diff --git a/js/src/modals/CreateWallet/createWallet.test.js b/js/src/modals/CreateWallet/createWallet.test.js
new file mode 100644
index 000000000..e034bd066
--- /dev/null
+++ b/js/src/modals/CreateWallet/createWallet.test.js
@@ -0,0 +1,25 @@
+// Copyright 2015-2017 Parity Technologies (UK) Ltd.
+// This file is part of Parity.
+
+// Parity is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+
+// Parity is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License
+// along with Parity. If not, see .
+
+const ACCOUNTS = {
+ '0x1234567890123456789012345678901234567890': {
+ address: '0x1234567890123456789012345678901234567890'
+ }
+};
+
+export {
+ ACCOUNTS
+};
diff --git a/js/src/modals/CreateWallet/createWalletStore.js b/js/src/modals/CreateWallet/createWalletStore.js
index b44bce99c..40c823254 100644
--- a/js/src/modals/CreateWallet/createWalletStore.js
+++ b/js/src/modals/CreateWallet/createWalletStore.js
@@ -15,10 +15,12 @@
// along with Parity. If not, see .
import { observable, computed, action, transaction } from 'mobx';
+import React from 'react';
+import { FormattedMessage } from 'react-intl';
import Contract from '~/api/contract';
-import Contracts from '~/contracts';
import { ERROR_CODES } from '~/api/transport/error';
+import Contracts from '~/contracts';
import { wallet as walletAbi } from '~/contracts/abi';
import { wallet as walletCode, walletLibraryRegKey, fullWalletCode } from '~/contracts/code/wallet';
@@ -27,10 +29,39 @@ import { toWei } from '~/api/util/wei';
import WalletsUtils from '~/util/wallets';
const STEPS = {
- TYPE: { title: 'wallet type' },
- DETAILS: { title: 'wallet details' },
- DEPLOYMENT: { title: 'wallet deployment', waiting: true },
- INFO: { title: 'wallet informaton' }
+ TYPE: {
+ title: (
+
+ )
+ },
+ DETAILS: {
+ title: (
+
+ )
+ },
+ DEPLOYMENT: {
+ title: (
+
+ ),
+ waiting: true
+ },
+ INFO: {
+ title: (
+
+ )
+ }
};
export default class CreateWalletStore {
@@ -227,25 +258,50 @@ export default class CreateWalletStore {
switch (data.state) {
case 'estimateGas':
case 'postTransaction':
- this.deployState = 'Preparing transaction for network transmission';
+ this.deployState = (
+
+ );
return;
case 'checkRequest':
- this.deployState = 'Waiting for confirmation of the transaction in the Parity Secure Signer';
+ this.deployState = (
+
+ );
return;
case 'getTransactionReceipt':
- this.deployState = 'Waiting for the contract deployment transaction receipt';
+ this.deployState = (
+
+ );
this.txhash = data.txhash;
return;
case 'hasReceipt':
case 'getCode':
- this.deployState = 'Validating the deployed contract code';
+ this.deployState = (
+
+ );
return;
case 'completed':
- this.deployState = 'The contract deployment has been completed';
+ this.deployState = (
+
+ );
return;
default:
diff --git a/js/src/ui/Form/TypedInput/typedInput.js b/js/src/ui/Form/TypedInput/typedInput.js
index 1d46fc620..082777192 100644
--- a/js/src/ui/Form/TypedInput/typedInput.js
+++ b/js/src/ui/Form/TypedInput/typedInput.js
@@ -28,6 +28,7 @@ import Input from '~/ui/Form/Input';
import InputAddressSelect from '~/ui/Form/InputAddressSelect';
import Select from '~/ui/Form/Select';
import { ABI_TYPES, parseAbiType } from '~/util/abi';
+import { nodeOrStringProptype } from '~/util/proptypes';
import styles from './typedInput.css';
@@ -42,9 +43,9 @@ export default class TypedInput extends Component {
allowCopy: PropTypes.bool,
className: PropTypes.string,
error: PropTypes.any,
- hint: PropTypes.string,
+ hint: nodeOrStringProptype(),
isEth: PropTypes.bool,
- label: PropTypes.string,
+ label: nodeOrStringProptype(),
max: PropTypes.number,
min: PropTypes.number,
onChange: PropTypes.func,