Changed to long types

122517
This commit is contained in:
2024-10-21 13:58:48 -07:00
parent 983448cfb3
commit 1241bbe622
8 changed files with 368 additions and 33 deletions

View File

@ -0,0 +1,65 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width" />
<title>Infineon - 122517 - Children of a Feature should have the same priority</title>
<link href="/styles/bootstrap.min.css?no-cache=2024-10-04-08-34" rel="stylesheet" />
<link href="/igniteui/css/themes/bootstrap3/default/infragistics.theme.css?v=2024-10-07-18-50" rel="stylesheet" />
<link href="/igniteui/css/structure/infragistics.css?v=2024-10-07-18-50" rel="stylesheet" />
<link href="/styles/122517.css?no-cache=2024-10-04-08-34" rel="stylesheet" />
<script src="/js/jquery-3.6.0.min.js?v=2024-10-07-18-50" type="text/javascript"></script>
<script src="/js/jquery-ui.min.js?v=2024-10-07-18-50" type="text/javascript"></script>
<script src="/js/122517.js?v=2024-10-07-18-50" type="text/javascript"></script>
<script src="/igniteui/js/infragistics.core.js?v=2024-10-07-18-50" type="text/javascript"></script>
<script src="/igniteui/js/infragistics.lob.js?v=2024-10-07-18-50" type="text/javascript"></script>
<script src="/igniteui/js/infragistics.dv.js?v=2024-10-07-18-50" type="text/javascript"></script>
</head>
<body>
<div class="navbar navbar-fixed-top">
<div class="container-fluid">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<div class="navbar-brand" style="min-width: 20px;">
<span id="siteHeader">&nbsp;</span> - 122517 - Children of a Feature should have the same priority
</div>
</div>
<div class="navbar-collapse collapse">
<ul class="nav navbar-nav">
<li><a target="_blank" href="https://tfs.intra.infineon.com/tfs/FactoryIntegration/ART%20SPS/_workitems/edit/122517">122517</a></li>
</ul>
<p class="navbar-text navbar-right">
&nbsp;
</p>
</div>
</div>
</div>
<div class="container-fluid body-content" style="margin-top: 10px;">
<div style="height: 550px;" id="HeaderGridDiv">
<table id="HeaderGrid"></table>
</div>
<br />&nbsp;
<div id="AllGridDiv">
<table id="AllGrid"></table>
</div>
</div>
<script>
$(document).ready(function () {
initIndex("/markdown/check-122517.json?v=2024-10-07-18-50");
});
</script>
</body>
</html>

View File

