1111from django .views .generic import CreateView , DeleteView , DetailView , ListView , UpdateView
1212
1313from argus .filter .queryset_filters import QuerySetFilter
14- from argus .htmx .incident .columns import BUILTIN_COLUMNS
14+ from argus .htmx .incident .columns import get_incident_table_columns , MAINTENANCE_COLUMN_LAYOUT_NAME
1515from argus .htmx .utils import TemplateNameViewMixin
1616from argus .htmx .widgets import SearchDropdownMultiSelect
1717from argus .incident .models import Incident
2020from argus .util .datetime_utils import LOCAL_INFINITY
2121
2222FLATPICKR_DATETIME_FORMAT = "%Y-%m-%d %H:%M"
23- FILTER_PREVIEW_COLUMNS = ["start_time" , "level" , "source_type" , "source" , "description" , "tags" ]
2423FILTER_PREVIEW_LIMIT = 5
2524
2625
@@ -218,6 +217,7 @@ def filter_preview(request):
218217 matching_count = matching_qs .count ()
219218 matching_percent = round (100 * matching_count / total_open ) if total_open else 0
220219 incident_list = matching_qs .select_related ("source" ).order_by ("-start_time" )[:FILTER_PREVIEW_LIMIT ]
220+ columns = get_incident_table_columns (MAINTENANCE_COLUMN_LAYOUT_NAME )
221221
222222 return render (
223223 request ,
@@ -227,7 +227,7 @@ def filter_preview(request):
227227 "matching_percent" : matching_percent ,
228228 "total_open" : total_open ,
229229 "incident_list" : incident_list ,
230- "columns" : [ BUILTIN_COLUMNS [ name ] for name in FILTER_PREVIEW_COLUMNS ] ,
230+ "columns" : columns ,
231231 "compact" : True ,
232232 "dummy_column" : True ,
233233 },
0 commit comments