summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/diff_notes/components/new_issue_for_discussion.js
blob: 8eb0e10b832fd31ce683970a0fb9cd8d91b0e060 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
/* global CommentsStore */

import Vue from 'vue';

(() => {
  const NewIssueForDiscussion = Vue.extend({
    props: {
      discussionId: {
        type: String,
        required: true,
      },
    },
    data() {
      return {
        discussions: CommentsStore.state,
      };
    },
    computed: {
      discussion() {
        return this.discussions[this.discussionId];
      },
      showButton() {
        if (this.discussion) return !this.discussion.isResolved();
        return false;
      },
    },
  });

  Vue.component('new-issue-for-discussion-btn', NewIssueForDiscussion);
})();