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

BIG-22371 - Add validation to search boxes #600

Merged
merged 3 commits into from
Oct 29, 2015
Merged

BIG-22371 - Add validation to search boxes #600

merged 3 commits into from
Oct 29, 2015

Conversation

mickr
Copy link

@mickr mickr commented Oct 29, 2015

BIG-22371

  • Add validation to quicksearch box
  • Add Validation to search box on Advanced search page.

* Add validation to quicksearch box
* Add Validation to search box on Advanced search page.
@bigbot
Copy link

bigbot commented Oct 29, 2015

Autotagging @mickr @mcampa @hegrec @haubc

this.validator.add({
selector: this.$form.find(element),
validate: 'presence',
errorMessage: 'Search field cannot be blank'
Copy link
Contributor

Choose a reason for hiding this comment

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

Translation please. You can add it to an element attribute:

errorMessage: $(element).data('error-message')

* Fixed spelling
* Added translation for error message
* optimized the variable name and element that gets passed to bindValidation
@hegrec
Copy link
Contributor

hegrec commented Oct 29, 2015

👍 LGTM, one thing I might do is move each of the chained calls to their own lines like we do in PHP 🍹

@mickr
Copy link
Author

mickr commented Oct 29, 2015

Like so?

let validator = internals.initValidation($quickSearchDiv)
.bindValidation($quickSearchDiv.find('#search_query'));

@hegrec
Copy link
Contributor

hegrec commented Oct 29, 2015

Yep, It's easier to see in steps what is happening

* Moved chained calls to seperate lines for legibility.
@mickr
Copy link
Author

mickr commented Oct 29, 2015

Done!

mickr pushed a commit that referenced this pull request Oct 29, 2015
BIG-22371 - Add validation to search boxes
@mickr mickr merged commit 1647fec into bigcommerce:master Oct 29, 2015
@mickr mickr deleted the BIG-22371 branch October 29, 2015 19:53
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.

4 participants