Skip to content
This repository has been archived by the owner on Nov 6, 2020. It is now read-only.

Commit

Permalink
Merge pull request #6819 from paritytech/td-ui-2
Browse files Browse the repository at this point in the history
Integrate UI 2
  • Loading branch information
arkpar committed Oct 19, 2017
2 parents 58db82d + bfcf4c4 commit 41eabfc
Show file tree
Hide file tree
Showing 2,207 changed files with 41,215 additions and 6,686 deletions.
15 changes: 13 additions & 2 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ linux-snap:
paths:
- scripts/parity_*_amd64.snap
name: "stable-x86_64-unknown-snap-gnu_parity"
allow_failure: true
allow_failure: true
linux-stable-debian:
stage: build
image: parity/rust-debian:gitlab-ci
Expand Down Expand Up @@ -244,7 +244,7 @@ linux-i686:
- strip target/$PLATFORM/release/parity
- strip target/$PLATFORM/release/parity-evm
- strip target/$PLATFORM/release/ethstore
- strip target/$PLATFORM/release/ethkey
- strip target/$PLATFORM/release/ethkey
- strip target/$PLATFORM/release/parity
- md5sum target/$PLATFORM/release/parity > parity.md5
- export SHA3=$(target/$PLATFORM/release/parity tools hash target/$PLATFORM/release/parity)
Expand Down Expand Up @@ -627,8 +627,12 @@ js-test:
- git submodule update --init --recursive
- export JS_FILES_MODIFIED=$(git --no-pager diff --name-only $CI_BUILD_REF^ $CI_BUILD_REF | grep ^js/ | wc -l)
- if [ $JS_FILES_MODIFIED -eq 0 ]; then echo "Skipping JS deps install since no JS files modified."; else ./js/scripts/install-deps.sh;fi
- export JS_OLD_FILES_MODIFIED=$(git --no-pager diff --name-only $CI_BUILD_REF^ $CI_BUILD_REF | grep ^js-old/ | wc -l)
- if [ $JS_OLD_FILES_MODIFIED -eq 0 ]; then echo "Skipping JS (old) deps install since no JS files modified."; else ./js-old/scripts/install-deps.sh;fi

script:
- if [ $JS_FILES_MODIFIED -eq 0 ]; then echo "Skipping JS lint since no JS files modified."; else ./js/scripts/lint.sh && ./js/scripts/test.sh && ./js/scripts/build.sh; fi
- if [ $JS_OLD_FILES_MODIFIED -eq 0 ]; then echo "Skipping JS (old) lint since no JS files modified."; else ./js-old/scripts/lint.sh && ./js-old/scripts/test.sh && ./js-old/scripts/build.sh; fi
tags:
- rust
- rust-stable
Expand Down Expand Up @@ -679,10 +683,17 @@ js-release:
- export JS_FILES_MODIFIED=$(git --no-pager diff --name-only $CI_BUILD_REF^ $CI_BUILD_REF | grep ^js/ | wc -l)
- echo $JS_FILES_MODIFIED
- if [ $JS_FILES_MODIFIED -eq 0 ]; then echo "Skipping JS deps install since no JS files modified."; else ./js/scripts/install-deps.sh;fi
- export JS_OLD_FILES_MODIFIED=$(git --no-pager diff --name-only $CI_BUILD_REF^ $CI_BUILD_REF | grep ^js-old/ | wc -l)
- echo $JS_OLD_FILES_MODIFIED
- if [ $JS_OLD_FILES_MODIFIED -eq 0 ]; then echo "Skipping JS (old) deps install since no JS files modified."; else ./js-old/scripts/install-deps.sh;fi

script:
- rustup default stable
- echo $JS_FILES_MODIFIED
- if [ $JS_FILES_MODIFIED -eq 0 ]; then echo "Skipping JS rebuild since no JS files modified."; else ./js/scripts/build.sh && ./js/scripts/release.sh; fi
- echo $JS_OLD_FILES_MODIFIED
- if [ $JS_OLD_FILES_MODIFIED -eq 0 ]; then echo "Skipping JS (old) rebuild since no JS files modified."; else ./js-old/scripts/build.sh && ./js-old/scripts/release.sh; fi

tags:
- javascript
push-release:
Expand Down
18 changes: 18 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions dapps/src/apps/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,9 @@ 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
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()));

Expand Down
1 change: 1 addition & 0 deletions dapps/src/router.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand Down
6 changes: 4 additions & 2 deletions dapps/ui/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,11 @@ rustc_version = "0.1"

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

