Fix contributor list, add kredits service tests #115

Merged
raucao merged 7 commits from bugfix/114-contributor_list into master 2019-05-08 10:35:01 +00:00
Showing only changes of commit 9386c30d09 - Show all commits
+1 -1
View File
@@ -45,7 +45,7 @@ export default Service.extend({
});
}),
galfert commented 2019-05-08 09:05:51 +00:00 (Migrated from github.com)
Review

I think you might want to change the dependency, so the computed property updates when the vetoed status of any of the contributions changes.

   kreditsByContributor: computed('contributionsUnconfirmed.@each.vetoed', 'contributors', function() {
I think you might want to change the dependency, so the computed property updates when the `vetoed` status of any of the contributions changes. ```suggestion kreditsByContributor: computed('contributionsUnconfirmed.@each.vetoed', 'contributors', function() { ```
raucao commented 2019-05-08 09:45:19 +00:00 (Migrated from github.com)
Review

Cool. Will that still account for new and deleted objects in the collection, and changes of other properties?

Cool. Will that still account for new and deleted objects in the collection, and changes of other properties?
galfert commented 2019-05-08 10:19:30 +00:00 (Migrated from github.com)
Review

Yes, it will also update when the array itself changes (e.g. elements added or removed). If you want to add additional properties as dependencies, you would add them like this contributionsUnconfirmed.@each.{vetoed,otherProperty}.

Yes, it will also update when the array itself changes (e.g. elements added or removed). If you want to add additional properties as dependencies, you would add them like this `contributionsUnconfirmed.@each.{vetoed,otherProperty}`.
kreditsByContributor: computed('contributionsUnconfirmed.[]', 'contributors', function() {
kreditsByContributor: computed('contributionsUnconfirmed.@each.vetoed', 'contributors', function() {
const contributionsUnconfirmed = this.contributionsUnconfirmed.filterBy('vetoed', false);
const contributionsGrouped = groupBy(contributionsUnconfirmed, 'contributorId');
const contributorsWithUnconfirmed = contributionsGrouped.map(c => c.value.toString());