Commit e5897481 authored by Justin Boyson's avatar Justin Boyson Committed by Paul Slaughter

Hide comment button if on diff HEAD

Also update specs to `@vue/test-utils`

https://gitlab.com/gitlab-org/gitlab/-/merge_requests/24207
parent 6b389148
<script>
import { mapState, mapGetters, mapActions } from 'vuex';
import { getParameterByName, parseBoolean } from '~/lib/utils/common_utils';
import Icon from '~/vue_shared/components/icon.vue';
import DiffGutterAvatars from './diff_gutter_avatars.vue';
import { LINE_POSITION_RIGHT } from '../constants';
......@@ -98,7 +99,8 @@ export default {
return this.showCommentButton && this.hasDiscussions;
},
shouldRenderCommentButton() {
return this.isLoggedIn && this.showCommentButton;
const isDiffHead = parseBoolean(getParameterByName('diff_head'));
return !isDiffHead && this.isLoggedIn && this.showCommentButton;
},
},
methods: {
......@@ -130,6 +132,7 @@ export default {
</button>
<a
v-if="lineNumber"
ref="lineNumberRef"
:data-linenumber="lineNumber"
:href="lineHref"
@click="setHighlightedRow(lineCode)"
......
---
title: Hide comment button if on diff HEAD
merge_request: 24207
author:
type: changed
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