With Parents on pages
WSJF Columns
This commit is contained in:
2024-10-21 17:55:24 -07:00
parent 1241bbe622
commit 326bd1ea73
29 changed files with 532 additions and 367 deletions

View File

@ -2,4 +2,5 @@
```bash
mklink /J "T:\MESAFIBACKLOG\06_SourceCode\MESAFIBACKLOG\Adaptation\.kanbn" "D:\5-Other-Small\Kanban\MESAFIBACKLOG"
mklink /J "T:\MESAFIBACKLOG\06_SourceCode\MESAFIBACKLOG\Adaptation\.vscode\helper" "D:\web-sites\OI-Metrology\_markdown"
```

View File

@ -208,11 +208,11 @@ public class ProcessData : IProcessData
try
{
records = GetKeyValuePairs(keyValuePairs, keyValuePair.Value, nests);
record = new(keyValuePair.Value, parentWorkItem, records);
record = Record.Get(keyValuePair.Value, parentWorkItem, records);
}
catch (Exception)
{
record = new(keyValuePair.Value, parentWorkItem, new(Array.Empty<Record>()));
record = new(keyValuePair.Value, parentWorkItem, Array.Empty<Record>());
}
results.Add(keyValuePair.Key, record);
}
@ -321,7 +321,7 @@ public class ProcessData : IProcessData
else
_ = keyValuePairs.TryGetValue(w.Parent.Value, out parentWorkItem);
records = GetKeyValuePairs(keyValuePairs, w, nests);
record = new(w, parentWorkItem, records);
record = Record.Get(w, parentWorkItem, records);
results.Add(record);
}
}

View File

