forked from Echo3ToEcho7/app-catalog
-
Notifications
You must be signed in to change notification settings - Fork 192
/
Copy pathPortfolioKanbanPolicy.js
65 lines (58 loc) · 2.06 KB
/
PortfolioKanbanPolicy.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
(function() {
var Ext = window.Ext4 || window.Ext;
/**
* @private
* Shows the Kanban Policy for a Portfolio Item board, based on the State representing the column.
* Used by the Rally.ui.cardboard.KanbanColumn
*/
Ext.define('Rally.apps.portfoliokanban.PortfolioKanbanPolicy', {
extend: 'Rally.ui.cardboard.PolicyContainer',
alias: 'widget.rallyportfoliokanbanpolicy',
config: {
/**
* @cfg {Rally.data.wsapi.Model} (required)
* The Kanban State record that holds the policy information.
*/
stateRecord: undefined
},
canEditPolicy: function() {
return this.getStateRecord().get('updatable');
},
getPolicyText: function() {
return this.getStateRecord() && this.getStateRecord().get('Description');
},
draw: function() {
if (this.getStateRecord()) {
this.callParent(arguments);
} else {
this._drawNotApplicable();
}
},
_drawNotApplicable: function() {
this.add({
xtype: 'component',
renderTpl: '<div class="policyContent">Not Applicable</div>'
});
},
onEditClick: function() {
Ext.create('Rally.ui.dialog.RichTextDialog', {
title: 'Edit the Exit Policy for "' + this.getStateRecord().get('Name') + '" Column',
headerItems: [
{
xtype: 'component',
cls: 'kanbanPolicyRichTextEditorHeader',
html: 'What needs to be done before an item is ready to leave this column?'
}
],
autoShow: true,
record: this.getStateRecord(),
fieldName: 'Description',
editorMaxHeight: 500,
listeners: {
save: this.drawPolicy,
scope: this
}
});
}
});
})();