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

Add support for limit submit and unique field in store data option #272

Closed
wants to merge 2 commits into from

Conversation

eikichi18
Copy link
Member

Added support for field limit that limits form submission and the exceeding ones are added to a waiting list.
also added support to make one or more fields unique

…rt + added possibility to add a unique constraint for form block
@coveralls
Copy link

coveralls commented Jul 11, 2024

Pull Request Test Coverage Report for Build 9894366719

Details

  • 45 of 151 (29.8%) changed or added relevant lines in 2 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-1.2%) to 68.052%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/design/plone/contenttypes/patches/collective_volto_formsupport.py 39 145 26.9%
Totals Coverage Status
Change from base Build 9891347021: -1.2%
Covered Lines: 3323
Relevant Lines: 4883

💛 - Coveralls

@cekk
Copy link
Member

cekk commented Jul 11, 2024

Why are you using patches instead of more specific adapters for endpoints?

It could be good if you write down some documentation in the README and also in the code with some comments, for example to print out what are actually the lines that you are adding as patch (and we are not forced to manually do a diff with original method).

Another note: can't be better to move these changes into design.plone.policy, that has form dependency?
This should be a package for content-types (and is already full of behaviors).

Last but not least: please add some tests because this is a new feature that could break something.

Last but not least (bis): can't be better to have these features into a package that we can install only where we need? Otherwise have you tried to ask the community if they would like to have these features into the original package? Now there are several people that use this product and maybe could be useful for someone else..if we put it into a design.* package we're hiding it

@eikichi18
Copy link
Member Author

@cekk

from the code:

"""
We use this file to change the base behavior of collective.volto.formsupport
to support some new feature:
- limit on form submit
- unique field in one form
Why do we use monkeypatch instead of overriding the classes?
Because it's temporary, until collective.volto.formsupport can support backend
validation for data
"""

@eikichi18 eikichi18 closed this Jul 12, 2024
@eikichi18 eikichi18 deleted the us56319_prenotazioni_mediateca_formsupport branch July 12, 2024 10:33
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.

3 participants