Previous state in onSubmitSuccess
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 3.9k
- Forks
- 703
- PR merge metrics
- No merged PRs in 30d
Description
Has been mentioned long ago in https://github.com/marmelab/ng-admin/pull/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;
}])
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Read the discussion in pull request #898, then locate the onSubmitSuccess callback and how its injectable arguments are assembled. Make the previous state and its parameters available to the callback so a caller can redirect with the earlier pagination and filters; verify the default redirect can still be cancelled as shown in the example.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- angularjs, javascript
- Domain
- frontend
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100