@ -80,19 +80,21 @@ public class ProcessData : IProcessData
}
List<char> spaces = new();
List<string> lines = new();
ReadOnlyCollection<WorkItem> results;
ReadOnlyCollection<Record> results;
ReadOnlyDictionary<int, Record> keyValuePairs = GetWorkItems(workItems);
ReadOnlyCollection<Record> records = new(keyValuePairs.Values.ToArray());
ReadOnlyCollection<string> bugFeatureWorkItemTypes = new(new string[] { "Bug", "Feature" });
ReadOnlyCollection<string> bugUserStoryWorkItemTypes = new(new string[] { "Bug", "User Story" });
ReadOnlyCollection<string> bugUserStoryTaskWorkItemTypes = new(new string[] { "Bug", "User Story", "Task" });
WriteWithPartentsFile(fileRead, destinationDirectory, fileInfoCollection, records, "with-parents");
WriteWithPartentsFile(fileRead, destinationDirectory, fileInfoCollection, records, bugFeatureWorkItemTypes, "bugs-features-with-parents");
WriteWithPartentsFile(fileRead, destinationDirectory, fileInfoCollection, records, bugUserStoryWorkItemTypes, "bugs-user-stories-with-parents");
foreach (string workItemType in workItemTypes)
{
lines.Clear();
lines.Add($"# {workItemType}");
lines.Add(string.Empty);
AppendLines(url, spaces, lines, records, workItemType);
results = new(Array.Empty<WorkItem>());
results = new(Array.Empty<Record>());
WriteFiles(fileRead, destinationDirectory, fileInfoCollection, new(lines), results, workItemType);
_Details.Add(results);
}
@ -101,7 +103,7 @@ public class ProcessData : IProcessData
string workItemType = "Feature";
lines.Add($"# {nameof(FeatureCheckIterationPath122508)}");
lines.Add(string.Empty);
results = FeatureCheckIterationPath122508(url, lines, bugUserStoryTaskWorkItemTypes, records, workItemType);
results = FeatureCheckIterationPath122508(url, lines, bugUserStoryTaskWorkItemTypes, keyValuePairs, workItemType);
WriteFiles(fileRead, destinationDirectory, fileInfoCollection, new(lines), results, "check-122508");
_Details.Add(results);
}
@ -110,7 +112,7 @@ public class ProcessData : IProcessData
string workItemType = "Feature";
lines.Add($"# {nameof(FeatureCheckTag122514)}");
lines.Add(string.Empty);
results = FeatureCheckTag122514(url, lines, bugUserStoryWorkItemTypes, records, workItemType);
results = FeatureCheckTag122514(url, lines, bugUserStoryWorkItemTypes, keyValuePairs, workItemType);
WriteFiles(fileRead, destinationDirectory, fileInfoCollection, new(lines), results, "check-122514");
_Details.Add(results);
}
@ -119,7 +121,7 @@ public class ProcessData : IProcessData
string workItemType = "Feature";
lines.Add($"# {nameof(FeatureCheckPriority126169)}");
lines.Add(string.Empty);
results = FeatureCheckPriority126169(url, lines, bugUserStoryWorkItemTypes, records, workItemType);
results = FeatureCheckPriority126169(url, lines, bugUserStoryWorkItemTypes, keyValuePairs, workItemType);
WriteFiles(fileRead, destinationDirectory, fileInfoCollection, new(lines), results, "check-126169");
_Details.Add(results);
}
@ -128,7 +130,7 @@ public class ProcessData : IProcessData
string workItemType = "Feature";
lines.Add($"# {nameof(FeatureCheckState123066)}");
lines.Add(string.Empty);
results = FeatureCheckState123066(url, lines, bugUserStoryTaskWorkItemTypes, records, workItemType);
results = FeatureCheckState123066(url, lines, bugUserStoryTaskWorkItemTypes, keyValuePairs, workItemType);
WriteFiles(fileRead, destinationDirectory, fileInfoCollection, new(lines), results, "check-123066");
_Details.Add(results);
}
@ -137,7 +139,7 @@ public class ProcessData : IProcessData
string workItemType = "Feature";
lines.Add($"# {nameof(FeatureCheckState123067)}");
lines.Add(string.Empty);
results = FeatureCheckState123067(url, lines, bugUserStoryTaskWorkItemTypes, records, workItemType);
results = FeatureCheckState123067(url, lines, bugUserStoryTaskWorkItemTypes, keyValuePairs, workItemType);
WriteFiles(fileRead, destinationDirectory, fileInfoCollection, new(lines), results, "check-123067");
_Details.Add(results);
}
@ -146,13 +148,13 @@ public class ProcessData : IProcessData
string workItemType = "Feature";
lines.Add($"# {nameof(FeatureCheckStart122517)}");
lines.Add(string.Empty);
results = FeatureCheckStart122517(url, lines, bugUserStoryTaskWorkItemTypes, records, workItemType);
results = FeatureCheckStart122517(url, lines, bugUserStoryTaskWorkItemTypes, keyValuePairs, workItemType);
WriteFiles(fileRead, destinationDirectory, fileInfoCollection, new(lines), results, "check-122517");
_Details.Add(results);
}
}
private static void WriteFiles(IFileRead fileRead, string destinationDirectory, List<FileInfo> fileInfoCollection, ReadOnlyCollection<string> lines, ReadOnlyCollection<WorkItem> workItems, string fileName)
private static void WriteFiles(IFileRead fileRead, string destinationDirectory, List<FileInfo> fileInfoCollection, ReadOnlyCollection<string> lines, ReadOnlyCollection<Record> records, string fileName)
{
string markdown = string.Join(Environment.NewLine, lines);
string markdownFile = Path.Combine(destinationDirectory, $"{fileName}.md");
@ -168,7 +170,7 @@ public class ProcessData : IProcessData
File.WriteAllText(htmlFile, html);
if (!fileRead.IsEAFHosted)
fileInfoCollection.Add(new(htmlFile));
string json = JsonSerializer.Serialize(workItems, new JsonSerializerOptions() { WriteIndented = true });
string json = JsonSerializer.Serialize(records, new JsonSerializerOptions() { WriteIndented = true });
string jsonFile = Path.Combine(destinationDirectory, $"{fileName}.json");
string jsonOld = !File.Exists(jsonFile) ? string.Empty : File.ReadAllText(jsonFile);
if (json != jsonOld)
@ -187,10 +189,18 @@ public class ProcessData : IProcessData
return results;
}
private static void WriteWithPartentsFile(IFileRead fileRead, string destinationDirectory, List<FileInfo> fileInfoCollection, ReadOnlyCollection<Record> records, string fileName)
private static void WriteWithPartentsFile(IFileRead fileRead, string destinationDirectory, List<FileInfo> fileInfoCollection, ReadOnlyCollection<Record> records, ReadOnlyCollection<string> workItemTypes, string fileName)
{
Record[] features = (from l in records where l.WorkItem.WorkItemType == "Feature" select l).ToArray();
string json = JsonSerializer.Serialize(features, new JsonSerializerOptions() { WriteIndented = true });
List<Record> filtered = new();
Record record;
foreach (Record r in records)
{
if (r.WorkItem.State == "Removed" || !workItemTypes.Contains(r.WorkItem.WorkItemType))
continue;
record = new(r.WorkItem, r.Parent, Array.Empty<Record>());
filtered.Add(record);
}
string json = JsonSerializer.Serialize(filtered, new JsonSerializerOptions() { WriteIndented = true });
string jsonFile = Path.Combine(destinationDirectory, $"{fileName}.json");
string jsonOld = !File.Exists(jsonFile) ? string.Empty : File.ReadAllText(jsonFile);
if (json != jsonOld)
@ -213,7 +223,7 @@ public class ProcessData : IProcessData
results.Add($"## {record.WorkItem.AssignedTo} - {record.WorkItem.Id} - {record.WorkItem.Title}");
results.Add(string.Empty);
results.Add($"- [{record.WorkItem.Id}]({url}{record.WorkItem.Id})");
if (record.Children.Count == 0)
if (record.Children.Length == 0)
results.Add(string.Empty);
else
{
@ -279,11 +289,11 @@ public class ProcessData : IProcessData
try
{
records = GetKeyValuePairs(keyValuePairs, keyValuePair.Value, nests);
record = new(keyValuePair.Value, parentWorkItem, records);
record = Record.Get(keyValuePair.Value, parentWorkItem, records);
}
catch (Exception)
{
record = new(keyValuePair.Value, parentWorkItem, new(Array.Empty<Record>()));
record = new(keyValuePair.Value, parentWorkItem, Array.Empty<Record>());
}
results.Add(keyValuePair.Key, record);
}
@ -332,7 +342,7 @@ public class ProcessData : IProcessData
else
_ = keyValuePairs.TryGetValue(w.Parent.Value, out parentWorkItem);
records = GetKeyValuePairs(keyValuePairs, w, nests);
record = new(w, parentWorkItem, records);
record = Record.Get(w, parentWorkItem, records);
results.Add(record);
}
}
@ -383,20 +393,20 @@ public class ProcessData : IProcessData
return new(results);
}
private static void FilterChildren(ReadOnlyCollection<string> workItemTypes, Record record, List<WorkItem> results)
private static void FilterChildren(ReadOnlyCollection<string> workItemTypes, Record record, List<Record> results)
{
foreach (Record r in record.Children)
{
if (!workItemTypes.Contains(r.WorkItem.WorkItemType))
continue;
results.Add(r.WorkItem);
results.Add(r);
FilterChildren(workItemTypes, r, results);
}
}
private static ReadOnlyCollection<WorkItem> FilterChildren(ReadOnlyCollection<string> workItemTypes, Record record)
private static ReadOnlyCollection<Record> FilterChildren(ReadOnlyCollection<string> workItemTypes, Record record)
{
List<WorkItem> results = new();
List<Record> results = new();
FilterChildren(workItemTypes, record, results);
return new(results);
}
@ -412,37 +422,39 @@ public class ProcessData : IProcessData
_ => 8
};
private static string? GetMaxIterationPath122508(ReadOnlyCollection<WorkItem> workItems)
private static string? GetMaxIterationPath122508(ReadOnlyCollection<Record> records)
{
string? result;
List<string> results = new();
foreach (WorkItem workItem in workItems)
foreach (Record record in records)
{
if (results.Contains(workItem.IterationPath))
if (results.Contains(record.WorkItem.IterationPath))
continue;
results.Add(workItem.IterationPath);
results.Add(record.WorkItem.IterationPath);
}
result = results.Count == 0 ? null : results.Max();
return result;
}
private static ReadOnlyCollection<WorkItem> FeatureCheckIterationPath122508(string url, List<string> lines, ReadOnlyCollection<string> workItemTypes, ReadOnlyCollection<Record> records, string workItemType)
private static ReadOnlyCollection<Record> FeatureCheckIterationPath122508(string url, List<string> lines, ReadOnlyCollection<string> workItemTypes, ReadOnlyDictionary<int, Record> keyValuePairs, string workItemType)
{
List<WorkItem> results = new();
List<Record> results = new();
Record record;
string? maxIterationPath;
List<string> collection = new();
ReadOnlyCollection<WorkItem> childrenWorkItems;
foreach (Record record in records)
ReadOnlyCollection<Record> records;
foreach (KeyValuePair<int, Record> keyValuePair in keyValuePairs)
{
record = keyValuePair.Value;
if (record.WorkItem.State is "Removed")
continue;
if (record.WorkItem.WorkItemType != workItemType)
continue;
collection.Clear();
if (record.Children.Count == 0)
if (record.Children.Length == 0)
continue;
childrenWorkItems = FilterChildren(workItemTypes, record);
maxIterationPath = GetMaxIterationPath122508(childrenWorkItems);
records = FilterChildren(workItemTypes, record);
maxIterationPath = GetMaxIterationPath122508(records);
if (string.IsNullOrEmpty(maxIterationPath) || record.WorkItem.IterationPath == maxIterationPath)
continue;
collection.Add($"## {record.WorkItem.AssignedTo} - {record.WorkItem.Id} - {record.WorkItem.Title}");
@ -450,137 +462,141 @@ public class ProcessData : IProcessData
collection.Add($"- [ ] [{record.WorkItem.Id}]({url}{record.WorkItem.Id}) => {record.WorkItem.IterationPath} != {maxIterationPath}");
collection.Add(string.Empty);
lines.AddRange(collection);
results.Add(WorkItem.Get(record.WorkItem, $"IterationPath:<a target='_blank' href='{url}{record.WorkItem.Id}'>{record.WorkItem.Id}</a>;{record.WorkItem.IterationPath} != {maxIterationPath}"));
results.Add(WorkItem.Get(record, $"IterationPath:<a target='_blank' href='{url}{record.WorkItem.Id}'>{record.WorkItem.Id}</a>;{record.WorkItem.IterationPath} != {maxIterationPath}"));
}
return new(results);
}
private static ReadOnlyCollection<WorkItem> GetWorkItemsNotMatching122514(Record record, ReadOnlyCollection<WorkItem> workItems)
private static ReadOnlyCollection<Record> GetWorkItemsNotMatching122514(Record record, ReadOnlyCollection<Record> records)
{
List<WorkItem> results = new();
List<Record> results = new();
string[] segments;
string[] parentTags = record.WorkItem.Tags.Split(';').Select(l => l.Trim()).ToArray();
foreach (WorkItem workItem in workItems)
foreach (Record r in records)
{
segments = string.IsNullOrEmpty(workItem.Tags) ? Array.Empty<string>() : workItem.Tags.Split(';').Select(l => l.Trim()).ToArray();
segments = string.IsNullOrEmpty(r.WorkItem.Tags) ? Array.Empty<string>() : r.WorkItem.Tags.Split(';').Select(l => l.Trim()).ToArray();
if (segments.Length > 0 && parentTags.Any(l => segments.Contains(l)))
continue;
results.Add(workItem);
results.Add(r);
}
return new(results);
}
private static ReadOnlyCollection<WorkItem> FeatureCheckTag122514(string url, List<string> lines, ReadOnlyCollection<string> workItemTypes, ReadOnlyCollection<Record> records, string workItemType)
private static ReadOnlyCollection<Record> FeatureCheckTag122514(string url, List<string> lines, ReadOnlyCollection<string> workItemTypes, ReadOnlyDictionary<int, Record> keyValuePairs, string workItemType)
{
List<WorkItem> results = new();
List<Record> results = new();
Record record;
List<string> collection = new();
List<string> violations = new();
ReadOnlyCollection<WorkItem> childrenWorkItems;
ReadOnlyCollection<WorkItem> workItemsNotMatching;
foreach (Record record in records)
ReadOnlyCollection<Record> records;
ReadOnlyCollection<Record> recordsNotMatching;
foreach (KeyValuePair<int, Record> keyValuePair in keyValuePairs)
{
record = keyValuePair.Value;
if (record.WorkItem.State is "Removed")
continue;
if (record.WorkItem.WorkItemType != workItemType)
continue;
collection.Clear();
violations.Clear();
if (record.Children.Count == 0)
if (record.Children.Length == 0)
continue;
if (string.IsNullOrEmpty(record.WorkItem.Tags))
workItemsNotMatching = new(new WorkItem[] { record.WorkItem });
recordsNotMatching = new(new Record[] { record });
else
{
childrenWorkItems = FilterChildren(workItemTypes, record);
workItemsNotMatching = GetWorkItemsNotMatching122514(record, childrenWorkItems);
if (!string.IsNullOrEmpty(record.WorkItem.Tags) && workItemsNotMatching.Count == 0)
records = FilterChildren(workItemTypes, record);
recordsNotMatching = GetWorkItemsNotMatching122514(record, records);
if (!string.IsNullOrEmpty(record.WorkItem.Tags) && recordsNotMatching.Count == 0)
continue;
}
collection.Add($"## {record.WorkItem.AssignedTo} - {record.WorkItem.Id} - {record.WorkItem.Title}");
collection.Add(string.Empty);
foreach (WorkItem workItem in workItemsNotMatching)
collection.Add($"- [ ] [{workItem}]({url}{workItem}) {nameof(record.WorkItem.Tags)} != {record.WorkItem.Tags}");
foreach (Record r in recordsNotMatching)
collection.Add($"- [ ] [{r.WorkItem}]({url}{r.WorkItem}) {nameof(record.WorkItem.Tags)} != {record.WorkItem.Tags}");
collection.Add(string.Empty);
lines.AddRange(collection);
violations.Add($"Tag:{record.WorkItem.Tags};");
foreach (WorkItem workItem in workItemsNotMatching)
violations.Add($"<a target='_blank' href='{url}{workItem.Id}'>{workItem.Id}</a>:{workItem.Tags};");
results.Add(WorkItem.Get(record.WorkItem, string.Join(" ", violations)));
foreach (Record r in recordsNotMatching)
violations.Add($"<a target='_blank' href='{url}{r.WorkItem.Id}'>{r.WorkItem.Id}</a>:{r.WorkItem.Tags};");
results.Add(WorkItem.Get(record, string.Join(" ", violations)));
}
return new(results);
}
private static ReadOnlyCollection<WorkItem> GetWorkItemsNotMatching126169(Record record, ReadOnlyCollection<WorkItem> workItems)
private static ReadOnlyCollection<Record> GetWorkItemsNotMatching126169(Record record, ReadOnlyCollection<Record> records)
{
List<WorkItem> results = new();
foreach (WorkItem workItem in workItems)
List<Record> results = new();
foreach (Record r in records)
{
if (record.WorkItem.Priority is null)
{
results.Add(record.WorkItem);
results.Add(record);
break;
}
if (workItem.Priority == record.WorkItem.Priority.Value)
if (r.WorkItem.Priority == record.WorkItem.Priority.Value)
continue;
results.Add(workItem);
results.Add(r);
}
return new(results);
}
private static ReadOnlyCollection<WorkItem> FeatureCheckPriority126169(string url, List<string> lines, ReadOnlyCollection<string> workItemTypes, ReadOnlyCollection<Record> records, string workItemType)
private static ReadOnlyCollection<Record> FeatureCheckPriority126169(string url, List<string> lines, ReadOnlyCollection<string> workItemTypes, ReadOnlyDictionary<int, Record> keyValuePairs, string workItemType)
{
List<WorkItem> results = new();
List<Record> results = new();
Record record;
List<string> collection = new();
List<string> violations = new();
ReadOnlyCollection<WorkItem> childrenWorkItems;
ReadOnlyCollection<WorkItem> workItemsNotMatching;
foreach (Record record in records)
ReadOnlyCollection<Record> records;
ReadOnlyCollection<Record> recordsNotMatching;
foreach (KeyValuePair<int, Record> keyValuePair in keyValuePairs)
{
record = keyValuePair.Value;
if (record.WorkItem.State is "Removed")
continue;
if (record.WorkItem.WorkItemType != workItemType)
continue;
collection.Clear();
violations.Clear();
if (record.Children.Count == 0)
if (record.Children.Length == 0)
continue;
childrenWorkItems = FilterChildren(workItemTypes, record);
workItemsNotMatching = GetWorkItemsNotMatching126169(record, childrenWorkItems);
if (workItemsNotMatching.Count == 0)
records = FilterChildren(workItemTypes, record);
recordsNotMatching = GetWorkItemsNotMatching126169(record, records);
if (recordsNotMatching.Count == 0)
continue;
collection.Add($"## {record.WorkItem.AssignedTo} - {record.WorkItem.Id} - {record.WorkItem.Title}");
collection.Add(string.Empty);
collection.Add($"- [{record.WorkItem.Id}]({url}{record.WorkItem.Id})");
foreach (WorkItem workItem in workItemsNotMatching)
collection.Add($"- [ ] [{workItem.Id}]({url}{workItem.Id}) {nameof(record.WorkItem.Priority)} != {record.WorkItem.Priority}");
foreach (Record r in recordsNotMatching)
collection.Add($"- [ ] [{r.WorkItem.Id}]({url}{r.WorkItem.Id}) {nameof(record.WorkItem.Priority)} != {record.WorkItem.Priority}");
collection.Add(string.Empty);
lines.AddRange(collection);
violations.Add($"Priority:{record.WorkItem.Priority};");
foreach (WorkItem workItem in workItemsNotMatching)
violations.Add($"<a target='_blank' href='{url}{workItem.Id}'>{workItem.Id}</a>:{workItem.Priority};");
results.Add(WorkItem.Get(record.WorkItem, string.Join(" ", violations)));
foreach (Record r in recordsNotMatching)
violations.Add($"<a target='_blank' href='{url}{r.WorkItem.Id}'>{r.WorkItem.Id}</a>:{r.WorkItem.Priority};");
results.Add(WorkItem.Get(record, string.Join(" ", violations)));
}
return new(results);
}
private static ReadOnlyCollection<WorkItem> GetWorkItemsNotMatching123066(Record record, ReadOnlyCollection<WorkItem> workItems)
private static ReadOnlyCollection<Record> GetWorkItemsNotMatching123066(Record record, ReadOnlyCollection<Record> records)
{
List<WorkItem> results = new();
List<Record> results = new();
int check;
int state = GetState(record.WorkItem);
List<KeyValuePair<int, WorkItem>> collection = new();
foreach (WorkItem workItem in workItems)
List<KeyValuePair<int, Record>> collection = new();
foreach (Record r in records)
{
if (workItem.State is "Removed")
if (r.WorkItem.State is "Removed")
continue;
check = GetState(workItem);
check = GetState(r.WorkItem);
if (check == state)
continue;
collection.Add(new(check, workItem));
collection.Add(new(check, r));
}
if (collection.Count > 0)
{
KeyValuePair<int, WorkItem>[] notNewState = (from l in collection where l.Value.State != "New" select l).ToArray();
KeyValuePair<int, Record>[] notNewState = (from l in collection where l.Value.WorkItem.State != "New" select l).ToArray();
if (notNewState.Length == 0 && record.WorkItem.State is "New" or "Active")
collection.Clear();
else if (notNewState.Length > 0)
@ -594,29 +610,29 @@ public class ProcessData : IProcessData
collection.Clear();
}
}
foreach (KeyValuePair<int, WorkItem> keyValuePair in collection.OrderByDescending(l => l.Key))
foreach (KeyValuePair<int, Record> keyValuePair in collection.OrderByDescending(l => l.Key))
results.Add(keyValuePair.Value);
return new(results);
}
private static ReadOnlyCollection<WorkItem> GetWorkItemsNotMatching123067(Record record, ReadOnlyCollection<WorkItem> workItems)
private static ReadOnlyCollection<Record> GetWorkItemsNotMatching123067(Record record, ReadOnlyCollection<Record> records)
{
List<WorkItem> results = new();
List<Record> results = new();
int check;
int state = GetState(record.WorkItem);
List<KeyValuePair<int, WorkItem>> collection = new();
foreach (WorkItem workItem in workItems)
List<KeyValuePair<int, Record>> collection = new();
foreach (Record r in records)
{
if (workItem.State is "Removed")
if (r.WorkItem.State is "Removed")
continue;
check = GetState(workItem);
check = GetState(r.WorkItem);
if (check == state)
continue;
collection.Add(new(check, workItem));
collection.Add(new(check, r));
}
if (collection.Count > 0)
{
KeyValuePair<int, WorkItem>[] notNewState = (from l in collection where l.Value.State != "New" select l).ToArray();
KeyValuePair<int, Record>[] notNewState = (from l in collection where l.Value.WorkItem.State != "New" select l).ToArray();
if (notNewState.Length == 0 && record.WorkItem.State is "New" or "Active")
collection.Clear();
else if (notNewState.Length > 0)
@ -630,139 +646,145 @@ public class ProcessData : IProcessData
collection.Clear();
}
}
foreach (KeyValuePair<int, WorkItem> keyValuePair in collection.OrderByDescending(l => l.Key))
foreach (KeyValuePair<int, Record> keyValuePair in collection.OrderByDescending(l => l.Key))
results.Add(keyValuePair.Value);
return new(results);
}
private static ReadOnlyCollection<WorkItem> GetWorkItemsNotMatching122517(Record record, ReadOnlyCollection<WorkItem> workItems)
private static ReadOnlyCollection<Record> GetWorkItemsNotMatching122517(Record record, ReadOnlyCollection<Record> records)
{
List<WorkItem> results = new();
List<Record> results = new();
if (record.WorkItem.StartDate is null)
throw new Exception();
DateTime dateTime = record.WorkItem.StartDate.Value;
List<KeyValuePair<long, WorkItem>> collection = new();
foreach (WorkItem workItem in workItems)
List<KeyValuePair<long, Record>> collection = new();
foreach (Record r in records)
{
if (workItem.State is "Removed")
if (r.WorkItem.State is "Removed")
continue;
if (workItem.ActivatedDate is null)
if (r.WorkItem.ActivatedDate is null)
continue;
if (dateTime >= workItem.ActivatedDate.Value)
if (dateTime >= r.WorkItem.ActivatedDate.Value)
continue;
collection.Add(new(workItem.ActivatedDate.Value.Ticks, workItem));
collection.Add(new(r.WorkItem.ActivatedDate.Value.Ticks, r));
}
foreach (KeyValuePair<long, WorkItem> keyValuePair in collection.OrderByDescending(l => l.Key))
foreach (KeyValuePair<long, Record> keyValuePair in collection.OrderBy(l => l.Key))
results.Add(keyValuePair.Value);
return new(results);
}
private static ReadOnlyCollection<WorkItem> FeatureCheckState123066(string url, List<string> lines, ReadOnlyCollection<string> workItemTypes, ReadOnlyCollection<Record> records, string workItemType)
private static ReadOnlyCollection<Record> FeatureCheckState123066(string url, List<string> lines, ReadOnlyCollection<string> workItemTypes, ReadOnlyDictionary<int, Record> keyValuePairs, string workItemType)
{
List<WorkItem> results = new();
List<Record> results = new();
Record record;
List<string> collection = new();
List<string> violations = new();
ReadOnlyCollection<WorkItem> childrenWorkItems;
ReadOnlyCollection<WorkItem> workItemsNotMatching;
foreach (Record record in records)
ReadOnlyCollection<Record> records;
ReadOnlyCollection<Record> recordsNotMatching;
foreach (KeyValuePair<int, Record> keyValuePair in keyValuePairs)
{
record = keyValuePair.Value;
if (record.WorkItem.State is "Removed")
continue;
if (record.WorkItem.WorkItemType != workItemType)
continue;
collection.Clear();
violations.Clear();
if (record.Children.Count == 0)
if (record.Children.Length == 0)
continue;
childrenWorkItems = FilterChildren(workItemTypes, record);
workItemsNotMatching = GetWorkItemsNotMatching123066(record, childrenWorkItems);
if (workItemsNotMatching.Count == 0)
records = FilterChildren(workItemTypes, record);
recordsNotMatching = GetWorkItemsNotMatching123066(record, records);
if (recordsNotMatching.Count == 0)
continue;
collection.Add($"## {record.WorkItem.AssignedTo} - {record.WorkItem.Id} - {record.WorkItem.Title}");
collection.Add(string.Empty);
collection.Add($"- [{record.WorkItem.Id}]({url}{record.WorkItem.Id})");
foreach (WorkItem workItem in workItemsNotMatching)
collection.Add($"- [ ] [{workItem.Id}]({url}{workItem.Id}) {nameof(record.WorkItem.State)} != {record.WorkItem.State}");
foreach (Record r in recordsNotMatching)
collection.Add($"- [ ] [{r.WorkItem.Id}]({url}{r.WorkItem.Id}) {nameof(record.WorkItem.State)} != {record.WorkItem.State}");
collection.Add(string.Empty);
lines.AddRange(collection);
violations.Add($"State:{record.WorkItem.State};");
foreach (WorkItem workItem in workItemsNotMatching)
violations.Add($"<a target='_blank' href='{url}{workItem.Id}'>{workItem.Id}</a>:{workItem.State};");
results.Add(WorkItem.Get(record.WorkItem, string.Join(" ", violations)));
foreach (Record r in recordsNotMatching)
violations.Add($"<a target='_blank' href='{url}{r.WorkItem.Id}'>{r.WorkItem.Id}</a>:{r.WorkItem.State};");
results.Add(WorkItem.Get(record, string.Join(" ", violations)));
}
return new(results);
}
private static ReadOnlyCollection<WorkItem> FeatureCheckState123067(string url, List<string> lines, ReadOnlyCollection<string> workItemTypes, ReadOnlyCollection<Record> records, string workItemType)
private static ReadOnlyCollection<Record> FeatureCheckState123067(string url, List<string> lines, ReadOnlyCollection<string> workItemTypes, ReadOnlyDictionary<int, Record> keyValuePairs, string workItemType)
{
List<WorkItem> results = new();
List<Record> results = new();
Record record;
List<string> collection = new();
List<string> violations = new();
ReadOnlyCollection<WorkItem> childrenWorkItems;
ReadOnlyCollection<WorkItem> workItemsNotMatching;
foreach (Record record in records)
ReadOnlyCollection<Record> records;
ReadOnlyCollection<Record> recordsNotMatching;
foreach (KeyValuePair<int, Record> keyValuePair in keyValuePairs)
{
record = keyValuePair.Value;
if (record.WorkItem.State is "Removed")
continue;
if (record.WorkItem.WorkItemType != workItemType)
continue;
collection.Clear();
violations.Clear();
if (record.Children.Count == 0)
if (record.Children.Length == 0)
continue;
childrenWorkItems = FilterChildren(workItemTypes, record);
workItemsNotMatching = GetWorkItemsNotMatching123067(record, childrenWorkItems);
if (workItemsNotMatching.Count == 0)
records = FilterChildren(workItemTypes, record);
recordsNotMatching = GetWorkItemsNotMatching123067(record, records);
if (recordsNotMatching.Count == 0)
continue;
collection.Add($"## {record.WorkItem.AssignedTo} - {record.WorkItem.Id} - {record.WorkItem.Title}");
collection.Add(string.Empty);
collection.Add($"- [{record.WorkItem.Id}]({url}{record.WorkItem.Id})");
foreach (WorkItem workItem in workItemsNotMatching)
collection.Add($"- [ ] [{workItem.Id}]({url}{workItem.Id}) {nameof(record.WorkItem.State)} != {record.WorkItem.State}");
foreach (Record r in recordsNotMatching)
collection.Add($"- [ ] [{r.WorkItem.Id}]({url}{r.WorkItem.Id}) {nameof(record.WorkItem.State)} != {record.WorkItem.State}");
collection.Add(string.Empty);
lines.AddRange(collection);
violations.Add($"State:{record.WorkItem.State};");
foreach (WorkItem workItem in workItemsNotMatching)
violations.Add($"<a target='_blank' href='{url}{workItem.Id}'>{workItem.Id}</a>:{workItem.State};");
results.Add(WorkItem.Get(record.WorkItem, string.Join(" ", violations)));
foreach (Record r in recordsNotMatching)
violations.Add($"<a target='_blank' href='{url}{r.WorkItem.Id}'>{r.WorkItem.Id}</a>:{r.WorkItem.State};");
results.Add(WorkItem.Get(record, string.Join(" ", violations)));
}
return new(results);
}
private static ReadOnlyCollection<WorkItem> FeatureCheckStart122517(string url, List<string> lines, ReadOnlyCollection<string> workItemTypes, ReadOnlyCollection<Record> records, string workItemType)
private static ReadOnlyCollection<Record> FeatureCheckStart122517(string url, List<string> lines, ReadOnlyCollection<string> workItemTypes, ReadOnlyDictionary<int, Record> keyValuePairs, string workItemType)
{
List<WorkItem> results = new();
List<Record> results = new();
Record record;
List<string> collection = new();
List<string> violations = new();
ReadOnlyCollection<WorkItem> childrenWorkItems;
ReadOnlyCollection<WorkItem> workItemsNotMatching;
foreach (Record record in records)
ReadOnlyCollection<Record> records;
ReadOnlyCollection<Record> recordsNotMatching;
foreach (KeyValuePair<int, Record> keyValuePair in keyValuePairs)
{
record = keyValuePair.Value;
if (record.WorkItem.State is "Removed")
continue;
if (record.WorkItem.WorkItemType != workItemType)
continue;
collection.Clear();
violations.Clear();
if (record.Children.Count == 0)
if (record.Children.Length == 0)
continue;
if (record.WorkItem.StartDate is null)
continue;
childrenWorkItems = FilterChildren(workItemTypes, record);
workItemsNotMatching = GetWorkItemsNotMatching122517(record, childrenWorkItems);
if (workItemsNotMatching.Count == 0)
records = FilterChildren(workItemTypes, record);
recordsNotMatching = GetWorkItemsNotMatching122517(record, records);
if (recordsNotMatching.Count == 0)
continue;
collection.Add($"## {record.WorkItem.AssignedTo} - {record.WorkItem.Id} - {record.WorkItem.Title}");
collection.Add(string.Empty);
collection.Add($"- [{record.WorkItem.Id}]({url}{record.WorkItem.Id})");
foreach (WorkItem workItem in workItemsNotMatching)
collection.Add($"- [ ] [{workItem.Id}]({url}{workItem.Id}) {nameof(record.WorkItem.ActivatedDate)} != {record.WorkItem.ActivatedDate}");
foreach (Record r in recordsNotMatching)
collection.Add($"- [ ] [{r.WorkItem.Id}]({url}{r.WorkItem.Id}) {nameof(record.WorkItem.ActivatedDate)} != {record.WorkItem.ActivatedDate}");
collection.Add(string.Empty);
lines.AddRange(collection);
violations.Add($"StartDate:{record.WorkItem.StartDate};");
foreach (WorkItem workItem in workItemsNotMatching)
violations.Add($"<a target='_blank' href='{url}{workItem.Id}'>{workItem.Id}</a>:{workItem.ActivatedDate};");
results.Add(WorkItem.Get(record.WorkItem, string.Join(" ", violations)));
foreach (Record r in recordsNotMatching)
violations.Add($"<a target='_blank' href='{url}{r.WorkItem.Id}'>{r.WorkItem.Id}</a>:{r.WorkItem.ActivatedDate};");
results.Add(WorkItem.Get(record, string.Join(" ", violations)));
}
return new(results);
}

