diff options
Diffstat (limited to 'app/assets/javascripts/diffs')
3 files changed, 4 insertions, 26 deletions
diff --git a/app/assets/javascripts/diffs/components/diff_row_utils.js b/app/assets/javascripts/diffs/components/diff_row_utils.js index 998320c3245..08b87a4bade 100644 --- a/app/assets/javascripts/diffs/components/diff_row_utils.js +++ b/app/assets/javascripts/diffs/components/diff_row_utils.js @@ -1,4 +1,3 @@ -import { getParameterByName, parseBoolean } from '~/lib/utils/common_utils'; import { __ } from '~/locale'; import { MATCH_LINE_TYPE, @@ -23,21 +22,8 @@ export const isMatchLine = type => type === MATCH_LINE_TYPE; export const isMetaLine = type => [OLD_NO_NEW_LINE_TYPE, NEW_NO_NEW_LINE_TYPE, EMPTY_CELL_TYPE].includes(type); -export const shouldRenderCommentButton = ( - isLoggedIn, - isCommentButtonRendered, - featureMergeRefHeadComments = false, -) => { - if (!isCommentButtonRendered) { - return false; - } - - if (isLoggedIn) { - const isDiffHead = parseBoolean(getParameterByName('diff_head')); - return !isDiffHead || featureMergeRefHeadComments; - } - - return false; +export const shouldRenderCommentButton = (isLoggedIn, isCommentButtonRendered) => { + return isCommentButtonRendered && isLoggedIn; }; export const hasDiscussions = line => line?.discussions?.length > 0; diff --git a/app/assets/javascripts/diffs/components/inline_diff_table_row.vue b/app/assets/javascripts/diffs/components/inline_diff_table_row.vue index f9d491603cb..99cf79a70d4 100644 --- a/app/assets/javascripts/diffs/components/inline_diff_table_row.vue +++ b/app/assets/javascripts/diffs/components/inline_diff_table_row.vue @@ -81,11 +81,7 @@ export default { return utils.addCommentTooltip(this.line); }, shouldRenderCommentButton() { - return utils.shouldRenderCommentButton( - this.isLoggedIn, - true, - gon.features?.mergeRefHeadComments, - ); + return utils.shouldRenderCommentButton(this.isLoggedIn, true); }, shouldShowCommentButton() { return utils.shouldShowCommentButton( diff --git a/app/assets/javascripts/diffs/components/parallel_diff_table_row.vue b/app/assets/javascripts/diffs/components/parallel_diff_table_row.vue index 06dcadb2dc1..cdc6db791f0 100644 --- a/app/assets/javascripts/diffs/components/parallel_diff_table_row.vue +++ b/app/assets/javascripts/diffs/components/parallel_diff_table_row.vue @@ -102,11 +102,7 @@ export default { return utils.addCommentTooltip(this.line.right); }, shouldRenderCommentButton() { - return utils.shouldRenderCommentButton( - this.isLoggedIn, - this.isCommentButtonRendered, - gon.features?.mergeRefHeadComments, - ); + return utils.shouldRenderCommentButton(this.isLoggedIn, this.isCommentButtonRendered); }, shouldShowCommentButtonLeft() { return utils.shouldShowCommentButton( |