basxsoftwareassociation / bread

Engine to create database applications based on Django and the IBM Carbon Design System
BSD 3-Clause "New" or "Revised" License
19 stars 2 forks source link

Add default search for BrowseViews #107

Closed saemideluxe closed 2 years ago

saemideluxe commented 2 years ago

For the person browse overview we use a special SearchBackendConfig. This is good and should not change. However, the bread.views.BrowseView actually supports filtering via a URL parameter ("q" by default). This is currently not used anywhere.

We need to add support so that any browse view can have a simple default search. BrowseView.get_queryset has the filtering via djangoql implemented, this should be reused. We need to implement a configuration parameter so that a default SearchBackendConfig can be used for any view

An example use case would be the report browse view. Right now there is no way to search for the name of a report. After this is implemented, the report view should have a search-bar (via SearchConfigBackend) which allows to search by name. The browse view for reports should only need a small additional parameter to enable that search bar.

Important: This functionality should not use the resultcontainerid of bread.layout.components.search.Search but work via URL-queries and page reloads. It might be a bit challenging to implement this so that both ways work.

dward2nd commented 2 years ago

Done as in this PR #110

dward2nd commented 2 years ago

Moved from Test to Development because I got some comments from @saemideluxe to adjust the BrowseView's search.

dward2nd commented 2 years ago

I have almost completed the default search box for BrowseView. However, I still encounter a problem distinguishing between the general search input box one and one that might appear in other places (like a navigation bar).

dward2nd commented 2 years ago

We can technically apply this solution though it might look ugly in practice. Or maybe we should temporarily remove the default value based on the GET queries.

Screen Shot 2022-01-02 at 午後01 55 15
saemideluxe commented 2 years ago

Okay for now