-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
77d64b8
commit 5ce4113
Showing
10 changed files
with
466 additions
and
27 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
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
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,143 @@ | ||
<h2>Bugs</h2> | ||
<hr> | ||
|
||
{{#each erros }} | ||
<div class="alert-danger">{{texto}}</div> | ||
{{else}} | ||
{{/each}} | ||
|
||
|
||
<div class="container"> | ||
<form action="" method="post"> | ||
|
||
<div class="row"> | ||
<div class="col-25"> | ||
<label for="ProjectCombo">Project</label> | ||
</div> | ||
<div class="col-75"> | ||
<select id="ProjectCombo" name="ProjectCombo"></select> | ||
</div> | ||
</div> | ||
|
||
<div class="row w3-margin-top"> | ||
<input type="submit" class="w3-grey" value="Search"> | ||
</div> | ||
</form> | ||
</div> | ||
<div id="containerList"></div> | ||
<script> | ||
$(document).ready(function () { | ||
getActiveProjects(); | ||
}); | ||
async function getActiveProjects() { | ||
const res = await fetch("http://localhost:8787/api/getActiveProjects"); | ||
const json = await res.json(); | ||
let ProjectCombo = document.getElementById("ProjectCombo"); | ||
let option = document.createElement("option"); | ||
option.value = 0; | ||
option.innerText = "Select a project..."; | ||
ProjectCombo.appendChild(option); | ||
for (let i = 0; i < json.length; i++) { | ||
let option = document.createElement("option"); | ||
option.value = json[i].ID; | ||
option.innerText = json[i].NameProject; | ||
ProjectCombo.appendChild(option); | ||
} | ||
} | ||
$(document).ready(function () { | ||
$("#ProjectCombo").change(function () { | ||
let id = $(this).children("option:selected").val(); | ||
getBugsByProject(id) | ||
}); | ||
}); | ||
async function getBugsByProject(id) { | ||
$("#containerList").empty() | ||
const res = await fetch(`http://localhost:8787/bug/getBugsByProject/${id}`); | ||
const json = await res.json(); | ||
let containerList = document.getElementById("containerList"); | ||
let i; | ||
for (i = 0; i < json.length; i++) { | ||
let divItem = document.createElement("div"); | ||
divItem.setAttribute("class", "solveItemDiv") | ||
let p = document.createElement("p"); | ||
p.innerText = json[i].Title; | ||
divItem.appendChild(p) | ||
let span = document.createElement("span"); | ||
if (json[i].StatusID === 1) { | ||
span.setAttribute("class", "label-issue danger") | ||
span.innerText = "Open"; | ||
} else if (json[i].StatusID === 2) { | ||
span.setAttribute("class", "label-issue warning") | ||
span.innerText = "In progress"; | ||
} else if (json[i].FeatureStatusID === 3) { | ||
span.setAttribute("class", "label-issue success") | ||
span.innerText = "To be tested"; | ||
} else { | ||
span.setAttribute("class", "label-issue info") | ||
span.innerText = "Closed"; | ||
} | ||
divItem.appendChild(span) | ||
containerList.appendChild(divItem) | ||
let p1 = document.createElement("p"); | ||
p1.innerText = "Notes: " + json[i].Summary; | ||
let div = document.createElement("div"); | ||
div.setAttribute("class", "panel") | ||
div.appendChild(p1) | ||
containerList.appendChild(div) | ||
let DivPanel = document.getElementsByClassName("panel") | ||
let openFeatureLink = document.createElement("a"); | ||
openFeatureLink.setAttribute("href", `bug/solveIssue/${json[i].ID}`) | ||
let openFeaturebutton = document.createElement("button"); | ||
openFeaturebutton.setAttribute("class", "w3-button w3-grey w3-round-medium w3-margin-bottom") | ||
openFeaturebutton.innerText = "Solve Issue" | ||
openFeatureLink.appendChild(openFeaturebutton) | ||
DivPanel[i].appendChild(openFeatureLink) | ||
} | ||
var acc = document.getElementsByClassName("solveItemDiv"); | ||
var j; | ||
for (j = 0; j < acc.length; j++) { | ||
acc[j].addEventListener("click", function () { | ||
this.classList.toggle("active"); | ||
var panel = this.nextElementSibling; | ||
if (panel.style.maxHeight) { | ||
panel.style.maxHeight = null; | ||
} else { | ||
panel.style.maxHeight = panel.scrollHeight + "px"; | ||
} | ||
}); | ||
} | ||
} | ||
</script> |
Oops, something went wrong.