Rename signup route, address property

This commit is contained in:
Râu Cao
2023-01-19 13:37:04 +08:00
parent 87bf8ff2df
commit 4356288497
8 changed files with 39 additions and 34 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
<form onsubmit={{action "submit"}}> <form onsubmit={{action "submit"}}>
<p> <p>
<label for="c-account">Ethereum account</label> <label for="c-account">Rootstock account</label>
<Input @type="text" <Input @type="text"
@value={{this.account}} @value={{this.account}}
name="account" id="c-account" name="account" id="c-account"
@@ -9,11 +9,11 @@ export default Controller.extend({
kredits: service(), kredits: service(),
ethAddress: null, accountAddress: null,
githubAccessToken: alias('kredits.githubAccessToken'), githubAccessToken: alias('kredits.githubAccessToken'),
isValidEthAccount: computed('ethAddress', function() { isValidEthAccount: computed('accountAddress', function() {
return isAddress(this.ethAddress); return isAddress(this.accountAddress);
}), }),
signupButtonDisabled: not('isValidEthAccount'), signupButtonDisabled: not('isValidEthAccount'),
@@ -23,7 +23,7 @@ export default Controller.extend({
completeSignup () { completeSignup () {
const payload = { const payload = {
accessToken: this.githubAccessToken, accessToken: this.githubAccessToken,
account: this.ethAddress account: this.accountAddress
} }
fetch(config.githubSignupUrl, { fetch(config.githubSignupUrl, {
@@ -37,7 +37,7 @@ export default Controller.extend({
this.setProperties({ this.setProperties({
githubAccessToken: null, githubAccessToken: null,
ethAddress: null accountAddress: null
}); });
this.transitionToRoute('signup.complete'); this.transitionToRoute('signup.complete');
+1 -1
View File
@@ -26,7 +26,7 @@ Router.map(function() {
}); });
this.route('signup', function() { this.route('signup', function() {
this.route('github'); this.route('github');
this.route('eth-account'); this.route('account');
this.route('complete'); this.route('complete');
}); });
this.route('budget', function() { this.route('budget', function() {
+1 -1
View File
@@ -22,7 +22,7 @@ export default Route.extend({
this.kredits.set('githubAccessToken', accessToken); this.kredits.set('githubAccessToken', accessToken);
this.transitionTo('signup.eth-account'); this.transitionTo('signup.account');
} }
}); });
+29
View File
@@ -0,0 +1,29 @@
<header>
<h2>Complete your contributor profile</h2>
</header>
<div class="content text-lg">
<p class="mb-8">
Kredits allow you to to earn rewards for your contributions, in the form of
dynamic open-source grants. As a regular contributor, you can also take
part in the community's project governance and finances.
</p>
<p>
In order to interact with the system you will need a <a
href="https://rootstock.io">Rootstock</a> wallet/account.
</p>
<form>
<p>
<label>
Rootstock account:<br>
<Input @type="text" @value={{this.accountAddress}} placeholder="0xF18E631Ea191aE4ebE70046Fcb01a436554421BA4" class={{if this.isValidEthAccount "valid" ""}} />
</label>
</p>
</form>
<p class="actions">
<button disabled={{this.signupButtonDisabled}}
onclick={{action "completeSignup"}}
type="button">
Complete my profile
</button>
</p>
</div>
-24
View File
@@ -1,24 +0,0 @@
<header>
<h2>Complete your contributor profile</h2>
</header>
<div class="content text-lg">
<p class="mb-8">
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.
</p>
<form>
<p>
<label>
Ethereum account:<br>
<Input @type="text" @value={{this.ethAddress}} placeholder="0xF18E631Ea191aE4ebE70046Fcb01a436554421BA4" class={{if this.isValidEthAccount "valid" ""}} />
</label>
</p>
</form>
<p class="actions">
<button disabled={{this.signupButtonDisabled}}
onclick={{action "completeSignup"}}
type="button">
Complete my profile
</button>
</p>
</div>
@@ -1,11 +1,11 @@
import { module, test } from 'qunit'; import { module, test } from 'qunit';
import { setupTest } from 'ember-qunit'; import { setupTest } from 'ember-qunit';
module('Unit | Route | signup/eth-account', function(hooks) { module('Unit | Route | signup/account', function(hooks) {
setupTest(hooks); setupTest(hooks);
test('it exists', function(assert) { test('it exists', function(assert) {
let route = this.owner.lookup('route:signup/eth-account'); let route = this.owner.lookup('route:signup/account');
assert.ok(route); assert.ok(route);
}); });
}); });