Commit 0491777b authored by Phil Hughes's avatar Phil Hughes

Merge branch '204739-app-views-discussions-remove-dormant-code' into 'master'

Removed dormant discussion items

Closes #204739

See merge request gitlab-org/gitlab!25506
parents d745c8fa addec47c
/* eslint-disable no-else-return */
/* global CommentsStore */
/* global ResolveService */
import Vue from 'vue';
import { __ } from '~/locale';
const ResolveDiscussionBtn = Vue.extend({
props: {
discussionId: {
type: String,
required: true,
},
mergeRequestId: {
type: Number,
required: true,
},
canResolve: {
type: Boolean,
required: true,
},
},
data() {
return {
discussion: {},
};
},
computed: {
showButton() {
if (this.discussion) {
return this.discussion.isResolvable();
} else {
return false;
}
},
isDiscussionResolved() {
if (this.discussion) {
return this.discussion.isResolved();
} else {
return false;
}
},
buttonText() {
if (this.isDiscussionResolved) {
return __('Unresolve discussion');
} else {
return __('Resolve discussion');
}
},
loading() {
if (this.discussion) {
return this.discussion.loading;
} else {
return false;
}
},
},
created() {
CommentsStore.createDiscussion(this.discussionId, this.canResolve);
this.discussion = CommentsStore.state[this.discussionId];
},
methods: {
resolve() {
ResolveService.toggleResolveForDiscussion(this.mergeRequestId, this.discussionId);
},
},
});
Vue.component('resolve-discussion-btn', ResolveDiscussionBtn);
...@@ -11,7 +11,6 @@ import './components/comment_resolve_btn'; ...@@ -11,7 +11,6 @@ import './components/comment_resolve_btn';
import './components/jump_to_discussion'; import './components/jump_to_discussion';
import './components/resolve_btn'; import './components/resolve_btn';
import './components/resolve_count'; import './components/resolve_count';
import './components/resolve_discussion_btn';
import './components/diff_note_avatars'; import './components/diff_note_avatars';
import './components/new_issue_for_discussion'; import './components/new_issue_for_discussion';
...@@ -20,7 +19,7 @@ export default () => { ...@@ -20,7 +19,7 @@ export default () => {
document.querySelector('.merge-request') || document.querySelector('.commit-box'); document.querySelector('.merge-request') || document.querySelector('.commit-box');
const { projectPath } = projectPathHolder.dataset; const { projectPath } = projectPathHolder.dataset;
const COMPONENT_SELECTOR = const COMPONENT_SELECTOR =
'resolve-btn, resolve-discussion-btn, jump-to-discussion, comment-and-resolve-btn, new-issue-for-discussion-btn'; 'resolve-btn, jump-to-discussion, comment-and-resolve-btn, new-issue-for-discussion-btn';
window.gl = window.gl || {}; window.gl = window.gl || {};
window.gl.diffNoteApps = {}; window.gl.diffNoteApps = {};
......
%resolve-discussion-btn{ ":discussion-id" => "'#{discussion.id}'",
":merge-request-id" => discussion.noteable.iid,
":can-resolve" => discussion.can_resolve?(current_user),
"inline-template" => true }
.btn-group{ role: "group", "v-if" => "showButton" }
%button.btn.btn-default{ type: "button", "@click" => "resolve", ":disabled" => "loading", "v-cloak" => "true" }
= icon("spinner spin", "v-show" => "loading")
{{ buttonText }}
...@@ -16375,9 +16375,6 @@ msgstr "" ...@@ -16375,9 +16375,6 @@ msgstr ""
msgid "Resolve conflicts on source branch" msgid "Resolve conflicts on source branch"
msgstr "" msgstr ""
msgid "Resolve discussion"
msgstr ""
msgid "Resolve thread" msgid "Resolve thread"
msgstr "" msgstr ""
...@@ -20783,9 +20780,6 @@ msgstr "" ...@@ -20783,9 +20780,6 @@ msgstr ""
msgid "Unresolve" msgid "Unresolve"
msgstr "" msgstr ""
msgid "Unresolve discussion"
msgstr ""
msgid "Unresolve thread" msgid "Unresolve thread"
msgstr "" msgstr ""
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment