Skip to content

Add pagination for submissions#2710

Merged
Chartman123 merged 1 commit intonextcloud:mainfrom
Koc:feature/add-submission-pagination
May 12, 2025
Merged

Add pagination for submissions#2710
Chartman123 merged 1 commit intonextcloud:mainfrom
Koc:feature/add-submission-pagination

Conversation

@Koc
Copy link
Copy Markdown
Collaborator

@Koc Koc commented Apr 18, 2025

This PR adds pagination for submissions list page. Few notes about implementation:

  • It's not affect "Summary" tab
  • Pagination works on the server
  • There is an extra "search" field that used for filtering submissions
🔍 Preview

image
image

@Koc Koc requested review from Chartman123, Copilot and susnux April 18, 2025 14:44
@Koc Koc self-assigned this Apr 18, 2025

This comment was marked as outdated.

Comment thread src/views/Results.vue Outdated
Copy link
Copy Markdown
Collaborator

@Chartman123 Chartman123 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @Koc

nice start, here are a few comments:

  • I think we should split up the filtering from the rest of the pagination block and move it up to the right of the summary/responses switch
    grafik
  • The page dropdown is placed too high, there should be more spacing on top of it
  • floating style looks odd to me, should be just embedded into the page
  • page selection should be below the submissions or above and below but not only above them.
  • A max of 50 items seems too big for me as a default. You'd still have to scroll a lot before you reach the end of the page
  • At best we should make the item limit configurable (user setting)

Regarding the pagination in general: I think we should only fetch the currently shown submissions from the API. But in this case the filtering will no longer be able to work only in the front-end. So more adjustments needed then...

Comment thread src/views/Results.vue Outdated
Comment thread src/views/Results.vue
Comment thread src/views/Results.vue Outdated
Comment thread src/views/Results.vue Outdated
@Koc Koc force-pushed the feature/add-submission-pagination branch 2 times, most recently from 3b059eb to a8ee312 Compare April 20, 2025 23:39
@Koc
Copy link
Copy Markdown
Collaborator Author

Koc commented Apr 20, 2025

Hey @Chartman123 , thank you for quick feedback, very appreciated!

I've did some changes and updated screenshots in the PR description. So, I've moved pagination to backend and added extra parameter for full text search. For some reason it not works for me 😕 . Please help, feel free to push.

@Koc Koc force-pushed the feature/add-submission-pagination branch from a8ee312 to c10b122 Compare April 20, 2025 23:43
@Chartman123 Chartman123 force-pushed the feature/add-submission-pagination branch 6 times, most recently from 85c7892 to 07600cc Compare April 21, 2025 13:42
@Koc Koc force-pushed the feature/add-submission-pagination branch 3 times, most recently from 62b2f1f to 205dfea Compare April 21, 2025 22:34
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 21, 2025

Codecov Report

Attention: Patch coverage is 96.00000% with 2 lines in your changes missing coverage. Please review.

Project coverage is 45.54%. Comparing base (de7971b) to head (bacb41f).
Report is 16 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff              @@
##               main    #2710      +/-   ##
============================================
+ Coverage     44.49%   45.54%   +1.05%     
- Complexity      974      977       +3     
============================================
  Files            79       79              
  Lines          3531     3548      +17     
============================================
+ Hits           1571     1616      +45     
+ Misses         1960     1932      -28     
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@Koc Koc force-pushed the feature/add-submission-pagination branch 3 times, most recently from 0319a73 to 2bcdcd2 Compare April 21, 2025 22:56
@Koc Koc requested a review from Copilot April 22, 2025 09:20

This comment was marked as outdated.

@Koc Koc force-pushed the feature/add-submission-pagination branch 3 times, most recently from 69bb0a3 to 010352c Compare May 10, 2025 15:46
@Koc Koc force-pushed the feature/add-submission-pagination branch from 010352c to 26b7b03 Compare May 10, 2025 15:56
Comment thread lib/Db/SubmissionMapper.php Outdated
Copy link
Copy Markdown
Collaborator

@Chartman123 Chartman123 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

