Skip to content

Commit 9cf94b2

Browse files
committed
UI Tweak: Fix default event icons in drop-down menus, and add category colors there as well.
1 parent cd3d065 commit 9cf94b2

1 file changed

Lines changed: 18 additions & 3 deletions

File tree

htdocs/js/pages/Base.class.js

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1806,9 +1806,24 @@ Page.Base = class Base extends Page {
18061806
} );
18071807

18081808
events.forEach( function(event) {
1809-
if (!event.icon) {
1810-
if (event.type == 'workflow') event.icon = 'clipboard-flow-outline';
1811-
else event.icon = 'calendar-clock';
1809+
var default_icon = 'file-clock-outline';
1810+
1811+
// pick default icon based on event attributes
1812+
if (event.type == 'workflow') {
1813+
default_icon = 'clipboard-flow-outline';
1814+
if (find_object(event.actions || [], { type: 'run_event', enabled: true })) default_icon = 'clipboard-arrow-right';
1815+
if (!event.enabled) default_icon = 'clipboard-outline';
1816+
}
1817+
else {
1818+
if (find_object(event.actions || [], { type: 'run_event', enabled: true })) default_icon = 'file-move';
1819+
if (!event.enabled) default_icon = 'file-outline';
1820+
}
1821+
1822+
if (!event.icon) event.icon = default_icon;
1823+
1824+
var category = cat_map[ event.category ];
1825+
if (category && category.color) {
1826+
event.class = `clr_${category.color}`;
18121827
}
18131828

18141829
if (event.category != last_cat_id) {

0 commit comments

Comments
 (0)