diff --git a/dependencyBookmarklet.js b/dependencyBookmarklet.js index 144eb6d..880f7f5 100644 --- a/dependencyBookmarklet.js +++ b/dependencyBookmarklet.js @@ -2,13 +2,13 @@ jQuery.fn.isAfter = function(sel){ return this.prevAll().filter(sel).length !== 0; }; - + jQuery.fn.isBefore= function(sel){ return this.nextAll().filter(sel).length !== 0; }; - + function loadDataJSON(issueKey, callback) { - + //https://docs.atlassian.com/jira/REST/latest/ var url = '/rest/api/2/issue/' + issueKey + '?fields=summary,issuelinks'; //console.log("IssueUrl: " + window.location.hostname + url); @@ -24,7 +24,7 @@ data: {}, }); } - + function checkDependencies(){ // reomve old warnings first jQuery('.blocked-warning').remove(); @@ -38,15 +38,24 @@ if(issue.type.name == "Blocker" && issue.inwardIssue){ var dependencyIssueKey = issue.inwardIssue.key; if (issueElement.isBefore('[data-issue-key='+dependencyIssueKey+']')) { - issueElement.find('.ghx-end.ghx-row') - .prepend('↯ '+dependencyIssueKey+'') - //issueElement.css('background-color', '#FFD351'); - } + + var warning = jQuery('↯ '+dependencyIssueKey+''); + warning.addClass('blocked-warning aui-label ghx-label-2 ghx-label ghx-label-double'); + warning.attr('title', issue.type.inward + ' ' + dependencyIssueKey); + warning.css('color', 'FIREBRICK'); + warning.css('background-color', 'white'); + warning.css('border-color', 'FIREBRICK'); + warning.css('border-width', '2px'); + warning.css('font-weight', 'bold'); + + issueElement.find('.ghx-end.ghx-row').prepend(warning); + + } } }) }) }); } - + checkDependencies(); })();