[features]
no-precompiled-js = ["parity-ui-dev"]
use-precompiled-js = ["parity-ui-precompiled"]
no-precompiled-js = ["parity-ui-dev", "parity-ui-old-dev"]
use-precompiled-js = ["parity-ui-precompiled", "parity-ui-old-precompiled"]
13 changes: 13 additions & 0 deletions dapps/ui/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,18 @@ mod inner {
pub use self::parity_ui_precompiled::*;
}

#[cfg(feature = "parity-ui-old-dev")]
pub mod old {
extern crate parity_ui_old_dev;

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::*;
34 changes: 34 additions & 0 deletions js-old/.babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"presets": [
"es2017", "es2016", "es2015",
"stage-0", "react"
],
"plugins": [
"transform-decorators-legacy",
"transform-class-properties",
"transform-object-rest-spread",
"transform-es2015-modules-commonjs",
"transform-runtime",
"lodash",
"recharts"
],
"retainLines": true,
"env": {
"production": {
"plugins": [
"transform-react-remove-prop-types"
]
},
"development": {
"plugins": [
[ "react-intl", { "messagesDir": "./.build/i18n/" } ],
"react-hot-loader/babel"
]
},
"test": {
"plugins": [
[ "babel-plugin-webpack-alias", { "config": "webpack/test.js" } ]
]
}
}
}
8 changes: 8 additions & 0 deletions js-old/.codeclimate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
engines:
eslint:
enabled: true
channel: "eslint-2"

ratings:
paths:
- "**.js"
10 changes: 10 additions & 0 deletions js-old/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
root = true
[*]
indent_style=space
indent_size=2
tab_width=2
end_of_line=lf
charset=utf-8
trim_trailing_whitespace=true
max_line_length=120
insert_final_newline=true
33 changes: 33 additions & 0 deletions js-old/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"extends": ["semistandard", "standard-react"],
"parser": "babel-eslint",
"env": {
"browser": true,
"mocha": true,
"node": true
},
"globals": {
"expect": true,
"FileReader": true
},
"rules": {
"curly": ["error", "all"],
"jsx-quotes": ["error", "prefer-single"],
"newline-after-var": ["error", "always"],
"no-alert": "error",
"no-debugger": "error",
"no-duplicate-imports": ["error", {
"includeExports": true
}],
"object-curly-spacing": ["error", "always"],
"object-property-newline": 0,
"one-var-declaration-per-line": ["error", "always"],
"padded-blocks": ["error", {
"blocks": "never",
"classes": "never",
"switches": "never"
}],
"react/jsx-closing-bracket-location": "error",
"react/jsx-curly-spacing": ["error", "always"]
}
}
10 changes: 10 additions & 0 deletions js-old/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
node_modules
npm-debug.log
build
docs
.build
.coverage
.dist
.happypack
.npmjs
.eslintcache
6 changes: 6 additions & 0 deletions js-old/.istanbul.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
instrumentation:
root: src
extensions:
- .js
reporting:
dir: ./.coverage
1 change: 1 addition & 0 deletions js-old/.npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
scripts/
2 changes: 2 additions & 0 deletions js-old/.npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
save-prefix=''
unsafe-perm=true
8 changes: 8 additions & 0 deletions js-old/.stylelintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"extends": "stylelint-config-standard",
"rules": {
"selector-pseudo-class-no-unknown": [
true, { "ignorePseudoClasses": ["global"] }
]
}
}
19 changes: 19 additions & 0 deletions js-old/Cargo.precompiled.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
[package]
description = "Parity built-in dapps."
name = "parity-ui-old-precompiled"
version = "1.9.0"
license = "GPL-3.0"
authors = ["Parity Technologies <admin@parity.io>"]
build = "build.rs"

[features]
default = ["with-syntex", "use-precompiled-js"]
use-precompiled-js = ["parity-dapps-glue/use-precompiled-js"]
with-syntex = ["parity-dapps-glue/with-syntex"]

[build-dependencies]
parity-dapps-glue = "1.9"

[dependencies]
parity-dapps-glue = "1.9"

18 changes: 18 additions & 0 deletions js-old/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
[package]
description = "Parity built-in dapps."
name = "parity-ui-old-dev"
version = "1.9.0"
license = "GPL-3.0"
authors = ["Parity Technologies <admin@parity.io>"]
build = "build.rs"

[features]
default = ["with-syntex"]
with-syntex = ["parity-dapps-glue/with-syntex"]

[build-dependencies]
parity-dapps-glue = "1.9"

[dependencies]
parity-dapps-glue = "1.9"

0 comments on commit 41eabfc

Please sign in to comment.