Fix contributor list, add kredits service tests #115
@@ -45,7 +45,7 @@ export default Service.extend({
|
||||
});
|
||||
}),
|
||||
|
|
||||
|
||||
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());
|
||||
|
||||
Reference in New Issue
Block a user
I think you might want to change the dependency, so the computed property updates when the
vetoedstatus of any of the contributions changes.Cool. Will that still account for new and deleted objects in the collection, and changes of other properties?
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}.