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

Previous state in onSubmitSuccess #1371

Open
tomy2105 opened this issue Nov 22, 2017 · 1 comment
Open

Previous state in onSubmitSuccess #1371

tomy2105 opened this issue Nov 22, 2017 · 1 comment

Comments

@tomy2105
Copy link

tomy2105 commented Nov 22, 2017

Has been mentioned long ago in #898.

It would be nice if previous state was available in onSubmitSuccess so one can redirect to (e.g list page) with correct pagination and filters.

As stated by @windmaomao in mentioned comment, something like this would be nice

        editionView.onSubmitSuccess(['previousState', 'progression', 'notification', '$state', 'entry', 'entity', function(previousState, progression, notification, $state, entry, entity) {
            // stop the progress bar
            progression.done();
            // add a notification
            notification.log(`Element #${entry._identifierValue} successfully edited.`, { addnCls: 'humane-flatty-success' });
            // redirect to the list view
            $state.go(previousState.name, previousState.params);
            // cancel the default action (redirect to the edition view)
            return false;
        }])
@tomy2105
Copy link
Author

Have fix for this but since it depends on #1361 and #1362 I'll submit pull when those two are merged.

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

No branches or pull requests

1 participant