Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Disable the 'Like' button for PR review comments

staylor936 February 22, 2019

Is it possible to disable the 'Like' button for BitBucket PR review comments for specific repos?

1 answer

0 votes
Julius Davies _bit-booster_com_
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 24, 2019

 

Possible?  Yes.

Easy?  No.

One way would be to write a small custom Bitbucket plugin that would emit a little bit of JavaScript or CSS on the Pull-Requests page to disable the like button on page-load.

It would be a bit brittle though and you'd need to keep an eye on future Bitbucket versions in case the HTML of the Like button ever changes (and thus breaks your JavaScript or CSS logic).

If you have a valid Bitbucket Server license then Atlassian makes the source code of Bitbucket available through my.atlassian.com.  Very handy for questions like this!

grep -r likes-button bitbucket-6.0.0-source/

bitbucket-6.0.0-source/bitbucket-parent/plugins/comment-likes/src/main/resources/static/bitbucket-plugin-comment-likes/internal/feature/comments/likes/controller.js: .find('.comment-likes-button');

[etc...]

 

staylor936 February 25, 2019

Thank you for the information.

I'll give it a whirl.

Kind Regards

Julius Davies _bit-booster_com_
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 25, 2019

 

Here's the "context" you'll need to reference in your <web-resource> element in your atlassian-plugin.xml to have code appear on the pull-requests screen:

 

<context>bitbucket.page.pullRequest.view</context>

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events