Fix handling of story points after stories are closed
This commit is contained in:
parent
796ff548f9
commit
7f29e76499
|
@ -2,7 +2,7 @@
|
|||
"manifestVersion": 1,
|
||||
"id": "enhanced-sprint-history",
|
||||
"publisher": "JamesSkemp",
|
||||
"version": "0.0.103",
|
||||
"version": "0.0.106",
|
||||
"name": "Enhanced Sprint History",
|
||||
"description": "Azure DevOps Extension",
|
||||
"categories": [
|
||||
|
|
|
@ -26,32 +26,13 @@ export function getIterationRelevantWorkItems(typedWorkItems: ITypedWorkItem[],
|
|||
// 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;
|
||||
}
|
||||
|
||||
|
|
|
@ -39,14 +39,13 @@ export class IterationHistoryDisplay extends React.Component<IterationHistoryDis
|
|||
});
|
||||
|
||||
function getChangedWorkItems(workItems: ITypedWorkItem[]): ITypedWorkItem[] {
|
||||
console.table(workItems);
|
||||
return workItems
|
||||
.filter((wi, i, array) => {
|
||||
if (i === 0) {
|
||||
return true;
|
||||
}
|
||||
const previousItem = array[i-1];
|
||||
if (wi.id !== previousItem.id || isWorkItemClosed(wi) !== isWorkItemClosed(previousItem) || wi.storyPoints !== previousItem.storyPoints) {
|
||||
if (wi.id !== previousItem.id || isWorkItemClosed(wi) !== isWorkItemClosed(previousItem) || (wi.storyPoints !== previousItem.storyPoints && !isWorkItemClosed(wi)) || wi.iterationPath !== previousItem.iterationPath) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
|
Loading…
Reference in New Issue