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] Display progress bar when deleting #1140

Merged
merged 4 commits into from
Jun 29, 2016
Merged

Conversation

fzaninotto
Copy link
Member

Closes #1109

@jpetitcolas
Copy link
Contributor

It would be great to test that progression.start() and progression.done() are called correctly in the controller (in both case of success and case of error).

@jpetitcolas
Copy link
Contributor

👍

return this.WriteQueries.deleteOne(this.view, this.entityId)
.then(() => this.previousStateParametersDeferred.promise)
.then(previousStateParameters => {
// if previous page was related to deleted entity, redirect to list
if (previousStateParameters.entity === entityName && previousStateParameters.id === this.entityId) {
this.$state.go(this.$state.get('list'), angular.extend({
return this.$state.go(this.$state.get('list'), angular.extend({
entity: entityName
}, this.$state.params));
} else {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You don't need an else statement here

@fzaninotto
Copy link
Member Author

@jpetitcolas this can only be done in an e2e test (because the done() is called in the resolve phase of the next route), and is very hard to test due to timing issues.

It is left as an exercise for the reader.

@fzaninotto
Copy link
Member Author

review applied

@RobinBressan RobinBressan merged commit 9eef85c into master Jun 29, 2016
@RobinBressan RobinBressan deleted the delete_progress branch June 29, 2016 11:36
@marmelab-bot
Copy link
Contributor

Thanks @fzaninotto for contributing to marmelab open-source projects!
As a sign of our gratitude, you can publish an image to advertise your brand on the marmelab website for a whole day.
Head to this page to submit your image. It will appear on Zero Dollar Homepage, powered by blockchain technology.

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.

4 participants