forked from RallyApps/app-catalog
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ReleaseTraceability.html
284 lines (254 loc) · 10.4 KB
/
ReleaseTraceability.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
<!DOCTYPE html>
<html>
<head>
<title>Release Traceability</title>
<meta name="Name" content="Mashup: Release Traceability"/>
<meta name="Version" content="2.0"/>
<meta name="Vendor" content="Rally Software"/>
<link rel="stylesheet" type="text/css" href="/slm/css/rally/core.css" charset="utf-8"/>
<link rel="stylesheet" type="text/css" href="/slm/css/slm.css" charset="utf-8"/>
<link rel="stylesheet" type="text/css" href="/slm/css/slm.css" charset="utf-8"/>
<style type="text/css">
.heading {
font-weight: bold;
font-size: 14px;
border: 0px;
padding-bottom: 5px;
}
#lastMod table {
border: none;
border-top: 1px solid #888;
empty-cells: show;
}
#lastMod table td, #lastMod table th{
border: 1px inset #888;
}
td {
background: #ffffff;
font-family: tahoma, geneva, helvetica, arial, sans-serif;
font-size: 11px;
}
th {
background: #e4ecee;
font-family: tahoma, geneva, helvetica, arial, sans-serif;
font-size: 11px;
}
.not-blocked {
}
.blocked {
background: transparent url(/slm/js/rally/resources/images/blocked.png) no-repeat scroll center right;
}
</style>
<script type="text/javascript" src="/slm/js-lib/dojo/1.3.1/dojo/dojo.js"></script>
<script type="text/javascript" src="/slm/js/slm.js"></script>
<script type="text/javascript" src="/slm/mashup/1.15/js/batch-toolkit.js"></script>
<script type="text/javascript" src="/slm/mashup/1.15/js/utilities.js"></script>
<script type="text/javascript" src="/slm/mashup/1.15/js/dropdown.js"></script>
<script>
dojo.addOnLoad(initPage);
var batchToolkit, timeboxDropdown;
batchToolkit = new RALLY.Mashup.BatchToolkit('__WORKSPACE_OID__', '__PROJECT_OID__', '__PROJECT_SCOPING_UP__', '__PROJECT_SCOPING_DOWN__');
function add2log(msg) {
document.getElementById("logdiv").innerHTML += "<br/>" + msg;
}
// builds a URL ink to the detail page of a defect, user story or defect suite
// expects a workProduct object that includes a Type and ObjectID attributes
function buildArtifactLink(serverURL, workProduct, linktext) {
var link = '';
var prefix = '';
switch (workProduct._type) {
case 'Defect':
prefix = 'df';
break;
case 'HierarchicalRequirement':
prefix = 'ar';
break;
case 'Task':
prefix = 'tk';
break;
case 'TestCase':
prefix = 'tc';
break;
}
if (workProduct.ObjectID !== 0) {
link = "<a href=" + serverURL + "\/detail/" + prefix + "/" +
workProduct.ObjectID + "\ target=\'_blank\'>";
}
link += linktext + "<\/a>";
return link;
}
function startTable() {
var emptyDiv = "<div style='width:0px;'></div>";
var tblhtml = "<table width=100%><tr>";
tblhtml += "<th width=34% class='taskh'>Task ID - Name<\/th><th width=50 class='taskh'>State<\/th><th width=50>"+emptyDiv+"<\/th>";
tblhtml += "<th width=33% class='defecth'>Defect ID - Name<\/th><th width=50 class='defecth'>State<\/th><th width=50>"+emptyDiv+"<\/th>";
tblhtml += "<th width=33% class='testh'>Test ID - Name<\/th><th width=50 class='testh'>State<\/th>";
tblhtml += "<\/tr>";
return tblhtml;
}
function drawTable(tblhtml, tablediv) {
tblhtml += "<\/table><br/>";
document.getElementById(tablediv).innerHTML = tblhtml;
}
function addRow(story, rowcount) {
var tlink, color;
var idname = " ";
var state = " ";
var tblhtml = "<tr>";
var emptytd = "<td><div style='width:0px;'></div><\/td>";
var emptyrow = emptytd + emptytd + emptytd;
var txtred = "#ef3f35";
var txtgreen = "#3a874f";
var txtblack = "#000000";
if (story.Tasks[rowcount] !== undefined) {
idname = story.Tasks[rowcount].FormattedID + " - " + story.Tasks[rowcount].Name;
tlink = buildArtifactLink("__SERVER_URL__", story.Tasks[rowcount], idname);
var dclass = "not-blocked";
if (story.Tasks[rowcount].Blocked === true) {
dclass = "blocked";
}
tblhtml += "<td class='" + dclass + "'>" + tlink + "<\/td>";
state = story.Tasks[rowcount].State;
tblhtml += "<td><font bold>" + state + "<\/font><\/td>";
tblhtml += emptytd;
}
else {
tblhtml += emptyrow;
}
if (story.Defects[rowcount] !== undefined) {
idname = story.Defects[rowcount].FormattedID + " - " + story.Defects[rowcount].Name;
tlink = buildArtifactLink("__SERVER_URL__", story.Defects[rowcount], idname);
var dclass = "not-blocked";
if (story.Defects[rowcount].Blocked === true) {
dclass = "blocked";
}
tblhtml += "<td class='" + dclass + "' >" + tlink + "<\/td>";
state = story.Defects[rowcount].State;
color = txtblack;
if (state === "Open") {
color = txtred;
}
if (state === "Closed") {
color = txtgreen;
}
tblhtml += "<td><font color='" + color + "' >" + state + "<\/font><\/td>";
tblhtml += emptytd;
}
else {
tblhtml += emptyrow;
}
if (story.TestCases[rowcount] !== undefined) {
idname = story.TestCases[rowcount].FormattedID + " - " + story.TestCases[rowcount].Name;
tlink = buildArtifactLink("__SERVER_URL__", story.TestCases[rowcount], idname);
tblhtml += "<td>" + tlink + "<\/td>";
state = story.TestCases[rowcount].LastVerdict || " ";
color = txtblack;
if (story.TestCases[rowcount].LastVerdict === "Pass") {
color = txtgreen;
}
if (story.TestCases[rowcount].LastVerdict === "Fail") {
color = txtred;
}
tblhtml += "<td><font color='" + color + "' >" + state + "<\/font><\/td>";
}
else {
tblhtml += emptytd + emptytd;
}
tblhtml += "<\/tr>";
return tblhtml;
}
function parseResults(results) {
RALLY.Mashup.Utilities.hideWait("spinner", "lastMod");
var storyID, linkname, i;
var temphtml = "";
for (i = 0; i < results.stories.length; i++) {
storyID = results.stories[i].FormattedID;
temphtml += "<div class='heading'>";
linkname = storyID + " " + results.stories[i].Name;
temphtml += buildArtifactLink("__SERVER_URL__", results.stories[i], linkname);
var planest = results.stories[i].PlanEstimate || " ";
temphtml += " - ( Plan Estimate:" + planest + " )";
temphtml += " - " + results.stories[i].ScheduleState;
temphtml += "<br/><\/div>";
temphtml += '<div id="' + storyID + '_div"><\/div><br/>';
}
document.getElementById("lastMod").innerHTML = temphtml;
for (i = 0; i < results.stories.length; i++) {
storyID = results.stories[i].FormattedID;
var templength = 0;
if (results.stories[i].Tasks !== undefined) {
templength = results.stories[i].Tasks.length;
}
if (results.stories[i].Defects !== undefined) {
if (templength < results.stories[i].Defects.length) {
templength = results.stories[i].Defects.length;
}
}
if (results.stories[i].TestCases !== undefined) {
if (templength < results.stories[i].TestCases.length) {
templength = results.stories[i].TestCases.length;
}
}
if (templength < 1) {
var nochildren = "No Children Artifacts";
document.getElementById(storyID + '_div').innerHTML = nochildren;
continue;
}
var tblhtml = startTable();
var rowcount = 0;
for (var j = 0; j < templength; j++) {
tblhtml += addRow(results.stories[i], rowcount);
rowcount = rowcount + 1;
}
drawTable(tblhtml, storyID + '_div');
}
}
function runMainQuery() {
document.getElementById("lastMod").innerHTML = "";
if (timeboxDropdown.getSelectedName() !== null) {
RALLY.Mashup.Utilities.showWait("spinner", "lastMod");
}
var storyquery = {
key:"stories",
type: "hierarchicalrequirement",
fetch: "Type,FormattedID,Name,ObjectID,ScheduleState,PlanEstimate,Tasks,State,Defects,TestCases,LastVerdict,Blocked",
order: "Rank",
query: "(Release.Name = " + "\"" + timeboxDropdown.getSelectedName() + "\")"
};
batchToolkit.findAll(storyquery, parseResults);
}
function initPage() {
timeboxDropdown = new RALLY.Mashup.Dropdown(batchToolkit, RALLY.Mashup.RELEASE,
'timeboxList', 'timeboxLabel', 'mu_release_trace', {projectScopeUp: false, projectScopeDown: false});
timeboxDropdown.invoke(runMainQuery);
}
</script>
</head>
<body>
<div style="float:left;" id="title" class="titlebar">Release Traceability</div>
<div style="clear:both;"></div>
<table>
<tr>
<td id="timeboxLabel" class="lbl">Iteration</td>
<td><select id="timeboxList"></select></td>
<td id="timeboxInfo" class="lbl"></td>
<td style="text-align: left; width: 99%;">
<td style="text-align: right; width: 1%;">
<img id="do" onmouseover="RALLY.Mashup.Utilities.showcbButton();" onmouseout="hidecbMenu('buttons',event);"
style="vertical-align: middle;" src="/slm/images/menu_actions.gif"/>
<div style="position:relative;top:5px" align="left">
<div id="buttons" class="do-menu" onmouseover="document.body.style.cursor='pointer';"
onmouseout="document.body.style.cursor='default';hidecbMenu('buttons',event);">
<a id="print" onclick="RALLY.Mashup.Utilities.printPage();">Print...</a>
</div>
</div>
</td>
</td>
</tr>
</table>
<div id="spinner"></div>
<div id="lastMod" style="background: white;"></div>
<br/>
<div id="logdiv"></div>
</body>
</html>