Last active
February 22, 2018 16:19
-
-
Save madeindjs/f718230c97ac4f53ca1926711c627484 to your computer and use it in GitHub Desktop.
Color tickets assigned to me
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Color Redmine Flow | |
// @version 1 | |
// @grant none | |
// ==/UserScript== | |
var nameToSearch = /Rousseau/; | |
var unavailableColor = "GhostWhite"; | |
var activeColor = "Gold"; | |
var testColor = "Khaki"; | |
// get all tasks | |
document.querySelectorAll('.issue-card').forEach(function(tag){ | |
// get informations about his task | |
var link = tag.querySelector('p.name>a').cloneNode(true); | |
var attributes = tag.querySelector('p.attributes'); | |
var assigned_user = tag.querySelector('p.assigned-user'); | |
var worker = tag.querySelector('p.info a.user'); | |
var worker_name = worker ? worker.innerHTML : ''; | |
// test if user is assigned to test or to dev | |
if (assigned_user.innerHTML.match(nameToSearch) || worker_name.match(nameToSearch)) { | |
// I work on this task | |
tag.style.backgroundColor = activeColor; | |
}else if(attributes.innerHTML.match(nameToSearch) ) { | |
// I test/tested this task | |
tag.style.backgroundColor = testColor; | |
}else if(attributes.innerHTML.match(/Testeur assigné/) ) { | |
// someone tests/tested this task | |
tag.style.backgroundColor = unavailableColor; | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment