CoD
With Parents on pages WSJF Columns
This commit is contained in:
@ -1,5 +1,9 @@
|
||||
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;
|
||||
if (a.CoD === null || b.CoD === null) {
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
function showOne(rowData) {
|
||||
@ -73,37 +77,35 @@ function getPriority(workItemType, priority) {
|
||||
return result;
|
||||
}
|
||||
|
||||
function getTimeCriticality(workItemType, timeCriticality) {
|
||||
var result;
|
||||
if (workItemType === "Bug")
|
||||
result = "0-Bug";
|
||||
else if (timeCriticality == null || timeCriticality === 0)
|
||||
result = "9-Null";
|
||||
else if (timeCriticality === 1)
|
||||
result = `${timeCriticality}-QSM`;
|
||||
else if (timeCriticality === 2)
|
||||
result = `${timeCriticality}-Qual`;
|
||||
else if (timeCriticality === 3)
|
||||
result = `${timeCriticality}-Eff`;
|
||||
else
|
||||
result = "8-Not";
|
||||
return result;
|
||||
}
|
||||
|
||||
function getRecords(data) {
|
||||
var workItems = [];
|
||||
var parent;
|
||||
var workItem;
|
||||
for (var i = data.length - 1; i > -1; i--) {
|
||||
workItem = data[i];
|
||||
if (workItem.AreaPath !== 'ART SPS\\MES')
|
||||
continue;
|
||||
var workItems = [];
|
||||
for (var i = 0; i < data.length; i++) {
|
||||
parent = data[i].Parent;
|
||||
workItem = data[i].WorkItem;
|
||||
if (workItem.Tags != null && workItem.Tags.includes("Ignore"))
|
||||
continue;
|
||||
if (workItem.WorkItemType !== 'Feature' && workItem.WorkItemType !== 'Bug')
|
||||
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;
|
||||
if (workItem["RiskReductionMinusOpportunityEnablement"] === null || workItem["TimeCriticality"] === null || workItem["BusinessValue"] === null)
|
||||
workItem["CoD"] === 0;
|
||||
else
|
||||
workItem["CoD"] === workItem["RiskReductionMinusOpportunityEnablement"] + workItem["TimeCriticality"] + workItem["BusinessValue"];
|
||||
if (parent === null) {
|
||||
workItem["ParentId"] = 9999999;
|
||||
workItem["ParentTitle"] = null;
|
||||
workItem["ParentState"] = null;
|
||||
}
|
||||
else {
|
||||
workItem["ParentId"] = parent["Id"];
|
||||
workItem["ParentTitle"] = parent["Title"];
|
||||
workItem["ParentState"] = getState(parent["State"]);
|
||||
}
|
||||
workItem["State"] = getState(workItem["State"])
|
||||
workItem["Priority"] = getPriority(workItem["WorkItemType"], workItem["Priority"])
|
||||
workItem["TimeCriticality"] = getTimeCriticality(workItem["WorkItemType"], workItem["TimeCriticality"])
|
||||
workItems.push(workItem);
|
||||
}
|
||||
workItems.sort(compareFunction);
|
||||
@ -128,42 +130,45 @@ function updateSite() {
|
||||
function initIndex(url) {
|
||||
updateSite();
|
||||
$.getJSON(url, { _: new Date().getTime() }, function (data) {
|
||||
var workItems = getRecords(data);
|
||||
var records = getRecords(data);
|
||||
console.log(data.length);
|
||||
if (data.length > 0)
|
||||
console.log(data[0]);
|
||||
$("#HeaderGrid").igGrid({
|
||||
autoGenerateColumns: false,
|
||||
dataSource: workItems,
|
||||
dataSource: records,
|
||||
height: "100%",
|
||||
primaryKey: "Id",
|
||||
width: "100%",
|
||||
columns: [
|
||||
{ key: "Violation", dataType: "string", hidden: true },
|
||||
{ headerText: "Parent Id", key: "ParentId", dataType: "string" },
|
||||
{ headerText: "Parent State", key: "ParentState", dataType: "string" },
|
||||
{ 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" },
|
||||
{ headerText: "Qual/Eff", key: "TimeCriticality", dataType: "string" },
|
||||
{ key: "State", dataType: "string" },
|
||||
{ headerText: "Effort in Days", key: "Effort", dataType: "number" },
|
||||
{ headerText: "Risk Reduction and/or Opportunity Enablement", key: "RiskReductionMinusOpportunityEnablement", dataType: "string" },
|
||||
{ headerText: "Business Value", key: "BusinessValue", dataType: "number" },
|
||||
{ headerText: "Time Criticality", key: "TimeCriticality", dataType: "number" },
|
||||
{ headerText: "Effort", key: "Effort", dataType: "number" },
|
||||
{ headerText: "Weighted Shortest Job First", key: "WeightedShortestJobFirst", 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: "Violation", dataType: "string", hidden: true },
|
||||
{ key: "WeightedShortestJobFirst", dataType: "number", hidden: true },
|
||||
{ key: "WorkItemType", dataType: "string", hidden: true },
|
||||
],
|
||||
features: [
|
||||
|
Reference in New Issue
Block a user