diff --git a/runbot/controllers/frontend.py b/runbot/controllers/frontend.py index 9331329f..0d7a2947 100644 --- a/runbot/controllers/frontend.py +++ b/runbot/controllers/frontend.py @@ -471,7 +471,6 @@ class Runbot(Controller): # Sort & Filter sortby = kwargs.get('sortby', 'count') - filterby = kwargs.get('filterby', 'not_one') searchbar_sortings = { 'date': {'label': 'Recently Seen', 'order': 'last_seen_date desc'}, 'count': {'label': 'Nb Seen', 'order': 'build_count desc'}, @@ -482,6 +481,16 @@ class Runbot(Controller): 'unassigned': {'label': 'Unassigned', 'domain': [('responsible', '=', False)]}, 'not_one': {'label': 'Seen more than once', 'domain': [('build_count', '>', 1)]}, } + + for trigger in team.build_error_ids.trigger_ids if team else []: + k = f'trigger_{trigger.name.lower().replace(" ", "_")}' + searchbar_filters.update( + {k: {'label': f'Trigger {trigger.name}', 'domain': [('trigger_ids', '=', trigger.id)]}} + ) + + filterby = kwargs.get('filterby', 'not_one') + if filterby not in searchbar_filters: + filterby = 'not_one' domain = expression.AND([domain, searchbar_filters[filterby]['domain']]) qctx = { diff --git a/runbot/templates/build_error.xml b/runbot/templates/build_error.xml index 5d727681..af2c43dd 100644 --- a/runbot/templates/build_error.xml +++ b/runbot/templates/build_error.xml @@ -9,6 +9,7 @@
Last seen date
Module
Summary
+
Triggers
Assigned to
 
@@ -26,6 +27,11 @@ +
+ + + +
Assign to me