forked from RallyApps/app-catalog
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ProjectStatusApp.html
142 lines (127 loc) · 4.6 KB
/
ProjectStatusApp.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
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<!-- Copyright (c) 2002-2010 Rally Software Development Corp. All rights reserved. -->
<html>
<head>
<meta name="Name" content="App: Project Status"/>
<meta name="Vendor" content="Rally Software"/>
<meta name="Version" content="2012.01.14"/>
<script type="text/javascript" src="/apps/1.33/sdk.js?apiVersion=1.29"></script>
<script type="text/javascript">
//Object to retrieve data
//and create pie charts
function ProjectStatusDashboard() {
var that = this;
var rallyDataSource = new rally.sdk.data.RallyDataSource('__WORKSPACE_OID__', '__PROJECT_OID__',
'__PROJECT_SCOPING_UP__', '__PROJECT_SCOPING_DOWN__');
//Private function to perform a query
//and create a pie from the results
function showPie(chartDiv, artifactType, artifactAttribute, title, colors) {
var config = {
type: artifactType,
attribute: artifactAttribute,
title: title,
height: 200,
width: 250,
colors: colors
};
var pieChart = new rally.sdk.ui.PieChart(config, rallyDataSource);
pieChart.display(chartDiv);
}
//Public function to display the tasks pie
this.showTaskPie = function(element) {
showPie(element,
"Task",
"State",
"Tasks",
{
"Completed" : "#6AB17D",
"Defined" : "#5C9ACB"
}
);
};
//Public function to display the user story pie
this.showUserStoryPie = function(element) {
showPie(element,
"Hierarchical Requirement",
"Schedule State",
"User Stories",
{
"Accepted" : "#6AB17D",
"Idea" : "#ACACAC",
"Defined" : "#E57E3A",
"In-Progress" : "#E5D038",
"Completed" : "#5C9ACB"
}
);
};
//Public function to display the test pie
this.showTestPie = function(element) {
showPie(element,
"Test Case",
"Last Verdict",
"Test Cases",
{
"Pass": "#6AB17D",
"Fail" : "#F47168",
"Error" : "#E57E3A",
"Inconclusive" : "#ACACAC",
"Blocked" : "#E5D038"
}
);
};
//Public function to display the defect pie
this.showDefectPie = function(element) {
showPie(element,
"Defect",
"State",
"Defects",
{
"Closed": "#6AB17D",
"Submitted" : "#5C9ACB",
"Open" : "#F47168",
"Fixed" : "#E5D038",
"Verifying" : "#B5D8EB",
"Unable To Reproduce" : "#ACACAC"
}
);
};
return that;
}
</script>
<script type="text/javascript">
rally.addOnLoad(function() {
var dashboard = new ProjectStatusDashboard();
dashboard.showUserStoryPie("storyDiv");
dashboard.showTaskPie("taskDiv");
dashboard.showTestPie("testCaseDiv");
dashboard.showDefectPie("defectDiv");
});
</script>
<style type="text/css">
.chartDiv {
width: 250px;
height: 250px;
}
</style>
</head>
<body>
<table>
<tr>
<td>
<div id="storyDiv" class="chartDiv"></div>
</td>
<td>
<div id="taskDiv" class="chartDiv"></div>
</td>
</tr>
<tr>
<td>
<div id="testCaseDiv" class="chartDiv"></div>
</td>
<td>
<div id="defectDiv" class="chartDiv"></div>
</td>
</tr>
</table>
</body>
</html>