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

Bump comment maximum to 5000 #454

Merged
merged 2 commits into from
Jun 6, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion backend/grant/comment/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def __init__(self, proposal_id, user_id, parent_comment_id, content):
self.proposal_id = proposal_id
self.user_id = user_id
self.parent_comment_id = parent_comment_id
self.content = content[:1000]
self.content = content[:5000]
self.date_created = datetime.datetime.now()

@staticmethod
Expand Down
2 changes: 1 addition & 1 deletion backend/grant/proposal/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ def report_proposal_comment(proposal_id, comment_id):
@limiter.limit("30/hour;2/minute")
@requires_email_verified_auth
@body({
"comment": fields.Str(required=True, validate=validate.Length(max=1000)),
"comment": fields.Str(required=True, validate=validate.Length(max=5000)),
"parentCommentId": fields.Int(required=False, missing=None),
})
def post_proposal_comments(proposal_id, comment, parent_comment_id):
Expand Down
82 changes: 66 additions & 16 deletions backend/tests/test_data.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from grant.utils.enums import Category

from .mocks import mock_request

test_user = {
Expand Down Expand Up @@ -54,22 +55,71 @@

test_comment_large = {
"comment": """
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
"""
massa vitae tortor condimentum lacinia quis vel eros donec ac odio tempor orci dapibus ultrices
in iaculis nunc sed augue lacus viverra vitae congue eu consequat ac felis donec et odio
pellentesque diam volutpat commodo sed egestas egestas fringilla phasellus
faucibus scelerisque eleifend donec pretium vulputate sapien nec
sagittis aliquam malesuada bibendum arcu vitae elementum curabitur
vitae nunc sed velit dignissim sodales ut eu sem integer vitae justo
eget magna fermentum iaculis eu non diam phasellus vestibulum lorem sed
risus ultricies tristique nulla aliquet enim tortor at auctor urna nunc id
cursus metus aliquam eleifend mi in nulla posuere sollicitudin aliquam ultrices
sagittis orci a scelerisque purus semper eget duis at tellus at urna condimentum
mattis pellentesque id nibh tortor id aliquet lectus proin nibh nisl condimentum id
venenatis a condimentum vitae sapien pellentesque habitant morbi tristique senectus
et netus et malesuada fames ac turpis egestas sed tempus urna et pharetra pharetra
massa massa ultricies mi quis hendrerit dolor magna eget est lorem ipsum dolor sit
amet consectetur adipiscing elit pellentesque habitant morbi tristique senectus et
netus et malesuada fames ac turpis egestas integer eget aliquet nibh praesent
tristique magna sit amet purus gravida quis blandit turpis cursus in hac habitasse
platea dictumst quisque sagittis purus sit amet volutpat consequat mauris nunc
congue nisi vitae suscipit tellus mauris a diam maecenas sed enim ut sem viverra
aliquet eget sit amet tellus cras adipiscing enim eu turpis egestas pretium aenean
pharetra magna ac placerat vestibulum lectus mauris ultrices eros in cursus
turpis massa tincidunt dui ut ornare lectus sit amet est placerat in egestas
erat imperdiet sed euismod nisi porta lorem mollis aliquam ut
porttitor leo a diam sollicitudin tempor id eu nisl nunc mi
ipsum faucibus vitae aliquet nec ullamcorper sit amet risus
nullam eget felis eget nunc lobortis mattis aliquam faucibus
purus in massa tempor nec feugiat nisl pretium fusce id velit ut tortor
pretium viverra suspendisse potenti nullam ac tortor vitae purus faucibus ornare suspendisse
sed nisi lacus sed viverra tellus in hac habitasse platea
dictumst vestibulum rhoncus est pellentesque
elit ullamcorper dignissim cras tincidunt lobortis feugiat vivamus at augue eget arcu dictum varius duis at
consectetur lorem donec massa sapien faucibus et molestie ac feugiat sed lectus
vestibulum mattis ullamcorper velit sed ullamcorper morbi tincidunt ornare massa
eget egestas purus viverra accumsan in nisl nisi scelerisque eu ultrices vitae auctor
eu augue ut lectus arcu bibendum at varius vel pharetra vel turpis nunc eget lorem dolor sed viverra ipsum nunc
aliquet bibendum enim facilisis gravida neque convallis a cras semper auctor neque vitae tempus quam pellentesque
nec nam aliquam sem et tortor consequat id porta nibh venenatis cras sed felis eget velit aliquet sagittis id
consectetur purus ut faucibus pulvinar elementum integer enim neque volutpat ac tincidunt vitae semper quis lectus
nulla at volutpat diam ut venenatis tellus in metus vulputate eu scelerisque felis imperdiet proin fermentum leo
vel orci porta non pulvinar neque laoreet suspendisse interdum consectetur libero id faucibus nisl tincidunt eget
nullam non nisi est sit amet facilisis magna etiam tempor orci eu lobortis elementum nibh tellus molestie nunc non
blandit massa enim nec dui nunc mattis enim ut tellus elementum sagittis vitae et leo duis ut diam quam nulla
porttitor massa id neque aliquam vestibulum morbi blandit cursus risus at ultrices mi tempus imperdiet nulla
malesuada pellentesque elit eget gravida cum sociis natoque penatibus et magnis dis parturient montes nascetur
ridiculus mus mauris vitae ultricies leo integer malesuada nunc vel risus commodo viverra maecenas accumsan lacus
vel facilisis volutpat est velit egestas dui id ornare arcu odio ut sem nulla pharetra diam sit amet nisl suscipit
adipiscing bibendum est ultricies integer quis auctor elit sed vulputate mi sit amet mauris commodo quis imperdiet
massa tincidunt nunc pulvinar sapien et ligula ullamcorper malesuada proin libero nunc consequat interdum varius
sit amet mattis vulputate enim nulla aliquet porttitor lacus luctus accumsan tortor posuere ac ut consequat semper
viverra nam libero justo laoreet sit amet cursus sit amet dictum sit amet justo donec enim diam vulputate ut
pharetra sit amet aliquam id diam maecenas ultricies mi eget mauris pharetra et ultrices neque ornare aenean
euismod elementum nisi quis eleifend quam adipiscing vitae proin sagittis nisl rhoncus mattis rhoncus urna neque
viverra justo nec ultrices dui sapien eget mi proin sed libero enim sed faucibus turpis in eu mi bibendum neque
egestas congue quisque egestas diam in arcu cursus euismod quis viverra nibh cras pulvinar mattis nunc sed blandit
libero volutpat sed cras ornare arcu dui vivamus arcu felis bibendum ut tristique et egestas quis ipsum
suspendisse ultrices gravida dictum fusce ut placerat orci nulla pellentesque dignissim enim sit amet venenatis
urna cursus eget nunc scelerisque viverra mauris in aliquam sem fringilla ut morbi tincidunt augue interdum velit
euismod in pellentesque massa placerat duis ultricies lacus sed turpis tincidunt id aliquet risus feugiat in ante
metus dictum at tempor commodo ullamcorper a lacus vestibulum sed arcu non odio euismod lacinia at quis risus sed
vulputate odio ut enim blandit volutpat maecenas volutpat blandit aliquam etiam erat velit scelerisque in dictum
non consectetur a erat nam at lectus urna duis convallis convallis tellus id interdum velit laoreet id donec
ultrices tincidunt arcu non sodales neque
sodales ut etiam sit amet nisl purus in mollis nunc sed id semper risus in hendrerit gravida rutrum quisque non
tellus orci ac auctor augue mauris augue neque gravida in fermentum et sollicitudin
"""
}

test_reply = {
Expand Down
2 changes: 1 addition & 1 deletion frontend/client/components/MarkdownEditor/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ export default class MarkdownEditor extends React.PureComponent<Props, State> {
generateMarkdownPreview={this.generatePreview}
commands={commands[type]}
readOnly={!!readOnly}
textAreaProps={{ maxLength: 1000 }}
textAreaProps={{ maxLength: 5000 }}
minEditorHeight={minHeight}
minPreviewHeight={minHeight - 10}
maxEditorHeight={99999}
Expand Down