forked from RallyApps/app-catalog
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathIterationPlanningBoardApp.js
116 lines (105 loc) · 4.09 KB
/
IterationPlanningBoardApp.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
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
(function() {
var Ext = window.Ext4 || window.Ext;
Ext.define('Rally.apps.iterationplanningboard.IterationPlanningBoardApp', {
extend: 'Rally.app.App',
requires: [
'Rally.ui.gridboard.planning.TimeboxGridBoard',
'Rally.ui.gridboard.plugin.GridBoardAddNew',
'Rally.ui.gridboard.plugin.GridBoardManageIterations',
'Rally.ui.gridboard.plugin.GridBoardCustomFilterControl'
],
mixins: ['Rally.app.CardFieldSelectable'],
modelNames: ['User Story', 'Defect'],
helpId: 272,
config: {
defaultSettings: {
cardFields: 'Parent,Tasks,Defects,Discussion,PlanEstimate'
}
},
launch: function() {
var context = this.getContext(),
plugins = [
{
ptype: 'rallygridboardaddnew',
rankScope: 'BACKLOG',
addNewControlConfig: {
stateful: true,
stateId: context.getScopedStateId('iteration-planning-add-new')
}
},
{
ptype: 'rallygridboardcustomfiltercontrol',
filterControlConfig: {
margin: '3 9 3 30',
blackListFields: ['Iteration', 'PortfolioItem'],
modelNames: this.modelNames,
stateful: true,
stateId: context.getScopedStateId('iteration-planning-custom-filter-button')
},
showOwnerFilter: true,
ownerFilterControlConfig: {
stateful: true,
stateId: context.getScopedStateId('iteration-planning-owner-filter')
}
}
];
if (context.getSubscription().isHsEdition() || context.getSubscription().isExpressEdition()) {
plugins.push('rallygridboardmanageiterations');
}
this.gridboard = this.add({
xtype: 'rallytimeboxgridboard',
context: context,
modelNames: this.modelNames,
timeboxType: 'Iteration',
plugins: plugins,
cardBoardConfig: {
cardConfig: {
fields: this.getCardFieldNames()
},
columnConfig: {
additionalFetchFields: ['PortfolioItem']
},
listeners: {
filter: this._onBoardFilter,
filtercomplete: this._onBoardFilterComplete,
scope: this
}
},
listeners: {
load: this._onLoad,
toggle: this._publishContentUpdated,
recordupdate: this._publishContentUpdatedNoDashboardLayout,
recordcreate: this._publishContentUpdatedNoDashboardLayout,
preferencesaved: this._publishPreferenceSaved,
scope: this
}
});
},
getSettingsFields: function () {
var fields = this.callParent(arguments);
this.appendCardFieldPickerSetting(fields);
return fields;
},
_onLoad: function() {
this._publishContentUpdated();
if (Rally.BrowserTest) {
Rally.BrowserTest.publishComponentReady(this);
}
},
_onBoardFilter: function() {
this.setLoading(true);
},
_onBoardFilterComplete: function() {
this.setLoading(false);
},
_publishContentUpdated: function() {
this.fireEvent('contentupdated');
},
_publishContentUpdatedNoDashboardLayout: function() {
this.fireEvent('contentupdated', {dashboardLayout: false});
},
_publishPreferenceSaved: function(record) {
this.fireEvent('preferencesaved', record);
}
});
})();