Skip to content

Commit 9657371

Browse files
committed
fixing delete button and cancel button
1 parent ec49d61 commit 9657371

File tree

3 files changed

+12
-3
lines changed

3 files changed

+12
-3
lines changed

quick-start/src/main/ui/app/flows/flows.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
<i class="mdi" [ngClass]="{'mdi-import': type === 'Input', 'mdi-looks' : type === 'Harmonize'}"></i>
4040
{{ flow.flowName }}
4141
<span class="mdl-layout-spacer"></span>
42-
<i class="fa fa-trash" (click)="deleteFlow(flow, type.toUpperCase())"></i>
42+
<i class="fa fa-trash" (click)="deleteFlow($event, flow, type.toUpperCase())"></i>
4343
<i class="fa fa-bug" *ngIf="flowHasError(entity.name, flow.flowName)"></i>
4444
</span>
4545
</div>

quick-start/src/main/ui/app/flows/flows.component.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,14 @@ export class FlowsComponent implements OnInit, OnDestroy {
214214
this.setCollapsed(entity, !collapsed);
215215
}
216216

217-
deleteFlow(flow: Flow, flowType: string): void {
217+
deleteFlow(event: MouseEvent, flow: Flow, flowType: string): void {
218+
if (event.stopPropagation) {
219+
event.stopPropagation();
220+
}
221+
if (event.preventDefault) {
222+
event.preventDefault();
223+
}
224+
event.cancelBubble = true;
218225
this.dialogService.confirm(`Really delete ${flow.flowName}`, 'Cancel', 'Delete').subscribe(() => {
219226
this.entitiesService.deleteFlow(flow, flowType).subscribe(() => {
220227
this.router.navigate(['/flows']);
@@ -363,6 +370,9 @@ export class FlowsComponent implements OnInit, OnDestroy {
363370
this.snackbar.showSnackbar({
364371
message: flow.entityName + ': ' + flow.flowName + ' starting...',
365372
});
373+
},
374+
() => {
375+
this.router.navigate(['/flows']);
366376
});
367377
}
368378

quick-start/src/main/ui/app/harmonize-flow-options/harmonize-flow-options.component.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ export class HarmonizeFlowOptionsComponent implements OnInit {
4343
}
4444

4545
cancel(): void {
46-
this.hide();
4746
this.finishedEvent.error(false);
4847
}
4948

0 commit comments

Comments
 (0)