Machine listing pagination displays incorrect total number of pages

Bug #2025375 reported by Peter Makowski
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
MAAS
Status tracked in 3.5
3.4
Fix Released
High
Peter Makowski
3.5
Fix Committed
High
Peter Makowski
maas-ui
Fix Committed
High
Peter Makowski
3.3
Fix Committed
High
Peter Makowski
3.4
Fix Committed
High
Peter Makowski

Bug Description

### Description
Machine listing pagination displays incorrect total number of pages.

Machine list pagination is calculating the total number of pages from count and page_size. This does not take into account collapsed groups and may result in an incorrect number of total pages being displayed.

MAAS UI should use instead the total_pages property returned by the API machine.list.

### Steps to reproduce:
- Go to machine listing on a MAAS with multiple machines
- If needed, you can set the page size manually to a low value in developer tools console by typing `localStorage.setItem("machineListPageSize", "1")` and refreshing the page
- collapse a group of machines and take note of the total number of pages
- expand a group of machines

#### Expected:
the total number of machines should update

#### Actual:
the total number of machines does not update and is incorrect

Changed in maas-ui:
importance: Undecided → High
milestone: none → 3.4.x
milestone: 3.4.x → none
Revision history for this message
Peter Makowski (petermakowski) wrote :

This affects both 3.3 and 3.4.

Fix for main in review: https://github.com/canonical/maas-ui/pull/5029

Changed in maas-ui:
status: New → Triaged
assignee: nobody → Peter Makowski (petermakowski)
Changed in maas-ui:
milestone: none → 3.5.0
no longer affects: maas-ui/3.5
Changed in maas-ui:
status: Triaged → In Progress
description: updated
Changed in maas-ui:
status: In Progress → Fix Committed
Changed in maas:
status: New → Triaged
importance: Undecided → High
milestone: none → 3.5.0
Changed in maas:
status: Triaged → Fix Committed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.