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

feat: add name and (exact) email fields to user search #25

Merged
merged 2 commits into from
Apr 29, 2015
Merged

feat: add name and (exact) email fields to user search #25

merged 2 commits into from
Apr 29, 2015

Conversation

bheiskell
Copy link
Collaborator

Didn't have much time to hack tonight. All I got done was the search with an avatar and their real name.

Addresses issue #15 and partly addresses #19

<div class="avatar avatar-64">
<img ng-src="{{match.model.avatar_url}}" width="64" />
</div>
<span bind-html-unsafe="match.label | typeaheadHighlight:query"></span>
Copy link
Owner

Choose a reason for hiding this comment

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

Won't this allow for html injection if the username contains html chars? Maybe we should escape the username or restrict it to ^[a-zA-Z0-9\-_]+$ in the User model

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The module handles the escaping for you. This is what's recommended in their documentation. It's an unsafe bind because they add strong tags around the username.

It's worth noting that the highlighting only works on the username, not their full name. Not sure how to make that work.

Add a few unit tests to verify expected behavior of the test.
@bheiskell
Copy link
Collaborator Author

@blaskovicz Updated

blaskovicz added a commit that referenced this pull request Apr 29, 2015
feat: add name and (exact) email fields to user search
@blaskovicz blaskovicz merged commit abce6b4 into blaskovicz:master Apr 29, 2015
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.

2 participants