-
Notifications
You must be signed in to change notification settings - Fork 724
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
[RFR]remember list filter when navigating on same entity. #418
Conversation
$location.path(entityLabel + '/list'); | ||
$state.go($state.get('list'), { | ||
entity: _this.entity.name(), | ||
page: _this.$state.params.page, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why don't you use $state
instead?
Please copy the params only if the target entity is the same as the current entity - otherwise you may apply filters set on the posts list to a list of comments |
Also, this PR deserves e2e tests |
fe06bff
to
9dee910
Compare
Need rebase |
9dee910
to
5e4cdb4
Compare
rebased |
@@ -15,7 +15,13 @@ define(function () { | |||
scope.label = scope.label || 'Create'; | |||
|
|||
scope.gotoCreate = function () { | |||
$state.go($state.get('create'), { 'entity': scope.entity().name() }); | |||
$state.go($state.get('create'), { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not merging $state.params?
like angular.extend($state.params, {/* ... */});
?
Need rebase, again... And can you skip your e2e tests because they don't work on saucelabs (see #445). |
…e/delete/batchdelete page
5db3f01
to
3c32452
Compare
[RFR]remember list filter when navigating on same entity.
Seems to me if you go to show record, and click list to come back, it'll go back to the page with filters. But this is not the case for edit and create view ? Ok, I checked the code, previousState is what we're using to track the page states, therefore it works if you click the list right after show/create/edit. However our create/edit is not one step thing, you normally will click on create and then submit, and then click list, so by then this old state is lost. Unless we can go to list page right after create/edit, I don't think this will be possible. Note: I tried the latest creation hook, and i suggest to make some changes to include previousState in the onSubmitSuccess(), #898 |
save filter page and sort in state when going from list to edit/create/delete/batchdelete page, and restore it when going back to the list view.