View File

@ -4,7 +4,7 @@
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width" />
<title>Infineon - 122517 - Children of a Feature should have the same priority</title>
<title>Infineon - 122517 - Feature start date should be min activated date of children</title>
<link href="/styles/bootstrap.min.css?no-cache=2024-10-04-08-34" rel="stylesheet" />
<link href="/igniteui/css/themes/bootstrap3/default/infragistics.theme.css?v=2024-10-07-18-50" rel="stylesheet" />
<link href="/igniteui/css/structure/infragistics.css?v=2024-10-07-18-50" rel="stylesheet" />
@ -27,7 +27,7 @@
<span class="icon-bar"></span>
</button>
<div class="navbar-brand" style="min-width: 20px;">
<span id="siteHeader">&nbsp;</span> - 122517 - Children of a Feature should have the same priority
<span id="siteHeader">&nbsp;</span> - 122517 - Feature start date should be min activated date of children
</div>
</div>
<div class="navbar-collapse collapse">

View File

@ -59,7 +59,7 @@ What is the relative value to the Customer or business?
<script>
$(document).ready(function () {
initIndex("/markdown/with-parents.json?v=2024-10-07-18-50", "https://oi-metrology-viewer-prod.mes.infineon.com:4438/api/v1/ado/", "business", "Value", "Business Value", "/markdown/PI4-Results/business.json?v=2024-10-07-18-50");
initIndex("/markdown/bugs-features-with-parents.json?v=2024-10-07-18-50", "https://oi-metrology-viewer-prod.mes.infineon.com:4438/api/v1/ado/", "business", "Value", "Business Value", "/markdown/PI4-Results/business.json?v=2024-10-07-18-50");
});
</script>

