ucfopen / Materia

Engage students with easily embedded apps for online courses. Supercharge your course with compelling experiences and game mechanics.
https://ucfopen.github.io/Materia-Docs/
GNU Affero General Public License v3.0
36 stars 34 forks source link

Issue/1508 pagination #1541

Closed cayb0rg closed 8 months ago

cayb0rg commented 11 months ago

Reopens #1518 Fixes #1508

~Currently, the user and instance search retrieve all entries in the database on page load. Depending on feedback, this may switch to fetching only after someone has typed something.~ Fixed.

clpetersonucf commented 8 months ago

Additional feedback: loading the entire list of users and instances on admin page load is a definite no-go. That's a very expensive request and there's no good reason for it. I'd much rather exclusively return the results of search queries instead.

cayb0rg commented 8 months ago

New changes: updated the function names to use "instances" instead of "widgets", created useSearchInstances hook from useInstanceList, and prevents searching on page load in admin search panel.

cayb0rg commented 8 months ago

That's a good point; functions querying the widget_instance table are either fetching a page or only the first instance in the results, so it's safe to leave the default limit at 80.

Caught an issue with paginated results returning duplicate entries because of the ORDER BY keyword; removing this seems to have fixed it.