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 configuration to customise rules for title and body #2

Open
PierreMesure opened this issue Jun 8, 2022 · 1 comment
Open

Add configuration to customise rules for title and body #2

PierreMesure opened this issue Jun 8, 2022 · 1 comment
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@PierreMesure
Copy link

Great module!

I wonder if you've thought of adding configuration possibilities for the rules that users have to respect when writing the title and body of the proposal. And if you'd need help to add it.

image

Decidim::SimpleProposal.configure do |config|
  config.min_length = 15 # Default
  config.max_caps_proportion = 25 # Default
  config.max_marks = 2 # Default
end

My intuition is that it would be as easy as overriding etiquette_validator.rb.

@ahukkanen
Copy link
Contributor

ahukkanen commented Jun 10, 2022

Hi Pierre! Why not?

I believe you mean with config.max_marks the amount of consecutive punctuation characters? I actually think that is good rule to have and we haven't really faced the issue that someone would've complained about this.

The capital character proportion and min length change are actual requests we've heard in the past. But I think the capital characters switch should be an on/off switch, either you want that rule or not. The 25% is already quite low threshold, so you probably want to remove the whole rule if it becomes a problem.

Min length could be configurable as you presented. We've faced this issue particularly with the titles, e.g. when someone suggested "Trash cans", "Go-carts", "Picnic", etc. But I do believe that the description limit should still be at least 15 characters even if the title character limit is decreased.

Would you be willing to send a PR for these features?

@ahukkanen ahukkanen added enhancement New feature or request help wanted Extra attention is needed labels Mar 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants