+ { label }
+ {
+ description
+ ? (
+ { description }
+ )
+ : null
+ }
+
+ ) }
+ />
+ );
+ });
+ }
+
+ getKey (value, index) {
+ if (typeof value !== 'string') {
+ return typeof value.key === 'undefined' ? index : value.key;
+ }
+
+ return index;
+ }
+
+ onChange = (event, index) => {
+ const { onChange, values } = this.props;
+
+ const value = values[index] || values.find((v) => v.key === index);
+ onChange(value, index);
+ }
+}
diff --git a/js/src/ui/Form/index.js b/js/src/ui/Form/index.js
index 46bb106f4..113f3424a 100644
--- a/js/src/ui/Form/index.js
+++ b/js/src/ui/Form/index.js
@@ -23,6 +23,7 @@ import InputAddressSelect from './InputAddressSelect';
import InputChip from './InputChip';
import InputInline from './InputInline';
import Select from './Select';
+import RadioButtons from './RadioButtons';
export default from './form';
export {
@@ -34,5 +35,6 @@ export {
InputAddressSelect,
InputChip,
InputInline,
- Select
+ Select,
+ RadioButtons
};
diff --git a/js/src/ui/Modal/modal.js b/js/src/ui/Modal/modal.js
index 7137c02a4..7c2a54b4e 100644
--- a/js/src/ui/Modal/modal.js
+++ b/js/src/ui/Modal/modal.js
@@ -43,7 +43,7 @@ class Modal extends Component {
waiting: PropTypes.array,
scroll: PropTypes.bool,
steps: PropTypes.array,
- title: React.PropTypes.oneOfType([
+ title: PropTypes.oneOfType([
PropTypes.node, PropTypes.string
]),
visible: PropTypes.bool.isRequired,
diff --git a/js/src/ui/index.js b/js/src/ui/index.js
index 69a7d26c3..d443d0dbc 100644
--- a/js/src/ui/index.js
+++ b/js/src/ui/index.js
@@ -29,7 +29,7 @@ import ContextProvider from './ContextProvider';
import CopyToClipboard from './CopyToClipboard';
import Editor from './Editor';
import Errors from './Errors';
-import Form, { AddressSelect, FormWrap, TypedInput, Input, InputAddress, InputAddressSelect, InputChip, InputInline, Select } from './Form';
+import Form, { AddressSelect, FormWrap, TypedInput, Input, InputAddress, InputAddressSelect, InputChip, InputInline, Select, RadioButtons } from './Form';
import IdentityIcon from './IdentityIcon';
import IdentityName from './IdentityName';
import MethodDecoding from './MethodDecoding';
@@ -78,6 +78,7 @@ export {
muiTheme,
Page,
ParityBackground,
+ RadioButtons,
SignerIcon,
Tags,
Tooltip,
diff --git a/js/src/views/Status/containers/StatusPage/StatusPage.js b/js/src/views/Status/containers/StatusPage/StatusPage.js
index afc7d60f7..617a6486a 100644
--- a/js/src/views/Status/containers/StatusPage/StatusPage.js
+++ b/js/src/views/Status/containers/StatusPage/StatusPage.js
@@ -18,7 +18,7 @@ import React, { Component, PropTypes } from 'react';
import { bindActionCreators } from 'redux';
import { connect } from 'react-redux';
-import { clearStatusLogs, toggleStatusLogs } from '../../../../redux/actions';
+import { clearStatusLogs, toggleStatusLogs, toggleStatusRefresh } from '../../../../redux/actions';
import Debug from '../../components/Debug';
import Status from '../../components/Status';
@@ -31,6 +31,14 @@ class StatusPage extends Component {
actions: PropTypes.object.isRequired
}
+ componentWillMount () {
+ this.props.actions.toggleStatusRefresh(true);
+ }
+
+ componentWillUnmount () {
+ this.props.actions.toggleStatusRefresh(false);
+ }
+
render () {
return (
@@ -49,7 +57,8 @@ function mapDispatchToProps (dispatch) {
return {
actions: bindActionCreators({
clearStatusLogs,
- toggleStatusLogs
+ toggleStatusLogs,
+ toggleStatusRefresh
}, dispatch)
};
}
diff --git a/js/test/npmLibrary.js b/js/test/npmLibrary.js
new file mode 100644
index 000000000..63d8f9515
--- /dev/null
+++ b/js/test/npmLibrary.js
@@ -0,0 +1,45 @@
+// Copyright 2015, 2016 Ethcore (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 .
+
+try {
+ var Api = require('../.npmjs/library.js').Api;
+ var Abi = require('../.npmjs/library.js').Abi;
+
+ if (typeof Api !== 'function') {
+ throw new Error('No Api');
+ }
+
+ if (typeof Abi !== 'function') {
+ throw new Error('No Abi');
+ }
+
+ var transport = new Api.Transport.Http('http://localhost:8545');
+ var api = new Api(transport);
+
+ api.eth
+ .blockNumber()
+ .then((block) => {
+ console.log('library working fine', '(block #' + block.toFormat() + ')');
+ process.exit(0);
+ })
+ .catch(() => {
+ console.log('library working fine (disconnected)');
+ process.exit(0);
+ });
+} catch (e) {
+ console.error('An error occured:', e.toString().split('\n')[0]);
+ process.exit(1);
+}
diff --git a/js/webpack.libraries.js b/js/webpack.libraries.js
index bf54a933f..07e40957e 100644
--- a/js/webpack.libraries.js
+++ b/js/webpack.libraries.js
@@ -26,6 +26,7 @@ const DEST = process.env.BUILD_DEST || '.build';
module.exports = {
context: path.join(__dirname, './src'),
+ target: 'node',
entry: {
// library
'inject': ['./web3.js'],
@@ -34,9 +35,18 @@ module.exports = {
},
output: {
path: path.join(__dirname, DEST),
- filename: '[name].js'
+ filename: '[name].js',
+ library: '[name].js',
+ libraryTarget: 'umd'
+ },
+ externals: {
+ 'node-fetch': 'node-fetch',
+ 'vertx': 'vertx'
},
module: {
+ noParse: [
+ /babel-polyfill/
+ ],
loaders: [
{
test: /\.js$/,
diff --git a/js/webpack.npm.js b/js/webpack.npm.js
index 23e2b7939..80b6dd540 100644
--- a/js/webpack.npm.js
+++ b/js/webpack.npm.js
@@ -24,13 +24,23 @@ const isProd = ENV === 'production';
module.exports = {
context: path.join(__dirname, './src'),
+ target: 'node',
entry: 'library.js',
output: {
path: path.join(__dirname, '.npmjs'),
filename: 'library.js',
- libraryTarget: 'commonjs'
+ library: 'Parity',
+ libraryTarget: 'umd',
+ umdNamedDefine: true
+ },
+ externals: {
+ 'node-fetch': 'node-fetch',
+ 'vertx': 'vertx'
},
module: {
+ noParse: [
+ /babel-polyfill/
+ ],
loaders: [
{
test: /(\.jsx|\.js)$/,
diff --git a/rpc/src/v1/tests/mocked/parity_accounts.rs b/rpc/src/v1/tests/mocked/parity_accounts.rs
index 272c55f6d..c5ed4172e 100644
--- a/rpc/src/v1/tests/mocked/parity_accounts.rs
+++ b/rpc/src/v1/tests/mocked/parity_accounts.rs
@@ -112,7 +112,7 @@ fn should_be_able_to_set_meta() {
let request = r#"{"jsonrpc": "2.0", "method": "parity_accountsInfo", "params": [], "id": 1}"#;
let res = tester.io.handle_request_sync(request);
- let response = format!("{{\"jsonrpc\":\"2.0\",\"result\":{{\"0x{}\":{{\"meta\":\"{{foo: 69}}\",\"name\":\"{}\",\"uuid\":\"{}\"}}}},\"id\":1}}", address.hex(), uuid, uuid);
+ let response = format!("{{\"jsonrpc\":\"2.0\",\"result\":{{\"0x{}\":{{\"meta\":\"{{foo: 69}}\",\"name\":\"\",\"uuid\":\"{}\"}}}},\"id\":1}}", address.hex(), uuid);
assert_eq!(res, Some(response));
}