nextcloud / forms

📝 Simple form & survey app for Nextcloud
https://apps.nextcloud.com/apps/forms
GNU Affero General Public License v3.0
324 stars 98 forks source link

feat: Allow to limit multiple question type #2080

Closed susnux closed 6 months ago

susnux commented 7 months ago

This allows to set a minimum and maximum of options that can or must be selected. E.g. you can enforce max. 3 options to be selected.

Other changes needed:

  1. Add custom validation
  2. Add validation of extra settings parameter types

Screenshots

settings error
Screenshot_20240420_021429 Screenshot_20240420_021446
susnux commented 6 months ago

@jancborchardt I am not sure about using the note card for validation / showing the error. What do you think?

Chartman123 commented 6 months ago

@jancborchardt I am not sure about using the note card for validation / showing the error. What do you think?

I think it looks nice and we could also use this for the other questions :)

Chartman123 commented 6 months ago

Could you please add some documentation here? https://github.com/nextcloud/forms/blob/main/docs/DataStructure.md#extra-settings

susnux commented 6 months ago

And as I stated in the other comment we should add the new extraSettings to the docs. And we should make sure that the min number can't be bigger than the max number. :)

Both fixed and also added a test for the options :)

susnux commented 6 months ago

Could you do another rebase so that we also have a Codecov update here?

image

:wink:

Chartman123 commented 6 months ago

Yes but last time I did that something regarding the signing went wrong 🙈

codecov[bot] commented 6 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 45.02%. Comparing base (82189a5) to head (b7404cc).

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #2080 +/- ## ============================================ + Coverage 44.76% 45.02% +0.26% - Complexity 710 720 +10 ============================================ Files 61 61 Lines 2761 2776 +15 ============================================ + Hits 1236 1250 +14 - Misses 1525 1526 +1 ```