Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 16 additions & 2 deletions src/pcards.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import Q = require("q");
const userStoryTemplate = require("./templates/user-story.handlebars");
const bugTemplate = require("./templates/bug.handlebars");
const taskTemplate = require("./templates/task.handlebars");
const techDebtTemplate = require("./templates/tech-debt.handlebars");

const extensionContext = VSS.getExtensionContext();
const client = WITClient.getClient();
Expand Down Expand Up @@ -52,6 +53,7 @@ const printWorkItems = {
let bugCard: any;
let userStoryCard: any;
let taskCard: any;
let techDebtCard: any;

if (page.type === "Bug") {
bugCard = bugTemplate({
Expand Down Expand Up @@ -79,6 +81,15 @@ const printWorkItems = {
});
}

if (page.type === "Technical Debt") {
techDebtCard = techDebtTemplate({
number: page.id,
title: page.title,
description: page.description,
acceptance_criteria: page.acceptance_criteria
});
}

if (page.type === "Bug") {
workItems.innerHTML += bugCard;
}
Expand All @@ -88,8 +99,11 @@ const printWorkItems = {
if (page.type === "Task") {
workItems.innerHTML += taskCard;
}
if (page.type !== "User Story" && page.type !== "Bug" && page.type !== "Task") {
workItems.innerHTML += "<div class='container'>Work item type not supported. Submit pull requests here: https://github.com/ryanjones/pcards</div>";
if (page.type === "Technical Debt") {
workItems.innerHTML += techDebtCard;
}
if (page.type !== "User Story" && page.type !== "Bug" && page.type !== "Task" && page.type !== "Technical Debt") {
workItems.innerHTML += `<div class='container'>Work item type (${page.type}) not supported. Submit pull requests here: https://github.com/ryanjones/pcards</div>`;
}
});
document.body.appendChild(workItems);
Expand Down
43 changes: 43 additions & 0 deletions src/templates/tech-debt.handlebars
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
<div class="container border-purple">
<div class="title-and-estimate-container">
<div class="title-container">
<div class="title-text">
<strong>Title:&nbsp;</strong>{{title}}
</div>
</div>
<div class="estimate-container border-purple"></div>
</div>
<div class="userstory-and-discipline-container">
<div class="user-story">
<strong>Description:</strong><br/>
{{{description}}}
</div>
<div class="discipline-container">
<div class="discipline">
<div class="description">Dev</div>
<div class="box border-purple"></div>
</div>
<div class="discipline">
<div class="description">UX</div>
<div class="box border-purple"></div>
</div>
</div>
</div>
<div class="po-vsts-container">
<div class="po">
<strong>Product Owner:</strong>
</div>
<div class="vsts-number">
<strong>{{number}}</strong>
</div>
</div>

<hr/>

<div class="acceptance-criteria-container">
<div class="acceptance-criteria">
<strong>Acceptance Criteria:</strong><br/>
{{{acceptance_criteria}}}
</div>
</div>
</div>
4 changes: 4 additions & 0 deletions static/pcards.html
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@
.border-blue {
border: 4px solid #009ccc;
}

.border-purple {
border: 4px solid #6900cc;
}

.container {
width: 620px;
Expand Down