Skip to content

Commit

Permalink
Merge pull request #743 from MauroDataMapper/feature/gh-739
Browse files Browse the repository at this point in the history
gh-739 Fix Bulk Editor cancel action
  • Loading branch information
jamesrwelch authored Feb 1, 2023
2 parents a74fe54 + 6cb079c commit 2411e15
Showing 1 changed file with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import { StateHandlerService, MessageHandlerService } from '@mdm/services';
import { EditingService } from '@mdm/services/editing.service';
import { UIRouterGlobals } from '@uirouter/core';
import { EMPTY } from 'rxjs';
import { catchError } from 'rxjs/operators';
import { catchError, filter } from 'rxjs/operators';
import { BulkEditContext, BulkEditStep } from '../bulk-edit.types';

@Component({
Expand Down Expand Up @@ -79,8 +79,13 @@ export class BulkEditContainerComponent implements OnInit {
}

cancel() {
// The state handler is also tied to the EditingService, so will automatically confirm to leave first
this.stateHandler.GoPrevious();
this.editing
.confirmCancelAsync()
.pipe(filter((confirm) => !!confirm))
.subscribe(() => {
this.editing.stop();
this.stateHandler.GoPrevious();
});
}

next() {
Expand Down

0 comments on commit 2411e15

Please sign in to comment.