[enhance] added priority to issue (#14815)

This commit is contained in:
Rushabh Mehta 2018-07-05 11:38:02 +05:30 committed by GitHub
parent 2a5dc911e6
commit c1b430c8bd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 1022 additions and 941 deletions

File diff suppressed because it is too large Load Diff

View File

@ -1,5 +1,6 @@
frappe.listview_settings['Issue'] = {
colwidths: {"subject": 6},
add_fields: ['priority'],
onload: function(listview) {
frappe.route_options = {
"status": "Open"
@ -14,5 +15,20 @@ frappe.listview_settings['Issue'] = {
listview.page.add_menu_item(__("Set as Closed"), function() {
listview.call_for_selected_items(method, {"status": "Closed"});
});
},
get_indicator: function(doc) {
if (doc.status === 'Open') {
if (!doc.priority) doc.priority = 'Medium';
const color = {
'Low': 'yellow',
'Medium': 'orange',
'High': 'red'
}
return [__(doc.status), color[doc.priority] || 'Red', `status,=,Open`];
} else if (doc.status === 'Closed') {
return [__(doc.status), "green", "status,=," + doc.status];
} else {
return [__(doc.status), "darkgrey", "status,=," + doc.status];
}
}
}