[Bug] Compliance violations clicking prev always returns to first page
Summary
Clicking prev
on the compliance violations report always returns to the first page, no matter the current page.
Steps to reproduce
- Have a GitLab Ultimate license.
- Checkout the branch from this MR !82989 (merged)
- Follow the setup steps in the MR above.
- View the report at
[GDK_HOST]/groups/[GROUP]/-/security/compliance_dashboard
- Click
Next
at least twice. - Click
Prev
.
What is the expected correct behavior?
Clicking Prev
should show the previous page results, not the first page unless you are on page 2.
Possible fixes
This is likely because the frontend adds first: GRAPHQL_PAGE_SIZE
to the GraphQL query, changing this to last: GRAPHQL_PAGE_SIZE
should resolve the issue.
Implementation plan
frontend -
- Update the component
compliance_dashboard/components/report.vue
. - Update the query
compliance_dashboard/graphql/compliance_violations.query.graphql
. - Update specs to make sure it works.
Edited by Jiaan Louw