-
-
Notifications
You must be signed in to change notification settings - Fork 38
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
Add unbelievably terrible search #165
Add unbelievably terrible search #165
Conversation
5ecc971
to
1d3b358
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good as a quick solution. One suggestion would be to hide/not render the search on /assignedPages
. I was confused for a second why it wasn't working there. Maybe with something equally terrible like
{(this.props.match.url === '/assignedPages') ? null :
<div className="row search-bar">
<input
type="text"
placeholder="Search for a URL..."
onChange={this._didSearch}
/>
</div>
}
=P
if (!/^(\*|\/\/|(h|ht|htt|https?|https?\/|https?\/\/))/.test(url)) { | ||
url = url = `*//${url}`; | ||
} | ||
// If the search is for a domain + TLD, return all paths under it |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just curious what TLD means?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Top Level Domain — e.g. .com
, .gov
, etc.
This does not fully handle #64, but is a start and is a quick-and-dirty way to search by URL. It should probably be totally rewritten if we want to do a good job.
1d3b358
to
ad10093
Compare
@lightandluck would it be better to just make it work on both views by removing the bone-headed hard-coded argument here? https://github.com/edgi-govdata-archiving/web-monitoring-ui/pull/165/files#diff-ff4ff84c13b0f2bc72a520d104382c74R78 |
I tried changing that to use I assumed you didn't want to futz around with it and just made it work for the |
Is that exactly what you tried? I’m guessing it didn’t work because that’s state, not a prop. It works for me ( |
Doh! Yea, if it's that simple, let's change it |
Ugh, sorry this took me so long to come back around to. How is this now? |
Np, looks good, works on both views now. 👍 |
This is not very good and should probably be totally rewritten, but I’m realizing just having something for this would be really useful. Pertains to #64 but is in no a way a well-thought-through or even full solution.
This lets you search by URL only (though you can include
*
as a wildcard anywhere in the URL).Depends on #164.