shinglyu / moztrap-new-ui

A new frontend UI for MozTrap that levarages on its REST API
10 stars 13 forks source link

Pagination #30

Open shinglyu opened 9 years ago

shinglyu commented 9 years ago

@hitripod: https://moztrap.mozilla.org/api/v1/caseversion/?format=json& There is a meta.total_count

hitripod commented 9 years ago

Got it, thanks!

shinglyu commented 9 years ago
"meta": {"limit": 20, "next": "/api/v1/caseversion/?offset=20&limit=20&format=json", "offset": 0, "previous": null, "total_count": 129935} 

should be enough for making a pagination.

shinglyu commented 9 years ago

This tool https://rawgit.com/shinglyu/moztrap-api-tester/master/index.html can help you explore the API

shinglyu commented 9 years ago

API doc: http://moztrap.readthedocs.org/en/latest/userguide/api/

hitripod commented 9 years ago

Thanks, I'll take this bug.

shinglyu commented 9 years ago

@hitripod : You might need to think about how checkboxes are handled between pages. Currently I save all the checked boxes's id in an array in this.state. We might need something like a shopping cart, in case the user changes pages and the checked items are not visible.

shinglyu commented 9 years ago

Oh, by the way, I use React-Bootstrap in this project. You can use the bootstrap pagination if you like.

hitripod commented 9 years ago

Thanks for your information. I hope you'll like it.

hitripod commented 9 years ago

updateListUIState() is a quick solution by jQuery, but it might be more react-styled?