Change pagination style to Horizon standard

Registered by Shinya Kawabata on 2016-04-11

Currently monasca-ui pagination style is differ from Horizon standard.
Horizon standard pagination style is better in point of below.

* Consistency looking for other openstack-ui
* lesser code
* Able to change number of list in one page by setting menu

To apply Horizon standard pagination style, api needs sort parameter.
Currently AlarmDefinitions, Alarms, Notifications all have sort parameter.

But sort specification needs little bit change.

When 'perv page' button is pressed, Horizon standard pagination style sends query to api like below
   notification-methods?sort_by=id desc&offset=xxxxx&limit=10
Then Api receives this query, api returns ten elements from last to offset.
(If offset is before more than ten from end, offset has no significance.
 That is api always returns from end to -limit or offset
  (offset case: when offset and end distance is within limit).)
But Horizon standard pagination expects that api returns ten elements before offset.

example
  query: ?sort_by=id desc&offset=11&limit=10
  elements: 1,2,...10,11,12,...20
  offset: 11
  currently api returns: 20..12
  horizon pagination expects: 10..1

So I suggest if parameter includes 'sort_by=id desc' and 'offset',
api returns elements which descending from offset.
Or add 'marker' parameter to api, then 'sort_by=id desc' and 'marker' are given,
return above mentioned. Nova and Glance have marker which is similar offset.

Blueprint information

Status:
Not started
Approver:
None
Priority:
Low
Drafter:
Shinya Kawabata
Direction:
Needs approval
Assignee:
Shinya Kawabata
Definition:
New
Series goal:
None
Implementation:
Unknown
Milestone target:
None

Related branches

Sprints

Whiteboard

(?)

Work Items

This blueprint contains Public information 
Everyone can see this information.

Subscribers

No subscribers.