]> cat aescling's git repositories - mastodon.git/commitdiff
Increase poll option length limit to 100 chars, number of options to 5
authorThibaut Girka <thib@sitedethib.com>
Fri, 13 Sep 2019 20:32:19 +0000 (22:32 +0200)
committerThibG <thib@sitedethib.com>
Thu, 10 Oct 2019 18:13:59 +0000 (20:13 +0200)
app/javascript/mastodon/features/compose/components/poll_form.js
app/validators/poll_validator.rb

index 211601d520602fb02a6d1c357138120ed991167e..bdccf9ce76d28a350b0b56e6a5c760c36572906d 100644 (file)
@@ -77,7 +77,7 @@ class Option extends React.PureComponent {
 
           <AutosuggestInput
             placeholder={intl.formatMessage(messages.option_placeholder, { number: index + 1 })}
-            maxLength={25}
+            maxLength={100}
             value={title}
             onChange={this.handleOptionTitleChange}
             suggestions={this.props.suggestions}
@@ -142,7 +142,7 @@ class PollForm extends ImmutablePureComponent {
         </ul>
 
         <div className='poll__footer'>
-          {options.size < 4 && (
+          {options.size < 5 && (
             <button className='button button-secondary' onClick={this.handleAddOption}><Icon id='plus' /> <FormattedMessage {...messages.add_option} /></button>
           )}
 
index 9d7321cad62966eea8ad85800952ed0cbc824b08..8259a62e5641df1d9c4c9c4ef220c4f119f7bb2a 100644 (file)
@@ -1,8 +1,8 @@
 # frozen_string_literal: true
 
 class PollValidator < ActiveModel::Validator
-  MAX_OPTIONS      = 4
-  MAX_OPTION_CHARS = 25
+  MAX_OPTIONS      = 5
+  MAX_OPTION_CHARS = 100
   MAX_EXPIRATION   = 1.month.freeze
   MIN_EXPIRATION   = 5.minutes.freeze