Skip to content

Commit 5bd9579

Browse files
committed
UX improvement: table_full leads to detail_full
Signed-off-by: Matthias Büchse <[email protected]>
1 parent abb888e commit 5bd9579

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

compliance-monitor/monitor.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -544,13 +544,13 @@ async def get_status(
544544
return convert_result_rows_to_dict2(rows2, get_scopes(), include_report=True)
545545

546546

547-
def render_view(view, view_type, base_url='/', title=None, **kwargs):
547+
def render_view(view, view_type, detail_page='detail', base_url='/', title=None, **kwargs):
548548
media_type = {ViewType.markdown: 'text/markdown'}.get(view_type, 'text/html')
549549
stage1 = stage2 = view[view_type]
550550
if view_type is ViewType.page:
551551
stage1 = view[ViewType.fragment]
552552
def scope_url(uuid): return f"{base_url}page/scope/{uuid}" # noqa: E306,E704
553-
def detail_url(subject, scope): return f"{base_url}page/detail/{subject}/{scope}" # noqa: E306,E704
553+
def detail_url(subject, scope): return f"{base_url}page/{detail_page}/{subject}/{scope}" # noqa: E306,E704
554554
def report_url(report): return f"{base_url}reports/{report}" # noqa: E306,E704
555555
fragment = templates_map[stage1].render(detail_url=detail_url, report_url=report_url, scope_url=scope_url, **kwargs)
556556
if view_type != ViewType.markdown and stage1.endswith('.md'):
@@ -618,7 +618,11 @@ async def get_table_full(
618618
with conn.cursor() as cur:
619619
rows2 = db_get_relevant_results2(cur, approved_only=False)
620620
results2 = convert_result_rows_to_dict2(rows2, get_scopes())
621-
return render_view(VIEW_TABLE, view_type, results=results2, base_url=settings.base_url, title="SCS compliance overview")
621+
return render_view(
622+
VIEW_TABLE, view_type, results=results2,
623+
detail_page='detail_full', base_url=settings.base_url,
624+
title="SCS compliance overview",
625+
)
622626

623627

624628
@app.get("/{view_type}/scope/{scopeuuid}")

0 commit comments

Comments
 (0)