diff --git a/frontends/dnet-is-application/src/app/app-routing.module.ts b/frontends/dnet-is-application/src/app/app-routing.module.ts index eff2fa6e..4f890422 100644 --- a/frontends/dnet-is-application/src/app/app-routing.module.ts +++ b/frontends/dnet-is-application/src/app/app-routing.module.ts @@ -21,6 +21,7 @@ const routes: Routes = [ { path: "adv_resources/protocol", component: ProtocolsComponent }, { path: "adv_resources/email", component: EmailsComponent }, { path: "wfs/:section", component: WfConfsComponent }, + { path: "wfs/conf/:conf", component: WfConfsComponent }, { path: "wf_history", component: WfHistoryComponent }, { path: "ctx_viewer", component: ContextViewerComponent }, { path: "voc_editor", component: VocabularyEditorComponent }, diff --git a/frontends/dnet-is-application/src/app/common/is.service.ts b/frontends/dnet-is-application/src/app/common/is.service.ts index 2f31d362..8befa3a9 100644 --- a/frontends/dnet-is-application/src/app/common/is.service.ts +++ b/frontends/dnet-is-application/src/app/common/is.service.ts @@ -24,10 +24,6 @@ export class ISService { this.httpGet("/ajax/resourceTypes/" + encodeURIComponent(id), onSuccess); } - loadWfSections(onSuccess: Function) { - this.httpGet("/ajax/wfs/sections", onSuccess) - } - loadInfo(onSuccess: Function): void { this.httpGet("/ajax/info/", onSuccess); } @@ -228,17 +224,18 @@ export class ISService { deleteEmailTemplate(id: string, onSuccess: Function): void { this.httpDelete('./ajax/templates/email/' + encodeURIComponent(id), onSuccess); } + loadWfSections(onSuccess: Function) { + this.httpGet("/ajax/wfs/sections", onSuccess) + } loadWfConfigurations(sectionId: string, onSuccess: Function): void { - this.httpGet('./ajax/wfs/section/' + encodeURIComponent(sectionId), onSuccess); + this.httpGet('./ajax/wfs/sections/' + encodeURIComponent(sectionId), onSuccess); } loadWfConfiguration(id: string, onSuccess: Function): void { this.httpGet('./ajax/wfs/conf/' + encodeURIComponent(id), onSuccess); } - - saveWfConfiguration(conf: WfConf, onSuccess: Function, relatedForm?: FormGroup): void { this.httpPost('./ajax/wfs/conf', conf, onSuccess, relatedForm); } diff --git a/frontends/dnet-is-application/src/app/wf-confs/wf-confs.component.html b/frontends/dnet-is-application/src/app/wf-confs/wf-confs.component.html index efb36755..a62d6fca 100644 --- a/frontends/dnet-is-application/src/app/wf-confs/wf-confs.component.html +++ b/frontends/dnet-is-application/src/app/wf-confs/wf-confs.component.html @@ -1,7 +1,16 @@

{{section?.name}}: Configured Workflows

+{{confs}} + - - Content 1 - Content 2 - Content 3 - +
+ {{conf}} +
+ +
+ Workflow Configuration does not exist +
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 34a2e15a..65bcde68 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 @@ -1,7 +1,7 @@ -import { Component, OnInit } from '@angular/core'; +import { Component, OnInit, SecurityContext } from '@angular/core'; import { MatDialog } from '@angular/material/dialog'; -import { ActivatedRoute } from '@angular/router'; -import { KeyValue, WfSection } from '../common/is.model'; +import { ActivatedRoute, Router } from '@angular/router'; +import { KeyValue, WfConf, WfSection } from '../common/is.model'; import { ISService } from '../common/is.service'; @Component({ @@ -13,19 +13,35 @@ export class WfConfsComponent implements OnInit { section?: WfSection; confs: KeyValue[] = []; + conf?: WfConf; - constructor(public service: ISService, public route: ActivatedRoute, public dialog: MatDialog) { + constructor(public service: ISService, public route: ActivatedRoute, public router: Router, public dialog: MatDialog) { } ngOnInit() { this.route.params.subscribe(params => { let sectionId = params['section']; - this.service.loadWfSections((data: WfSection[]) => this.section = data.find(s => s.id == sectionId)); - this.reload(); + let confId = params['conf']; + + if (confId) { + this.service.loadWfConfiguration(confId, (conf: WfConf) => { + this.conf = conf; + if (conf.section) { + this.service.loadWfSections((data: WfSection[]) => this.section = data.find(s => s.id == conf?.section)); + this.service.loadWfConfigurations(conf.section, (data: KeyValue[]) => this.confs = data); + } + }); + } else if (sectionId) { + this.service.loadWfSections((data: WfSection[]) => this.section = data.find(s => s.id == sectionId)); + this.service.loadWfConfigurations(sectionId, (data: KeyValue[]) => { + this.confs = data; + if (data.length > 0) { + this.router.navigate(['/wfs/conf', data[0].k]); + } + }); + } else { + console.log("One of the following parameters is missing: sectionId or confId"); + } }); } - - reload() { - - } }