View File

@ -55,7 +55,7 @@
<script>
$(document).ready(function () {
initIndex("/markdown/with-parents.json?v=2024-10-07-18-50", "https://oi-metrology-viewer-prod.mes.infineon.com:4438/api/v1/ado/", "effort", "Effort", "Effort", "/markdown/PI4-Results/effort.json?v=2024-10-07-18-50");
initIndex("/markdown/bugs-features-with-parents.json?v=2024-10-07-18-50", "https://oi-metrology-viewer-prod.mes.infineon.com:4438/api/v1/ado/", "effort", "Effort", "Effort", "/markdown/PI4-Results/effort.json?v=2024-10-07-18-50");
});
</script>

View File

@ -31,12 +31,6 @@
</div>
</div>
<div class="navbar-collapse collapse">
<ul class="nav navbar-nav">
<li><a target="_blank" href="/markdown/Feature.html">Feature(s)</a></li>
<li><a target="_blank" href="/markdown/FeatureCheckTag.html">Tag</a></li>
<li><a target="_blank" href="/markdown/FeatureCheckPriority.html">Priority</a></li>
<li><a target="_blank" href="/markdown/FeatureCheckIterationPath.html">Iteration Path</a></li>
</ul>
<p class="navbar-text navbar-right">
&nbsp;
</p>
@ -59,7 +53,7 @@
<script>
$(document).ready(function () {
initIndex("/json/work-items.json?v=2024-10-07-10-09");
initIndex("/markdown/bugs-features-with-parents.json?v=2024-10-07-10-09");
});
</script>

