verben-workflow-ui 0.5.41 → 0.5.44
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm2022/src/lib/components/actors/actors.facade.mjs +36 -4
- package/esm2022/src/lib/components/actors/actors.service.mjs +1 -1
- package/esm2022/src/lib/components/designer/services/wf-persistence.service.mjs +22 -3
- package/esm2022/src/lib/components/my-queue/my-queue.facade.mjs +74 -4
- package/esm2022/src/lib/components/my-queue/my-queue.service.mjs +1 -1
- package/esm2022/src/lib/components/tasks/tasks.facade.mjs +48 -3
- package/esm2022/src/lib/components/tasks/tasks.service.mjs +1 -1
- package/esm2022/src/lib/components/workflows/workflows.facade.mjs +40 -4
- package/esm2022/src/lib/components/workflows/workflows.service.mjs +1 -1
- package/fesm2022/verben-workflow-ui-src-lib-components-actors.mjs +35 -3
- package/fesm2022/verben-workflow-ui-src-lib-components-actors.mjs.map +1 -1
- package/fesm2022/verben-workflow-ui-src-lib-components-designer.mjs +19 -2
- package/fesm2022/verben-workflow-ui-src-lib-components-designer.mjs.map +1 -1
- package/fesm2022/verben-workflow-ui-src-lib-components-my-queue.mjs +73 -4
- package/fesm2022/verben-workflow-ui-src-lib-components-my-queue.mjs.map +1 -1
- package/fesm2022/verben-workflow-ui-src-lib-components-tasks.mjs +47 -3
- package/fesm2022/verben-workflow-ui-src-lib-components-tasks.mjs.map +1 -1
- package/fesm2022/verben-workflow-ui-src-lib-components-workflows.mjs +39 -3
- package/fesm2022/verben-workflow-ui-src-lib-components-workflows.mjs.map +1 -1
- package/package.json +7 -7
- package/src/lib/components/actors/actors.service.d.ts +6 -6
- package/src/lib/components/designer/services/wf-persistence.service.d.ts +2 -3
- package/src/lib/components/my-queue/my-queue.service.d.ts +23 -23
- package/src/lib/components/tasks/tasks.service.d.ts +15 -15
- package/src/lib/components/workflows/workflows.service.d.ts +11 -16
|
@@ -3,7 +3,7 @@ import { Injectable, input, Component, Input, ViewChildren, EventEmitter, Output
|
|
|
3
3
|
import { BehaviorSubject, lastValueFrom } from 'rxjs';
|
|
4
4
|
import * as i2$1 from 'verben-workflow-ui/src/lib/components/tasks';
|
|
5
5
|
import { TaskModel } from 'verben-workflow-ui/src/lib/components/tasks';
|
|
6
|
-
import { SortDirection, DataType, TaskStatus, ObjectState, Status } from 'verben-workflow-ui/src/lib/models';
|
|
6
|
+
import { SortDirection, ErrorResponse, DataType, TaskStatus, ObjectState, Status } from 'verben-workflow-ui/src/lib/models';
|
|
7
7
|
import { BaseDataViewComponent, SharedModule } from 'verben-workflow-ui/src/lib/shared';
|
|
8
8
|
import * as i1 from 'verben-workflow-ui/src/lib/services';
|
|
9
9
|
import * as i2 from '@angular/common';
|
|
@@ -298,9 +298,14 @@ class MyQueueFacade {
|
|
|
298
298
|
try {
|
|
299
299
|
this.state.setUpdating(true);
|
|
300
300
|
const params = this.state.getQueryParamsValue();
|
|
301
|
-
const
|
|
301
|
+
const response = queue
|
|
302
302
|
? await this.service.getQueueTasksForUser(params.user || '', params.skip, params.limit, params.sortParam || 'CreatedDate', params.sortOrder)
|
|
303
303
|
: await this.service.getTasksForUser(params.user || '', params.skip, params.limit, params.sortParam || 'CreatedDate', params.sortOrder);
|
|
304
|
+
if (response instanceof ErrorResponse) {
|
|
305
|
+
this.utilService.showError(response.ErrorMsg);
|
|
306
|
+
return;
|
|
307
|
+
}
|
|
308
|
+
const { Skip, PageSize, Result } = response;
|
|
304
309
|
if (Result) {
|
|
305
310
|
this.state.setRequests(Result);
|
|
306
311
|
this.state.updateQueryParams({ skip: Skip });
|
|
@@ -319,6 +324,10 @@ class MyQueueFacade {
|
|
|
319
324
|
this.state.setUpdating(true);
|
|
320
325
|
const params = this.state.getQueryParamsValue();
|
|
321
326
|
const requests = await this.service.getTaskWithParam(param, params.skip, params.limit, params.sortParam || 'CreatedDate', params.sortOrder);
|
|
327
|
+
if (requests instanceof ErrorResponse) {
|
|
328
|
+
this.utilService.showError(requests.ErrorMsg);
|
|
329
|
+
return;
|
|
330
|
+
}
|
|
322
331
|
this.state.setRequests(requests.Result);
|
|
323
332
|
this.state.updateQueryParams({ skip: requests.Skip });
|
|
324
333
|
}
|
|
@@ -339,7 +348,11 @@ class MyQueueFacade {
|
|
|
339
348
|
this.state.setUpdating(true);
|
|
340
349
|
const newRequest = { ...request };
|
|
341
350
|
this.state.addRequest(newRequest);
|
|
342
|
-
await this.service.saveTasks([newRequest]);
|
|
351
|
+
const response = await this.service.saveTasks([newRequest]);
|
|
352
|
+
if (response instanceof ErrorResponse) {
|
|
353
|
+
this.utilService.showError(response.ErrorMsg);
|
|
354
|
+
return;
|
|
355
|
+
}
|
|
343
356
|
this.utilService.showSuccess('Task created successfully');
|
|
344
357
|
await this.loadRequests(); // Reload to get server-side changes
|
|
345
358
|
}
|
|
@@ -355,7 +368,11 @@ class MyQueueFacade {
|
|
|
355
368
|
async updateRequest(request) {
|
|
356
369
|
try {
|
|
357
370
|
this.state.setUpdating(true);
|
|
358
|
-
await this.service.saveTasks([request]);
|
|
371
|
+
const response = await this.service.saveTasks([request]);
|
|
372
|
+
if (response instanceof ErrorResponse) {
|
|
373
|
+
this.utilService.showError(response.ErrorMsg);
|
|
374
|
+
return;
|
|
375
|
+
}
|
|
359
376
|
this.utilService.showSuccess('Task updated successfully');
|
|
360
377
|
this.state.updateRequest(request);
|
|
361
378
|
}
|
|
@@ -385,6 +402,10 @@ class MyQueueFacade {
|
|
|
385
402
|
try {
|
|
386
403
|
this.state.setUpdating(true);
|
|
387
404
|
const response = await this.service.processTasks([request], true);
|
|
405
|
+
if (response instanceof ErrorResponse) {
|
|
406
|
+
this.utilService.showError(response.ErrorMsg);
|
|
407
|
+
return;
|
|
408
|
+
}
|
|
388
409
|
// console.log(response);
|
|
389
410
|
const data = response?.[0];
|
|
390
411
|
if (data) {
|
|
@@ -404,6 +425,10 @@ class MyQueueFacade {
|
|
|
404
425
|
this.state.setUpdating(true);
|
|
405
426
|
const params = this.state.getQueryParamsValue();
|
|
406
427
|
const requests = await this.service.getNextActions(taskCode);
|
|
428
|
+
if (requests instanceof ErrorResponse) {
|
|
429
|
+
this.utilService.showError(requests.ErrorMsg);
|
|
430
|
+
return [];
|
|
431
|
+
}
|
|
407
432
|
this.state.setNextActions(requests);
|
|
408
433
|
// if (requests.length > 0) {
|
|
409
434
|
// // this.selectedAction = actions[0];
|
|
@@ -423,6 +448,10 @@ class MyQueueFacade {
|
|
|
423
448
|
try {
|
|
424
449
|
this.state.setUpdating(true);
|
|
425
450
|
const requests = await this.service.getPreviousActions(taskCode);
|
|
451
|
+
if (requests instanceof ErrorResponse) {
|
|
452
|
+
this.utilService.showError(requests.ErrorMsg);
|
|
453
|
+
return [];
|
|
454
|
+
}
|
|
426
455
|
this.state.setNextActions(requests);
|
|
427
456
|
return requests;
|
|
428
457
|
}
|
|
@@ -438,6 +467,10 @@ class MyQueueFacade {
|
|
|
438
467
|
try {
|
|
439
468
|
this.state.setUpdating(true);
|
|
440
469
|
const requests = await this.service.getAllPreviousActions(taskCode);
|
|
470
|
+
if (requests instanceof ErrorResponse) {
|
|
471
|
+
this.utilService.showError(requests.ErrorMsg);
|
|
472
|
+
return [];
|
|
473
|
+
}
|
|
441
474
|
this.state.setNextActions(requests);
|
|
442
475
|
return requests;
|
|
443
476
|
}
|
|
@@ -454,6 +487,10 @@ class MyQueueFacade {
|
|
|
454
487
|
this.state.setUpdating(true);
|
|
455
488
|
const params = this.state.getQueryParamsValue();
|
|
456
489
|
const requests = await this.service.getNextActors(taskCode, forCurrentStage, stageCode);
|
|
490
|
+
if (requests instanceof ErrorResponse) {
|
|
491
|
+
this.utilService.showError(requests.ErrorMsg);
|
|
492
|
+
return [];
|
|
493
|
+
}
|
|
457
494
|
this.state.setNextActors(requests);
|
|
458
495
|
return requests;
|
|
459
496
|
}
|
|
@@ -470,6 +507,10 @@ class MyQueueFacade {
|
|
|
470
507
|
this.state.setUpdating(true);
|
|
471
508
|
console.log('Loading task form');
|
|
472
509
|
const requests = await this.service.getCurrentFormsForTask(taskCode);
|
|
510
|
+
if (requests instanceof ErrorResponse) {
|
|
511
|
+
this.utilService.showError(requests.ErrorMsg);
|
|
512
|
+
return [];
|
|
513
|
+
}
|
|
473
514
|
console.log('FORMS', requests);
|
|
474
515
|
this.state.setTaskForms(requests);
|
|
475
516
|
return requests;
|
|
@@ -493,6 +534,10 @@ class MyQueueFacade {
|
|
|
493
534
|
ActorTags: [],
|
|
494
535
|
})),
|
|
495
536
|
}, comment, recipient ?? undefined);
|
|
537
|
+
if (response instanceof ErrorResponse) {
|
|
538
|
+
this.utilService.showError(response.ErrorMsg);
|
|
539
|
+
return;
|
|
540
|
+
}
|
|
496
541
|
// console.log(response);
|
|
497
542
|
const data = response;
|
|
498
543
|
if (data) {
|
|
@@ -525,6 +570,10 @@ class MyQueueFacade {
|
|
|
525
570
|
ActorTags: [],
|
|
526
571
|
})),
|
|
527
572
|
}, comment, recipient ?? undefined);
|
|
573
|
+
if (response instanceof ErrorResponse) {
|
|
574
|
+
this.utilService.showError(response.ErrorMsg);
|
|
575
|
+
return;
|
|
576
|
+
}
|
|
528
577
|
// console.log(response);
|
|
529
578
|
const data = response;
|
|
530
579
|
if (data) {
|
|
@@ -556,6 +605,10 @@ class MyQueueFacade {
|
|
|
556
605
|
ActorTags: [],
|
|
557
606
|
})),
|
|
558
607
|
}, comment, recipient ?? undefined);
|
|
608
|
+
if (response instanceof ErrorResponse) {
|
|
609
|
+
this.utilService.showError(response.ErrorMsg);
|
|
610
|
+
return;
|
|
611
|
+
}
|
|
559
612
|
// console.log(response);
|
|
560
613
|
const data = response;
|
|
561
614
|
if (data) {
|
|
@@ -587,6 +640,10 @@ class MyQueueFacade {
|
|
|
587
640
|
ActorTags: [],
|
|
588
641
|
})),
|
|
589
642
|
}, comment, recipient ?? undefined);
|
|
643
|
+
if (response instanceof ErrorResponse) {
|
|
644
|
+
this.utilService.showError(response.ErrorMsg);
|
|
645
|
+
return;
|
|
646
|
+
}
|
|
590
647
|
// console.log(response);
|
|
591
648
|
const data = response;
|
|
592
649
|
if (data) {
|
|
@@ -618,6 +675,10 @@ class MyQueueFacade {
|
|
|
618
675
|
ActorTags: [],
|
|
619
676
|
})),
|
|
620
677
|
}, comment);
|
|
678
|
+
if (response instanceof ErrorResponse) {
|
|
679
|
+
this.utilService.showError(response.ErrorMsg);
|
|
680
|
+
return;
|
|
681
|
+
}
|
|
621
682
|
// console.log(response);
|
|
622
683
|
const data = response;
|
|
623
684
|
if (data) {
|
|
@@ -642,6 +703,10 @@ class MyQueueFacade {
|
|
|
642
703
|
try {
|
|
643
704
|
this.state.setUpdating(true);
|
|
644
705
|
const filledForm = await this.service.fillForm(form, taskCode);
|
|
706
|
+
if (filledForm instanceof ErrorResponse) {
|
|
707
|
+
this.utilService.showError(filledForm.ErrorMsg);
|
|
708
|
+
throw new Error(filledForm.ErrorMsg);
|
|
709
|
+
}
|
|
645
710
|
return filledForm;
|
|
646
711
|
}
|
|
647
712
|
catch (error) {
|
|
@@ -665,6 +730,10 @@ class MyQueueFacade {
|
|
|
665
730
|
const response = queue
|
|
666
731
|
? await this.service.getQueueTasksForUser(currentParams.user || '', currentParams.skip, currentParams.limit, currentParams.sortParam || 'CreatedDate', currentParams.sortOrder)
|
|
667
732
|
: await this.service.getTasksForUser(currentParams.user || '', currentParams.skip, currentParams.limit, currentParams.sortParam || 'CreatedDate', currentParams.sortOrder);
|
|
733
|
+
if (response instanceof ErrorResponse) {
|
|
734
|
+
this.utilService.showError(response.ErrorMsg);
|
|
735
|
+
return;
|
|
736
|
+
}
|
|
668
737
|
this.state.appendRequests(response.Result);
|
|
669
738
|
this.state.updateQueryParams({
|
|
670
739
|
skip: newSkip,
|