Add pagination to credentials and project credentials page#4672
Add pagination to credentials and project credentials page#4672sharleenawinja wants to merge 5 commits into
Conversation
|
@midigofrank could you please review this PR when you have a moment? Thanks! |
|
Hey @sharleenawinja , thank you. I will review this today |
|
Hi @sharleenawinja, thank you for this! There are two tests failing in CI, I think just because some of the HTML structures have changed. Would you mind taking a look before Frank reviews this properly? You can see the errors here: https://app.circleci.com/pipelines/github/OpenFn/lightning/17326/workflows/2b9ed83e-0bac-4f14-9180-2958451d29ac/jobs/93782/tests |
midigofrank
left a comment
There was a problem hiding this comment.
Hey @sharleenawinja , thank you for picking this up, you've picked a tough one, pagination in a page with multiple lists is an unchartered territory in lightning.
The credentials page is gnarly, it has multiple lists and the lists are shared in both the credentials page and the project settings page.
I see that you've chosen to do the pagination in the UI, I think that's understandable given the complexity of the page. I'm just not sure if that's the direction we want to take given that every other place does pagination using db queries. @elias-ba what do you think about this approach?
I also noticed that you created a new pagination component, could you try and reuse the one in https://github.com/OpenFn/lightning/blob/main/lib/lightning_web/pagination.ex ?
Also, test this in both pages (project settings and credentials page)
|
@midigofrank Thanks for the context. I'll rework the pagination to use DB queries to stay consistent with the rest of the app, and I'll reuse the existing pagination component instead of the one I added. I'll update the PR once that's done. |
d0a4068 to
a4ab2f0
Compare
|
@josephjclark @midigofrank @elias-ba I have switched to DB-level pagination and reused the existing pagination_bar component. Each table now paginates via URL params. For the pipeline, the elixir tests job is failing due to pre-existing flaky tests. |
Description
This PR adds pagination to the credentials, keychain credentials, and OAuth clients tables on the credentials list pages (10 items per page, with Previous/Next control). OAuth clients are now in a collapsible section, collapsed by default. Tables are ordered: credentials first, keychain credentials second, OAuth clients last.
Closes #4301
Validation steps
Go to
/credentialswith more than 10 credentials — confirm the table paginatesConfirm the OAuth Clients section is collapsed by default and the toggle shows/hides it.
If there are more than 10 OAuth clients, expand the section and confirm pagination works.
Verify the same behaviour on Project Settings → Credentials.
Additional notes for the reviewer
AI Usage
Please disclose whether you've used AI anywhere in this PR (it's cool, we just
want to know!):
You can read more details in our
Responsible AI Policy
Pre-submission checklist
/reviewwith Claude Code)
(e.g.,
:owner,:admin,:editor,:viewer)