Skip to content

Instantly share code, notes, and snippets.

@io41
Last active June 14, 2024 15:36
Show Gist options
  • Save io41/4975d20286203df3b4b75bcb7f0fa2d0 to your computer and use it in GitHub Desktop.
Save io41/4975d20286203df3b4b75bcb7f0fa2d0 to your computer and use it in GitHub Desktop.
// ==UserScript==
// @name Hide JIRA Sidebar Reports
// @namespace http://tampermonkey.net/
// @version 2024-06-14.2
// @downloadURL https://gist.github.com/io41/4975d20286203df3b4b75bcb7f0fa2d0/raw/Hide%2520JIRA%2520Sidebar%2520Reports.user.js
// @updateURL https://gist.github.com/io41/4975d20286203df3b4b75bcb7f0fa2d0/raw/Hide%2520JIRA%2520Sidebar%2520Reports.user.js
// @supportURL https://gist.github.com/io41/4975d20286203df3b4b75bcb7f0fa2d0
// @description Hide reports in JIRA sidebar because it offends our delicate sensibilities
// @author Tim Kersten
// @match https://*.atlassian.net/jira/software/c/projects/*/boards/*
// @grant none
// ==/UserScript==
(function() {
'use strict';
function hideReportsLink() {
var reportsLink = document.querySelector('a[data-testid="navigation-apps-sidebar-software-classic.ui.menu.reports-link--item"]');
if (reportsLink) {
reportsLink.style.display = 'none';
}
}
function monitorDocument() {
var observerOptions = {
childList: true,
subtree: true
};
var observer = new MutationObserver(function(mutationsList, observer) {
for (var mutation of mutationsList) {
if (mutation.type === 'childList') {
hideReportsLink();
}
}
});
observer.observe(document.documentElement, observerOptions);
}
// Run the functions on page load
window.addEventListener('load', function() {
hideReportsLink();
monitorDocument();
});
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment