Hello,
I would like to know if there is any option in GitLab settings or some 3rd party browser plugin to check tick “Make this an internal note” bellow comment by default?
The point is that all coments by default are only internal.
Grega
Hello,
I would like to know if there is any option in GitLab settings or some 3rd party browser plugin to check tick “Make this an internal note” bellow comment by default?
The point is that all coments by default are only internal.
Grega
I came across the same problem and solved it by writing a custom TamperMonkey userscript that automatically checks the internal-note checkbox of issues (replace example.com with the actual domain of your Gitlab instance). It’s not ideal that this cannot be configured but it’s better than unintentionally sending out internal comments to external parties.
// ==UserScript==
// @name Gitlab-Internal-Note-Default
// @namespace https://yahe.sh/
// @version 0.3
// @description This userscript makes sure that Gitlab comments are marked as internal notes by default.
// @author Yahe <hello@yahe.sh>
// @match https://example.com/*/*/-/issues/*
// @icon https://example.com/favicon.ico
// @run-at document-idle
// @grant none
// ==/UserScript==
(function() {
'use strict';
new Promise((resolve, reject) => {
// recheck for the existence of the internal-note checkbox
let checkInterval = setInterval(() => {
// try to query the internal-note checkbox through its selector
let checkbox = document.querySelector("[data-testid=internal-note-checkbox]");
// check if we were able to query the internal-note checkbox
if (null !== checkbox) {
// remove the recheck interval
clearInterval(checkInterval);
// return the checkbox object
resolve(checkbox);
}
}, 100);
}).then((checkbox) => {
// click the internal-note checkbox if it was found and is currently not checked,
// we explictly call the click() method to trigger the attached frontend logic
if (!checkbox.checked) {
checkbox.click();
}
});
})();
First of all, thanks for the initial script, Yahesh.
As of recently, the matching needs a slight tweak.
https://example.com/*/*/-/issues/*
needs to be replaced by
https://example.com/*/*/-/work_items/*