submissionCount is now part of the Form, you can just rely on it. I needed it for the allowEditSubmission PR :)

Comment thread lib/Controller/ApiController.php Outdated
Comment thread docs/API_v3.md Outdated
Comment thread lib/Controller/ApiController.php Outdated
Comment thread lib/Controller/ApiController.php Outdated
Comment thread lib/ResponseDefinitions.php Outdated
Comment thread tests/Unit/Controller/ApiControllerTest.php Outdated
Comment thread tests/Unit/Controller/ApiControllerTest.php Outdated
Comment thread tests/Unit/Controller/ApiControllerTest.php
Comment thread src/views/Results.vue Outdated
Comment thread src/views/Results.vue Outdated
@Koc
Copy link
Copy Markdown
Collaborator Author

Koc commented May 10, 2025

@Chartman123 mate, the problem is that we have 2 different counts. That's the reason why I'm using another property. BTW thanx for SQLite fix!

image

@Chartman123
Copy link
Copy Markdown
Collaborator

@Koc ah yes you're right... 🙈

@Chartman123
Copy link
Copy Markdown
Collaborator

But your count is wrong at the moment for shared forms:

grafik

You're counting all submissions and not only those by the current user if the user doesn't have the see all results permission

@Koc Koc force-pushed the feature/add-submission-pagination branch 4 times, most recently from ffd258b to c7889b3 Compare May 10, 2025 22:32
@Koc
Copy link
Copy Markdown
Collaborator Author

Koc commented May 10, 2025

We have green pipeline finally! 🎉

Also I've replaced shitty unit test for SubmissionMapper with a proper integration test that reads real data from db without mocking.

@Chartman123
Copy link
Copy Markdown
Collaborator

Count looks good now :) But I'm not happy with the name totalSubmissionsCount as it's not the total of all submissions available to the user. What about renaming it to filteredSubmissionsCount?

And the search box is not properly aligned to the other items in the block. You could also use the var(--default-grid-baseline) for the margin instead of the 4px.

@Koc Koc force-pushed the feature/add-submission-pagination branch from c7889b3 to 595cd3a Compare May 11, 2025 13:14
@Koc
Copy link
Copy Markdown
Collaborator Author

Koc commented May 11, 2025

@Chartman123 done ✔️

Copy link
Copy Markdown
Collaborator

@Chartman123 Chartman123 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Two more little comments, but rest looks fine for me :)

I posted this PR to Design team chat and asked if someone could have a look at it design-wise...

Comment thread src/components/Results/Answer.vue Outdated
Comment thread src/views/Results.vue Outdated
@Koc Koc force-pushed the feature/add-submission-pagination branch 4 times, most recently from 09b9ad7 to 01c34d3 Compare May 11, 2025 22:42
Copy link
Copy Markdown
Member

@jancborchardt jancborchardt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Just 2 comments:

Usually the pagination element is on the bottom of the oage rather than the top. It can be made sticky on the bottom if wanted.

At best we should make the item limit configurable (user setting)

@Chartman123 just for info – something unimportant as this should not be a setting but instead have a proper value, as per design guidelines. :)

@Chartman123
Copy link
Copy Markdown
Collaborator

@jancborchardt Thanks for the review 👍🏻

Usually the pagination element is on the bottom of the oage rather than the top.

@Koc could you then please remove the page selection from above the results?

Signed-off-by: Kostiantyn Miakshyn <molodchick@gmail.com>
@Koc Koc force-pushed the feature/add-submission-pagination branch from 01c34d3 to bacb41f Compare May 12, 2025 09:04
@Koc
Copy link
Copy Markdown
Collaborator Author

Koc commented May 12, 2025

@Chartman123 removed

@Chartman123 Chartman123 merged commit bdacb88 into nextcloud:main May 12, 2025
54 checks passed
@Chartman123 Chartman123 linked an issue May 17, 2025 that may be closed by this pull request
2 tasks
@Koc Koc deleted the feature/add-submission-pagination branch May 18, 2025 12:38
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

Successfully merging this pull request may close these issues.

Process forms in chunks or use pagination

4 participants