Add temporary debugging logic to track down issue
This commit is contained in:
parent
2aa72cc194
commit
796ff548f9
|
@ -2,7 +2,7 @@
|
|||
"manifestVersion": 1,
|
||||
"id": "enhanced-sprint-history",
|
||||
"publisher": "JamesSkemp",
|
||||
"version": "0.0.99",
|
||||
"version": "0.0.103",
|
||||
"name": "Enhanced Sprint History",
|
||||
"description": "Azure DevOps Extension",
|
||||
"categories": [
|
||||
|
|
|
@ -21,7 +21,38 @@ export function getIterationRelevantWorkItems(typedWorkItems: ITypedWorkItem[],
|
|||
return [];
|
||||
}
|
||||
|
||||
return typedWorkItems.filter(wi => wi.revision >= firstRevision.revision);
|
||||
let typedWorkItemsRelevantToIteration = typedWorkItems.filter(wi => wi.revision >= firstRevision.revision);
|
||||
if (typedWorkItemsRelevantToIteration.find(wi => wi.iterationPath !== iterationPath)) {
|
||||
// Wasn't in the iteration at least once after it was.
|
||||
const typedWorkItemLastTimeInIteration = typedWorkItemsRelevantToIteration.sort((a, b) => a.revision === b.revision ? 0 : a.revision < b.revision ? 1 : -1).find(wi => wi.iterationPath === iterationPath);
|
||||
if (typedWorkItemLastTimeInIteration) {
|
||||
console.log(typedWorkItemLastTimeInIteration);
|
||||
const indexWhenLastInIteration = typedWorkItemsRelevantToIteration.indexOf(typedWorkItemLastTimeInIteration);
|
||||
console.log(indexWhenLastInIteration);
|
||||
if (indexWhenLastInIteration !== 0) {
|
||||
console.log(typedWorkItemsRelevantToIteration[indexWhenLastInIteration].revision);
|
||||
console.log(typedWorkItemsRelevantToIteration[indexWhenLastInIteration - 1].revision);
|
||||
typedWorkItemsRelevantToIteration = typedWorkItemsRelevantToIteration.filter(wi => wi.revision <= typedWorkItemsRelevantToIteration[indexWhenLastInIteration - 1].revision);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (typedWorkItemsRelevantToIteration.sort((a, b) => a.revision === b.revision ? 0 : a.revision < b.revision ? 1 : -1)[0].iterationPath)
|
||||
//typedWorkItemsRelevantToIteration.lastIndexOf()
|
||||
console.groupCollapsed(typedWorkItems[0].id);
|
||||
console.table(typedWorkItems);
|
||||
console.table(typedWorkItemsRelevantToIteration);
|
||||
/*console.groupCollapsed('first ');
|
||||
// newest (highest revision) first
|
||||
console.table(typedWorkItemsRelevantToIteration.sort((a, b) => a.revision === b.revision ? 0 : a.revision < b.revision ? 1 : -1));
|
||||
console.groupEnd();
|
||||
console.groupCollapsed('second');
|
||||
// oldest (lowest revision) first
|
||||
console.table(typedWorkItemsRelevantToIteration.sort((a, b) => a.revision === b.revision ? 0 : a.revision < b.revision ? -1 : 1));
|
||||
console.groupEnd();*/
|
||||
console.groupEnd();
|
||||
|
||||
return typedWorkItemsRelevantToIteration;
|
||||
}
|
||||
|
||||
export function getFlattenedRelevantRevisions(workItemHistory: IHubWorkItemIterationRevisions[]): ITypedWorkItem[] {
|
||||
|
|
|
@ -39,6 +39,7 @@ export class IterationHistoryDisplay extends React.Component<IterationHistoryDis
|
|||
});
|
||||
|
||||
function getChangedWorkItems(workItems: ITypedWorkItem[]): ITypedWorkItem[] {
|
||||
console.table(workItems);
|
||||
return workItems
|
||||
.filter((wi, i, array) => {
|
||||
if (i === 0) {
|
||||
|
@ -148,7 +149,7 @@ export class IterationHistoryDisplay extends React.Component<IterationHistoryDis
|
|||
<td>{wi.changedDateFull.toLocaleString()}</td>
|
||||
<td><a href={wi.url} target="_blank" title={wi.title}>{wi.id}</a><br />{wi.title}</td>
|
||||
<td>{workItemChange.change}</td>
|
||||
<td className="story-points increase">{addedStoryPoints !== 0 || workItemChange.change === 'Story Points Changed' ? addedStoryPoints : ''}</td>
|
||||
<td className="story-points increase">{addedStoryPoints !== 0 || workItemChange.change === 'Story Points Changed' || workItemChange.change === 'Added' || workItemChange.change === 'Reopened' ? addedStoryPoints : ''}</td>
|
||||
<td className="story-points decrease">{subtractedStoryPoints !== 0 || workItemChange.change === 'Story Points Changed' || storyClosed || workItemChange.change === 'Removed' ? subtractedStoryPoints : ''}</td>
|
||||
<td className={totalStoryPointsClass}>{totalStoryPoints} {String.fromCharCode(changeCharacterCode)}</td>
|
||||
</tr>
|
||||
|
|
Loading…
Reference in New Issue