@uiowa/universal-workflow
v2.1.0
Published
universal-workflow, uiowa-universal-workflow, universal workflow
Downloads
227
Readme
UIOWA Universal Workflow
This NPM package @uiowa/universal-workflow serves as the standard way to display Universal Workflow widget and routing history in Angular. The package contains two components, workflow-widget and uw-routing-history, and a service WorkflowService.
This package depends on @uiowa/spinner which shows a loading placeholder while the Universal Workflow data is loading.
Usage
The Widget Component
@if(uwPermissions?.canSign){ <workflow-widget [packageId]="packageId" /> } @else { <uw-routing-history [packageId]="packageId" /> }ngOnInit(): void { this.route.queryParamMap .pipe( switchMap((params: ParamMap) => { if (!params) { return of(null); } this.packageId = +(params.get('packageId') || ''); if (!this.packageId) { return of(null); } this.loading.set(true); return this.svc.getMyForm(this.packageId).pipe(finalize(() => this.loading.set(false))); }) ) .subscribe((x) => { if (x) { this.dataRows = x.data; this.uwPermissions = x.permissions; } }); }The Routing History Component
<uw-routing-history [packageId]="13082237" />The Workflow Service
By default, you don't need to touch the
WorkflowService. The service has two methods:getWorkflowWidgetConfig()andgetPackageRoutingHistory(packageId: number): Observable<string>, which call backend API endpoints${this.api}/widget-configand${this.api}/packages/${packageId}/routing-historywhereprotected readonly api: string = 'api/workflow'.If you decide to choose a different implementation, then you can follow the demo app in this solution to provide another service.