View File

@ -31,12 +31,6 @@
</div>
</div>
<div class="navbar-collapse collapse">
<ul class="nav navbar-nav">
<li><a target="_blank" href="/markdown/Feature.html">Feature(s)</a></li>
<li><a target="_blank" href="/markdown/FeatureCheckTag.html">Tag</a></li>
<li><a target="_blank" href="/markdown/FeatureCheckPriority.html">Priority</a></li>
<li><a target="_blank" href="/markdown/FeatureCheckIterationPath.html">Iteration Path</a></li>
</ul>
<p class="navbar-text navbar-right">
&nbsp;
</p>
@ -59,7 +53,7 @@
<script>
$(document).ready(function () {
initIndex("/json/work-items.json?v=2024-10-07-10-09");
initIndex("/markdown/bugs-features-with-parents.json?v=2024-10-07-10-09");
});
</script>

View File

@ -59,7 +59,7 @@ What else does this do for our business?
<script>
$(document).ready(function () {
initIndex("/markdown/with-parents.json?v=2024-10-07-18-50", "https://oi-metrology-viewer-prod.mes.infineon.com:4438/api/v1/ado/", "risk", "Risk", "Risk Reduction and/or Opportunity Enablement", "/markdown/PI4-Results/risk.json?v=2024-10-07-18-50");
initIndex("/markdown/bugs-features-with-parents.json?v=2024-10-07-18-50", "https://oi-metrology-viewer-prod.mes.infineon.com:4438/api/v1/ado/", "risk", "Risk", "Risk Reduction and/or Opportunity Enablement", "/markdown/PI4-Results/risk.json?v=2024-10-07-18-50");
});
</script>

