Skip to content

feat: add maximum submissions limit for forms#3199

Merged
Chartman123 merged 1 commit into
nextcloud:mainfrom
LAfricain:maxsubmissions
Mar 14, 2026
Merged

feat: add maximum submissions limit for forms#3199
Chartman123 merged 1 commit into
nextcloud:mainfrom
LAfricain:maxsubmissions

Conversation

@LAfricain
Copy link
Copy Markdown

Add the ability to limit the number of responses a form can receive. When the limit is reached, the form is automatically closed and displays a dedicated message instead of accepting new submissions.

  • Add max_submissions column to forms_v2_forms table (migration)
  • Add maxSubmissions property to Form entity
  • Check submission limit in FormsService::canSubmit()
  • Add limit enforcement in ApiController::newSubmission()
  • Add isMaxSubmissionsReached flag in form API response
  • Add limit settings UI in SettingsSidebarTab
  • Display dedicated 'Form is full' message in Submit view
  • Add French translations for new strings

Closes #596

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.

@LAfricain thanks for your PR. I just had a quick look at your code and didn't test it yet in my instance. Already a few comments. :)

Comment thread l10n/fr.js
Comment thread l10n/fr.json
Comment thread lib/Controller/ApiController.php Outdated
Comment thread lib/Migration/Version050300Date20250914000000.php
Comment thread src/components/SidebarTabs/SettingsSidebarTab.vue
Comment thread src/components/SidebarTabs/SettingsSidebarTab.vue
Comment thread src/components/SidebarTabs/SettingsSidebarTab.vue Outdated
Comment thread src/components/SidebarTabs/SettingsSidebarTab.vue Outdated
Comment thread src/views/Submit.vue Outdated
Comment thread src/views/Submit.vue
@Chartman123 Chartman123 added this to the 5.3 milestone Mar 3, 2026
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.

Some more comments :) Please have a look at the failing workflows, too.

Comment thread lib/Service/FormsService.php Outdated
Comment thread lib/Controller/ApiController.php Outdated
Comment thread lib/Controller/ApiController.php
Comment thread lib/Migration/Version050300Date20260303000000.php
Comment thread src/components/SidebarTabs/SettingsSidebarTab.vue Outdated
@LAfricain
Copy link
Copy Markdown
Author

Hello @Chartman123,
I would like to know if everything is ready for a merge or if there are still some improvements to be made?
Thank you in any case for this tool!

@Chartman123
Copy link
Copy Markdown
Collaborator

@LAfricain sorry, I don't have much spare time at the moment :) Please fix the remaining workflow issues

@LAfricain
Copy link
Copy Markdown
Author

I don't have much spare time at the moment :)

It's Ok, no rush. I didn't realize I had to fix the errors myself; I still need to get used to the tool. It's done now.

@Chartman123
Copy link
Copy Markdown
Collaborator

@LAfricain yes, you have to fix them yourself (or use the npm scripts and php scripts). Environments like VSCode also can assist you with that :)

@codecov
Copy link
Copy Markdown

codecov Bot commented Mar 11, 2026

Codecov Report

❌ Patch coverage is 42.10526% with 11 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
lib/Migration/Version050300Date20260303000000.php 0.00% 10 Missing ⚠️
lib/Controller/ApiController.php 66.66% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

@Chartman123
Copy link
Copy Markdown
Collaborator

@LAfricain it's getting better :) only the DCO (sign-off your commits) and OpenAPI missing... Could you then please also squash all your commits into a single one?

@Chartman123
Copy link
Copy Markdown
Collaborator

Oh, please don't merge the main branch into this PR, always use git rebase -i main. There you can also squash the commits into a single one :)

@LAfricain LAfricain force-pushed the maxsubmissions branch 2 times, most recently from d1c6101 to 05bfd72 Compare March 13, 2026 07:33
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.

a few more comments that came up during test

Comment thread lib/Service/FormsService.php Outdated
Comment thread src/components/SidebarTabs/SettingsSidebarTab.vue Outdated
Comment thread src/views/Submit.vue Outdated
@Chartman123
Copy link
Copy Markdown
Collaborator

@LAfricain please add maxSubmissions to the FormsMigrator.php import. And please don't merge the main branch into your branch. This adds lots of changed files to the PR that aren't related. Please use git rebase as I already wrote in my last comment :)

@LAfricain
Copy link
Copy Markdown
Author

Hi @Chartman123, sorry for the mess with the main branch merge. I've cleaned everything up and the PR should now only contains the relevant files. I also added maxSubmissions to FormsMigrator.php as requested. Hope it's good now! 🙏

@Chartman123 Chartman123 force-pushed the maxsubmissions branch 2 times, most recently from 0be66b0 to 5bdd12e Compare March 14, 2026 22:27
Add the ability to limit the number of responses a form can receive.
When the limit is reached, the form is automatically closed and displays
a dedicated message instead of accepting new submissions.

- Add max_submissions column to forms_v2_forms table (migration)
- Add maxSubmissions property to Form entity
- Check submission limit in FormsService::canSubmit()
- Add limit enforcement in ApiController::newSubmission()
- Add isMaxSubmissionsReached flag in form API response
- Update FormsForm psalm type in ResponseDefinitions
- Add limit settings UI in SettingsSidebarTab
- Display dedicated 'Form is full' message in Submit view
- Update openapi.json
- Update unit and integration tests

Closes nextcloud#596

Signed-off-by: lafricain79 <lafricain79@gmail.com>
Signed-off-by: Christian Hartmann <chris-hartmann@gmx.de>
@Chartman123
Copy link
Copy Markdown
Collaborator

@LAfricain somehow the latest changes got lost again... I've rebased the commits again on current main and added the changes back. So from my side everything looks good now and I'll merge this PR :) Thanks for your contribution!!

@Chartman123 Chartman123 self-requested a review March 14, 2026 22:40
@Chartman123 Chartman123 merged commit dc294b4 into nextcloud:main Mar 14, 2026
57 of 58 checks passed
@github-actions
Copy link
Copy Markdown
Contributor

Hello there,
Thank you so much for taking the time and effort to create a pull request to our Nextcloud project.

We hope that the review process is going smooth and is helpful for you. We want to ensure your pull request is reviewed to your satisfaction. If you have a moment, our community management team would very much appreciate your feedback on your experience with this PR review process.

Your feedback is valuable to us as we continuously strive to improve our community developer experience. Please take a moment to complete our short survey by clicking on the following link: https://cloud.nextcloud.com/apps/forms/s/i9Ago4EQRZ7TWxjfmeEpPkf6

Thank you for contributing to Nextcloud and we hope to hear from you soon!

(If you believe you should not receive this message, you can add yourself to the blocklist.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Limit Number of Answers

2 participants