Support both versions.

This commit is contained in:
Tomasz Drwięga 2017-10-17 18:07:21 +02:00
parent 0f8fb62581
commit 304b067417
No known key found for this signature in database
GPG Key ID: D066F497E62CAF66
10 changed files with 63 additions and 65 deletions

10
Cargo.lock generated
View File

@ -2212,6 +2212,7 @@ version = "1.9.0"
dependencies = [
"parity-ui-dev 1.9.0",
"parity-ui-old-dev 1.9.0",
"parity-ui-old-precompiled 1.8.0 (git+https://github.com/paritytech/js-precompiled.git?branch=v1)",
"parity-ui-precompiled 1.4.0 (git+https://github.com/paritytech/js-precompiled.git)",
"rustc_version 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)",
]
@ -2230,6 +2231,14 @@ dependencies = [
"parity-dapps-glue 1.9.0 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "parity-ui-old-precompiled"
version = "1.8.0"
source = "git+https://github.com/paritytech/js-precompiled.git?branch=v1#94b0a89aac7eb5ddfdb53cd9bb039da6fdbf7583"
dependencies = [
"parity-dapps-glue 1.9.0 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "parity-ui-precompiled"
version = "1.4.0"
@ -3641,6 +3650,7 @@ dependencies = [
"checksum owning_ref 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "cdf84f41639e037b484f93433aa3897863b561ed65c6e59c7073d7c561710f37"
"checksum parity-dapps-glue 1.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "9df5504a83dbbbd25ddb0645372bd09dff5a7716e18690a21211873b81606fe9"
"checksum parity-tokio-ipc 0.1.5 (git+https://github.com/nikvolf/parity-tokio-ipc)" = "<none>"
"checksum parity-ui-old-precompiled 1.8.0 (git+https://github.com/paritytech/js-precompiled.git?branch=v1)" = "<none>"
"checksum parity-ui-precompiled 1.4.0 (git+https://github.com/paritytech/js-precompiled.git)" = "<none>"
"checksum parity-wasm 0.14.5 (registry+https://github.com/rust-lang/crates.io-index)" = "d4502e18417d96bd8e72fca9ea4cc18f4d80288ff565582d10aefe86f18b4fc3"
"checksum parity-wordlist 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "81451bfab101d186f8fc4a0aa13cb5539b31b02c4ed96425a0842e2a413daba6"

View File

@ -78,11 +78,8 @@ pub fn all_endpoints<F: Fetch>(
// NOTE [ToDr] Dapps will be currently embeded on 8180
insert::<parity_ui::App>(&mut pages, "ui", Embeddable::Yes(embeddable.clone()), pool.clone());
// old version
{
let mut endpoint = PageEndpoint::new_safe_to_embed(parity_ui::old::App::default(), embeddable.clone());
endpoint.prefix = Some("v1".into());
pages.insert("v1".into(), Box::new(endpoint));
}
insert::<parity_ui::old::App>(&mut pages, "v1", Embeddable::Yes(embeddable.clone()), pool.clone());
pages.insert("proxy".into(), ProxyPac::boxed(embeddable.clone(), dapps_domain.to_owned()));
pages.insert(WEB_PATH.into(), Web::boxed(embeddable.clone(), web_proxy_tokens.clone(), fetch.clone()));

View File

@ -138,6 +138,7 @@ impl Router {
},
// Any other GET|HEAD requests to home page.
_ if (is_get_request || is_head_request) && self.special.contains_key(&SpecialEndpoint::Home) => {
trace!(target: "dapps", "Resolving to home page.");
let special = self.special.get(&SpecialEndpoint::Home).expect("special known to contain key; qed");
match *special {
Some(ref special) => {

View File

@ -12,9 +12,10 @@ rustc_version = "0.1"
[dependencies]
parity-ui-dev = { path = "../../js", optional = true }
parity-ui-old-dev = { path = "../../js-old", optional = true }
parity-ui-old-precompiled = { git = "https://github.com/paritytech/js-precompiled.git", optional = true, branch = "v1" }
# This is managed by the js/scripts/release.sh script on CI - keep it in a single line
parity-ui-precompiled = { git = "https://github.com/paritytech/js-precompiled.git", optional = true, branch = "master" }
[features]
no-precompiled-js = ["parity-ui-dev", "parity-ui-old-dev"]
use-precompiled-js = ["parity-ui-precompiled"]
use-precompiled-js = ["parity-ui-precompiled", "parity-ui-old-precompiled"]

View File

@ -36,5 +36,11 @@ pub mod old {
pub use self::parity_ui_old_dev::*;
}
#[cfg(feature = "parity-ui-old-precompiled")]
pub mod old {
extern crate parity_ui_old_precompiled;
pub use self::parity_ui_old_precompiled::*;
}
pub use self::inner::*;

View File

@ -9,6 +9,16 @@
"resolved": "https://registry.npmjs.org/@parity/wordlist/-/wordlist-1.0.1.tgz",
"integrity": "sha1-wn5A4as2OKCe1TtKLoHVMbXrWjE="
},
"JSONStream": {
"version": "0.8.4",
"resolved": "https://registry.npmjs.org/JSONStream/-/JSONStream-0.8.4.tgz",
"integrity": "sha1-kWV9/m/4V0gwZhMrRhi2Lo9Ih70=",
"dev": true,
"requires": {
"jsonparse": "0.0.5",
"through": "2.3.8"
}
},
"abab": {
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/abab/-/abab-1.0.3.tgz",
@ -6850,16 +6860,6 @@
"integrity": "sha1-T9kss04OnbPInIYi7PUfm5eMbLk=",
"dev": true
},
"JSONStream": {
"version": "0.8.4",
"resolved": "https://registry.npmjs.org/JSONStream/-/JSONStream-0.8.4.tgz",
"integrity": "sha1-kWV9/m/4V0gwZhMrRhi2Lo9Ih70=",
"dev": true,
"requires": {
"jsonparse": "0.0.5",
"through": "2.3.8"
}
},
"jsprim": {
"version": "1.4.0",
"resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.0.tgz",
@ -11345,14 +11345,6 @@
"resolved": "https://registry.npmjs.org/strict-uri-encode/-/strict-uri-encode-1.1.0.tgz",
"integrity": "sha1-J5siXfHVgrH1TmWt3UNS4Y+qBxM="
},
"string_decoder": {
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.0.3.tgz",
"integrity": "sha512-4AH6Z5fzNNBcH+6XDMfA/BTt87skxqJlO0lAh3Dker5zThcAxG6mKz+iGu308UKoPPQ8Dcqx/4JhujzltRa+hQ==",
"requires": {
"safe-buffer": "5.1.1"
}
},
"string-width": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz",
@ -11368,6 +11360,14 @@
"resolved": "https://registry.npmjs.org/string.prototype.repeat/-/string.prototype.repeat-0.2.0.tgz",
"integrity": "sha1-q6Nt4I3O5qWjN9SbLqHaGyj8Ds8="
},
"string_decoder": {
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.0.3.tgz",
"integrity": "sha512-4AH6Z5fzNNBcH+6XDMfA/BTt87skxqJlO0lAh3Dker5zThcAxG6mKz+iGu308UKoPPQ8Dcqx/4JhujzltRa+hQ==",
"requires": {
"safe-buffer": "5.1.1"
}
},
"stringify-object": {
"version": "3.2.0",
"resolved": "https://registry.npmjs.org/stringify-object/-/stringify-object-3.2.0.tgz",

View File

@ -40,10 +40,10 @@ impl WebApp for App {
fn info(&self) -> Info {
Info {
name: "Parity UI",
name: "Parity Wallet v1",
version: env!("CARGO_PKG_VERSION"),
author: "Parity <admin@parity.io>",
description: "New UI for Parity.",
description: "Deprecated version of Parity Wallet.",
icon_url: "icon.png",
}
}

42
js/package-lock.json generated
View File

@ -374,19 +374,19 @@
}
},
"@parity/plugin-signer-account": {
"version": "github:paritytech/plugin-signer-account#ed568ac368ff6292a8bccf5181a8d2b817a00eb1",
"version": "github:paritytech/plugin-signer-account#03cd3564191f1d4dfbea9e9b2158b4a03a37daf8",
"requires": {
"@parity/ui": "2.0.42"
}
},
"@parity/plugin-signer-default": {
"version": "github:paritytech/plugin-signer-default#67babac60bd5108c94f643e8374bf7815897cb2a",
"version": "github:paritytech/plugin-signer-default#fe26dd11431482742d679c83762ead450ed26928",
"requires": {
"@parity/ui": "2.0.42"
}
},
"@parity/plugin-signer-hardware": {
"version": "github:paritytech/plugin-signer-hardware#4de522d01da3e1ea7f2398010a69f3ea46f26eef",
"version": "github:paritytech/plugin-signer-hardware#d549d2344f034d12518c195f6e7519478b35bf15",
"requires": {
"@parity/ui": "2.0.42"
}
@ -497,6 +497,16 @@
"integrity": "sha512-5ZskbOk+/EIZErNRo8bgemhtw99PB+CsdOm2wM5qAgc+MwAVL6L9RZv2Hin7Y8S7FewCkPqNlw+3hTmT+PsnJA==",
"dev": true
},
"JSONStream": {
"version": "0.8.4",
"resolved": "https://registry.npmjs.org/JSONStream/-/JSONStream-0.8.4.tgz",
"integrity": "sha1-kWV9/m/4V0gwZhMrRhi2Lo9Ih70=",
"dev": true,
"requires": {
"jsonparse": "0.0.5",
"through": "2.3.8"
}
},
"abab": {
"version": "1.0.4",
"resolved": "https://registry.npmjs.org/abab/-/abab-1.0.4.tgz",
@ -7628,16 +7638,6 @@
"integrity": "sha1-T9kss04OnbPInIYi7PUfm5eMbLk=",
"dev": true
},
"JSONStream": {
"version": "0.8.4",
"resolved": "https://registry.npmjs.org/JSONStream/-/JSONStream-0.8.4.tgz",
"integrity": "sha1-kWV9/m/4V0gwZhMrRhi2Lo9Ih70=",
"dev": true,
"requires": {
"jsonparse": "0.0.5",
"through": "2.3.8"
}
},
"jsprim": {
"version": "1.4.1",
"resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.1.tgz",
@ -12458,14 +12458,6 @@
"resolved": "https://registry.npmjs.org/strict-uri-encode/-/strict-uri-encode-1.1.0.tgz",
"integrity": "sha1-J5siXfHVgrH1TmWt3UNS4Y+qBxM="
},
"string_decoder": {
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.0.3.tgz",
"integrity": "sha512-4AH6Z5fzNNBcH+6XDMfA/BTt87skxqJlO0lAh3Dker5zThcAxG6mKz+iGu308UKoPPQ8Dcqx/4JhujzltRa+hQ==",
"requires": {
"safe-buffer": "5.1.1"
}
},
"string-width": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz",
@ -12481,6 +12473,14 @@
"resolved": "https://registry.npmjs.org/string.prototype.repeat/-/string.prototype.repeat-0.2.0.tgz",
"integrity": "sha1-q6Nt4I3O5qWjN9SbLqHaGyj8Ds8="
},
"string_decoder": {
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.0.3.tgz",
"integrity": "sha512-4AH6Z5fzNNBcH+6XDMfA/BTt87skxqJlO0lAh3Dker5zThcAxG6mKz+iGu308UKoPPQ8Dcqx/4JhujzltRa+hQ==",
"requires": {
"safe-buffer": "5.1.1"
}
},
"stringify-object": {
"version": "3.2.1",
"resolved": "https://registry.npmjs.org/stringify-object/-/stringify-object-3.2.1.tgz",

View File

@ -25,11 +25,9 @@ import viewsDapps from '@parity/shared/config/dappsViews.json';
import DappsStore from '@parity/shared/mobx/dappsStore';
import HistoryStore from '@parity/shared/mobx/historyStore';
import walletVersion1 from '../v1.json';
import styles from './dapp.css';
const internalDapps = [walletVersion1]
const internalDapps = []
.concat(viewsDapps, builtinDapps)
.map((app) => {
if (app.id && app.id.substr(0, 2) !== '0x') {
@ -74,13 +72,6 @@ export default class Dapp extends Component {
}
loadApp (id) {
if (id === walletVersion1.id) {
return this.setState({
loading: false,
app: walletVersion1
});
}
this.setState({ loading: true });
this.store

View File

@ -28,8 +28,6 @@ import SectionList from '@parity/ui/SectionList';
import DappsStore from '@parity/shared/mobx/dappsStore';
import walletVersion1 from '../v1.json';
import styles from './dapps.css';
@observer
@ -87,7 +85,6 @@ class Dapps extends Component {
/>
}
>
{ this.renderHardcodedDapps() }
{ this.renderList(this.store.visibleViews) }
{ this.renderList(this.store.visibleLocal) }
{ this.renderList(this.store.visibleBuiltin) }
@ -96,11 +93,6 @@ class Dapps extends Component {
);
}
renderHardcodedDapps () {
const dapp = [walletVersion1];
return this.renderList(dapp);
}
renderList (items, overlay) {
console.log(items);
return (