View File

@ -60,7 +60,7 @@ How does user/business value decay over time?
<script>
$(document).ready(function () {
initIndex("/markdown/with-parents.json?v=2024-10-07-18-50", "https://oi-metrology-viewer-prod.mes.infineon.com:4438/api/v1/ado/", "time", "Critical", "Time Criticality", "/markdown/PI4-Results/time.json?v=2024-10-07-18-50");
initIndex("/markdown/bugs-features-with-parents.json?v=2024-10-07-18-50", "https://oi-metrology-viewer-prod.mes.infineon.com:4438/api/v1/ado/", "time", "Critical", "Time Criticality", "/markdown/PI4-Results/time.json?v=2024-10-07-18-50");
});
</script>

View File

@ -55,7 +55,7 @@
<script>
$(document).ready(function () {
initIndex("/markdown/with-parents.json?v=2024-10-07-18-50");
initIndex("/markdown/bugs-user-stories-with-parents.json?v=2024-10-07-18-50");
});
</script>

View File

@ -55,7 +55,7 @@
<script>
$(document).ready(function () {
initIndex("/markdown/with-parents.json?v=2024-10-07-18-50", "https://oi-metrology-viewer-prod.mes.infineon.com:4438/api/v1/ado/");
initIndex("/markdown/bugs-features-with-parents.json?v=2024-10-07-18-50", "https://oi-metrology-viewer-prod.mes.infineon.com:4438/api/v1/ado/");
});
</script>

View File

