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

Add django-admin-site-search #776

Merged
merged 2 commits into from
Dec 10, 2024
Merged

Add django-admin-site-search #776

merged 2 commits into from
Dec 10, 2024

Conversation

WillNilges
Copy link
Collaborator

@WillNilges WillNilges commented Dec 9, 2024

This PR implements Django Admin Site Search to MeshDB, so that you can easily search MeshDB. It adds a bar to the top of the interface you can click to open, or press CTRL+K (CMD+K on Mac) to open it.

image

The normal search bars are still present (for now) if you wish to use those.

Closes #706

@WillNilges
Copy link
Collaborator Author

There are some issues I've spotted with this, namely sometimes, the results are duplicated in the UI for whatever reason. It took me 10 minutes to install this and it's really useful, so I think this is a bug worth living with. Given a few days with the developer, I might be able to figure it out.

image

Copy link

codecov bot commented Dec 9, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 94.85%. Comparing base (d90c9ca) to head (8ae3736).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #776   +/-   ##
=======================================
  Coverage   94.85%   94.85%           
=======================================
  Files          89       89           
  Lines        3790     3792    +2     
=======================================
+ Hits         3595     3597    +2     
  Misses        195      195           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@Andrew-Dickinson
Copy link
Member

Some of the duplicates are due to model inheritance, but weird that the devices section is copied whole

@Andrew-Dickinson
Copy link
Member

Is there a way to do queryset filtering the way we do on the regular search so that we don’t give the admins links to the device objects underneath sectors and APs?

also I don’t think this incorporates the custom ranking logic, does it? That was very important for small length queries (I.e. “3”). The results for that were totally useless prior to the ranking changes

@WillNilges
Copy link
Collaborator Author

I'll have to get back to you on that. As I understood (at 2AM last night), the mode I've switched it to should be doing that filtering and using the same search logic (but I didn't test it that thoroughly).

I'm pretty sure there are ways to have custom logic. I will see if I can avoid reinventing the wheel, and if not, maybe I'll open another issue with the maintainer.

@WillNilges WillNilges merged commit 1931b2a into main Dec 10, 2024
12 checks passed
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.

Add "unified search" across all model types
2 participants