@ -0,0 +1,157 @@
function compareFunction(a, b) {
return a.Priority[0] - b.Priority[0] || a.TimeCriticality[0] - b.TimeCriticality[0] || b.State[0] - a.State[0] || a.Id - b.Id;
}
function showOne(rowData) {
if (rowData == null)
return;
var data = [];
data.push({ name: "Edit in ADO", value: '<a target="_blank" href="https://tfs.intra.infineon.com/tfs/FactoryIntegration/ART%20SPS/_workitems/edit/' + rowData["Id"] + '">Edit in ADO ' + rowData["Id"] + '</a>' });
for (const property in rowData) {
if (rowData[property] == null)
continue;
data.push({ name: property, value: rowData[property].toString() });
}
$("#AllGrid").igGrid({
autoGenerateColumns: true,
dataSource: data,
width: "100%",
showHeader: false,
});
}
function loadOne() {
var selectedRow = $("#HeaderGrid").data("igGridSelection").selectedRow();
if (selectedRow == null)
return;
var rowData = $("#HeaderGrid").data("igGrid").dataSource.dataView()[selectedRow.index];
showOne(rowData);
}
function detailSelectionChangedRunInfo(evt, ui) {
if (ui.row.index === 0)
return;
var rowData = ui.owner.grid.dataSource.dataView()[ui.row.index];
showOne(rowData);
}
function getState(state) {
var result;
if (state == null)
result = "9-Null";
else if (state === "New")
result = `1-${state}`;
else if (state === "Active")
result = `2-${state}`;
else if (state === "Resolved")
result = `3-${state}`;
else if (state === "Closed")
result = `4-${state}`;
else if (state === "Removed")
result = `5-${state}`;
else
result = `8-${state}`;
return result;
}
function getPriority(workItemType, priority) {
var result;
if (workItemType === "Bug")
result = "0-Bug";
else if (priority == null || priority === 0)
result = "9-Null";
else if (priority === 1)
result = `${priority}-High`;
else if (priority === 2)
result = `${priority}-Med`;
else if (priority === 3)
result = `${priority}-Low`;
else if (priority === 4)
result = `${priority}-TBD`;
else
result = "8-Not";
return result;
}
function getWorkItems(data) {
var workItem;
var workItems = [];
for (var i = data.length - 1; i > -1; i--) {
workItem = data[i];
if (workItem.Tags != null && workItem.Tags.includes("Ignore"))
continue;
if ((window.location.href.indexOf('=LEO') > -1 && workItem.AreaPath !== 'ART SPS\\LEO') || (window.location.href.indexOf('=MES') > -1 && workItem.AreaPath !== 'ART SPS\\MES'))
continue;
workItem["State"] = getState(workItem["State"])
workItem["Priority"] = getPriority(workItem["WorkItemType"], workItem["Priority"])
workItems.push(workItem);
}
workItems.sort(compareFunction);
return workItems;
}
function updateSite() {
if (window.location.href.indexOf('=LEO') > -1) {
document.title = document.title.replace("Infineon", "HiRel (Leominster)");
document.getElementById("siteHeader").innerText = "HiRel (Leominster)";
}
else if (window.location.href.indexOf('=MES') > -1) {
document.title = document.title.replace("Infineon", "Mesa");
document.getElementById("siteHeader").innerText = "Mesa";
}
else {
document.title = document.title.replace("Infineon", "Infineon");
document.getElementById("siteHeader").innerText = "Infineon";
}
}
function initIndex(url) {
updateSite();
$.getJSON(url, { _: new Date().getTime() }, function (data) {
var workItems = getWorkItems(data);
console.log(data.length);
if (data.length > 0)
console.log(data[0]);
$("#HeaderGrid").igGrid({
autoGenerateColumns: false,
dataSource: workItems,
height: "100%",
primaryKey: "Id",
width: "100%",
columns: [
{ key: "Violation", dataType: "string", hidden: true },
{ key: "Id", dataType: "number" },
{ key: "Requester", dataType: "string" },
{ headerText: "Assigned To", key: "AssignedTo", dataType: "string" },
{ key: "Title", dataType: "string", width: "20%" },
{ headerText: "System(s)", key: "Tags", dataType: "string" },
{ key: "Priority", dataType: "string" },
{ key: "State", dataType: "string" },
{ headerText: "Effort in Days", key: "Effort", dataType: "number" },
{ headerText: "UAT as of", key: "ResolvedDate", dataType: "date", format: "date" },
{ headerText: "CMP Date", key: "ClosedDate", dataType: "date", format: "date" },
{ headerText: "Target", key: "TargetDate", dataType: "date", format: "date" },
{ key: "AreaPath", dataType: "string", hidden: true },
{ key: "AssignedTo", dataType: "string", hidden: true },
{ key: "BusinessValue", dataType: "number", hidden: true },
{ key: "ChangedDate", dataType: "string", hidden: true },
{ key: "CommentCount", dataType: "number", hidden: true },
{ key: "CreatedDate", dataType: "string", hidden: true },
{ key: "Description", dataType: "string", hidden: true },
{ key: "IterationPath", dataType: "string", hidden: true },
{ key: "Revision", dataType: "number", hidden: true },
{ key: "RiskReductionMinusOpportunityEnablement", dataType: "string", hidden: true },
{ key: "StartDate", dataType: "string", hidden: true },
{ key: "WeightedShortestJobFirst", dataType: "number", hidden: true },
{ key: "WorkItemType", dataType: "string", hidden: true },
],
features: [
{ name: "Sorting", type: "local" },
{ name: "Filtering", type: "local" },
{ name: "Selection", mode: "row", multipleSelection: false, rowSelectionChanging: detailSelectionChangedRunInfo },
{ name: "Paging", type: "local", recordCountKey: "TotalRows", pageSize: 10, pageSizeUrlKey: "pageSize", "pageIndexUrlKey": "page", showPageSizeDropDown: true },
],
});
});
$("#HeaderGrid").on("dblclick", "tr", loadOne);
}

View File

@ -0,0 +1,12 @@
#HeaderGridDiv,
#DetailsGridDiv {
font-size: 12px;
}
#HeaderGrid {
font-family: monospace;
}
#AllGrid {
font-family: monospace;
}