The Project settings page shows max 20 badges

Summary

The Badges section on the Project's Settings > General page shows a maximum of 20 badges, even if there are more badges configured. Tested in 12.0.1

Steps to reproduce

Go to the Badges section on the Project's Settings > General page and add more than 20 badges. Even though more than 20 badges are added to the Project, the info shown is Your badges 20, and there are only 20 badges shown in the list.

What is the current bug behavior?

The Your badges counter shows a value of 20, and only 20 badges are shown in the list.

What is the expected correct behavior?

The actual number of badges is shown in the Your badges counter, and all badges are shown in the list. Optionally show the badges in a paginated list.

Relevant logs and/or screenshots

I added 25 badges to a Project.

The Your badges counter shows only 20, and the list (not fully shown in screenshot) only has 20 badges. Screenshot_2019-06-26_at_15.20.10

Retrieving badges information through the API shows there are indeed 25 badges: Screenshot_2019-06-26_at_15.23.19

Implementation guide

  1. Fix showPagination logic. We need to check the X-TOTAL header instead of this.badges.length because the badges length will always be the amount of badges returned which is 20. We can use parseIntPagination for this.
Edited by Peter Hegman