Improve styling and remove testing code

This commit is contained in:
James Skemp 2024-04-14 12:33:38 -05:00
parent bcc1fc450c
commit 2aa72cc194
7 changed files with 20 additions and 27 deletions

View File

@ -2,7 +2,7 @@
"manifestVersion": 1,
"id": "enhanced-sprint-history",
"publisher": "JamesSkemp",
"version": "0.0.95",
"version": "0.0.99",
"name": "Enhanced Sprint History",
"description": "Azure DevOps Extension",
"categories": [
@ -30,12 +30,12 @@
},
"links": {
"learn": {
"uri": "https://git.ebacher-skemp.com/strivinglife/enhanced-sprint-history"
"uri": "https://git.ebacher-skemp.com/azure-devops/enhanced-sprint-history"
}
},
"repository": {
"type": "git",
"uri": "https://git.ebacher-skemp.com/strivinglife/enhanced-sprint-history"
"uri": "https://git.ebacher-skemp.com/azure-devops/enhanced-sprint-history"
},
"files": [
{

View File

@ -1 +1 @@
Enhanced Sprint History supports viewing a sprint iteration over time.
Enhanced Sprint History supports viewing changes to user stories in an iteration over time.

View File

@ -14,7 +14,7 @@
},
"repository": {
"type": "git",
"url": "https://git.ebacher-skemp.com/strivinglife/enhanced-sprint-history.git"
"url": "https://git.ebacher-skemp.com/azure-devops/enhanced-sprint-history.git"
},
"keywords": [
"extensions",

View File

@ -8,6 +8,10 @@ h3 {
margin-top: 0;
}
.current-iteration, .current-state {
padding-left: 1em;
}
.enhanced-sprint-history {
font-size: $fontSizeM;
padding: 0 1em;

View File

@ -124,7 +124,8 @@ class HubContent extends React.Component<{}, IHubContentState> {
return (
<div>
<a href={workItem.url} target="_blank">{workItem.id}</a> : {workItem.title} ({workItem.storyPoints})
<br />Current Iteration: {workItem.iterationPath}
<div className="current-iteration">Current Iteration: {workItem.iterationPath}</div>
<div className="current-state">{workItem.state}</div>
</div>
)
});
@ -163,13 +164,14 @@ class HubContent extends React.Component<{}, IHubContentState> {
dismissOnSelect={true}
/>
<h2>Sprint History for {this.state.selectedTeamName} : {this.state.selectedTeamIterationName}</h2>
<h2>Iteration History for {this.state.selectedTeamName} : {this.state.selectedTeamIterationName}</h2>
{sprintDatesHeading(this.state.selectedTeamIteration)}
<h4>User Stories</h4>
<p>These stories are or have been in this iteration.</p>
{displayUserStories(this.state.workItems)}
<h4>User Story History</h4>
<h4>Iteration User Story History</h4>
<IterationHistoryDisplay iteration={this.state.selectedTeamIteration} workItemHistory={this.state.workItemsHistory} />
</Page>
);

View File

@ -1,3 +1,7 @@
table {
margin-bottom: 2em;
}
th, td {
padding: .25em .5em;
}

View File

@ -25,13 +25,9 @@ export class IterationHistoryDisplay extends React.Component<IterationHistoryDis
public render(): JSX.Element {
const selectedIterationPath = this.props.iteration ? this.props.iteration.path : undefined;
const asdf: IHubWorkItemIterationRevisions[] = this.props.workItemHistory.map(wiHistory => {
const iterationWorkItemRevisions: IHubWorkItemIterationRevisions[] = this.props.workItemHistory.map(wiHistory => {
const typedWorkItems: ITypedWorkItem[] = wiHistory.revisions.map(workItem => getTypedWorkItem(workItem));
console.log(wiHistory);
console.log(`Typed Work Items for ${wiHistory.id}:`);
console.table(typedWorkItems);
const firstRevision = selectedIterationPath ? typedWorkItems.find(wi => wi.iterationPath === selectedIterationPath) : undefined;
return {
@ -43,10 +39,6 @@ export class IterationHistoryDisplay extends React.Component<IterationHistoryDis
});
function getChangedWorkItems(workItems: ITypedWorkItem[]): ITypedWorkItem[] {
// TODO this isn't working as expected ... excluding revisions that it shouldn't be, needs to look at previous change to see if it should be added instead
// TODO fixed?
console.log('uh oh');
console.table(workItems);
return workItems
.filter((wi, i, array) => {
if (i === 0) {
@ -59,9 +51,6 @@ export class IterationHistoryDisplay extends React.Component<IterationHistoryDis
return false;
})
.sort((a, b) => a.changedDateFull === b.changedDateFull ? 0 : a.changedDateFull > b.changedDateFull ? 1 : -1);
/*return workItems
.filter((wi, i, arr) => i === arr.findIndex((twi) => wi.iterationPath === twi.iterationPath && isWorkItemClosed(wi) === isWorkItemClosed(twi) && wi.storyPoints === twi.storyPoints && wi.id === twi.id))
.sort((a, b) => a.changedDateFull === b.changedDateFull ? 0 : a.changedDateFull > b.changedDateFull ? 1 : -1);*/
}
function getWorkItemChange(workItem: ITypedWorkItem, currentIndex: number, allWorkItems: ITypedWorkItem[]): ITypedWorkItemWithRevision {
@ -100,12 +89,6 @@ export class IterationHistoryDisplay extends React.Component<IterationHistoryDis
returnData.change = 'Story Points Changed';
return returnData;
}
console.groupCollapsed(currentIndex);
console.log(previousWorkItemRevisions);
console.log(workItem);
console.log(currentIndex);
console.log(allWorkItems);
console.groupEnd();
returnData.change = 'unknown';
return returnData;
}
@ -131,7 +114,7 @@ export class IterationHistoryDisplay extends React.Component<IterationHistoryDis
</thead>
<tbody>
{
getChangedWorkItems(getFlattenedRelevantRevisions(asdf)).map((wi, i, a) => {
getChangedWorkItems(getFlattenedRelevantRevisions(iterationWorkItemRevisions)).map((wi, i, a) => {
const workItemChange = getWorkItemChange(wi, i, a);
const storyClosed = isWorkItemClosed(wi);
let addedStoryPoints = 0;