Skip to content

Commit

Permalink
Issue #2725: code review changes
Browse files Browse the repository at this point in the history
  • Loading branch information
ksy36 committed May 31, 2019
1 parent 9d51f6a commit 508269a
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
1 change: 1 addition & 0 deletions grunt-tasks/concat.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ module.exports = function(grunt) {
"<%= jsPath %>/lib/flash-message.js",
"<%= jsPath %>/lib/homepage.js",
"<%= jsPath %>/lib/autogrow-textfield.js",
"<%= jsPath %>/lib/bugform-validation.js",
"<%= jsPath %>/lib/bugform.js",
"<%= jsDistPath %>/templates.js"
],
Expand Down
4 changes: 2 additions & 2 deletions webcompat/form.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,10 @@
username_message = u'A valid username must be {0} characters long'.format(
random.randrange(0, 99))

desc_label = u'Please write a short problem summary'
desc_label = u'Please write a short problem summary (mandatory)'
desc_message = u'A problem summary is required.'

url_label = u'Site URL'
url_label = u'Site URL (mandatory)'
browser_test_label = u'Did you test in another browser?'
textarea_label = u'Please describe what happened, including any steps you took before you saw the problem' # noqa

Expand Down
12 changes: 9 additions & 3 deletions webcompat/static/js/lib/bugform.js
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,9 @@ BugForm.prototype.enableSubmits = function() {

/* determines function based on whether validation returns true or false */
BugForm.prototype.determineValidityFunction = function(func, field, silent) {
if (func(field)) return "makeValid";
if (func(field)) {
return "makeValid";
}
return silent ? "makeInvalidSilent" : "makeInvalid";
};

Expand Down Expand Up @@ -329,7 +331,9 @@ BugForm.prototype.checkImageTypeValidity = function(event) {
}
// null out input.value so we get a consistent
// change event across browsers
if (event) event.target.value = null;
if (event) {
event.target.value = null;
}
};

BugForm.prototype.checkUrl = function(event) {
Expand Down Expand Up @@ -478,7 +482,9 @@ BugForm.prototype.makeInvalid = function(id) {
this.showError(id);
// someone might decide to just not select an image after seeing the error,
// so buttons shouldn't be disabled
if (id !== "image") this.disableSubmits();
if (id !== "image") {
this.disableSubmits();
}
};

BugForm.prototype.makeInvalidSilent = function(id) {
Expand Down

0 comments on commit 508269a

Please sign in to comment.