Cost of Delay

This commit is contained in:
2025-01-28 13:27:12 -07:00
parent 08a23114c9
commit 304bf04afe
45 changed files with 55913 additions and 414 deletions

View File

@ -1,22 +1,22 @@
var _apiUrl = null;
function compareFunction(a, b) {
if (a.TimeCriticality === null || b.TimeCriticality === null) {
if (a.TimeCriticality == undefined || b.TimeCriticality == undefined) {
var aPollValue = a.PollValue.split('-');
var bPollValue = b.PollValue.split('-');
return bPollValue[0].trim() - aPollValue[0].trim() || b.State[0] - a.State[0] || bPollValue[bPollValue.length - 1].trim()[0] - aPollValue[aPollValue.length - 1].trim()[0] || b.ParentId - a.ParentId || a.Id - b.Id;
return b.State[0] - a.State[0] || bPollValue[0] - aPollValue[0] || bPollValue[bPollValue.length - 1].trim()[0] - aPollValue[aPollValue.length - 1].trim()[0] || b.ParentId - a.ParentId || a.Id - b.Id;
} else {
return b.TimeCriticality - a.TimeCriticality || b.State[0] - a.State[0] || b.ParentId - a.ParentId || a.Id - b.Id;
}
}
function showOne(rowData) {
if (rowData == null)
if (rowData == undefined)
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)
if (rowData[property] == undefined)
continue;
data.push({ name: property, value: rowData[property].toString() });
}
@ -30,7 +30,7 @@ function showOne(rowData) {
function loadOne() {
var selectedRow = $("#HeaderGrid").data("igGridSelection").selectedRow();
if (selectedRow == null)
if (selectedRow == undefined)
return;
var rowData = $("#HeaderGrid").data("igGrid").dataSource.dataView()[selectedRow.index];
showOne(rowData);
@ -45,7 +45,7 @@ function detailSelectionChangedRunInfo(evt, ui) {
function getState(state) {
var result;
if (state == null)
if (state == undefined)
result = "9-Null";
else if (state === "New")
result = `1-${state}`;
@ -66,7 +66,7 @@ function getPriority(workItemType, priority) {
var result;
if (workItemType === "Bug")
result = "0-Bug";
else if (priority == null || priority === 0)
else if (priority == undefined || priority === 0)
result = "9-Null";
else if (priority === 1)
result = `${priority}-High`;
@ -81,45 +81,34 @@ function getPriority(workItemType, priority) {
return result;
}
function getInversePriority(priority) {
function getPollValue(description, pollValue) {
var result;
if (priority == null || priority === 0)
result = "0.000";
else if (priority === 1)
result = "3.000";
else if (priority === 2)
result = "2.000";
else if (priority === 3)
result = "1.000";
if (pollValue == undefined || pollValue.TimeCriticality == undefined || pollValue.TimeCriticality.InverseAverage == undefined)
result = "";
else if (pollValue.TimeCriticality.InverseAverage >= 4)
result = `${pollValue.TimeCriticality.InverseAverage} - 1-Highest (Most ${description}) - ${pollValue.Count} Vote(s)`;
else if (pollValue.TimeCriticality.InverseAverage >= 3)
result = `${pollValue.TimeCriticality.InverseAverage} - 2-High - ${pollValue.Count} Vote(s)`;
else if (pollValue.TimeCriticality.InverseAverage >= 2)
result = `${pollValue.TimeCriticality.InverseAverage} - 3-Medium - ${pollValue.Count} Vote(s)`;
else if (pollValue.TimeCriticality.InverseAverage >= 1)
result = `${pollValue.TimeCriticality.InverseAverage} - 4-Low - ${pollValue.Count} Vote(s)`;
else if (pollValue.TimeCriticality.InverseAverage >= 0)
result = `${pollValue.TimeCriticality.InverseAverage} - 5-Lowest - ${pollValue.Count} Vote(s)`;
else
result = "0.000";
return result;
}
function getPollValue(description, priority, priorityDisplay, pollValue) {
var result;
if (pollValue === undefined || pollValue.Records.length === undefined || pollValue.Records.length === 0 || pollValue.Average === null)
result = getInversePriority(priority) + ' - ' + priorityDisplay + ' - *Priority';
else if (pollValue.Average > 2)
result = `${pollValue.Average} - 1-High (Most ${description}) - ${pollValue.Count} Vote(s)`;
else if (pollValue.Average > 1)
result = `${pollValue.Average} - 2-Medium - ${pollValue.Count} Vote(s)`;
else if (pollValue.Average > 0)
result = `${pollValue.Average} - 3-Low - ${pollValue.Count} Vote(s)`;
else
result = getInversePriority(priority) + ' - ' + priorityDisplay + ' - *Priority';
result = "";
return result;
}
function updateRecordCoD(workItem) {
if (workItem !== null) {
if (workItem.Effort === null)
if (workItem != undefined) {
if (workItem.Effort == undefined)
workItem.Effort = 10123;
if (workItem.BusinessValue === null)
if (workItem.BusinessValue == undefined)
workItem.BusinessValue = 99999;
if (workItem.TimeCriticality === null)
if (workItem.TimeCriticality == undefined)
workItem.TimeCriticality = 99999;
if (workItem.RiskReductionMinusOpportunityEnablement === null)
if (workItem.RiskReductionMinusOpportunityEnablement == undefined)
workItem.RiskReductionMinusOpportunityEnablement = 99999;
workItem.CoD = workItem.RiskReductionMinusOpportunityEnablement + workItem.TimeCriticality + workItem.BusinessValue;
}
@ -128,12 +117,12 @@ function updateRecordCoD(workItem) {
function updateRecordOther(workItem, dataB, description) {
workItem["State"] = getState(workItem["State"]);
var priority = getPriority(workItem["WorkItemType"], workItem["Priority"]);
workItem["PollValue"] = getPollValue(description, workItem["Priority"], priority, dataB[workItem.Id]);
workItem["PollValue"] = getPollValue(description, dataB[workItem.Id]);
workItem["Priority"] = priority;
}
function updateRecordParent(parent, workItem) {
if (parent === null) {
if (parent == undefined) {
workItem["ParentId"] = 9999999;
workItem["ParentTitle"] = null;
workItem["ParentState"] = null;
@ -183,13 +172,47 @@ function sendValue(element, page, id) {
});
}
function getFibonacciValue(average) {
var result;
if (average >= 7)
result = 34;
else if (average >= 6)
result = 21;
else if (average >= 5)
result = 13;
else if (average >= 4)
result = 8;
else if (average >= 3)
result = 5;
else if (average >= 2)
result = 3;
else if (average >= 1)
result = 2;
else if (average >= 0)
result = 1;
else
result = "";
return result;
}
function setRecords(workItems, page, description, th) {
var record;
var html = "<tr><th>Parent Id</th><th>Parent Title</th><th>Id</th><th>Requester</th><th>Title</th><th>Assigned To</th><th>System(s)</th><th>State</th><th>Value</th><th>Up</th><th>Down</th><th>Poll Value</th><th>" + th + "</th></tr>";
var array = [];
var count = "";
var select = "";
var average = "";
var fibonacciValue = "";
var html = "<tr><th>Parent Id</th><th>Parent Title</th><th>Id</th><th>Requester</th><th>Title</th><th>Assigned To</th><th>System(s)</th><th>State</th><th>Value</th><th>Poll Average</th><th>Fibonacci</th><th>Poll Description</th><th>Vote(s)</th><th>" + th + "</th><th>Up</th><th>Down</th></tr>";
const element = document.getElementById("HeaderGrid");
for (var i = 0; i < workItems.length; i++) {
record = workItems[i];
var length = record.TimeCriticality === null ? "" : record.TimeCriticality.toString().length;
array = record.PollValue.split('-')
average = array.length > 0 ? array[0] : "";
fibonacciValue = getFibonacciValue(average);
select = array.length > 2 ? array[1] + '-' + array[2] : "";
count = array.length > 3 ? array[3].trim().split(' ')[0] : "";
var length = record.TimeCriticality == undefined ? "" : record.TimeCriticality.toString().length;
html += "<tr><td>" + '<a target="_blank" href="https://tfs.intra.infineon.com/tfs/FactoryIntegration/ART%20SPS/_workitems/edit/' + record.ParentId + '">' + record.ParentId + "</a>" +
"</td><td>" + record.ParentTitle +
"</td><td>" + '<a target="_blank" href="https://tfs.intra.infineon.com/tfs/FactoryIntegration/ART%20SPS/_workitems/edit/' + record.Id + '">' + record.Id + "</a>" +
@ -201,14 +224,19 @@ function setRecords(workItems, page, description, th) {
"</td><td>" +
'<select onchange="sendValue(this, \'' + page + '\', ' + record.Id + ')">' +
'<option value="9">Unknown</option>' +
'<option value="1">High (Most ' + description + ')</option>' +
'<option value="2">Medium</option>' +
'<option value="3">Low</option>' +
'<option value="1">Highest (Most ' + description + ')</option>' +
'<option value="2">High</option>' +
'<option value="3">Medium</option>' +
'<option value="4">Low</option>' +
'<option value="5">Lowest</option>' +
"</select>" +
"</td><td>" + average +
"</td><td>" + fibonacciValue +
"</td><td>" + select +
"</td><td>" + count +
"</td><td>" + length + " - " + record.TimeCriticality +
"</td><td><a href='#' class='up'>Up</a>" +
"</td><td><a href='#' class='down'>Down</a>" +
"</td><td>" + record.PollValue +
"</td><td>" + length + " - " + record.TimeCriticality +
"</td></tr>";
}
element.innerHTML = html.replaceAll(">null<", ">&nbsp;<");