gitlab-ce/app/assets/javascripts/diff_notes/components/resolve_count.js.es6

32 lines
708 B
JavaScript

((w) => {
w.ResolveCount = Vue.extend({
data: function () {
return {
discussions: CommentsStore.state,
loading: false
};
},
computed: {
resolved: function () {
let resolvedCount = 0;
for (const discussionId in this.discussions) {
const discussion = this.discussions[discussionId];
if (discussion.isResolved()) {
resolvedCount++;
}
}
return resolvedCount;
},
discussionCount: function () {
return Object.keys(this.discussions).length;
},
allResolved: function () {
return this.resolved === this.discussionCount;
}
}
});
})(window);