@ -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,15 +77,31 @@ function getPriority(workItemType, priority) {
return result;
}
function getWorkItems(data) {
function getRecords(data) {
var parent;
var workItem;
var workItems = [];
for (var i = data.length - 1; i > -1; i--) {
workItem = data[i];
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 ((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"])
workItems.push(workItem);
@ -108,18 +128,20 @@ function updateSite() {
function initIndex(url) {
updateSite();
$.getJSON(url, { _: new Date().getTime() }, function (data) {
var workItems = getWorkItems(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" },
@ -127,22 +149,24 @@ function initIndex(url) {
{ headerText: "System(s)", key: "Tags", dataType: "string" },
{ key: "Priority", 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: "WeightedShortestJobFirst", dataType: "number", hidden: true },
{ key: "Violation", dataType: "string", hidden: true },
{ key: "WorkItemType", dataType: "string", hidden: true },
],
features: [

View File

@ -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,15 +77,31 @@ function getPriority(workItemType, priority) {
return result;
}
function getWorkItems(data) {
function getRecords(data) {
var parent;
var workItem;
var workItems = [];
for (var i = data.length - 1; i > -1; i--) {
workItem = data[i];
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 ((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"])
workItems.push(workItem);
@ -108,18 +128,20 @@ function updateSite() {
function initIndex(url) {
updateSite();
$.getJSON(url, { _: new Date().getTime() }, function (data) {
var workItems = getWorkItems(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" },
@ -127,22 +149,24 @@ function initIndex(url) {
{ headerText: "System(s)", key: "Tags", dataType: "string" },
{ key: "Priority", 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: "WeightedShortestJobFirst", dataType: "number", hidden: true },
{ key: "Violation", dataType: "string", hidden: true },
{ key: "WorkItemType", dataType: "string", hidden: true },
],
features: [

View File

@ -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,15 +77,31 @@ function getPriority(workItemType, priority) {
return result;
}
function getWorkItems(data) {
function getRecords(data) {
var parent;
var workItem;
var workItems = [];
for (var i = data.length - 1; i > -1; i--) {
workItem = data[i];
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 ((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"])
workItems.push(workItem);
@ -108,18 +128,20 @@ function updateSite() {
function initIndex(url) {
updateSite();
$.getJSON(url, { _: new Date().getTime() }, function (data) {
var workItems = getWorkItems(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" },
@ -127,22 +149,24 @@ function initIndex(url) {
{ headerText: "System(s)", key: "Tags", dataType: "string" },
{ key: "Priority", 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: "WeightedShortestJobFirst", dataType: "number", hidden: true },
{ key: "Violation", dataType: "string", hidden: true },
{ key: "WorkItemType", dataType: "string", hidden: true },
],
features: [

View File

@ -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,15 +77,31 @@ function getPriority(workItemType, priority) {
return result;
}
function getWorkItems(data) {
function getRecords(data) {
var parent;
var workItem;
var workItems = [];
for (var i = data.length - 1; i > -1; i--) {
workItem = data[i];
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 ((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"])
workItems.push(workItem);
@ -108,18 +128,20 @@ function updateSite() {
function initIndex(url) {
updateSite();
$.getJSON(url, { _: new Date().getTime() }, function (data) {
var workItems = getWorkItems(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" },
@ -127,22 +149,24 @@ function initIndex(url) {
{ headerText: "System(s)", key: "Tags", dataType: "string" },
{ key: "Priority", 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: "WeightedShortestJobFirst", dataType: "number", hidden: true },
{ key: "Violation", dataType: "string", hidden: true },
{ key: "WorkItemType", dataType: "string", hidden: true },
],
features: [

View File

@ -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,15 +77,31 @@ function getPriority(workItemType, priority) {
return result;
}
function getWorkItems(data) {
function getRecords(data) {
var parent;
var workItem;
var workItems = [];
for (var i = data.length - 1; i > -1; i--) {
workItem = data[i];
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 ((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"])
workItems.push(workItem);
@ -108,18 +128,20 @@ function updateSite() {
function initIndex(url) {
updateSite();
$.getJSON(url, { _: new Date().getTime() }, function (data) {
var workItems = getWorkItems(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" },
@ -127,22 +149,24 @@ function initIndex(url) {
{ headerText: "System(s)", key: "Tags", dataType: "string" },
{ key: "Priority", 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: "WeightedShortestJobFirst", dataType: "number", hidden: true },
{ key: "Violation", dataType: "string", hidden: true },
{ key: "WorkItemType", dataType: "string", hidden: true },
],
features: [

View File

@ -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,15 +77,31 @@ function getPriority(workItemType, priority) {
return result;
}
function getWorkItems(data) {
function getRecords(data) {
var parent;
var workItem;
var workItems = [];
for (var i = data.length - 1; i > -1; i--) {
workItem = data[i];
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 ((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"])
workItems.push(workItem);
@ -108,18 +128,20 @@ function updateSite() {
function initIndex(url) {
updateSite();
$.getJSON(url, { _: new Date().getTime() }, function (data) {
var workItems = getWorkItems(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" },
@ -127,22 +149,24 @@ function initIndex(url) {
{ headerText: "System(s)", key: "Tags", dataType: "string" },
{ key: "Priority", 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: "WeightedShortestJobFirst", dataType: "number", hidden: true },
{ key: "Violation", dataType: "string", hidden: true },
{ key: "WorkItemType", dataType: "string", hidden: true },
],
features: [

View File

@ -115,7 +115,7 @@ function getWorkItems(data, dataB, description) {
var parent;
var workItem;
var workItems = [];
for (var i = data.length - 1; i > -1; i--) {
for (var i = 0; i < data.length; i++) {
parent = data[i].Parent;
workItem = data[i].WorkItem;
if (workItem.WorkItemType !== 'Feature')

View File

@ -115,7 +115,7 @@ function getWorkItems(data, dataB, description) {
var parent;
var workItem;
var workItems = [];
for (var i = data.length - 1; i > -1; i--) {
for (var i = 0; i < data.length; i++) {
parent = data[i].Parent;
workItem = data[i].WorkItem;
if (workItem.WorkItemType !== 'Feature')

View File

@ -1,12 +1,16 @@
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) {
if (rowData == null)
return;
var data = [];
data.push({ name: "ADO Edit", value: '<a target="_blank" href="https://tfs.intra.infineon.com/tfs/FactoryIntegration/ART%20SPS/_workitems/edit/' + rowData["Id"] + '">' + rowData["Id"] + '</a>' });
data.push({ name: "Edit in ADO", value: '<a target="_blank" href="https://tfs.intra.infineon.com/tfs/FactoryIntegration/ART%20SPS/_workitems/edit/' + rowData["Id"] + '">Edit in ADO ' + rowData["Id"] + '</a>' });
for (const property in rowData) {
if (rowData[property] == null)
continue;
@ -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 getWorkItems(data) {
var workItems = [];
function getRecords(data) {
var parent;
var workItem;
for (var i = data.length - 1; i > -1; i--) {
workItem = data[i];
if (workItem.AreaPath !== 'ART SPS\\LEO')
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 = getWorkItems(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: [

View File

@ -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: [

View File

@ -115,7 +115,7 @@ function getWorkItems(data, dataB, description) {
var parent;
var workItem;
var workItems = [];
for (var i = data.length - 1; i > -1; i--) {
for (var i = 0; i < data.length; i++) {
parent = data[i].Parent;
workItem = data[i].WorkItem;
if (workItem.WorkItemType !== 'Feature')

View File

@ -115,7 +115,7 @@ function getWorkItems(data, dataB, description) {
var parent;
var workItem;
var workItems = [];
for (var i = data.length - 1; i > -1; i--) {
for (var i = 0; i < data.length; i++) {
parent = data[i].Parent;
workItem = data[i].WorkItem;
if (workItem.WorkItemType !== 'Feature')

View File

@ -1,5 +1,5 @@
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;
return b.State[0] - a.State[0] || b.ParentId - a.ParentId || a.Id - b.Id;
}
function showOne(rowData) {
@ -77,13 +77,13 @@ function getWorkItems(data) {
var parent;
var workItem;
var workItems = [];
for (var i = data.length - 1; i > -1; i--) {
for (var i = 0; i < data.length; i++) {
parent = data[i].Parent;
workItem = data[i].WorkItem;
if (workItem.WorkItemType !== 'User Story' && workItem.WorkItemType !== 'Bug')
continue;
if (workItem.Tags != null && workItem.Tags.includes("Ignore"))
continue;
if (workItem.WorkItemType !== 'User Story' && 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 (parent === null) {
@ -143,23 +143,15 @@ function initIndex(url) {
{ headerText: "System(s)", key: "Tags", dataType: "string" },
{ key: "Priority", dataType: "string" },
{ key: "State", dataType: "string" },
{ headerText: "Effort in Days", key: "Effort", dataType: "number" },
{ headerText: "UAT as of", key: "ResolvedDate", dataType: "date", format: "date" },
{ headerText: "CMP Date", key: "ClosedDate", dataType: "date", format: "date" },
{ headerText: "Target", key: "TargetDate", dataType: "date", format: "date" },
{ key: "ParentTitle", dataType: "string", hidden: true },
{ key: "AreaPath", dataType: "string", hidden: true },
{ key: "AssignedTo", dataType: "string", hidden: true },
{ key: "BusinessValue", dataType: "number", hidden: true },
{ key: "ChangedDate", dataType: "string", hidden: true },
{ key: "CommentCount", dataType: "number", hidden: true },
{ key: "CreatedDate", dataType: "string", hidden: true },
{ key: "Description", dataType: "string", hidden: true },
{ key: "IterationPath", dataType: "string", hidden: true },
{ key: "Revision", dataType: "number", hidden: true },
{ key: "RiskReductionMinusOpportunityEnablement", dataType: "string", hidden: true },
{ key: "StartDate", dataType: "string", hidden: true },
{ key: "WeightedShortestJobFirst", dataType: "number", hidden: true },
{ key: "WorkItemType", dataType: "string", hidden: true },
],
features: [

View File

@ -79,7 +79,7 @@ function getWorkItems(data) {
var parent;
var workItem;
var workItems = [];
for (var i = data.length - 1; i > -1; i--) {
for (var i = 0; i < data.length; i++) {
parent = data[i].Parent;
workItem = data[i].WorkItem;
if (workItem.WorkItemType !== 'Feature')

View File

@ -1,4 +1,6 @@
using System.Collections.ObjectModel;
using System.Linq;
using System.Text.Json.Serialization;
namespace Adaptation.FileHandlers.json.WorkItems;
@ -7,7 +9,8 @@ public class Record
#nullable enable
public Record(WorkItem workItem, WorkItem? parent, ReadOnlyCollection<Record> children)
[JsonConstructor]
public Record(WorkItem workItem, WorkItem? parent, Record[] children)
{
WorkItem = workItem;
Parent = parent;
@ -16,6 +19,9 @@ public class Record
public WorkItem WorkItem { get; set; }
public WorkItem? Parent { get; set; }
public ReadOnlyCollection<Record> Children { get; set; }
public Record[] Children { get; set; }
public static Record Get(WorkItem workItem, WorkItem? parent, ReadOnlyCollection<Record> children) =>
new(workItem, parent, children.ToArray());
}

View File

@ -70,36 +70,38 @@ public class WorkItem
public override string ToString() => $"{Id} - {WorkItemType} - {Title}";
public static WorkItem Get(WorkItem workItem, string? violation)
public static Record Get(Record record, string? violation)
{
WorkItem result = new(workItem.ActivatedDate,
workItem.AreaPath,
workItem.AssignedTo,
workItem.BusinessValue,
workItem.ChangedDate,
workItem.ClosedDate,
workItem.CommentCount,
workItem.CreatedDate,
workItem.Description,
workItem.Effort,
workItem.Id,
workItem.IterationPath,
workItem.Parent,
workItem.Priority,
workItem.Relations,
workItem.Requester,
workItem.ResolvedDate,
workItem.Revision,
workItem.RiskReductionMinusOpportunityEnablement,
workItem.StartDate,
workItem.State,
workItem.Tags,
workItem.TargetDate,
workItem.TimeCriticality,
workItem.Title,
workItem.Violation is null ? violation : workItem.Violation,
workItem.WeightedShortestJobFirst,
workItem.WorkItemType);
Record result;
WorkItem workItem = new(record.WorkItem.ActivatedDate,
record.WorkItem.AreaPath,
record.WorkItem.AssignedTo,
record.WorkItem.BusinessValue,
record.WorkItem.ChangedDate,
record.WorkItem.ClosedDate,
record.WorkItem.CommentCount,
record.WorkItem.CreatedDate,
record.WorkItem.Description,
record.WorkItem.Effort,
record.WorkItem.Id,
record.WorkItem.IterationPath,
record.WorkItem.Parent,
record.WorkItem.Priority,
record.WorkItem.Relations,
record.WorkItem.Requester,
record.WorkItem.ResolvedDate,
record.WorkItem.Revision,
record.WorkItem.RiskReductionMinusOpportunityEnablement,
record.WorkItem.StartDate,
record.WorkItem.State,
record.WorkItem.Tags,
record.WorkItem.TargetDate,
record.WorkItem.TimeCriticality,
record.WorkItem.Title,
record.WorkItem.Violation is null ? violation : record.WorkItem.Violation,
record.WorkItem.WeightedShortestJobFirst,
record.WorkItem.WorkItemType);
result = new(workItem, record.Parent, Array.Empty<Record>());
return result;
}

View File

@ -76,60 +76,60 @@ public class MESAFIBACKLOG
return new(results);
}
private static ReadOnlyCollection<WorkItem> GetWorkItems(FileInfo fileInfo)
private static ReadOnlyCollection<Record> GetRecords(FileInfo fileInfo)
{
WorkItem[] results;
Record[] results;
string json = File.ReadAllText(fileInfo.FullName);
results = JsonSerializer.Deserialize<WorkItem[]>(json);
results = JsonSerializer.Deserialize<Record[]>(json);
return new(results);
}
private static void Verify122508(FileInfo fileInfo)
{
ReadOnlyCollection<WorkItem> workItems = GetWorkItems(fileInfo);
Assert.IsNotNull(workItems);
// Assert.IsTrue(workItems.Count == 10);
// Assert.IsTrue(workItems.Count == 6);
ReadOnlyCollection<Record> records = GetRecords(fileInfo);
Assert.IsNotNull(records);
// Assert.IsTrue(records.Count == 10);
// Assert.IsTrue(records.Count == 6);
}
private static void Verify122514(FileInfo fileInfo)
{
ReadOnlyCollection<WorkItem> workItems = GetWorkItems(fileInfo);
Assert.IsNotNull(workItems);
// Assert.IsTrue(workItems.Count == 25);
// Assert.IsTrue(workItems.Count == 6);
ReadOnlyCollection<Record> records = GetRecords(fileInfo);
Assert.IsNotNull(records);
// Assert.IsTrue(records.Count == 25);
// Assert.IsTrue(records.Count == 6);
}
private static void Verify126169(FileInfo fileInfo)
{
ReadOnlyCollection<WorkItem> workItems = GetWorkItems(fileInfo);
Assert.IsNotNull(workItems);
// Assert.IsTrue(workItems.Count == 1);
// Assert.IsTrue(workItems.Count == 1);
ReadOnlyCollection<Record> records = GetRecords(fileInfo);
Assert.IsNotNull(records);
// Assert.IsTrue(records.Count == 1);
// Assert.IsTrue(records.Count == 1);
}
private static void Verify123066(FileInfo fileInfo)
{
ReadOnlyCollection<WorkItem> workItems = GetWorkItems(fileInfo);
Assert.IsNotNull(workItems);
// Assert.IsTrue(workItems.Count == 24);
// Assert.IsTrue(workItems.Count == 5);
ReadOnlyCollection<Record> records = GetRecords(fileInfo);
Assert.IsNotNull(records);
// Assert.IsTrue(records.Count == 24);
// Assert.IsTrue(records.Count == 5);
}
private static void Verify123067(FileInfo fileInfo)
{
ReadOnlyCollection<WorkItem> workItems = GetWorkItems(fileInfo);
Assert.IsNotNull(workItems);
// Assert.IsTrue(workItems.Count == 24);
// Assert.IsTrue(workItems.Count == 5);
ReadOnlyCollection<Record> records = GetRecords(fileInfo);
Assert.IsNotNull(records);
// Assert.IsTrue(records.Count == 24);
// Assert.IsTrue(records.Count == 5);
}
private static void Verify122517(FileInfo fileInfo)
{
ReadOnlyCollection<WorkItem> workItems = GetWorkItems(fileInfo);
Assert.IsNotNull(workItems);
// Assert.IsTrue(workItems.Count == 14);
// Assert.IsTrue(workItems.Count == 14);
ReadOnlyCollection<Record> records = GetRecords(fileInfo);
Assert.IsNotNull(records);
// Assert.IsTrue(records.Count == 14);
// Assert.IsTrue(records.Count == 14);
}
#if DEBUG