forked from Echo3ToEcho7/app-catalog
-
Notifications
You must be signed in to change notification settings - Fork 192
/
Copy pathTeamBoardSettings.js
74 lines (67 loc) · 2.35 KB
/
TeamBoardSettings.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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
(function() {
var Ext = window.Ext4 || window.Ext;
Ext.define('Rally.apps.teamboard.TeamBoardSettings', {
requires: [
'Rally.ui.combobox.ComboBox',
'Rally.ui.picker.FieldPicker',
'Rally.ui.picker.MultiObjectPicker'
],
singleton: true,
getFields: function(userModel){
return [this._getTeamsPickerConfig(), this._getFieldPickerConfig(), this._getGroupByPickerConfig(userModel)];
},
_getTeamsPickerConfig: function(){
return {
xtype: 'rallymultiobjectpicker',
alwaysExpanded: true,
availableTextLabel: 'Available Teams',
fieldLabel: 'Teams',
pickerCfg: {
style: {
border: '1px solid #DDD',
'border-top': 'none'
},
height: 248,
shadow: false
},
margin: '10px 0 265px 0',
maintainScrollPosition: true,
modelType: 'Project',
name: 'teamOids',
pickerAlign: 'tl-bl',
selectedTextLabel: 'Selected Teams',
selectionKey: 'ObjectID',
storeLoadOptions: {
params: {
order: 'Name ASC'
}
},
width: 300
};
},
_getFieldPickerConfig: function(){
return {
xtype: 'rallyfieldpicker',
fieldLabel: 'Card Fields',
name: 'cardFields',
modelTypes: ['User']
};
},
_getGroupByPickerConfig: function(userModel) {
var groupByFields = _.filter(userModel.getFields(), function(field){
return field.getType() === 'rating' || field.hasAllowedValues();
});
return {
xtype: 'rallycombobox',
allowNoEntry: true,
editable: false,
fieldLabel: 'Group By',
name: 'groupBy',
queryMode: 'local',
store: _.map(_.sortBy(groupByFields, 'displayName'), function(field){
return [field.name, field.displayName];
})
};
}
});
})();