forked from RallyApps/app-catalog
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ReleaseDependenciesApp.html
146 lines (126 loc) · 5.63 KB
/
ReleaseDependenciesApp.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
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<!-- Copyright (c) 2011 Rally Software Development Corp. All rights reserved -->
<html>
<head>
<title>Release Dependencies</title>
<meta name="Name" content="App: Release Dependencies"/>
<meta name="Version" content="2011.04.21"/>
<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 ReleaseDependencies() {
var rallyDataSource;
var relDropdown;
var table;
var header;
function setRow(prefix, row, story) {
var link = new rally.sdk.ui.basic.Link({item: story}).renderToHtml();
table.setCell(row, prefix + 'FormattedID', link);
table.setCell(row, prefix + 'Name', story.Name);
table.setCell(row, prefix + 'Project', story.Project.Name);
table.setCell(row, prefix + 'ScheduleState', story.ScheduleState);
}
function buildHeaders() {
var headerConfig = {
sortingEnabled : false,
columnKeys : ['pred', 'story', 'succ'],
columnHeaders : ['Predecessors', 'Stories', 'Successors'],
columnWidths : ['34%', '33%', '33%'],
noDataMessage : " "
};
header = new rally.sdk.ui.Table(headerConfig);
}
function buildStoryTable() {
var tableConfig = {
sortingEnabled : false,
columnKeys : [
'PredFormattedID', 'PredName', 'PredProject', 'PredScheduleState',
'FormattedID', 'Name', 'Project', 'ScheduleState',
'SuccFormattedID', 'SuccName', 'SuccProject', 'SuccScheduleState' ],
columnHeaders : [
'ID', 'Name', 'Project', 'Schedule State',
'ID', 'Name', 'Project', 'Schedule State',
'ID', 'Name', 'Project', 'Schedule State'],
columnWidths : ['8%', '10%', '8%', '8%', '8%', '9%', '8%', '8%', '8%', '9%', '8%', '8%']
};
table = new rally.sdk.ui.Table(tableConfig);
}
function showUserStoriesTable(results) {
buildHeaders();
buildStoryTable();
var row = 0;
for (var i = 0; i < results.stories.length; i++) {
var story = results.stories[i];
var preds = results.stories[i].Predecessors;
var succs = results.stories[i].Successors;
if (succs.length !== 0 || preds.length !== 0) {
if (preds.length !== 0) {
for (var pred = 0; pred < preds.length; pred++) {
setRow('', row + pred, story);
setRow('Pred', row + pred, preds[pred]);
}
}
if (succs.length !== 0) {
for (var succ = 0; succ < succs.length; succ++) {
setRow('', row + succ, story);
setRow('Succ', row + succ, succs[succ]);
}
}
row = row + Math.max(preds.length, succs.length);
}
}
header.display(document.getElementById('header'));
table.display(document.getElementById('stories'));
}
function destroyTables() {
if (table) {
table.destroy();
}
if(header) {
header.destroy();
}
}
function onReleaseSelected() {
destroyTables();
var queryConfig = {
type : 'hierarchicalrequirement',
key : 'stories',
fetch: 'Rank,FormattedID,Name,Predecessors,Successors,Project,ScheduleState',
query: '(Release.Name = "' + relDropdown.getSelectedName() + '")',
order: 'Rank'
};
rallyDataSource.findAll(queryConfig, showUserStoriesTable);
}
this.display = function() {
rallyDataSource = new rally.sdk.data.RallyDataSource('__WORKSPACE_OID__',
'__PROJECT_OID__',
'__PROJECT_SCOPING_UP__',
'__PROJECT_SCOPING_DOWN__');
var relConfig = {};
rally.sdk.ui.AppHeader.showPageTools(true);
rally.sdk.ui.AppHeader.setHelpTopic("245");
relDropdown = new rally.sdk.ui.ReleaseDropdown(relConfig, rallyDataSource);
relDropdown.display(document.getElementById("releaseDiv"), onReleaseSelected);
};
}
</script>
<style type="text/css">
#header {
margin-bottom: -22px;
}
</style>
<script type="text/javascript">
function onLoad() {
var releaseDependencies = new ReleaseDependencies();
releaseDependencies.display();
}
rally.addOnLoad(onLoad);
</script>
</head>
<body>
<div id="releaseDiv"></div>
<br/><br/>
<div id="header"></div>
<div id="stories"></div>
</body>
</html>