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

[RFR]remember list filter when navigating on same entity. #418

Merged
merged 8 commits into from
May 20, 2015

Conversation

ThieryMichel
Copy link
Contributor

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.

$location.path(entityLabel + '/list');
$state.go($state.get('list'), {
entity: _this.entity.name(),
page: _this.$state.params.page,
Copy link
Member

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?

@fzaninotto
Copy link
Member

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

@fzaninotto
Copy link
Member

Also, this PR deserves e2e tests

@ThieryMichel ThieryMichel force-pushed the back_to_filtered_list branch 5 times, most recently from fe06bff to 9dee910 Compare May 13, 2015 17:08
@jeromemacias
Copy link
Contributor

Need rebase

@ThieryMichel ThieryMichel force-pushed the back_to_filtered_list branch from 9dee910 to 5e4cdb4 Compare May 18, 2015 12:08
@ThieryMichel
Copy link
Contributor Author

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'), {
Copy link
Contributor

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, {/* ... */}); ?

@jeromemacias
Copy link
Contributor

Need rebase, again... And can you skip your e2e tests because they don't work on saucelabs (see #445).

@ThieryMichel ThieryMichel force-pushed the back_to_filtered_list branch from 5db3f01 to 3c32452 Compare May 19, 2015 12:11
jeromemacias added a commit that referenced this pull request May 20, 2015
[RFR]remember list filter when navigating on same entity.
@jeromemacias jeromemacias merged commit 71d2721 into master May 20, 2015
@jeromemacias jeromemacias deleted the back_to_filtered_list branch May 20, 2015 12:14
@windmaomao
Copy link

windmaomao commented May 12, 2016

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

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.

5 participants