Skip to content

Add sorting to compliance report violations table

What does this MR do and why?

Adds sorting to compliance report violations table as described in #299369 (closed):

  • Enables sorting on the GlTable.
  • Default sorts by SEVERITY_DESC.
  • Sorts the apollo violations query.
  • Syncs the sort param with the URL.
  • Updates the fields to match the API sort enum !78681 (diffs).

Notes:

  • This change is hidden behind a development feature flag.
  • Sorting is not available on smaller viewports when GlTable is collapsed, this will be added in a follow-up.
  • The results won't update because we're using a static mock resolver while the backend is in development.

Screenshots or screen recordings

Screen_Recording_2022-01-26_at_14.55.32

The only UI change is the sort icon on the table columns.

image

How to set up and validate locally

  1. You need a GitLab Ultimate license.
  2. Enable the new feature flag in your terminal: echo "Feature.enable(:compliance_violations_report)" | rails c
  3. View the compliance report and use the filter and sort features: [GDK_HOST]/groups/gitlab-org/-/security/compliance_dashboard

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Related to #299369 (closed)

Edited by Jiaan Louw

Merge request reports