From dc5dfe19f2515a501b493014f0a0c965963d5fc0 Mon Sep 17 00:00:00 2001 From: Sebastian Kippe Date: Tue, 27 Aug 2019 18:19:46 +0200 Subject: [PATCH] Add success page to GitHub signup --- app/controllers/signup/eth-account.js | 9 ++--- app/router.js | 1 + app/routes/signup/complete.js | 4 ++ app/styles/_layout.scss | 8 ++++ app/styles/app.scss | 4 ++ app/templates/signup.hbs | 10 +---- app/templates/signup/complete.hbs | 15 ++++++++ app/templates/signup/eth-account.hbs | 45 ++++++++++++----------- app/templates/signup/index.hbs | 35 ++++++++++-------- package-lock.json | 45 ++++++++++++++++------- tests/unit/routes/signup/complete-test.js | 11 ++++++ 11 files changed, 123 insertions(+), 64 deletions(-) create mode 100644 app/routes/signup/complete.js create mode 100644 app/templates/signup/complete.hbs create mode 100644 tests/unit/routes/signup/complete-test.js diff --git a/app/controllers/signup/eth-account.js b/app/controllers/signup/eth-account.js index d1a8bcf..1a29880 100644 --- a/app/controllers/signup/eth-account.js +++ b/app/controllers/signup/eth-account.js @@ -28,13 +28,10 @@ export default Controller.extend({ fetch(config.githubSignupUrl, { method: 'POST', - headers: { - 'Content-Type': 'application/json' - }, + headers: { 'Content-Type': 'application/json' }, body: JSON.stringify(payload) - }).then(response => { - return response.json(); }) + .then(res => res.json()) .then(data => { console.log('Created contributor:', data); @@ -43,7 +40,7 @@ export default Controller.extend({ ethAddress: null }); - // TODO show success message or transition to success page + this.transitionToRoute('signup.complete'); }); } diff --git a/app/router.js b/app/router.js index 61cc122..e2c6349 100644 --- a/app/router.js +++ b/app/router.js @@ -29,6 +29,7 @@ Router.map(function() { this.route('signup', function() { this.route('github'); this.route('eth-account'); + this.route('complete'); }); }); diff --git a/app/routes/signup/complete.js b/app/routes/signup/complete.js new file mode 100644 index 0000000..6c74252 --- /dev/null +++ b/app/routes/signup/complete.js @@ -0,0 +1,4 @@ +import Route from '@ember/routing/route'; + +export default Route.extend({ +}); diff --git a/app/styles/_layout.scss b/app/styles/_layout.scss index 66729a6..bd95fe8 100644 --- a/app/styles/_layout.scss +++ b/app/styles/_layout.scss @@ -31,6 +31,10 @@ main { section { .content { + a { + font-size: inherit; + } + &.text-lg { p { font-size: 1.2rem; @@ -39,6 +43,10 @@ main { } } + &.text-center { + text-align: center; + } + p { &.mg-bottom-md { margin-bottom: 2rem; diff --git a/app/styles/app.scss b/app/styles/app.scss index ce49075..8396a20 100644 --- a/app/styles/app.scss +++ b/app/styles/app.scss @@ -38,6 +38,10 @@ h1, h2, h3, h4, h5, input, button { font-weight: 300; } +a { + color: $primary-color; +} + section { h2 { font-size: 1.4rem; diff --git a/app/templates/signup.hbs b/app/templates/signup.hbs index f6d10f9..2e18661 100644 --- a/app/templates/signup.hbs +++ b/app/templates/signup.hbs @@ -1,13 +1,5 @@
-
-
-

Create your contributor profile

-
- -
- {{outlet}} -
+ {{outlet}}
-
\ No newline at end of file diff --git a/app/templates/signup/complete.hbs b/app/templates/signup/complete.hbs new file mode 100644 index 0000000..189db7a --- /dev/null +++ b/app/templates/signup/complete.hbs @@ -0,0 +1,15 @@ +
+

Welcome aboard!

+
+
+

+ Congratulations. Your initial profile is now complete. +

+

+ Why not say hi to your fellow contributors + in one of our chat rooms?. +

+

+ {{#link-to "dashboard" class="button small"}}Return to dashboard{{/link-to}} +

+
\ No newline at end of file diff --git a/app/templates/signup/eth-account.hbs b/app/templates/signup/eth-account.hbs index 6e20d06..b69dca9 100644 --- a/app/templates/signup/eth-account.hbs +++ b/app/templates/signup/eth-account.hbs @@ -1,22 +1,25 @@ -

- Kredits allow you to take part in project governance, and to earn rewards for - your contributions. For both, you will need an Ethereum wallet/account. -

- -
-

- +

+

Complete your contributor profile

+
+
+

+ Kredits allow you to take part in project governance, and to earn rewards for + your contributions. For both, you will need an Ethereum wallet/account.

- - -

- -

\ No newline at end of file +
+

+ +

+
+

+ +

+
\ No newline at end of file diff --git a/app/templates/signup/index.hbs b/app/templates/signup/index.hbs index a8ad30f..b3296e6 100644 --- a/app/templates/signup/index.hbs +++ b/app/templates/signup/index.hbs @@ -1,15 +1,20 @@ -

- You have already contributed to a Kosmos project, or you are interested - in contributing in the near future? Fantastic! -

-

- In order to earn kredits for your contributions, you will need a - registered contributor profile. The quickest way to register is by - connecting one of the following accounts: -

-

- -

+
+

Create your contributor profile

+
+
+

+ You have already contributed to a Kosmos project, or you are interested + in contributing in the near future? Fantastic! +

+

+ In order to earn kredits for your contributions, you will need a + registered contributor profile. The quickest way to register is by + connecting one of the following accounts: +

+

+ +

+
diff --git a/package-lock.json b/package-lock.json index 81bacd8..849e839 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9429,7 +9429,8 @@ "ansi-regex": { "version": "2.1.1", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "aproba": { "version": "1.2.0", @@ -9450,12 +9451,14 @@ "balanced-match": { "version": "1.0.0", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "brace-expansion": { "version": "1.1.11", "bundled": true, "dev": true, + "optional": true, "requires": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" @@ -9470,17 +9473,20 @@ "code-point-at": { "version": "1.1.0", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "concat-map": { "version": "0.0.1", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "console-control-strings": { "version": "1.1.0", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "core-util-is": { "version": "1.0.2", @@ -9597,7 +9603,8 @@ "inherits": { "version": "2.0.3", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "ini": { "version": "1.3.5", @@ -9609,6 +9616,7 @@ "version": "1.0.0", "bundled": true, "dev": true, + "optional": true, "requires": { "number-is-nan": "^1.0.0" } @@ -9623,6 +9631,7 @@ "version": "3.0.4", "bundled": true, "dev": true, + "optional": true, "requires": { "brace-expansion": "^1.1.7" } @@ -9630,12 +9639,14 @@ "minimist": { "version": "0.0.8", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "minipass": { "version": "2.3.5", "bundled": true, "dev": true, + "optional": true, "requires": { "safe-buffer": "^5.1.2", "yallist": "^3.0.0" @@ -9654,6 +9665,7 @@ "version": "0.5.1", "bundled": true, "dev": true, + "optional": true, "requires": { "minimist": "0.0.8" } @@ -9734,7 +9746,8 @@ "number-is-nan": { "version": "1.0.1", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "object-assign": { "version": "4.1.1", @@ -9746,6 +9759,7 @@ "version": "1.4.0", "bundled": true, "dev": true, + "optional": true, "requires": { "wrappy": "1" } @@ -9831,7 +9845,8 @@ "safe-buffer": { "version": "5.1.2", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "safer-buffer": { "version": "2.1.2", @@ -9867,6 +9882,7 @@ "version": "1.0.2", "bundled": true, "dev": true, + "optional": true, "requires": { "code-point-at": "^1.0.0", "is-fullwidth-code-point": "^1.0.0", @@ -9886,6 +9902,7 @@ "version": "3.0.1", "bundled": true, "dev": true, + "optional": true, "requires": { "ansi-regex": "^2.0.0" } @@ -9929,12 +9946,14 @@ "wrappy": { "version": "1.0.2", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "yallist": { "version": "3.0.3", "bundled": true, - "dev": true + "dev": true, + "optional": true } } }, @@ -10864,7 +10883,7 @@ "bs58": "^4.0.1", "buffer": "^5.2.1", "cids": "~0.5.5", - "concat-stream": "github:hugomrdias/concat-stream#057bc7b5d6d8df26c8cf00a3f151b6721a0a8034", + "concat-stream": "github:hugomrdias/concat-stream#feat/smaller", "debug": "^4.1.0", "detect-node": "^2.0.4", "end-of-stream": "^1.4.1", @@ -10886,7 +10905,7 @@ "multibase": "~0.6.0", "multicodec": "~0.5.0", "multihashes": "~0.4.14", - "ndjson": "github:hugomrdias/ndjson#4db16da6b42e5b39bf300c3a7cde62abb3fa3a11", + "ndjson": "github:hugomrdias/ndjson#feat/readable-stream3", "once": "^1.4.0", "peer-id": "~0.12.2", "peer-info": "~0.15.1", diff --git a/tests/unit/routes/signup/complete-test.js b/tests/unit/routes/signup/complete-test.js new file mode 100644 index 0000000..199e6b9 --- /dev/null +++ b/tests/unit/routes/signup/complete-test.js @@ -0,0 +1,11 @@ +import { module, test } from 'qunit'; +import { setupTest } from 'ember-qunit'; + +module('Unit | Route | signup/complete', function(hooks) { + setupTest(hooks); + + test('it exists', function(assert) { + let route = this.owner.lookup('route:signup/complete'); + assert.ok(route); + }); +});