forked from RallyApps/app-catalog
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ReleaseSummaryApp.html
171 lines (139 loc) · 6.78 KB
/
ReleaseSummaryApp.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
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<!-- Copyright (c) 2010 Rally Software Development Corp. All rights reserved -->
<html>
<head>
<title>Release Summary</title>
<meta name="Name" content="App: Release Summary"/>
<meta name="Version" content="2012.01.14"/>
<meta name="Vendor" content="Rally Software"/>
<script type="text/javascript" src="/apps/1.33/sdk.js?apiVersion=1.29"></script>
<script type="text/javascript">
function ReleaseNotes() {
var that = this;
var rallyDataSource = new rally.sdk.data.RallyDataSource('__WORKSPACE_OID__',
'__PROJECT_OID__',
'__PROJECT_SCOPING_UP__',
'__PROJECT_SCOPING_DOWN__');
var releaseDropdown;
var releaseNotesDiv;
var wait;
var loadingSpan;
this._renderReleaseNotes = function(items) {
if (wait) {
wait.hide();
wait = null;
}
var notesHeader = dojo.create('div', {'class': 'notesHeader'}, releaseNotesDiv);
notesHeader.appendChild(document.createTextNode("About this release:"));
if (items.release && items.release.length > 0 && items.release[0].Notes) {
//use innerhtml so it will render html characters
dojo.create('div', {'class': 'notes', innerHTML: items.release[0].Notes}, releaseNotesDiv);
}
var additionalInfo = dojo.create('div', {'class': 'additionalInfo'}, releaseNotesDiv);
additionalInfo.appendChild(document.createTextNode("Additional information is available "));
var releaseLink = new rally.sdk.ui.basic.Link({item: releaseDropdown.getSelectedItem(), text: "here"});
releaseLink.display(additionalInfo);
additionalInfo.appendChild(document.createTextNode("."));
if (items.stories) {
var storiesHeader = dojo.create('div', {'class': 'storiesHeader'}, releaseNotesDiv);
storiesHeader.appendChild(document.createTextNode("Stories: " + items.stories.length));
var stories = dojo.create('ul', {'class': 'storiesList'}, releaseNotesDiv);
rally.forEach(items.stories, function(s) {
var li = dojo.create('li', {'class': 'story'}, stories);
var link = new rally.sdk.ui.basic.Link({item: s});
link.display(li);
dojo.create('span', {innerHTML: " - " + s.Name}, li);
});
}
if (items.defects) {
var defectsHeader = dojo.create('div', {'class': 'defectsHeader'}, releaseNotesDiv);
defectsHeader.appendChild(document.createTextNode("Defects: " + items.defects.length));
var defects = dojo.create('ul', {'class': 'defectsList'}, releaseNotesDiv);
rally.forEach(items.defects, function(d) {
var li = dojo.create('li', {'class': 'defect'}, defects);
var link = new rally.sdk.ui.basic.Link({item: d});
link.display(li);
dojo.create('span', {innerHTML: " - " + d.Name}, li);
});
}
};
this._queryForItems = function() {
dojo.empty(releaseNotesDiv);
wait = new rally.sdk.ui.basic.Wait({});
wait.display(loadingSpan);
var query = new rally.sdk.util.Query("ScheduleState = Accepted");
if (releaseDropdown.getQueryFromSelected()) {
query = query.and(releaseDropdown.getQueryFromSelected());
}
rallyDataSource.findAll([
{
key: "stories",
type: "hierarchicalrequirement",
query: query,
fetch: "FormattedID,Name",
order: "ObjectID"
},
{
key: "defects",
type: "defect",
query: query,
fetch: "FormattedID,Name",
order: "ObjectID"
},
{
key: "release",
type: "release",
fetch: "Notes",
query: new rally.sdk.util.Query("ObjectID = " + rally.sdk.util.Ref.getOidFromRef(releaseDropdown.getSelectedItem()))
}
], that._renderReleaseNotes);
};
this._createLayout = function(element) {
var headerDiv = dojo.create('div', {'class': 'header'}, element);
var dropdownContainerSpan = dojo.create('span', {'class': 'dropdownContainer'}, headerDiv);
loadingSpan = dojo.create('span', {'class': 'loading'}, headerDiv);
//IE7 requires child content to display wait/span correctly
loadingSpan.appendChild(document.createTextNode(" "));
releaseNotesDiv = dojo.create('div', {'class': 'releaseNotes'}, element);
//Create dropdowns
var dropdownConfig = {
showLabel: true,
label: "Release: "
};
releaseDropdown = new rally.sdk.ui.ReleaseDropdown(dropdownConfig, rallyDataSource);
releaseDropdown.display(dropdownContainerSpan, that._queryForItems);
};
this.display = function(element) {
rally.sdk.ui.AppHeader.setHelpTopic("247");
rally.sdk.ui.AppHeader.showPageTools(true);
//Build app layout
that._createLayout(element);
};
}
</script>
<style type="text/css">
.defectsHeader, .storiesHeader, .notesHeader {
font-weight: bold;
margin-top: 20px;
}
.loading {
margin-left: 20px;
}
.header {
line-height: 30px;
vertical-align: middle;
}
.notes, .additionalInfo {
padding-top: 10px;
}
</style>
<script type="text/javascript">
rally.addOnLoad(function() {
var releaseNotes = new ReleaseNotes();
releaseNotes.display(dojo.body());
});
</script>
</head>
<body>
</body>
</html>