- {{user-avatar contributor=c.contributor}} {{c.contributor.name}}
+ {{c.contributor.name}}
- {{#if showUnconfirmedKredits}}
+ {{#if @showUnconfirmedKredits}}
{{c.amountTotal}}
{{else}}
{{c.amountConfirmed}}
diff --git a/app/components/external-account-link/template.hbs b/app/components/external-account-link/template.hbs
index 3371c9d..e63156f 100644
--- a/app/components/external-account-link/template.hbs
+++ b/app/components/external-account-link/template.hbs
@@ -1,4 +1,4 @@
-
- {{account.site}}
- {{component iconComponentName}}
+
+ {{this.account.site}}
+ {{component this.iconComponentName}}
\ No newline at end of file
diff --git a/app/components/topbar-account-panel/template.hbs b/app/components/topbar-account-panel/template.hbs
index 35e802c..f4d8d28 100644
--- a/app/components/topbar-account-panel/template.hbs
+++ b/app/components/topbar-account-panel/template.hbs
@@ -1,17 +1,17 @@
- {{#if setupInProgress}}
+ {{#if this.setupInProgress}}
Connecting account...
{{else}}
- {{#if (and kredits.hasAccounts kredits.currentUser)}}
- {{kredits.currentUser.name}}
- {{#if kredits.currentUserIsCore}}
+ {{#if (and this.kredits.hasAccounts this.kredits.currentUser)}}
+ {{this.kredits.currentUser.name}}
+ {{#if this.kredits.currentUserIsCore}}
(core)
{{/if}}
{{else}}
Anonymous
- Sign up
- {{#if showConnectButton}}
- Connect account
+ Sign up
+ {{#if this.showConnectButton}}
+ Connect account
{{/if}}
{{/if}}
{{/if}}
diff --git a/app/templates/contributions/new.hbs b/app/templates/contributions/new.hbs
index cbcf910..e0ecce3 100644
--- a/app/templates/contributions/new.hbs
+++ b/app/templates/contributions/new.hbs
@@ -6,7 +6,9 @@
diff --git a/app/templates/contributions/resubmit.hbs b/app/templates/contributions/resubmit.hbs
index bd48439..1eb365d 100644
--- a/app/templates/contributions/resubmit.hbs
+++ b/app/templates/contributions/resubmit.hbs
@@ -2,11 +2,13 @@
- Re-submit contribution #{{model.id}}
+ Re-submit contribution #{{this.model.id}}
diff --git a/app/templates/contributors/edit.hbs b/app/templates/contributors/edit.hbs
index efbe7a8..c840748 100644
--- a/app/templates/contributors/edit.hbs
+++ b/app/templates/contributors/edit.hbs
@@ -6,7 +6,7 @@
diff --git a/app/templates/dashboard.hbs b/app/templates/dashboard.hbs
index af98894..31d27ec 100644
--- a/app/templates/dashboard.hbs
+++ b/app/templates/dashboard.hbs
@@ -1,40 +1,43 @@
-{{#if showIntroText}}
-
+{{#if this.showIntroText}}
+
Welcome to the contribution dashboard of the
- Kosmos project!
+ Kosmos project!
If you want to learn more about what the numbers mean and how this works,
check out the
- Kredits documentation .
+ Kredits documentation .
If you want to start earning kredits for your contributions,
create a contributor profile .
{{/if}}
-
+
Contributors
- {{#if kredits.hasAccounts}}
+ {{#if this.kredits.hasAccounts}}
add
{{/if}}
@@ -45,26 +48,36 @@
Contributions by type
-
+
- {{#if contributionsUnconfirmed}}
+ {{#if this.contributionsUnconfirmed}}
Latest Contributions
- filter
- {{#if kredits.hasAccounts}}
- add
+
+ filter
+
+ {{#if this.kredits.hasAccounts}}
+ add
{{/if}}
{{!-- TODO: We need a better naming for kredits.hasAccounts --}}
-
+
{{/if}}
@@ -73,11 +86,18 @@
Confirmed Contributions
- filter
+
+ filter
+
-
+
diff --git a/app/templates/dashboard/contributions/show.hbs b/app/templates/dashboard/contributions/show.hbs
index ff22086..a447c1e 100644
--- a/app/templates/dashboard/contributions/show.hbs
+++ b/app/templates/dashboard/contributions/show.hbs
@@ -1,8 +1,8 @@
-
+
- Contribution #{{model.id}}
+ Contribution #{{this.model.id}}
- {{model.amount}}
+ {{this.model.amount}}
₭S
@@ -10,29 +10,29 @@
-
- {{model.contributor.name}}
+
+ {{this.model.contributor.name}}
contributed
- {{moment-from model.iso8601Date}} :
+ {{moment-from this.model.iso8601Date}} :
-
{{model.description}}
+
{{this.model.description}}
- Kind: {{model.kind}}
- Status: {{contribution-status model}}
+ Kind: {{this.model.kind}}
+ Status: {{contribution-status this.model}}
- {{#if model.url}}
+ {{#if this.model.url}}
-
+ rel="noopener noreferrer">
Open URL
{{/if}}
- {{#if model.vetoed}}
+ {{#if this.model.vetoed}}
@@ -42,7 +42,7 @@
kredits will be issued.
- Re-submit contribution …
+ Re-submit contribution …
{{/if}}
@@ -50,10 +50,10 @@
- Copy & edit as new
- {{#if model.ipfsHash}}
-
+ Copy & edit as new
+ {{#if this.model.ipfsHash}}
+
Inspect IPFS data
{{/if}}
diff --git a/app/templates/dashboard/contributors/show.hbs b/app/templates/dashboard/contributors/show.hbs
index e8978f4..241de86 100644
--- a/app/templates/dashboard/contributors/show.hbs
+++ b/app/templates/dashboard/contributors/show.hbs
@@ -1,21 +1,21 @@
-
{{model.name}}
-
{{roleName}}
+
{{this.model.name}}
+
{{this.roleName}}
- {{#each model.accounts as |account|}}
+ {{#each this.model.accounts as |account|}}
-
+
{{/each}}
- {{#if model.url}}
+ {{#if this.model.url}}
-
+
Web
@@ -24,18 +24,18 @@
- ♥ Give kredits
+ ♥ Give kredits
diff --git a/app/templates/signup/eth-account.hbs b/app/templates/signup/eth-account.hbs
index 6c3f513..7f100e9 100644
--- a/app/templates/signup/eth-account.hbs
+++ b/app/templates/signup/eth-account.hbs
@@ -6,17 +6,18 @@
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 my profile
diff --git a/app/templates/signup/index.hbs b/app/templates/signup/index.hbs
index 1146f59..036384d 100644
--- a/app/templates/signup/index.hbs
+++ b/app/templates/signup/index.hbs
@@ -12,7 +12,7 @@
connecting one of the following accounts:
-
+
Connect GitHub
From 12df28f7fdb00b0d2eeb2594b35a996860a20c9f Mon Sep 17 00:00:00 2001
From: Sebastian Kippe
Date: Sun, 10 May 2020 10:43:02 +0200
Subject: [PATCH 06/15] Fix ESLint errors
---
.eslintrc.js | 6 ++++--
app/components/user-avatar/component.js | 3 +++
app/helpers/contribution-status.js | 4 +---
app/services/kredits.js | 4 ++--
4 files changed, 10 insertions(+), 7 deletions(-)
diff --git a/.eslintrc.js b/.eslintrc.js
index 5e87acb..cc287d7 100644
--- a/.eslintrc.js
+++ b/.eslintrc.js
@@ -25,8 +25,10 @@ module.exports = {
},
rules: {
'ember/avoid-leaking-state-in-ember-objects': 'warn',
- 'no-console': 'off'
- 'ember/no-jquery': 'error'
+ 'no-console': 'off',
+ 'ember/no-jquery': 'error',
+ 'ember/require-computed-property-dependencies': 'warn',
+ 'ember/no-observers': 'off'
},
overrides: [
// node files
diff --git a/app/components/user-avatar/component.js b/app/components/user-avatar/component.js
index e37ab88..46e81f2 100644
--- a/app/components/user-avatar/component.js
+++ b/app/components/user-avatar/component.js
@@ -24,6 +24,9 @@ export default Component.extend({
if (github_uid) {
return `https://avatars2.githubusercontent.com/u/${github_uid}?v=3&s=${SIZES[this.size]}`;
+ } else {
+ // TODO use custom avatar
+ return '';
}
})
diff --git a/app/helpers/contribution-status.js b/app/helpers/contribution-status.js
index cab5832..b9d9fd8 100644
--- a/app/helpers/contribution-status.js
+++ b/app/helpers/contribution-status.js
@@ -50,9 +50,7 @@ export default Helper.extend({
},
triggerRecompute () {
- once(this, function () {
- this.recompute();
- });
+ once(this, this.recompute);
}
});
diff --git a/app/services/kredits.js b/app/services/kredits.js
index 2c6773c..bd1b0f5 100644
--- a/app/services/kredits.js
+++ b/app/services/kredits.js
@@ -251,12 +251,12 @@ export default Service.extend({
});
},
- getCurrentUser: computed('kredits.provider', function() {
+ getCurrentUser: computed('kredits.provider', 'currentUserAccounts.[]', function() {
if (isEmpty(this.currentUserAccounts)) {
return RSVP.resolve();
}
return this.kredits.Contributor
- .functions.getContributorIdByAddress(this.get('currentUserAccounts.firstObject'))
+ .functions.getContributorIdByAddress(this.currentUserAccounts.firstObject)
.then((id) => {
// check if the user is a contributor or not
if (id === 0) {
From f5d791655682f53d5767e6feed89fa33bfcbefeb Mon Sep 17 00:00:00 2001
From: Sebastian Kippe
Date: Mon, 11 May 2020 10:04:16 +0200
Subject: [PATCH 07/15] Turn on warnings for observer usage
---
.eslintrc.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.eslintrc.js b/.eslintrc.js
index cc287d7..9f3cfc9 100644
--- a/.eslintrc.js
+++ b/.eslintrc.js
@@ -28,7 +28,7 @@ module.exports = {
'no-console': 'off',
'ember/no-jquery': 'error',
'ember/require-computed-property-dependencies': 'warn',
- 'ember/no-observers': 'off'
+ 'ember/no-observers': 'warn'
},
overrides: [
// node files
From 018132034daf9e205c0e7c13972fb8aba8910b91 Mon Sep 17 00:00:00 2001
From: Sebastian Kippe
Date: Mon, 11 May 2020 10:04:38 +0200
Subject: [PATCH 08/15] Fix github icon filename
---
.../{icon-account-github.hbs => icon-account-github-com.hbs} | 0
1 file changed, 0 insertions(+), 0 deletions(-)
rename app/templates/components/{icon-account-github.hbs => icon-account-github-com.hbs} (100%)
diff --git a/app/templates/components/icon-account-github.hbs b/app/templates/components/icon-account-github-com.hbs
similarity index 100%
rename from app/templates/components/icon-account-github.hbs
rename to app/templates/components/icon-account-github-com.hbs
From 22300c2980acaeecf499b551be7aec17dd542ab5 Mon Sep 17 00:00:00 2001
From: Sebastian Kippe
Date: Mon, 11 May 2020 10:06:12 +0200
Subject: [PATCH 09/15] Fix actions, etc.
---
app/components/add-contribution/component.js | 4 +++-
app/components/add-contribution/template.hbs | 2 +-
app/components/add-contributor/component.js | 12 +++++++++---
app/components/add-contributor/template.hbs | 2 +-
app/components/contribution-list/component.js | 10 ++++------
app/components/contribution-list/template.hbs | 12 ++++++------
app/components/contributor-list/template.hbs | 2 +-
app/components/topbar-account-panel/template.hbs | 4 ++--
app/templates/dashboard/contributors/show.hbs | 2 +-
app/templates/signup/eth-account.hbs | 2 +-
app/templates/signup/index.hbs | 2 +-
11 files changed, 30 insertions(+), 24 deletions(-)
diff --git a/app/components/add-contribution/component.js b/app/components/add-contribution/component.js
index 19247a8..56de353 100644
--- a/app/components/add-contribution/component.js
+++ b/app/components/add-contribution/component.js
@@ -45,7 +45,9 @@ export default Component.extend({
actions: {
- submit () {
+ submit (evt) {
+ evt.preventDefault();
+
if (!this.isValid) {
alert('Invalid data. Please review and try again.');
return;
diff --git a/app/components/add-contribution/template.hbs b/app/components/add-contribution/template.hbs
index 05fd22e..ab7b930 100644
--- a/app/components/add-contribution/template.hbs
+++ b/app/components/add-contribution/template.hbs
@@ -1,4 +1,4 @@
-
@@ -32,8 +32,8 @@
{{#each this.contributionsFiltered as |contribution|}}
+ {{action "openContributionDetails" contribution}}
+ class="{{if (eq contribution.id @selectedContributionId) " selected"}}">
({{contribution.kind}})
@@ -45,9 +45,9 @@
{{#unless contribution.vetoed}}
{{#unless (is-confirmed-contribution contribution)}}
-
+ {{input type="button" class="button small danger" value="veto"
+ click=(action "veto" contribution.id)
+ disabled=contribution.hasPendingChanges}}
{{/unless}}
{{/unless}}
diff --git a/app/components/contributor-list/template.hbs b/app/components/contributor-list/template.hbs
index 95ec449..5149035 100644
--- a/app/components/contributor-list/template.hbs
+++ b/app/components/contributor-list/template.hbs
@@ -1,7 +1,7 @@
{{#each @contributorList as |c|}}
{{c.contributor.name}}
diff --git a/app/components/topbar-account-panel/template.hbs b/app/components/topbar-account-panel/template.hbs
index f4d8d28..1c113cf 100644
--- a/app/components/topbar-account-panel/template.hbs
+++ b/app/components/topbar-account-panel/template.hbs
@@ -9,9 +9,9 @@
{{/if}}
{{else}}
Anonymous
- Sign up
+ Sign up
{{#if this.showConnectButton}}
- Connect account
+ Connect account
{{/if}}
{{/if}}
{{/if}}
diff --git a/app/templates/dashboard/contributors/show.hbs b/app/templates/dashboard/contributors/show.hbs
index 241de86..4686f70 100644
--- a/app/templates/dashboard/contributors/show.hbs
+++ b/app/templates/dashboard/contributors/show.hbs
@@ -10,7 +10,7 @@
{{#each this.model.accounts as |account|}}
-
+
{{/each}}
{{#if this.model.url}}
diff --git a/app/templates/signup/eth-account.hbs b/app/templates/signup/eth-account.hbs
index 7f100e9..d5091c3 100644
--- a/app/templates/signup/eth-account.hbs
+++ b/app/templates/signup/eth-account.hbs
@@ -16,7 +16,7 @@
Complete my profile
diff --git a/app/templates/signup/index.hbs b/app/templates/signup/index.hbs
index 036384d..5d68d22 100644
--- a/app/templates/signup/index.hbs
+++ b/app/templates/signup/index.hbs
@@ -12,7 +12,7 @@
connecting one of the following accounts:
-
+
Connect GitHub
From 9a1f543921de7d5fafb6efbd1845eba9263f583e Mon Sep 17 00:00:00 2001
From: Sebastian Kippe
Date: Mon, 11 May 2020 10:24:38 +0200
Subject: [PATCH 10/15] Mark remaining template-lint issues as pending
These need more updates outside of the templates, like e.g. Glimmer
components and such.
---
.template-lintrc.js | 80 ++++++++++++++++++++++++++++++++++++++++++++-
1 file changed, 79 insertions(+), 1 deletion(-)
diff --git a/.template-lintrc.js b/.template-lintrc.js
index a838de2..5e45040 100644
--- a/.template-lintrc.js
+++ b/.template-lintrc.js
@@ -11,5 +11,83 @@ module.exports = {
ignore: [
'kredits-web/templates/components/**',
'app/templates/components/**'
- ]
+ ],
+
+ pending: [
+ {
+ "moduleId": "app/templates/dashboard",
+ "only": [
+ "no-action"
+ ]
+ },
+ {
+ "moduleId": "app/components/add-contribution/template",
+ "only": [
+ "no-action",
+ "no-curly-component-invocation"
+ ]
+ },
+ {
+ "moduleId": "app/components/add-contributor/template",
+ "only": [
+ "no-action",
+ "no-curly-component-invocation"
+ ]
+ },
+ {
+ "moduleId": "app/components/contribution-list/template",
+ "only": [
+ "no-action",
+ "no-curly-component-invocation"
+ ]
+ },
+ {
+ "moduleId": "app/components/contributor-list/template",
+ "only": [
+ "no-action"
+ ]
+ },
+ {
+ "moduleId": "app/components/topbar-account-panel/template",
+ "only": [
+ "no-action"
+ ]
+ },
+ {
+ "moduleId": "app/templates/contributions/new",
+ "only": [
+ "no-action"
+ ]
+ },
+ {
+ "moduleId": "app/templates/contributions/resubmit",
+ "only": [
+ "no-action"
+ ]
+ },
+ {
+ "moduleId": "app/templates/contributors/edit",
+ "only": [
+ "no-action"
+ ]
+ },
+ {
+ "moduleId": "app/templates/contributors/new",
+ "only": [
+ "no-action"
+ ]
+ },
+ {
+ "moduleId": "app/templates/signup/eth-account",
+ "only": [
+ "no-action"
+ ]
+ },
+ {
+ "moduleId": "app/templates/signup/index",
+ "only": [
+ "no-action"
+ ]
+ }
+ ]
};
From 009caa53e5678066ccc62818184c77e6b4a58ef9 Mon Sep 17 00:00:00 2001
From: Garret Alfert
Date: Mon, 11 May 2020 12:18:07 +0200
Subject: [PATCH 11/15] Fix typo in contribution-status helper
The wrong property name caused an exception when trying to remove the observer.
---
app/helpers/contribution-status.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/app/helpers/contribution-status.js b/app/helpers/contribution-status.js
index b9d9fd8..959aa72 100644
--- a/app/helpers/contribution-status.js
+++ b/app/helpers/contribution-status.js
@@ -45,7 +45,7 @@ export default Helper.extend({
contribution.removeObserver('vetoed', this, this.triggerRecompute);
contribution.removeObserver('confirmedAt', this, this.triggerRecompute);
contribution.removeObserver('currentBlock', this, this.triggerRecompute);
- contribution.removeObserver('hadPendingChanges', this, this.triggerRecompute);
+ contribution.removeObserver('hasPendingChanges', this, this.triggerRecompute);
};
},
From b8da04c1454c670eda4b78c7db4da0d27dab06e5 Mon Sep 17 00:00:00 2001
From: Sebastian Kippe
Date: Mon, 11 May 2020 13:03:07 +0200
Subject: [PATCH 12/15] Re-add contribution status class
---
app/components/contribution-list/template.hbs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/app/components/contribution-list/template.hbs b/app/components/contribution-list/template.hbs
index 9656b0f..87d2349 100644
--- a/app/components/contribution-list/template.hbs
+++ b/app/components/contribution-list/template.hbs
@@ -33,7 +33,7 @@
{{#each this.contributionsFiltered as |contribution|}}
+ class="{{contribution-status contribution}}{{if (eq contribution.id @selectedContributionId) " selected"}}">
({{contribution.kind}})
From cedbe3cb3d295b5dd9844a53d161aa9680e72d5e Mon Sep 17 00:00:00 2001
From: Sebastian Kippe
Date: Mon, 11 May 2020 13:03:34 +0200
Subject: [PATCH 13/15] Formatting
---
app/components/external-account-link/template.hbs | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/app/components/external-account-link/template.hbs b/app/components/external-account-link/template.hbs
index e63156f..6b2a107 100644
--- a/app/components/external-account-link/template.hbs
+++ b/app/components/external-account-link/template.hbs
@@ -1,4 +1,5 @@
-
+
{{this.account.site}}
{{component this.iconComponentName}}
\ No newline at end of file
From 3cc01cce4ecad106b31e00d01606455758f61139 Mon Sep 17 00:00:00 2001
From: Sebastian Kippe
Date: Mon, 11 May 2020 13:15:17 +0200
Subject: [PATCH 14/15] Fix some minor template issues
---
app/components/add-contributor/template.hbs | 9 +++++----
app/templates/dashboard.hbs | 3 ++-
2 files changed, 7 insertions(+), 5 deletions(-)
diff --git a/app/components/add-contributor/template.hbs b/app/components/add-contributor/template.hbs
index 140752c..8478db6 100644
--- a/app/components/add-contributor/template.hbs
+++ b/app/components/add-contributor/template.hbs
@@ -1,10 +1,11 @@
Ethereum account
-
+
Kind
diff --git a/app/templates/dashboard.hbs b/app/templates/dashboard.hbs
index 31d27ec..1f9e22d 100644
--- a/app/templates/dashboard.hbs
+++ b/app/templates/dashboard.hbs
@@ -36,7 +36,8 @@
{{this.contributorsWithKredits.length}} contributors
-
Show unconfirmed kredits in toplist
From 081584a508d36e272737e7ac175e19536012a06b Mon Sep 17 00:00:00 2001
From: Sebastian Kippe
Date: Mon, 11 May 2020 13:15:47 +0200
Subject: [PATCH 15/15] Remove obsolete file
---
codemods.log | 4 ----
1 file changed, 4 deletions(-)
delete mode 100644 codemods.log
diff --git a/codemods.log b/codemods.log
deleted file mode 100644
index f5cf047..0000000
--- a/codemods.log
+++ /dev/null
@@ -1,4 +0,0 @@
-2020-05-09T13:41:58.543Z [warn] WARNING: {{await}} was not converted as it has positional parameters which can't be automatically converted. Source: app/templates/dashboard.hbs
-2020-05-09T13:41:58.919Z [warn] WARNING: {{contribution-status}} was not converted as it has positional parameters which can't be automatically converted. Source: app/templates/dashboard/contributions/show.hbs
-2020-05-09T14:59:55.142Z [warn] WARNING: {{contribution-status}} was not converted as it has positional parameters which can't be automatically converted. Source: app/templates/dashboard/contributions/show.hbs
-2020-05-09T14:59:56.285Z [warn] WARNING: {{await}} was not converted as it has positional parameters which can't be automatically converted. Source: app/templates/dashboard.hbs