Closed Bug 885384 Opened 12 years ago Closed 12 years ago

Improve Make Editor Pagination

Categories

(Webmaker Graveyard :: MakeAPI, defect)

x86
macOS
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: cade, Assigned: cade)

References

Details

Attachments

(3 files)

It limits the search results to 1000, but there could be far more hits. I'm going to explore how I can do this and post my findings.
I've written a custom Paging tool I've lovingly dubbed the "MakePager" I've grabbed all the script/css dependencies that were being loaded from remote sources and added the minified versions to our repo. I included font-awesome to use for the MakePager's control elements. Basically, what this new tool does is remove the 1000 make limit we had by making requests to the MakeAPI 100 Makes at a time, page by page, while leveraging the total hits variable now available from the MakeAPI. I tried to keep it as modular as I could (but didn't separate it into a different file - which I could if you made me) dale: this code needs some serious reviewing, so buckle up! I can also help you get a whole bunch of fake makes to test with if you need them.
Attachment #785003 - Flags: review?(dale)
Comment on attachment 785003 [details] https://github.com/mozilla/MakeAPI/pull/129/files Tested locally, tried to break it but it would not break! Looked through code, looks good to me!
Attachment #785003 - Flags: review?(dale) → review+
woo! Gonna get this onto staging for some more testing in that case!
Commit pushed to master at https://github.com/mozilla/MakeAPI https://github.com/mozilla/MakeAPI/commit/7fc256586350369dbcfb54d4f9a04af7306d4505 Bug 885384 - Write custom paging tool for make editor, use local versions of script dependencies, add font-awesome for MakePager UI
This fixes some minor issues with the first patch that I caught on staging. 1. Loading spinny while it fetches pages - very useful 2. The trimItems function was moved out of scope of one its callers 3. Removed majority of jQuery Usage in favour of pure JS for DOM manipulation and event setup
Attachment #785149 - Flags: review?(dale)
Attachment #785149 - Flags: review?(dale) → review+
One more upgrade: Adds setting of the page size. also fixes the click callback for adding an API key.
Attachment #785214 - Flags: review?(dale)
Attachment #785214 - Flags: review?(dale) → review+
Commit pushed to master at https://github.com/mozilla/MakeAPI https://github.com/mozilla/MakeAPI/commit/01dd93a7718ee8ee6c6167b547e94611a4ea5d14 Bug 885384 - Handle page numbers out of range when changing the max results per page value
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Attachment mime type: text/plain text/plain → text/x-github-pull-request text/x-github-pull-request
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: