Skip to content

Commit

Permalink
Merge pull request #3521 from webcompat/isssue/3520/1
Browse files Browse the repository at this point in the history
Fixes #3520: Bring back min characters rule for description field
  • Loading branch information
Karl Dubost authored Jan 26, 2021
2 parents f34865d + 2666171 commit 626fbf2
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 10 deletions.
4 changes: 2 additions & 2 deletions tests/functional/reporting-auth.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@ registerSuite("Reporting (auth)", {
.findDisplayedByCssSelector(".next-description")
.getAttribute("disabled")
.then(function (attribute) {
// Make sure "Continue" is enabled by default
assert.isNull(attribute);
// Make sure "Continue" is disabled if there are not enough characters
assert.isNotNull(attribute);
})
.end()
.findById("steps_reproduce")
Expand Down
8 changes: 4 additions & 4 deletions tests/functional/reporting-issue-wizard-non-auth.js
Original file line number Diff line number Diff line change
Expand Up @@ -175,8 +175,8 @@ registerSuite("Reporting with wizard", {
.findDisplayedByCssSelector(".next-description")
.getAttribute("disabled")
.then(function (attribute) {
// Make sure "Continue" is enabled by default
assert.isNull(attribute);
// Make sure "Continue" is disabled if there are not enough characters
assert.isNotNull(attribute);
})
.end()
.findById("steps_reproduce")
Expand Down Expand Up @@ -521,8 +521,8 @@ registerSuite("Reporting with wizard", {
.findDisplayedByCssSelector(".next-description")
.getAttribute("disabled")
.then(function (attribute) {
// Make sure "Continue" is enabled by default
assert.isNull(attribute);
// Make sure "Continue" is disabled if there are not enough characters
assert.isNotNull(attribute);
})
.end()
// Enter more than 30 characters in the description field
Expand Down
2 changes: 1 addition & 1 deletion webcompat/static/js/lib/wizard/steps/description.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ const updateDescription = (url) => {

const showProgress = () => {
progress.removeClass("is-hidden");
$(".char-limit").text("Minimum 30 characters");
$(".char-limit").text(`Minimum ${MIN_CHARACTERS} characters`);
};

const initMinCharMode = () => {
Expand Down
7 changes: 4 additions & 3 deletions webcompat/templates/steps/description.html
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
<div class="step-container step-description col" data-min-char="false">
<div class="step-container step-description col" data-min-char="true">
<div class="row mobile-col">
<div class="input-control device-data-hero half">
<img class="protruding-img" src="{{ url_for('static', filename='img/svg/describe-issue.svg') }}" title="Describe issue" alt="Describe issue" />
<div class="description-text">
Any <strong>additional information</strong> you would like to specify? <br/>
That would help us diagnose the problem faster.
OK, now the vital part! <br>
Please <strong>describe what happened</strong>,
including any steps you took before you saw the problem.
</div>
</div>
<div class="input-control half col">
Expand Down

0 comments on commit 626fbf2

Please sign in to comment.