forked from Echo3ToEcho7/app-catalog
-
Notifications
You must be signed in to change notification settings - Fork 192
/
Copy pathBurnDownSettings.js
60 lines (49 loc) · 1.95 KB
/
BurnDownSettings.js
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
(function () {
var Ext = window.Ext4 || window.Ext;
Ext.define("Rally.apps.charts.burndown.BurnDownSettings", {
requires: [
"Rally.apps.charts.settings.ChartDisplayTypePicker",
"Rally.apps.charts.settings.DataTypePicker",
"Rally.apps.charts.settings.TimeboxPicker",
"Rally.ui.CheckboxField"
],
config: {
app: undefined
},
constructor: function (config) {
this.mergeConfig(config);
},
_buildSettingsComponent: function (type, label, name) {
var self = this;
var componentAdded = function (cmp) {
this.settingsParent = this.settingsParent || self;
};
var settings = {
xtype: type,
label: label,
listeners: {
added: componentAdded
}
};
if (name) {
settings.name = name;
settings.cls = "settings-" + name;
}
return settings;
},
_isOnScopedDashboard: function() {
return this.app.isOnScopedDashboard() && !!this.app.context.getTimeboxScope();
},
getFields: function() {
var dataTypePicker = this._buildSettingsComponent("chartdatatypepicker", "Data Type"),
displayPicker = this._buildSettingsComponent("chartdisplaytypepicker", "Chart Type"),
timeboxPicker = this._buildSettingsComponent("charttimeboxpicker", "Level"),
labelNameVisible = this._buildSettingsComponent("rallycheckboxfield", "Show Iteration Labels", 'showLabels');
if(this._isOnScopedDashboard()) {
return [dataTypePicker, displayPicker, labelNameVisible];
} else {
return [timeboxPicker, dataTypePicker, displayPicker, labelNameVisible];
}
}
});
}());