-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathStoryTree.js
49 lines (40 loc) · 1.55 KB
/
StoryTree.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
Ext.define('PlanIterationsAndReleases.StoryTree', {
extend: 'Ext.Container',
initComponent: function(){
this.callParent(arguments);
this.add({
xtype: 'component',
autoEl: 'h1',
html: 'Unscheduled Story Hierarchy'
});
this.add({
xtype: 'component',
cls: 'grayLabel',
html: 'Drill down to see unscheduled leaf user stories. Drag and drop into an iteration on the right.'
});
this.buildTree();
},
buildTree: function(){
Rally.data.util.PortfolioItemHelper.loadTypeOrDefault({
success: function(typeRecord){
var tree = Ext.widget('rallyportfoliotree', {
topLevelModel: typeRecord.get('TypePath'),
treeItemConfigForRecordFn: function(record){
var canDrag = record.get('_type') === 'hierarchicalrequirement' && record.get('Children').length === 0;
var config = {
canDrag: canDrag
};
if(record.get('_type') === 'hierarchicalrequirement'){
config.xtype = 'rallystorytreeitem';
} else {
config.xtype = 'rallyportfolioitemtreeitem';
}
return config;
}
});
this.add(tree);
},
scope: this
});
}
});