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,5 +1,5 @@
function compareFunction(a, b) {
if (a.CoD === null || b.CoD === null) {
if (a.CoD == undefined || b.CoD == undefined) {
return b.Id - a.Id;
} else {
return b.CoD - a.CoD || b.State[0] - a.State[0] || b.ParentId - a.ParentId || a.Id - b.Id;
@ -7,12 +7,12 @@ function compareFunction(a, b) {
}
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() });
}
@ -26,7 +26,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);
@ -41,7 +41,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}`;
@ -62,7 +62,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`;
@ -78,14 +78,14 @@ function getPriority(workItemType, priority) {
}
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;
}
@ -97,7 +97,7 @@ function updateRecordOther(workItem) {
}
function updateRecordParent(parent, workItem) {
if (parent === null) {
if (parent == undefined) {
workItem["ParentId"] = 9999999;
workItem["ParentTitle"] = null;
workItem["ParentState"] = null;

View File

@ -1,5 +1,5 @@
function compareFunction(a, b) {
if (a.CoD === null || b.CoD === null) {
if (a.CoD == undefined || b.CoD == undefined) {
return b.Id - a.Id;
} else {
return b.CoD - a.CoD || b.State[0] - a.State[0] || b.ParentId - a.ParentId || a.Id - b.Id;
@ -7,12 +7,12 @@ function compareFunction(a, b) {
}
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() });
}
@ -26,7 +26,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);
@ -41,7 +41,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}`;
@ -62,7 +62,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`;
@ -78,14 +78,14 @@ function getPriority(workItemType, priority) {
}
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;
}
@ -97,7 +97,7 @@ function updateRecordOther(workItem) {
}
function updateRecordParent(parent, workItem) {
if (parent === null) {
if (parent == undefined) {
workItem["ParentId"] = 9999999;
workItem["ParentTitle"] = null;
workItem["ParentState"] = null;

View File

@ -1,5 +1,5 @@
function compareFunction(a, b) {
if (a.CoD === null || b.CoD === null) {
if (a.CoD == undefined || b.CoD == undefined) {
return b.Id - a.Id;
} else {
return b.CoD - a.CoD || b.State[0] - a.State[0] || b.ParentId - a.ParentId || a.Id - b.Id;
@ -7,12 +7,12 @@ function compareFunction(a, b) {
}
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() });
}
@ -26,7 +26,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);
@ -41,7 +41,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}`;
@ -62,7 +62,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`;
@ -78,14 +78,14 @@ function getPriority(workItemType, priority) {
}
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;
}
@ -97,7 +97,7 @@ function updateRecordOther(workItem) {
}
function updateRecordParent(parent, workItem) {
if (parent === null) {
if (parent == undefined) {
workItem["ParentId"] = 9999999;
workItem["ParentTitle"] = null;
workItem["ParentState"] = null;

View File

@ -1,5 +1,5 @@
function compareFunction(a, b) {
if (a.CoD === null || b.CoD === null) {
if (a.CoD == undefined || b.CoD == undefined) {
return b.Id - a.Id;
} else {
return b.CoD - a.CoD || b.State[0] - a.State[0] || b.ParentId - a.ParentId || a.Id - b.Id;
@ -7,12 +7,12 @@ function compareFunction(a, b) {
}
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() });
}
@ -26,7 +26,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);
@ -41,7 +41,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}`;
@ -62,7 +62,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`;
@ -78,14 +78,14 @@ function getPriority(workItemType, priority) {
}
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;
}
@ -97,7 +97,7 @@ function updateRecordOther(workItem) {
}
function updateRecordParent(parent, workItem) {
if (parent === null) {
if (parent == undefined) {
workItem["ParentId"] = 9999999;
workItem["ParentTitle"] = null;
workItem["ParentState"] = null;

View File

@ -1,5 +1,5 @@
function compareFunction(a, b) {
if (a.CoD === null || b.CoD === null) {
if (a.CoD == undefined || b.CoD == undefined) {
return b.Id - a.Id;
} else {
return b.CoD - a.CoD || b.State[0] - a.State[0] || b.ParentId - a.ParentId || a.Id - b.Id;
@ -7,12 +7,12 @@ function compareFunction(a, b) {
}
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() });
}
@ -26,7 +26,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);
@ -41,7 +41,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}`;
@ -62,7 +62,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`;
@ -78,14 +78,14 @@ function getPriority(workItemType, priority) {
}
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;
}
@ -97,7 +97,7 @@ function updateRecordOther(workItem) {
}
function updateRecordParent(parent, workItem) {
if (parent === null) {
if (parent == undefined) {
workItem["ParentId"] = 9999999;
workItem["ParentTitle"] = null;
workItem["ParentState"] = null;

View File

@ -1,5 +1,5 @@
function compareFunction(a, b) {
if (a.CoD === null || b.CoD === null) {
if (a.CoD == undefined || b.CoD == undefined) {
return b.Id - a.Id;
} else {
return b.CoD - a.CoD || b.State[0] - a.State[0] || b.ParentId - a.ParentId || a.Id - b.Id;
@ -7,12 +7,12 @@ function compareFunction(a, b) {
}
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() });
}
@ -26,7 +26,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);
@ -41,7 +41,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}`;
@ -62,7 +62,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`;
@ -78,14 +78,14 @@ function getPriority(workItemType, priority) {
}
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;
}
@ -97,7 +97,7 @@ function updateRecordOther(workItem) {
}
function updateRecordParent(parent, workItem) {
if (parent === null) {
if (parent == undefined) {
workItem["ParentId"] = 9999999;
workItem["ParentTitle"] = null;
workItem["ParentState"] = null;

View File

@ -1,22 +1,22 @@
var _apiUrl = null;
function compareFunction(a, b) {
if (a.BusinessValue === null || b.BusinessValue === null) {
if (a.BusinessValue == undefined || b.BusinessValue == 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 bPollValue[0] - aPollValue[0] || 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;
} else {
return b.BusinessValue - a.BusinessValue || 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.BusinessValue == undefined || pollValue.BusinessValue.InverseAverage == undefined)
result = "";
else if (pollValue.BusinessValue.InverseAverage >= 4)
result = `${pollValue.BusinessValue.InverseAverage} - 1-Highest (Most ${description}) - ${pollValue.Count} Vote(s)`;
else if (pollValue.BusinessValue.InverseAverage >= 3)
result = `${pollValue.BusinessValue.InverseAverage} - 2-High - ${pollValue.Count} Vote(s)`;
else if (pollValue.BusinessValue.InverseAverage >= 2)
result = `${pollValue.BusinessValue.InverseAverage} - 3-Medium - ${pollValue.Count} Vote(s)`;
else if (pollValue.BusinessValue.InverseAverage >= 1)
result = `${pollValue.BusinessValue.InverseAverage} - 4-Low - ${pollValue.Count} Vote(s)`;
else if (pollValue.BusinessValue.InverseAverage >= 0)
result = `${pollValue.BusinessValue.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,46 @@ 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.BusinessValue === null ? "" : record.BusinessValue.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.BusinessValue == undefined ? "" : record.BusinessValue.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 +223,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.BusinessValue +
"</td><td><a href='#' class='up'>Up</a>" +
"</td><td><a href='#' class='down'>Down</a>" +
"</td><td>" + record.PollValue +
"</td><td>" + length + " - " + record.BusinessValue +
"</td></tr>";
}
element.innerHTML = html.replaceAll(">null<", ">&nbsp;<");

File diff suppressed because one or more lines are too long

View File

@ -1,22 +1,22 @@
var _apiUrl = null;
function compareFunction(a, b) {
if (a.Effort === null || b.Effort === null) {
if (a.Effort == undefined || b.Effort == 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 bPollValue[0] - aPollValue[0] || 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;
} else {
return b.Effort - a.Effort || 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.Effort == undefined || pollValue.Effort.InverseAverage == undefined)
result = "";
else if (pollValue.Effort.InverseAverage >= 4)
result = `${pollValue.Effort.InverseAverage} - 1-Highest (Most ${description}) - ${pollValue.Count} Vote(s)`;
else if (pollValue.Effort.InverseAverage >= 3)
result = `${pollValue.Effort.InverseAverage} - 2-High - ${pollValue.Count} Vote(s)`;
else if (pollValue.Effort.InverseAverage >= 2)
result = `${pollValue.Effort.InverseAverage} - 3-Medium - ${pollValue.Count} Vote(s)`;
else if (pollValue.Effort.InverseAverage >= 1)
result = `${pollValue.Effort.InverseAverage} - 4-Low - ${pollValue.Count} Vote(s)`;
else if (pollValue.Effort.InverseAverage >= 0)
result = `${pollValue.Effort.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,46 @@ 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.Effort === null ? "" : record.Effort.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.Effort == undefined ? "" : record.Effort.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 +223,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.Effort +
"</td><td><a href='#' class='up'>Up</a>" +
"</td><td><a href='#' class='down'>Down</a>" +
"</td><td>" + record.PollValue +
"</td><td>" + length + " - " + record.Effort +
"</td></tr>";
}
element.innerHTML = html.replaceAll(">null<", ">&nbsp;<");

File diff suppressed because it is too large Load Diff

View File

@ -1,5 +1,5 @@
function compareFunction(a, b) {
if (a.CoD === null || b.CoD === null) {
if (a.CoD == undefined || b.CoD == undefined) {
return b.Id - a.Id;
} else {
return b.CoD - a.CoD || b.State[0] - a.State[0] || b.ParentId - a.ParentId || a.Id - b.Id;
@ -7,12 +7,12 @@ function compareFunction(a, b) {
}
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() });
}
@ -26,7 +26,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);
@ -41,7 +41,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}`;
@ -62,7 +62,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`;
@ -78,14 +78,14 @@ function getPriority(workItemType, priority) {
}
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;
}
@ -97,7 +97,7 @@ function updateRecordOther(workItem) {
}
function updateRecordParent(parent, workItem) {
if (parent === null) {
if (parent == undefined) {
workItem["ParentId"] = 9999999;
workItem["ParentTitle"] = null;
workItem["ParentState"] = null;

View File

@ -1,5 +1,5 @@
function compareFunction(a, b) {
if (a.CoD === null || b.CoD === null) {
if (a.CoD == undefined || b.CoD == undefined) {
return b.Id - a.Id;
} else {
return b.CoD - a.CoD || b.State[0] - a.State[0] || b.ParentId - a.ParentId || a.Id - b.Id;
@ -7,12 +7,12 @@ function compareFunction(a, b) {
}
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() });
}
@ -26,7 +26,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);
@ -41,7 +41,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}`;
@ -62,7 +62,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`;
@ -78,14 +78,14 @@ function getPriority(workItemType, priority) {
}
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;
}
@ -97,7 +97,7 @@ function updateRecordOther(workItem) {
}
function updateRecordParent(parent, workItem) {
if (parent === null) {
if (parent == undefined) {
workItem["ParentId"] = 9999999;
workItem["ParentTitle"] = null;
workItem["ParentState"] = null;

View File

@ -1,22 +1,22 @@
var _apiUrl = null;
function compareFunction(a, b) {
if (a.RiskReductionMinusOpportunityEnablement === null || b.RiskReductionMinusOpportunityEnablement === null) {
if (a.RiskReductionMinusOpportunityEnablement == undefined || b.RiskReductionMinusOpportunityEnablement == 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 bPollValue[0] - aPollValue[0] || 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;
} else {
return b.RiskReductionMinusOpportunityEnablement - a.RiskReductionMinusOpportunityEnablement || 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.RiskReductionOpportunityEnablement == undefined || pollValue.RiskReductionOpportunityEnablement.InverseAverage == undefined)
result = "";
else if (pollValue.RiskReductionOpportunityEnablement.InverseAverage >= 4)
result = `${pollValue.RiskReductionOpportunityEnablement.InverseAverage} - 1-Highest (Most ${description}) - ${pollValue.Count} Vote(s)`;
else if (pollValue.RiskReductionOpportunityEnablement.InverseAverage >= 3)
result = `${pollValue.RiskReductionOpportunityEnablement.InverseAverage} - 2-High - ${pollValue.Count} Vote(s)`;
else if (pollValue.RiskReductionOpportunityEnablement.InverseAverage >= 2)
result = `${pollValue.RiskReductionOpportunityEnablement.InverseAverage} - 3-Medium - ${pollValue.Count} Vote(s)`;
else if (pollValue.RiskReductionOpportunityEnablement.InverseAverage >= 1)
result = `${pollValue.RiskReductionOpportunityEnablement.InverseAverage} - 4-Low - ${pollValue.Count} Vote(s)`;
else if (pollValue.RiskReductionOpportunityEnablement.InverseAverage >= 0)
result = `${pollValue.RiskReductionOpportunityEnablement.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,46 @@ 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.RiskReductionMinusOpportunityEnablement === null ? "" : record.RiskReductionMinusOpportunityEnablement.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.RiskReductionMinusOpportunityEnablement == undefined ? "" : record.RiskReductionMinusOpportunityEnablement.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 +223,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.RiskReductionMinusOpportunityEnablement +
"</td><td><a href='#' class='up'>Up</a>" +
"</td><td><a href='#' class='down'>Down</a>" +
"</td><td>" + record.PollValue +
"</td><td>" + length + " - " + record.RiskReductionMinusOpportunityEnablement +
"</td></tr>";
}
element.innerHTML = html.replaceAll(">null<", ">&nbsp;<");

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,95 @@
/*!
* ASP.NET SignalR JavaScript Library 2.4.3
* http://signalr.net/
*
* Copyright (c) .NET Foundation. All rights reserved.
* Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
*
*/
/// <reference path="..\..\SignalR.Client.JS\Scripts\jquery-1.6.4.js" />
/// <reference path="jquery.signalR.js" />
(function ($, window, undefined) {
/// <param name="$" type="jQuery" />
"use strict";
if (typeof ($.signalR) !== "function") {
throw new Error("SignalR: SignalR is not loaded. Please ensure jquery.signalR-x.js is referenced before ~/signalr/js.");
}
var signalR = $.signalR;
function makeProxyCallback(hub, callback) {
return function () {
// Call the client hub method
callback.apply(hub, $.makeArray(arguments));
};
}
function registerHubProxies(instance, shouldSubscribe) {
var key, hub, memberKey, memberValue, subscriptionMethod;
for (key in instance) {
if (instance.hasOwnProperty(key)) {
hub = instance[key];
if (!(hub.hubName)) {
// Not a client hub
continue;
}
if (shouldSubscribe) {
// We want to subscribe to the hub events
subscriptionMethod = hub.on;
} else {
// We want to unsubscribe from the hub events
subscriptionMethod = hub.off;
}
// Loop through all members on the hub and find client hub functions to subscribe/unsubscribe
for (memberKey in hub.client) {
if (hub.client.hasOwnProperty(memberKey)) {
memberValue = hub.client[memberKey];
if (!$.isFunction(memberValue)) {
// Not a client hub function
continue;
}
// Use the actual user-provided callback as the "identity" value for the registration.
subscriptionMethod.call(hub, memberKey, makeProxyCallback(hub, memberValue), memberValue);
}
}
}
}
}
$.hubConnection.prototype.createHubProxies = function () {
var proxies = {};
this.starting(function () {
// Register the hub proxies as subscribed
// (instance, shouldSubscribe)
registerHubProxies(proxies, true);
this._registerSubscribedHubs();
}).disconnected(function () {
// Unsubscribe all hub proxies when we "disconnect". This is to ensure that we do not re-add functional call backs.
// (instance, shouldSubscribe)
registerHubProxies(proxies, false);
});
proxies['weightedShortestJobFirstHub'] = this.createHubProxy('weightedShortestJobFirstHub');
proxies['weightedShortestJobFirstHub'].client = { };
proxies['weightedShortestJobFirstHub'].server = {
send: function (name, message) {
return proxies['weightedShortestJobFirstHub'].invoke.apply(proxies['weightedShortestJobFirstHub'], $.merge(["Send"], $.makeArray(arguments)));
}
};
return proxies;
};
signalR.hub = $.hubConnection("/signalr", { useDefaultPath: false });
$.extend(signalR, signalR.hub.createHubProxies());
}(window.jQuery, window));

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

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;<");

View File

@ -1,5 +1,5 @@
function compareFunction(a, b) {
if (a.ParentCoD === null || b.ParentCoD === null) {
if (a.ParentCoD == undefined || b.ParentCoD == undefined) {
return b.ParentCoD - a.ParentCoD || b.Id - a.Id;
} else {
return b.State[0] - a.State[0] || b.ParentId - a.ParentId || a.Id - b.Id;
@ -7,12 +7,12 @@ function compareFunction(a, b) {
}
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() });
}
@ -26,7 +26,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);
@ -41,7 +41,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}`;
@ -62,7 +62,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`;
@ -78,14 +78,14 @@ function getPriority(workItemType, priority) {
}
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;
}
@ -97,7 +97,7 @@ function updateRecordOther(workItem) {
}
function updateRecordParent(parent, workItem) {
if (parent === null) {
if (parent == undefined) {
workItem["ParentId"] = 9999999;
workItem["ParentTitle"] = null;
workItem["ParentState"] = null;

View File

@ -0,0 +1,321 @@
var _apiUrl = null;
function compareFunction(a, b) {
return b.WeightedShortestJobFirst - a.WeightedShortestJobFirst || b.CoDRank - b.CoDRank || b.ParentId - a.ParentId || a.Id - b.Id;
}
function compareEffortFunction(a, b) {
return a.Effort - b.Effort || b.ParentId - a.ParentId || a.Id - b.Id;
}
function compareBusinessValueFunction(a, b) {
return a.BusinessValue - b.BusinessValue || b.ParentId - a.ParentId || a.Id - b.Id;
}
function compareTimeCriticalityFunction(a, b) {
return a.TimeCriticality - b.TimeCriticality || b.ParentId - a.ParentId || a.Id - b.Id;
}
function compareRiskReductionMinusOpportunityEnablementFunction(a, b) {
return b.RiskReductionMinusOpportunityEnablement - b.RiskReductionMinusOpportunityEnablement || b.ParentId - a.ParentId || a.Id - b.Id;
}
function compareCostOfDelay(a, b) {
return b.CoD - b.CoD || b.ParentId - a.ParentId || a.Id - b.Id;
}
function showOne(rowData) {
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] == undefined)
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 == undefined)
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 == undefined)
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 == undefined || 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 updateRecordCoD(workItem) {
if (workItem != undefined) {
if (workItem["Effort"] == undefined)
workItem["Effort"] = 1;
if (workItem["BusinessValue"] == undefined)
workItem["BusinessValue"] = 99999;
if (workItem["TimeCriticality"] == undefined)
workItem["TimeCriticality"] = 99999;
if (workItem["RiskReductionMinusOpportunityEnablement"] == undefined)
workItem["RiskReductionMinusOpportunityEnablement"] = 99999;
}
}
function getFibonacci(length) {
var results = [];
for (var i = 0; i < length; i++) {
results.push(21);
}
var index = 0;
var fibonacci = [3, 5, 8, 13, 20];
var factor = (length / fibonacci.length).toFixed();
for (var j = 0; j < fibonacci.length; j++) {
for (var i = 0; i < factor; i++) {
results[index] = fibonacci[j];
index += 1;
}
}
// for (var i = 0; i < results.length; i++) {
// console.log(results[i]);
// }
return results;
}
function updateCoD(records) {
var workItem;
var collection = [];
for (var i = 0; i < records.length; i++) {
workItem = records[i];
if (workItem.Priority[0] === '2') {
workItem.EffortFibonacci = 2;
workItem.BusinessValueFibonacci = 2;
workItem.TimeCriticalityFibonacci = 2;
workItem.RiskReductionMinusOpportunityEnablementFibonacci = 2;
continue;
}
else if (workItem.Priority[0] === '3') {
workItem.EffortFibonacci = 1;
workItem.BusinessValueFibonacci = 1;
workItem.TimeCriticalityFibonacci = 1;
workItem.RiskReductionMinusOpportunityEnablementFibonacci = 1;
continue;
}
collection.push(workItem);
}
var fibonacci = getFibonacci(collection.length);
collection.sort(compareEffortFunction);
for (var i = 0; i < collection.length; i++) {
workItem = collection[i];
workItem.EffortFibonacci = fibonacci[i];
}
records.sort(compareEffortFunction);
for (var i = 0; i < records.length; i++) {
workItem = records[i];
workItem.EffortRank = (((i + 1) / records.length) * 100).toFixed();
}
collection.sort(compareBusinessValueFunction);
for (var i = 0; i < collection.length; i++) {
workItem = collection[i];
workItem.BusinessValueFibonacci = fibonacci[i];
}
records.sort(compareBusinessValueFunction);
for (var i = 0; i < records.length; i++) {
workItem = records[i];
workItem.BusinessValueRank = (((i + 1) / records.length) * 100).toFixed();
}
collection.sort(compareTimeCriticalityFunction);
for (var i = 0; i < collection.length; i++) {
workItem = collection[i];
workItem.TimeCriticalityFibonacci = fibonacci[i];
}
records.sort(compareTimeCriticalityFunction);
for (var i = 0; i < records.length; i++) {
workItem = records[i];
workItem.TimeCriticalityRank = (((i + 1) / records.length) * 100).toFixed();
}
collection.sort(compareRiskReductionMinusOpportunityEnablementFunction);
for (var i = 0; i < collection.length; i++) {
workItem = collection[i];
workItem.RiskReductionMinusOpportunityEnablementFibonacci = fibonacci[i];
}
records.sort(compareRiskReductionMinusOpportunityEnablementFunction);
for (var i = 0; i < records.length; i++) {
workItem = records[i];
workItem.RiskReductionMinusOpportunityEnablementRank = (((i + 1) / records.length) * 100).toFixed();
}
for (var i = 0; i < records.length; i++) {
workItem = records[i];
workItem.CoD = workItem.RiskReductionMinusOpportunityEnablementFibonacci + workItem.TimeCriticalityFibonacci + workItem.BusinessValueFibonacci;
}
records.sort(compareCostOfDelay);
for (var i = 0; i < records.length; i++) {
workItem = records[i];
workItem.CoDRank = (((i + 1) / records.length) * 100).toFixed();
}
for (var i = 0; i < records.length; i++) {
workItem = records[i];
if (workItem.Priority[0] !== '1' && workItem.Priority[0] !== '4') {
workItem.WeightedShortestJobFirst = 0.000001;
workItem.WeightedShortestJobFirstRank = 0;
}
else {
workItem.WeightedShortestJobFirstRank = (((i + 1) / records.length) * 100).toFixed();
workItem.WeightedShortestJobFirst = (workItem.CoD / workItem.EffortFibonacci).toFixed(3);
}
}
}
function updateRecordOther(workItem) {
workItem["State"] = getState(workItem["State"]);
workItem["Priority"] = getPriority(workItem["WorkItemType"], workItem["Priority"]);
}
function updateRecordParent(parent, workItem) {
if (parent == undefined) {
workItem["ParentId"] = 9999999;
workItem["ParentTitle"] = null;
workItem["ParentState"] = null;
workItem["ParentCoD"] = 9999999;
}
else {
workItem["ParentId"] = parent["Id"];
workItem["ParentCoD"] = parent["CoD"];
workItem["ParentTitle"] = parent["Title"];
workItem["ParentState"] = getState(parent["State"]);
}
}
function getRecords(data) {
var parent;
var workItem;
var records = [];
for (var i = 0; i < data.length; i++) {
parent = data[i].Parent;
workItem = data[i].WorkItem;
if (workItem.WorkItemType !== 'Feature')
continue;
if (workItem.State !== 'Active' && workItem.State !== 'New')
continue;
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;
updateRecordCoD(parent);
updateRecordCoD(workItem);
updateRecordOther(workItem);
updateRecordParent(parent, workItem);
records.push(workItem);
}
updateCoD(records);
records.sort(compareFunction);
return records;
}
function setRecords(workItems) {
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>Priority</th><th>Risk Reduction and/or Opportunity Enablement</th><th>Time Criticality</th><th>Business Value</th><th>CoD</th><th>Effort</th><th>WSJF</th><th>Up</th><th>Down</th></tr>";
const element = document.getElementById("HeaderGrid");
for (var i = 0; i < workItems.length; i++) {
record = workItems[i];
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>" +
"</td><td>" + record.Requester +
"</td><td>" + record.Title +
"</td><td>" + record.AssignedTo +
"</td><td>" + record.Tags +
"</td><td>" + record.State +
"</td><td>" + record.Priority +
"</td><td>" + record.RiskReductionMinusOpportunityEnablementRank + '% - ' + record.RiskReductionMinusOpportunityEnablement + ' - ' + record.RiskReductionMinusOpportunityEnablementFibonacci +
"</td><td>" + record.TimeCriticalityRank + '% - ' +record.TimeCriticality + ' - ' + record.TimeCriticalityFibonacci +
"</td><td>" + record.BusinessValueRank + '% - ' +record.BusinessValue + ' - ' + record.BusinessValueFibonacci +
"</td><td>" + record.CoDRank + '% - ' + record.CoD +
"</td><td>" + record.EffortRank + '% - ' +record.Effort + ' - ' + record.EffortFibonacci +
"</td><td>" + record.WeightedShortestJobFirst +
"</td><td><a href='#' class='up'>Up</a></td><td><a href='#' class='down'>Down</a></td></tr>";
}
element.innerHTML = html.replaceAll(">null<", ">&nbsp;<");
}
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, apiUrl) {
_apiUrl = apiUrl;
updateSite();
$.getJSON(url, { _: new Date().getTime() }, function (data) {
var records = getRecords(data);
console.log(data.length);
if (data.length > 0)
console.log(data[0]);
setRecords(records);
$(".up,.down").click(function () {
var row = $(this).parents("tr:first");
if ($(this).is(".up")) {
row.insertBefore(row.prev());
} else {
row.insertAfter(row.next());
}
});
});
$("#HeaderGrid").on("dblclick", "tr", loadOne);
}

View File

@ -0,0 +1,47 @@
var _apiUrl = null;
function initIndex(url, apiUrl) {
_apiUrl = apiUrl;
//Set the hubs URL for the connection
$.connection.hub.url = url;
$.connection.hub.logging = true;
// Declare a proxy to reference the hub.
// var chat = $.connection.myHub;
var chat = $.connection.weightedShortestJobFirstHub;
// Create a function that the hub can call to broadcast messages.
chat.client.addNotification = function (name, message) {
// Html encode display name and message.
console.log(message);
var encodedName = $('<div />').text(name).html();
var encodedMsg = $('<div />').text("hash").html();
// Add the message to the page.
$('#discussion').append('<li><strong>' + encodedName
+ '</strong>:&nbsp;&nbsp;' + encodedMsg + '</li>');
};
// Get the user name and store it to prepend to messages.
$('#displayname').val(prompt('Enter your name:', ''));
// Set initial focus to message input box.
$('#message').focus();
// Start the connection.
$.connection.hub.start({ transport: 'longPolling' }).done(function () {
$('#sendmessage').click(function () {
// Call the Send method on the hub.
// chat.server.send($('#displayname').val(), $('#message').val());
var notification = {
"Json": null,
"id": 110743,
"page": "effort",
"QueryString": "time=1737573418926\u0026id=110743\u0026page=effort\u0026value=1",
"RemoteIpAddress": "10.95.36.87",
"time": 1737573418926,
"value": 1
};
chat.server.notifyAll(notification);
// Clear text box and reset focus for next comment.
$('#message').val('').focus();
});
});
}

View File

@ -25,12 +25,12 @@ function compareCostOfDelay(a, b) {
}
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() });
}
@ -44,7 +44,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);
@ -59,7 +59,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}`;
@ -80,7 +80,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`;
@ -96,14 +96,14 @@ function getPriority(workItemType, priority) {
}
function updateRecordCoD(workItem) {
if (workItem !== null) {
if (workItem["Effort"] === null)
if (workItem != undefined) {
if (workItem["Effort"] == undefined)
workItem["Effort"] = 1;
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;
}
}
@ -218,7 +218,7 @@ function updateRecordOther(workItem) {
}
function updateRecordParent(parent, workItem) {
if (parent === null) {
if (parent == undefined) {
workItem["ParentId"] = 9999999;
workItem["ParentTitle"] = null;
workItem["ParentState"] = null;
@ -241,7 +241,7 @@ function getRecords(data) {
workItem = data[i].WorkItem;
if (workItem.WorkItemType !== 'Feature')
continue;
if (workItem.State !== 'New' && workItem.State !== 'Active')
if (workItem.State !== 'Active' && workItem.State !== 'New')
continue;
if (workItem.Tags != null && workItem.Tags.includes("Ignore"))
continue;
@ -265,7 +265,7 @@ function setRecords(workItems) {
for (var i = 0; i < workItems.length; i++) {
record = workItems[i];
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.Title +
"</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>" +
"</td><td>" + record.Requester +
"</td><td>" + record.Title +