-
Notifications
You must be signed in to change notification settings - Fork 8
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
Fix for feature requests #32 and #299 #6
base: master
Are you sure you want to change the base?
Conversation
…ing. Allow -t to specify file type.
Would you be interested in implementing the dropdown menu for search types? This implementation would only be a temporary workaround as the search type selection should also be easily available for non-advanced users. |
Yes, I think I can do it. I did some experiments, and it seems to work, but I'm not sure about the styling. |
The file type selection dropdown should probably be a separate component, which fetches the search types from the API and shows the options using the generic dropdown component. There are also existing utils to get an icon for each search type. I was thinking of a possibly collapsible (or popup?) advanced options panel, that could later also include other search options found from the Windows version (size limits, excluded words, hubs to search from and so on). |
That is probably more than I can do. I don't know Node or React or even TypeScript really. |
Now there is a drop-down also. Do you know what the proper way to automatically execute the search would be? |
You could do something similar that is currently being done in I'm going to be travelling during the next few weeks so I may not be able to respond to questions until I come back. |
I don't fully understand everything going on in there, so I went with a "simpler" solution that I can understand. Just launch the search from render with a small delay and make sure it only gets called once. It does not "blend in" with the framework 100%, but is quite easy to understand. |
Quality Gate passedIssues Measures |
With these fixes it solves both of my features from #299, and the duplicate from #32.
Query from URL populates the search box with input parameter query, if it exists, like this:
http://localhost:3000/search?query=search term
Searching for specific file types can now be done by prepending "-t XYZ" before the search term.
XYZ can be any of the allowed strings in the API, and also all the short hand alternatives that ncdc uses.
The parameter parsing is prepared for more parameters, but only -t does something at this point.
Specifying options in the search text itself is not as nice as having a dedicated drop down menu, but it should be good enough for the power users out there.