fairvotereform / RankIt

https://rankit.vote
1 stars 2 forks source link

Searching "Manage polls" and "Manage users" #150

Closed ggordn3r closed 4 years ago

ggordn3r commented 4 years ago

For admins, fetching on the "manage users" and "manage polls" pages is now taking a very long time. This makes sense if they're loading all records--we now have over 4,000 registered users and probably something like 10,000 polls. It's also becoming increasingly difficult to find the exact user or poll you want to moderate and this will only get worse over time.

We need some way to help admins find the record they want more quickly. I propose:

proggeramlug commented 4 years ago

Okay, we have some limitations here:

  1. We cannot search for a title.
  2. We cannot know how many polls/users we have in total.

Of course, we can do both but that is a way different scope. Firebase's database is meant for documents, these kinds of operations are more relational (like SQL). There is no easy way to do both.

BUT what we can do:

  1. Have a button "more" that loads the next 50
  2. have a reset button that brings us back to the begininng.

Available for testing in stage - please test and let me know how to proceed.

ggordn3r commented 4 years ago

This looks good. I'll have to document how it works. What determines which user/poll shows up on page 1? Is it creation date? As I mentioned above, ideally the users with recent logins and polls with recent create dates are the first ones to appear, but I understand that's more of a SQL request.

proggeramlug commented 4 years ago

It's pretty random who shows up first. As this is not sortable by default we just know that we are getting them in order (presumably, but not guaranteed, in which they are created).

ggordn3r commented 4 years ago

Ok, I'll document this.