Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor certificates to be able to show certificates for users when viewing as admin #1023

Open
mipyykko opened this issue Sep 21, 2022 · 1 comment

Comments

@mipyykko
Copy link
Collaborator

mipyykko commented Sep 21, 2022

Might need creating an endpoint in certificates to actually be able to get the certificate availability for other users than the one currently signed in

@mipyykko
Copy link
Collaborator Author

  • Current implementation only show certificate button when course has has_certificate set. This is not true for EoAI nor BAI (apart from Greek EoAI) so those will not appear -- should show certificate info to admin at least, but then courses that actually don't have any certificates would be queried from certificate API for no reason?

  • Querying the certificate_availability field slows things down considerably, so that user course summary page will take forever to load even if there's only one course to check!

  • As certificate_availability is under Completion and completion is tied to the parent course, we lose the information which course instance (ie. language version) it actually is -- apart from the language information in the completion, but that is not tied to the course. This happens even if we query it through the actual course instance, since it will return the handler course completion. This all means that as certificate_availability queries certificate API, it always uses the handler course slug -- but in Certificates the certificates are tied to the language version slug!

  • show certificate info in completion when logged in as admin, even if the course does not have has_certificate?

  • summary page now probably has ssr disabled in its query, maybe enable it? Same for other pages using the completions component.

  • don't query certificate_availability unless we really need it -- is it now in all UserOverview queries? Query only in useCertificates hook? Apollo might actually manage to batch the queries, even if there are multiple on the page.

  • move certificate_availability somewhere else where we still have the information on the original course instance? It belongs in completion semantically, but... Have the original course id in Completion model -- not necessarily in the database, but passed on from whichever thing queries it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant