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

[Northamptonshire] restrict title to 120 characters #2451

Merged
merged 2 commits into from
Apr 9, 2019

Conversation

struan
Copy link
Member

@struan struan commented Apr 3, 2019

Prevent people from using very long titles.

Fixes mysociety/fixmystreet-commercial#1344

Please check the following:

  • All cobrand-specific commits start their commit message with the cobrand in square brackets;
  • Is new functionality tested? CodeCov will warn you about the diff coverage, but won’t complain about e.g. new files;
  • Have you updated the changelog? If this is not necessary, put square brackets around this: [skip changelog]

Please check the contributing docs, and describe your pull request here.
Screenshots or GIF animations (using e.g. LICEcap) may be helpful.

Please include any issues that are fixed, using "fixes" or "closes" so that
they are auto-closed when the PR is merged.

Thanks for contributing!

@ghost ghost assigned struan Apr 3, 2019
@ghost ghost added the Reviewing label Apr 3, 2019
@struan struan force-pushed the issues/commercial/1244-ncc-title-character-limit branch from dab5600 to cc70303 Compare April 3, 2019 11:17
@codecov
Copy link

codecov bot commented Apr 3, 2019

Codecov Report

Merging #2451 into master will increase coverage by <.01%.
The diff coverage is 66.66%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2451      +/-   ##
==========================================
+ Coverage   81.06%   81.07%   +<.01%     
==========================================
  Files         196      196              
  Lines       12639    12642       +3     
  Branches     2349     2350       +1     
==========================================
+ Hits        10246    10249       +3     
+ Misses       1604     1603       -1     
- Partials      789      790       +1
Impacted Files Coverage Δ
perllib/FixMyStreet/Cobrand/Northamptonshire.pm 17.5% <66.66%> (+6.68%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 4200423...cc70303. Read the comment docs.

@codecov
Copy link

codecov bot commented Apr 3, 2019

Codecov Report

Merging #2451 into master will increase coverage by <.01%.
The diff coverage is 66.66%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2451      +/-   ##
==========================================
+ Coverage   81.18%   81.18%   +<.01%     
==========================================
  Files         197      197              
  Lines       12632    12635       +3     
  Branches     2344     2345       +1     
==========================================
+ Hits        10255    10258       +3     
+ Misses       1594     1593       -1     
- Partials      783      784       +1
Impacted Files Coverage Δ
perllib/FixMyStreet/Cobrand/Northamptonshire.pm 17.5% <66.66%> (+6.68%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 15c5006...355f891. Read the comment docs.

@struan struan requested a review from dracos April 3, 2019 14:04
Copy link
Member

@dracos dracos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comma issue; could we put maxlength on the actual input to save the user only finding out it's too long when they hit a button? (In fact, maxlength is on textarea too, so we should do this on detail too!)

templates/web/base/js/translation_strings.html Outdated Show resolved Hide resolved
@struan struan force-pushed the issues/commercial/1244-ncc-title-character-limit branch from 01676ab to 3115db7 Compare April 8, 2019 14:41
@struan struan requested a review from dracos April 8, 2019 14:41
Copy link
Member

@dracos dracos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is fine; ideally the maxlength should be output in the HTML also if someone has come to /report/new directly (the server presumably can know the location + body at that point, or at least only on the cobrand always would be simpler presumably).

@struan struan force-pushed the issues/commercial/1244-ncc-title-character-limit branch from 3115db7 to 5164b9e Compare April 8, 2019 15:46
If a field has a maximum length set in the javascript validation then
add a maxlength attribute so the user doesn't have to wait till
submission to find out about it.
@struan struan force-pushed the issues/commercial/1244-ncc-title-character-limit branch from 5164b9e to 355f891 Compare April 9, 2019 08:55
@struan struan merged commit 355f891 into master Apr 9, 2019
@ghost ghost removed the Reviewing label Apr 9, 2019
@struan struan temporarily deployed to github-pages April 9, 2019 08:56 Inactive
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.

None yet

2 participants