This repository was archived by the owner on Oct 3, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathApp.js
More file actions
149 lines (134 loc) · 3.14 KB
/
App.js
File metadata and controls
149 lines (134 loc) · 3.14 KB
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
Ext.define('CustomApp', {
extend: 'Rally.app.App',
componentCls: 'app',
layout: 'fit',
launch: function() {
this.setLoading(true);
var projectRef = this.getContext().getProjectRef();
var projectOid = this.getContext().getProject().ObjectID;
// iron man
// var projectRef = '/project/6781680972';
// var projectOid = 6781680972;
this.loadIterations(projectRef, projectOid);
},
loadIterations: function(projectRef, projectOid){
var app = this;
var iterationStore = Ext.create('Rally.data.WsapiDataStore', {
model: 'Iteration',
context: {
project: projectRef,
projectScopeUp: false,
projectScopeDown: false
},
filters: [
{
property: 'Project',
value: projectRef
}
],
sorters: [
{
property: 'EndDate',
direction: 'ASC'
}
]
});
var iterationsPromise = iterationStore.load();
iterationsPromise.then({
success: function(iterations) {
var iterationFilters = [];
for(var i=0, l=iterations.length; i < l; i++){
iterationFilters.push({
property: 'Iteration',
value: iterations[i].get('_ref')
});
}
var capacityStore = Ext.create('Rally.data.WsapiDataStore', {
model: 'useriterationcapacity',
context: {
project: projectRef,
projectScopeUp: false,
projectScopeDown: false
},
filters: Rally.data.QueryFilter.or(iterationFilters),
fetch: ['Capacity', 'Iteration']
});
var capacityPromise = capacityStore.load();
capacityPromise.then({
success: function(capacities) {
app.loadChart(iterations, capacities, projectOid);
this.setLoading(false);
},
failure: function(error) {
console.log("Failed to load iteration capacities");
console.log(error);
}
});
},
failure: function(error) {
console.log("Failed to load iterations for project '"+ projectRef +"'");
console.log(error);
}
});
},
loadChart: function(iterations, capacities, projectOid){
var chart = {
xtype: 'rallychart',
storeType: 'Rally.data.lookback.SnapshotStore',
storeConfig: {
find: {
'Project': projectOid,
'_TypeHierarchy': 'HierarchicalRequirement',
'Children': null
},
fetch: ['PlanEstimate', 'ObjectID', 'ScheduleState', '_ValidFrom', '_ValidTo', '_PreviousValues'],
hydrate: ['ScheduleState'],
sort: {'_ValidFrom': -1}
},
calculatorType: 'ActualCalculator',
calculatorConfig: {
iterations: iterations,
capacities: capacities
},
chartColors: ['#009944', '#254361', '#A40000', '#EE0000'],
chartConfig: {
chart: {
type: 'column',
zoomType: 'xy'
},
title: {
text: 'Project Burn Chart by Iteration'
},
xAxis: {
// needed to keep it from blowing up
},
yAxis: {
lineWidth: 1,
tickInterval: 50,
min: 0,
title: {
text: 'Story Points'
}
},
plotOptions: {
column: {
stacking: 'normal',
borderWidth: 0,
shadow: true
},
line: {
connectNulls: true,
lineWidth: 1,
marker: {
radius: 2.5
}
}
},
tooltip: {
shared: true
}
}
};
this.add(chart);
}
});