Last active
May 1, 2019 13:31
-
-
Save zolotokrylin/3b5565710c26c997f09bc9f51029f6c8 to your computer and use it in GitHub Desktop.
Product Owner cheat-list
This file contains 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Product manager dashboard</title> | |
<script | |
src="https://code.jquery.com/jquery-3.3.1.min.js" | |
integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8=" | |
crossorigin="anonymous"></script> | |
<script src="https://api.trello.com/1/client.js?key=5971ce0cdd8bc45946980a62ed81ae8c"></script> | |
</head> | |
<body> | |
<script type="text/javascript"> | |
window.Trello.authorize({ | |
type: 'popup', | |
name: 'Getting Started Application', | |
scope: { | |
read: 'true', | |
write: 'true' }, | |
expiration: 'never', | |
success: authenticationSuccess, | |
error: authenticationFailure | |
}); | |
function authenticationSuccess() { | |
console.log("Nice") | |
} | |
function authenticationFailure() { | |
console.log("sucks ;(") | |
} | |
Trello.get("/boards/gKxlWcuZ/cards/", success, error) | |
function success(data){ | |
console.log(data); | |
showNoLabelCards(data); | |
showNoPersonaCards(data); | |
} | |
function error(data) { | |
console.log(data); | |
} | |
function showAllCards(array) { | |
allCardsContainer = $("#allCards"); | |
$(array).each(function (i,v) { | |
allCardsContainer.append(v.id + "<br>"); | |
console.log(v); | |
}) | |
} | |
function showNoLabelCards(array) { | |
var counter = 0; | |
noLabelContainer = $("#noLabel"); | |
$(array).each(function (i,v) { | |
if (v.labels.length == 0) { | |
if (counter == 0){ | |
noLabelContainer.append("<span style=\"background: red\">No labels here :( </span><br><br>"); | |
counter++; | |
} | |
noLabelContainer.append('<a href="https://trello.com/c/' + v.id + '">' + v.name + '</a>' + "<br>"); | |
} | |
}) | |
} | |
function showNoPersonaCards(array) { | |
var counter = 0; | |
noLabelContainer = $("#noPersona"); | |
$(array).each(function (i,v) { | |
var name = v.name; | |
var id = v.id; | |
var hasPersona = false; | |
// check if relevant label is assigned | |
$(v.labels).each(function(i,v){ | |
if (v.name == "Customer" || v.name == "End-user") { | |
hasPersona = true; | |
} | |
}); | |
if (counter == 0){ | |
noLabelContainer.append("<br><br><span style=\"background: red\">No Persona here :( </span><br><br>"); | |
counter++; | |
} | |
if (hasPersona == false){ | |
noLabelContainer.append('<a href="https://trello.com/c/' + id + '">' + name + '</a>' + "<br>"); | |
// isNoPersona = false; | |
} | |
}) | |
} | |
</script> | |
<div id="allCards"></div> | |
<div id="noLabel"></div> | |
<div id="noPersona"></div> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment