-
Notifications
You must be signed in to change notification settings - Fork 725
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
filters - the list should remain filtered if we access the same ui-state in different ways #685
Comments
Hi Gabriela, And thanks for the compliment. filters are already persistent when you navigate within an entity, i.e. if you go from the filtered list of clients to a client detail, and then back to the list (using the list button or the browser's back button), the filters are kept (since #418). Also, the filters do have a watch if you change the URL, the filters update. The only think that doesn't work in what you ask for is that filters aren't kept when going back to the list using the sidebar menu. And I'm not sure if we want to keep filters on in this case, because I find it convenient to be able to reset filters by clicking on the sidebar menu. I wonder what other users think about it? |
Hi, I'm a colleague of githubGabriela working on the same project. The main issue with the filter reset when clicking on the navigational menu on the left, is that the although the list is no longer filtered, the value remains in the filter input field. This prevents (due to lazy binding) to apply the same value to the filter. To explain with the example of githubGabriela:
On top of the fact that this prevents searching again on John, without first entering a new value, this is also not consistent. The filter display indicates the presence of a filter that is not applied to the list. This behaviour was observed on version 0.8.0. On top of this, it would be nice to have an option when defining the filters to give them a default value. The use case we have, is that the default view of the list should be to only show the clients of the current user, but with an option to deactivate this filter to view all clients. Currently this is not possible, since the permanent filter cannot be interacted with by the user, and we cannot set a default value in a regular filter, that is applied on first/initial visit to the page. |
Hi Mark, I can't reproduce the issue in ng-admin-demo (http://marmelab.com/ng-admin-demo/).
Are you using the latest ng-admin version? |
Actually, the situation seems worse on the demo. I executed the following steps on the demo:
The problem only exists if the first visit is through the link on the dashboard pane. When going to the view through the menu bar, everything works as described: when clicking again on the menu bar, the filter is reset. My guess is that it is somehow related to the search=null query parameter added to the url when going to the list coming from the dashboard. This must somehow mess with the scopes/states of the application. We are using the latest released version of ngadmin (0.8.0), which in regards to the multiple commits, is no longer the most up to date. :) On which version is the demo running? |
BTW, nice login page. Is this now also a feature of ng-admin (or upcoming) or has it been implemented especially for the demo site? |
I've split off the request for the default value feature into a separate issue (#690) |
The "orders" page is in fact a list of "commands" with a preset filter of "status=ordered". If you click on "pending orders" from the homepage, you should also arrive to a prefiltered list. In other terms, what you see in the ng-admin demo is normal. You should use the (yet unreleased) 0.9.0-dev, i.e. the github master HEAD. As for the login, it's a very simple (and insecure) login page. Look at the source to see how it works. |
I understand, but this means there is a bug with this, since when coming from the dashboard, the list is not filtered on status. |
We don't understand each other. I suggest you come to chat on ng-admin's gitter channel to make things clearer for me. |
OK, after chatting with @marknelissen, the bug is confirmed. Reproduction is simple:
Adding the "bug" label. |
Hello guys :) Very good work with ng-admin, congrats!!!!!
I have a little bug with the filters..
So, my application has a dashboard with a list of Clients, and a menu with clients and other entities. From the dashboard I can go to the page /clients/list where I list the clients with some information.
I also added some filters on name, status and address.
To see the list of clients I can also click on the menu Clients that correspond to the same url: /clients/list
(I want to specify that these are views generated by ng-admin, none of them is custom)
So, this is the workflow:
From the dahsboard, I click on the link 'My Clients' and I am redirected to /clients/list. Then I filter by name, I put the value 'john' in the textbox filter.
My table is filtered correctly, so everything is OK till now.
Then I click on the menu item 'My Clients' and I am redirected to the same url /clients/list, with the value of the filter 'john' (the value remains typed in).
The problem is that the list of clients is not filtered anymore because the _filter query is made only when we type something in the filter box.
Actually the filter should have a watch.. if there is something already typed in the filter then it should list the clients filtered.
Thank you!
Gabriela
The text was updated successfully, but these errors were encountered: