From cdb3381d3e17508bab3aa286b0b288f164dbc914 Mon Sep 17 00:00:00 2001 From: "michele.artini" Date: Thu, 30 Mar 2023 12:34:36 +0200 Subject: [PATCH] ui --- .../src/app/wf-confs/wf-confs.component.ts | 20 ++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/frontends/dnet-is-application/src/app/wf-confs/wf-confs.component.ts b/frontends/dnet-is-application/src/app/wf-confs/wf-confs.component.ts index 352764ee..7e0c2386 100644 --- a/frontends/dnet-is-application/src/app/wf-confs/wf-confs.component.ts +++ b/frontends/dnet-is-application/src/app/wf-confs/wf-confs.component.ts @@ -3,6 +3,7 @@ import { Component, Inject, OnInit, SecurityContext } from '@angular/core'; import { FormControl, FormGroup, ValidatorFn, Validators } from '@angular/forms'; import { MatDialog, MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog'; import { MatSelectChange } from '@angular/material/select'; +import { MatSnackBar } from '@angular/material/snack-bar'; import { ActivatedRoute, Router } from '@angular/router'; import { KeyValue, SimpleResource, WfConf, WfParam, WfSection } from '../common/is.model'; import { ISService } from '../common/is.service'; @@ -18,7 +19,7 @@ export class WfConfsComponent implements OnInit { confs: KeyValue[] = []; conf?: WfConf; - constructor(public service: ISService, public route: ActivatedRoute, public router: Router, public dialog: MatDialog) { + constructor(public service: ISService, public route: ActivatedRoute, public router: Router, public dialog: MatDialog, public snackBar: MatSnackBar) { } ngOnInit() { @@ -75,7 +76,12 @@ export class WfConfsComponent implements OnInit { launchWf() { - throw new Error('Method not implemented.'); + if (this.conf?.workflow) + this._launchWf(this.conf.workflow); + } + + _launchWf(wfId: string) { + } editConf() { @@ -86,7 +92,15 @@ export class WfConfsComponent implements OnInit { } deleteConf() { - throw new Error('Method not implemented.'); + if (this.conf?.destroyWf) { + this._launchWf(this.conf.destroyWf); + this.snackBar.open('Destroy Workflow launched, PLEASE WAIT !!!', 'INFO', { duration: 5000 }); + } else if (this.conf?.id) { + this.service.deleteWfConfiguration(this.conf?.id, (data: void) => { + this.snackBar.open('Configuration deleted !!!', 'INFO', { duration: 5000 }); + this.conf = undefined; + }); + } }