This commit is contained in:
parent
ff908c7af3
commit
1a0bfe69a6
|
@ -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 },
|
||||
|
|
|
@ -24,10 +24,6 @@ export class ISService {
|
|||
this.httpGet<ResourceType>("/ajax/resourceTypes/" + encodeURIComponent(id), onSuccess);
|
||||
}
|
||||
|
||||
loadWfSections(onSuccess: Function) {
|
||||
this.httpGet<WfSection[]>("/ajax/wfs/sections", onSuccess)
|
||||
}
|
||||
|
||||
loadInfo(onSuccess: Function): void {
|
||||
this.httpGet<any[]>("/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<WfSection[]>("/ajax/wfs/sections", onSuccess)
|
||||
}
|
||||
|
||||
loadWfConfigurations(sectionId: string, onSuccess: Function): void {
|
||||
this.httpGet<KeyValue[]>('./ajax/wfs/section/' + encodeURIComponent(sectionId), onSuccess);
|
||||
this.httpGet<KeyValue[]>('./ajax/wfs/sections/' + encodeURIComponent(sectionId), onSuccess);
|
||||
}
|
||||
|
||||
loadWfConfiguration(id: string, onSuccess: Function): void {
|
||||
this.httpGet<WfConf>('./ajax/wfs/conf/' + encodeURIComponent(id), onSuccess);
|
||||
}
|
||||
|
||||
|
||||
|
||||
saveWfConfiguration(conf: WfConf, onSuccess: Function, relatedForm?: FormGroup): void {
|
||||
this.httpPost('./ajax/wfs/conf', conf, onSuccess, relatedForm);
|
||||
}
|
||||
|
|
|
@ -1,7 +1,16 @@
|
|||
<h2>{{section?.name}}: Configured Workflows</h2>
|
||||
{{confs}}
|
||||
<nav mat-tab-nav-bar *ngIf="confs.length > 0">
|
||||
<a mat-tab-link *ngFor="let c of confs" [routerLink]="['/wfs/conf', c.k]" routerLinkActive #rla="routerLinkActive"
|
||||
[active]="rla.isActive">
|
||||
{{c.v}}
|
||||
</a>
|
||||
</nav>
|
||||
|
||||
<mat-tab-group animationDuration="0ms">
|
||||
<mat-tab label="First">Content 1</mat-tab>
|
||||
<mat-tab label="Second">Content 2</mat-tab>
|
||||
<mat-tab label="Third">Content 3</mat-tab>
|
||||
</mat-tab-group>
|
||||
<div *ngIf="conf">
|
||||
{{conf}}
|
||||
</div>
|
||||
|
||||
<div *ngIf="!conf">
|
||||
Workflow Configuration does not exist
|
||||
</div>
|
||||
|
|
|
@ -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() {
|
||||
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue