Commit 1f093bcd authored by Fatih Acet's avatar Fatih Acet

IssueNotesRefactor: Don’t show report as abuse link for own notes.

parent 7fcc1eef
...@@ -35,6 +35,9 @@ export default { ...@@ -35,6 +35,9 @@ export default {
'disabled-content': this.isDeleting, 'disabled-content': this.isDeleting,
}; };
}, },
canReportAsAbuse() {
return this.note.report_abuse_path && this.author.id !== window.gon.current_user_id;
},
}, },
methods: { methods: {
editHandler() { editHandler() {
...@@ -116,6 +119,7 @@ export default { ...@@ -116,6 +119,7 @@ export default {
:canAward="note.emoji_awardable" :canAward="note.emoji_awardable"
:canEdit="note.current_user.can_edit" :canEdit="note.current_user.can_edit"
:canDelete="note.current_user.can_edit" :canDelete="note.current_user.can_edit"
:canReportAsAbuse="canReportAsAbuse"
:reportAbusePath="note.report_abuse_path" :reportAbusePath="note.report_abuse_path"
:editHandler="editHandler" :editHandler="editHandler"
:deleteHandler="deleteHandler" /> :deleteHandler="deleteHandler" />
......
...@@ -22,6 +22,10 @@ export default { ...@@ -22,6 +22,10 @@ export default {
type: Boolean, type: Boolean,
required: true, required: true,
}, },
canReportAsAbuse: {
type: Boolean,
required: true,
},
editHandler: { editHandler: {
type: Function, type: Function,
required: true, required: true,
...@@ -90,7 +94,7 @@ export default { ...@@ -90,7 +94,7 @@ export default {
</li> </li>
<li class="divider"></li> <li class="divider"></li>
</template> </template>
<li v-if="reportAbusePath"> <li v-if="canReportAsAbuse">
<a :href="reportAbusePath"> <a :href="reportAbusePath">
Report as abuse Report as abuse
</a> </a>
......
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