fix: trigger a save when switching flows; fixes
import { Component } from '@angular/core';
-import { IntegrationEditPage } from '../../edit-page/edit-page.component';
import { CanComponentDeactivate } from '@syndesis/ui/platform';
import { RouterStateSnapshot } from '@angular/router';
+import { IntegrationEditPage, INTEGRATION_SAVE } from '../../edit-page';
@Component({
selector: 'syndesis-integration-api-provider-operation-editor-page',
@@ -11,6 +11,13 @@ import { RouterStateSnapshot } from '@angular/router';
export class ApiProviderOperationsEditorComponent extends IntegrationEditPage
implements CanComponentDeactivate {
canDeactivate(nextState: RouterStateSnapshot) {
+ // When switching flows trigger a save operation in the background
+ if (
+ nextState.url.endsWith('edit') &&
+ this.currentFlowService.dirty$.getValue()
+ ) {
+ this.currentFlowService.events.emit({ kind: INTEGRATION_SAVE });
+ }
return (
nextState.url.endsWith('edit') ||
nextState.url.endsWith('operations') ||
