This implements a basic search of hubs, and puts the search in the search box at the top of the page
Fixes #461
Signed-off-by: Ryan Lerch rlerch@redhat.com
Hmm, I'd love it if we could get that URL from the backend, so we don't have to change it in both places if we need to (for example if Hubs is not installed at the domain root). Could you define a function that would take the url as the argument, and call that function from a script tag at the bottom of the HTML template, passing it something like {{ url_for('api_search')|tojson }} ? This pattern has already been used elsewhere in the code (for example to setup React).
script
{{ url_for('api_search')|tojson }}
There! A missing space! ;-)
This would also be a good candidate for a URL passed as a template. Or even better, return the Hub URL in the datum so you can just use it.
Did you just add a space a the end of the line here? Typo maybe?
Also add the hub's URL here so you can use it to redirect on selection.
rebased onto 93ca4543cedfd3e1259d630f534699da375fdff5
Okies! fixed the typos, and got the URLs from the url_for flask calls!
It looks great, thanks! I think it would be pretty cool if we could search in the hub's summary too, don't you think? Could you add that to the backend view?
rebased onto 434dafffe7084d1ddd54e57bbdfbed65fba24012
@abompard done! now searching on the summary as well as the hubname.
I'm thinking of something else: in the API endpoints we have as a convention to return {"status": "OK", "data": the_data} as JSON. I think it would be best to make the api_query_hubs endpoint adhere to that (and thus do some minor changes in the javascript to accomodate for the change).
{"status": "OK", "data": the_data}
api_query_hubs
Sorry for being so nitpicky! :-)
I'm thinking of something else: in the API endpoints we have as a convention to return {"status": "OK", "data": the_data} as JSON. I think it would be best to make the api_query_hubs endpoint adhere to that (and thus do some minor changes in the javascript to accomodate for the change). Sorry for being so nitpicky! :-)
Don't be sorry! it's good to get this right!
updated the commit with the status and data elements, and changed the search.js to pull from the new elements!
rebased onto 30323f033aa595092e6e9c40a44d39ab2cfd6a6a
Pull-Request has been merged by abompard
This implements a basic search of hubs, and puts the search
in the search box at the top of the page
Fixes #461
Signed-off-by: Ryan Lerch rlerch@redhat.com