-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feature/html report UI upgrade (#134)
This feature adds the following updates to the HTML report. 1. Filter items by status (Ok, Missing, Partial, Warning, Justified) 2. Hide/Unhide Issues. 3. Search in issues.
- Loading branch information
Showing
7 changed files
with
305 additions
and
16 deletions.
There are no files selected for viewing
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,139 @@ | ||
.button { | ||
background-color: #818589; | ||
border: none; | ||
border-radius: 5px; | ||
color: white; | ||
padding: 12px 25px; | ||
text-align: center; | ||
text-decoration: none; | ||
display: inline-block; | ||
font-size: 14px; | ||
margin: 4px 2px; | ||
cursor: pointer | ||
} | ||
|
||
.button active:before { | ||
content: ; | ||
position: absolute; | ||
left: 0; | ||
top: 0; | ||
display: inline-block; | ||
width: 0; | ||
height: 0; | ||
border-style: solid; | ||
border-width: 15px 15px 0 0; | ||
border-color: #333 transparent transparent transparent | ||
} | ||
|
||
.buttonActive.button { | ||
text-decoration: none; | ||
border: 5px solid #000000 | ||
} | ||
|
||
.buttonOK { | ||
background-color: #04AA6D; | ||
color: white; | ||
border: 2px solid #04AA6D; | ||
border-radius: 5px | ||
} | ||
|
||
.buttonOK:hover { | ||
background-color: #026641; | ||
color: white; | ||
border: 2px solid #026641 | ||
} | ||
|
||
.buttonActive.buttonOK { | ||
text-decoration: none; | ||
border: 5px solid #026641 | ||
} | ||
|
||
.buttonPartial { | ||
background-color: #17a2b8; | ||
color: white; | ||
border: 2px solid #17a2b8; | ||
border-radius: 5px | ||
} | ||
|
||
.buttonPartial:hover { | ||
background-color: #0e616e; | ||
color: white; | ||
border: 2px solid #0e616e | ||
} | ||
|
||
.buttonActive.buttonPartial { | ||
text-decoration: none; | ||
border: 5px solid #0e616e | ||
} | ||
|
||
.buttonMissing { | ||
background-color: #f44336; | ||
color: white; | ||
border: 2px solid #f44336; | ||
border-radius: 5px | ||
} | ||
|
||
.buttonMissing:hover { | ||
background-color: #a91409; | ||
color: white; | ||
border: 2px solid #a91409 | ||
} | ||
|
||
.buttonActive.buttonMissing { | ||
text-decoration: none; | ||
border: 5px solid #a91409 | ||
} | ||
|
||
.buttonJustified { | ||
background-color: #6c757d; | ||
color: white; | ||
border: 2px solid #6c757d; | ||
border-radius: 5px | ||
} | ||
|
||
.buttonJustified:hover { | ||
background-color: #41464b; | ||
color: white; | ||
border: 2px solid #41464b | ||
} | ||
|
||
.buttonActive.buttonJustified { | ||
text-decoration: none; | ||
border: 5px solid #41464b | ||
} | ||
|
||
.buttonWarning { | ||
background-color: #ffbf00; | ||
color: white; | ||
border: 2px solid #ffbf00; | ||
border-radius: 5px | ||
} | ||
|
||
.buttonWarning:hover { | ||
background-color: #997300; | ||
color: white; | ||
border: 2px solid #997300 | ||
} | ||
|
||
.buttonActive.buttonWarning { | ||
text-decoration: none; | ||
border: 5px solid #997300 | ||
} | ||
|
||
.buttonBlue { | ||
background-color: #0000ff; | ||
color: white; | ||
border: 2px solid #0000ff; | ||
border-radius: 5px | ||
} | ||
|
||
.buttonBlue:hover { | ||
background-color: #000099; | ||
color: white; | ||
border: 2px solid #000099 | ||
} | ||
|
||
.buttonActive.buttonBlue { | ||
text-decoration: none; | ||
border: 5px solid #000099 | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
function buttonFilter(filter) { | ||
var elms = document.getElementsByTagName("div"); | ||
var issue_elms = document.getElementsByClassName("issue"); | ||
for (i = 0; i < elms.length; i++) { | ||
if (elms[i].id.startsWith("item-")) { | ||
console.log("elms[i].className ", elms[i].className) | ||
if (filter == "all") { | ||
elms[i].style.display = "block"; | ||
} else if (elms[i].className == "item-" + filter) { | ||
elms[i].style.display = "block"; | ||
} else { | ||
elms[i].style.display = "none"; | ||
} | ||
} | ||
} | ||
// filter the issues list based on the issue filter button clicked | ||
for (i = 0; i < issue_elms.length; i++) { | ||
console.log("log ", issue_elms[i].className) | ||
if (filter == "all") { | ||
issue_elms[i].style.display = "list-item"; | ||
} else if (issue_elms[i].className == "issue issue-" + filter) { | ||
issue_elms[i].style.display = "list-item"; | ||
} else { | ||
issue_elms[i].style.display = "none"; | ||
} | ||
} | ||
activeButton(filter); | ||
//call the search filering which could have been overwritten by the current filtering | ||
searchItem(); | ||
} | ||
|
||
|
||
function activeButton(filter) { | ||
var elms = document.getElementsByTagName("button"); | ||
console.log("the click buitton is " + filter); | ||
for (i = 0; i < elms.length; i++) { | ||
if (elms[i].className.includes("buttonActive")) { | ||
console.log("elem active found : " + elms[i].className); | ||
elms[i].className = elms[i].className.replace("buttonActive", ""); | ||
} else if (elms[i].className.toLowerCase().includes("button" + filter.toLowerCase())) { | ||
console.log("elem to be activated found : " + elms[i].className); | ||
elms[i].className = elms[i].className + " buttonActive"; | ||
} | ||
} | ||
} | ||
|
||
|
||
function ToggleIssues() { | ||
var div_issue = document.getElementById("issues-section"); | ||
if (div_issue.style.display == "block" || div_issue.style.display == "") { | ||
div_issue.style.display = "none"; | ||
document.getElementById("BtnToggleIssue").innerHTML = "Show Issues"; | ||
document.getElementById("BtnToggleIssue").className = document.getElementById("BtnToggleIssue").className + " buttonActive"; | ||
} else { | ||
div_issue.style = 'display: block; flex-direction: column; height: 200px;' + | ||
'overflow:auto;'; | ||
document.getElementById("BtnToggleIssue").innerHTML = "Hide Issues"; | ||
document.getElementById("BtnToggleIssue").className = document.getElementById("BtnToggleIssue").className.replace("buttonActive", ""); | ||
} | ||
} | ||
|
||
|
||
function searchItem() { | ||
var input = document.getElementById('search').value | ||
input = input.toLowerCase(); | ||
|
||
var divs = document.getElementsByClassName('item-name'); | ||
for (i = 0; i < divs.length; i++) { | ||
var title = divs[i].parentNode.getAttribute("title"); | ||
// get requirement name: 2nd part when we cut the long string with /svg | ||
var reqname = divs[i].innerHTML.toLowerCase().split("</svg>").pop(); | ||
reqname = reqname.split(" ").pop(); | ||
if (reqname.includes(input)) { | ||
// the search pattern has been found, if this elem has the title "hidden-not-matching", put it back to diplayed | ||
if (title) { | ||
if (title.startsWith("hidden-not-matching")) { | ||
divs[i].parentNode.style.display = "block"; | ||
} | ||
} | ||
divs[i].parentNode.setAttribute("title", "matching-" + input) | ||
} else { | ||
// not maching, we hide | ||
divs[i].parentNode.setAttribute("title", "hidden-not-matching") | ||
divs[i].parentNode.style.display = "none"; | ||
} | ||
} | ||
} |
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
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
Oops, something went wrong.