debian-mirror-gitlab/app/assets/javascripts/diff_notes/components/resolve_count.js

30 lines
623 B
JavaScript
Raw Normal View History

2018-12-13 13:39:08 +05:30
/* eslint-disable object-shorthand, func-names */
2017-08-17 22:00:37 +05:30
/* global CommentsStore */
import Vue from 'vue';
2018-11-08 19:23:39 +05:30
import DiscussionMixins from '../mixins/discussion';
2018-03-17 18:26:18 +05:30
2017-08-17 22:00:37 +05:30
window.ResolveCount = Vue.extend({
mixins: [DiscussionMixins],
props: {
2018-11-08 19:23:39 +05:30
loggedOut: {
type: Boolean,
required: true,
},
2017-08-17 22:00:37 +05:30
},
2018-12-13 13:39:08 +05:30
data: function() {
2017-08-17 22:00:37 +05:30
return {
2018-12-13 13:39:08 +05:30
discussions: CommentsStore.state,
2017-08-17 22:00:37 +05:30
};
},
computed: {
2018-12-13 13:39:08 +05:30
allResolved: function() {
2017-08-17 22:00:37 +05:30
return this.resolvedDiscussionCount === this.discussionCount;
},
resolvedCountText() {
return this.discussionCount === 1 ? 'discussion' : 'discussions';
2018-12-13 13:39:08 +05:30
},
},
2017-08-17 22:00:37 +05:30
});