[enhance] added priority to issue (#14815)
This commit is contained in:
parent
2a5dc911e6
commit
c1b430c8bd
File diff suppressed because it is too large
Load Diff
@ -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];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user