-
Notifications
You must be signed in to change notification settings - Fork 8
/
Settings.js
45 lines (44 loc) · 1.65 KB
/
Settings.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
Ext.define('Settings', {
singleton: true,
requires: [
'Rally.ui.combobox.FieldComboBox',
'Rally.ui.combobox.ComboBox',
'Rally.ui.TextField',
'Rally.ui.NumberField',
'RowSettingsField',
'Rally.data.wsapi.Filter',
'SizesField'
],
getFields: function (context) {
return [
{
name: 'sizes',
xtype: 'sizesfield',
fieldLabel: 'Columns'
},
{
name: 'groupHorizontallyByField',
xtype: 'rowsettingsfield',
fieldLabel: 'Swimlanes',
mapsToMultiplePreferenceKeys: ['showRows', 'rowsField'],
readyEvent: 'ready',
isAllowedFieldFn: function(field) {
var attr = field.attributeDefinition;
return (attr.Custom && (attr.Constrained || attr.AttributeType.toLowerCase() !== 'string') ||
attr.Constrained || _.contains(['quantity', 'boolean'], attr.AttributeType.toLowerCase()) ||
(!attr.Constrained && attr.AttributeType.toLowerCase() === 'object')) &&
!_.contains(['web_link', 'text', 'date'], attr.AttributeType.toLowerCase()) &&
!_.contains(['PortfolioItemType', 'LastResult'], attr.ElementName);
},
handlesEvents: {
typeselected: function(type, context) {
this.refreshWithNewModelType(type, context);
}
}
},
{
type: 'query'
}
];
}
});