WIP Group contributions by URL
This commit is contained in:
@@ -2,6 +2,8 @@ import EmberObject, { computed } from '@ember/object';
|
||||
import { isEmpty, isPresent } from '@ember/utils';
|
||||
import moment from 'moment';
|
||||
|
||||
import contributionGroupingKey from 'kredits-web/utils/contribution-grouping-key';
|
||||
|
||||
export default EmberObject.extend({
|
||||
// Contract
|
||||
id: null,
|
||||
@@ -44,6 +46,13 @@ export default EmberObject.extend({
|
||||
return isPresent(this.pendingTx);
|
||||
}),
|
||||
|
||||
// Stable key shared by all per-contributor contributions created for the
|
||||
// same issue/pull request (derived from `url`). Manual contributions without
|
||||
// a URL return null and are treated as singletons (not grouped).
|
||||
groupId: computed('url', function() {
|
||||
return contributionGroupingKey(this);
|
||||
}),
|
||||
|
||||
serialize () {
|
||||
return JSON.stringify(this);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user