@yuuvis/bpm-management-app 1.1.0-alpha.1 → 1.1.0-alpha.2
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/README.md
CHANGED
|
@@ -18,7 +18,7 @@ In your `app.routes.ts` add a new lazy loaded route for the `@yuuvis/bpm-managem
|
|
|
18
18
|
export const apps: App[] = [
|
|
19
19
|
{
|
|
20
20
|
id: 'io.yuuvis.app.bpm-management',
|
|
21
|
-
title: 'yuuvis
|
|
21
|
+
title: 'yuuvis bpm-management',
|
|
22
22
|
path: 'bpm-management',
|
|
23
23
|
iconName: 'flowchart',
|
|
24
24
|
loadChildren: () => import('@yuuvis/bpm-management-app').then((m) => m.YuvBpmManagementRoutes)
|
|
@@ -32,27 +32,29 @@ The app is configured by the client via the `data` property of its app entry in
|
|
|
32
32
|
|
|
33
33
|
| Option | Type | Default | Description |
|
|
34
34
|
| ----------------- | --------- | ------- | ----------- |
|
|
35
|
-
| `showDeployments` | `boolean` | `
|
|
36
|
-
| `showProcessDefinitions` | `boolean` | `
|
|
35
|
+
| `showDeployments` | `boolean` | `true` | Shows the **Deployments** tab. If set to `false`, the tab is hidden and navigating directly to `.../deployments` redirects to the processes page. |
|
|
36
|
+
| `showProcessDefinitions` | `boolean` | `true` | Shows the **Process definitions** tab. If set to `false`, the tab is hidden and navigating directly to `.../definitions` redirects to the processes page. |
|
|
37
37
|
|
|
38
|
-
Example,
|
|
38
|
+
Example, hiding the Deployments and Process definitions tabs:
|
|
39
39
|
|
|
40
40
|
```ts
|
|
41
41
|
export const apps: App[] = [
|
|
42
42
|
{
|
|
43
43
|
id: 'io.yuuvis.app.bpm-management',
|
|
44
|
-
title: 'yuuvis
|
|
44
|
+
title: 'yuuvis bpm-management',
|
|
45
45
|
path: 'bpm-management',
|
|
46
46
|
iconName: 'flowchart',
|
|
47
47
|
loadChildren: () => import('@yuuvis/bpm-management-app').then((m) => m.YuvBpmManagementRoutes),
|
|
48
48
|
data: {
|
|
49
|
-
showDeployments:
|
|
50
|
-
showProcessDefinitions:
|
|
49
|
+
showDeployments: false,
|
|
50
|
+
showProcessDefinitions: false
|
|
51
51
|
}
|
|
52
52
|
},
|
|
53
53
|
]
|
|
54
54
|
```
|
|
55
55
|
|
|
56
|
+
Navigating to the app's path (`.../bpm-management`) opens the first enabled tab: Deployments, then Process definitions, then Processes. Processes and Tasks are always available.
|
|
57
|
+
|
|
56
58
|
The app can be registered multiple times with different `id`, `path` and `data` (for example one entry with all tabs and one without), each entry is configured independently.
|
|
57
59
|
|
|
58
60
|
## License
|
|
@@ -220,23 +220,23 @@ function resolveAppConfig(route) {
|
|
|
220
220
|
return { appId, data };
|
|
221
221
|
}
|
|
222
222
|
/**
|
|
223
|
-
* Whether the host shell client enabled the deployments tab
|
|
223
|
+
* Whether the host shell client enabled the deployments tab unless `data: { showDeployments: false }` hides it (shown by default).
|
|
224
224
|
*/
|
|
225
225
|
function isDeploymentsEnabled(route) {
|
|
226
|
-
return resolveAppConfig(route).data.showDeployments
|
|
226
|
+
return resolveAppConfig(route).data.showDeployments !== false;
|
|
227
227
|
}
|
|
228
228
|
/**
|
|
229
|
-
* Whether the host shell client enabled the process definitions tab
|
|
229
|
+
* Whether the host shell client enabled the process definitions tab unless `data: { showProcessDefinitions: false }` hides it (shown by default).
|
|
230
230
|
*/
|
|
231
231
|
function isProcessDefinitionsEnabled(route) {
|
|
232
|
-
return resolveAppConfig(route).data.showProcessDefinitions
|
|
232
|
+
return resolveAppConfig(route).data.showProcessDefinitions !== false;
|
|
233
233
|
}
|
|
234
234
|
/**
|
|
235
|
-
* The entities the host shell client enabled (deployments and process definitions are optional).
|
|
235
|
+
* The entities the host shell client enabled (deployments and process definitions are optional, both on by default).
|
|
236
236
|
*/
|
|
237
237
|
function enabledEntities(route) {
|
|
238
238
|
const { showDeployments, showProcessDefinitions } = resolveAppConfig(route).data;
|
|
239
|
-
return BPM_ENTITIES.filter(e => (e !== 'deployments' || showDeployments
|
|
239
|
+
return BPM_ENTITIES.filter(e => (e !== 'deployments' || showDeployments !== false) && (e !== 'definitions' || showProcessDefinitions !== false));
|
|
240
240
|
}
|
|
241
241
|
/**
|
|
242
242
|
* Guard for an optional tab's route. If the tab is not enabled, redirects to the processes page.
|
|
@@ -245,9 +245,31 @@ function optionalTabGuard(path, isEnabled) {
|
|
|
245
245
|
const pathRegex = new RegExp(`/${path}(?=[/?#]|$)`);
|
|
246
246
|
return (route, state) => isEnabled(route) || inject(Router).parseUrl(state.url.replace(pathRegex, '/processes').split(/[?#]/)[0]);
|
|
247
247
|
}
|
|
248
|
+
/**
|
|
249
|
+
* Guard for the empty path of the app: redirects to the first enabled entity (deployments, process
|
|
250
|
+
* definitions, processes, tasks), keeping the query string.
|
|
251
|
+
*/
|
|
252
|
+
const defaultEntityGuard = (route, state) => {
|
|
253
|
+
const [path, query] = state.url.split('#')[0].split('?');
|
|
254
|
+
const base = path.replace(/\/+$/, '');
|
|
255
|
+
return inject(Router).parseUrl(`${base}/${enabledEntities(route)[0]}${query ? '?' + query : ''}`);
|
|
256
|
+
};
|
|
248
257
|
const deploymentsGuard = optionalTabGuard('deployments', isDeploymentsEnabled);
|
|
249
258
|
const processDefinitionsGuard = optionalTabGuard('definitions', isProcessDefinitionsEnabled);
|
|
250
259
|
|
|
260
|
+
/**
|
|
261
|
+
* Appends the set criteria of a filter to the REST parameters.
|
|
262
|
+
* Skips unset (undefined/null) criteria and keys without a REST name, but keeps falsy values such as `false`.
|
|
263
|
+
*/
|
|
264
|
+
function applyBpmFilterParams(params, filter, restNames) {
|
|
265
|
+
for (const [key, criterion] of Object.entries(filter ?? {})) {
|
|
266
|
+
const value = criterion?.value;
|
|
267
|
+
if (value === undefined || value === null || !restNames[key])
|
|
268
|
+
continue;
|
|
269
|
+
params = params.set(restNames[key], value);
|
|
270
|
+
}
|
|
271
|
+
return params;
|
|
272
|
+
}
|
|
251
273
|
/**
|
|
252
274
|
* Base class for BPM filter conversion with shared logic
|
|
253
275
|
*/
|
|
@@ -328,9 +350,6 @@ class DeploymentFilter extends BaseBpmFilter {
|
|
|
328
350
|
name: 'nameLike',
|
|
329
351
|
category: 'category'
|
|
330
352
|
};
|
|
331
|
-
id;
|
|
332
|
-
name;
|
|
333
|
-
category;
|
|
334
353
|
static fromAgFilterModel(tableFilters) {
|
|
335
354
|
return this.convertFromAgFilterModel(new DeploymentFilter(), tableFilters);
|
|
336
355
|
}
|
|
@@ -347,15 +366,6 @@ class ProcessDefinitionFilter extends BaseBpmFilter {
|
|
|
347
366
|
global: 'global',
|
|
348
367
|
latest: 'latest'
|
|
349
368
|
};
|
|
350
|
-
id;
|
|
351
|
-
deploymentId;
|
|
352
|
-
name;
|
|
353
|
-
category;
|
|
354
|
-
version;
|
|
355
|
-
key;
|
|
356
|
-
status;
|
|
357
|
-
global;
|
|
358
|
-
latest;
|
|
359
369
|
static fromAgFilterModel(tableFilters) {
|
|
360
370
|
return this.convertFromAgFilterModel(new ProcessDefinitionFilter(), tableFilters);
|
|
361
371
|
}
|
|
@@ -386,16 +396,6 @@ class ProcessFilter extends BaseBpmFilter {
|
|
|
386
396
|
endTimeAfter: 'finishedAfter',
|
|
387
397
|
status: 'isCompleted'
|
|
388
398
|
};
|
|
389
|
-
id;
|
|
390
|
-
processDefinitionId;
|
|
391
|
-
name;
|
|
392
|
-
startUserId;
|
|
393
|
-
startTimeBefore;
|
|
394
|
-
startTimeAfter;
|
|
395
|
-
endTimeBefore;
|
|
396
|
-
endTimeAfter;
|
|
397
|
-
businessKey;
|
|
398
|
-
status;
|
|
399
399
|
static fromAgFilterModel(tableFilters, ts) {
|
|
400
400
|
return this.convertFromAgFilterModel(new ProcessFilter(), tableFilters, ts);
|
|
401
401
|
}
|
|
@@ -427,17 +427,6 @@ class TaskFilter extends BaseBpmFilter {
|
|
|
427
427
|
endTimeBefore: 'completedBefore',
|
|
428
428
|
endTimeAfter: 'completedAfter'
|
|
429
429
|
};
|
|
430
|
-
id;
|
|
431
|
-
name;
|
|
432
|
-
status;
|
|
433
|
-
processDefinitionId;
|
|
434
|
-
processInstanceId;
|
|
435
|
-
assignee;
|
|
436
|
-
owner;
|
|
437
|
-
createTimeBefore;
|
|
438
|
-
createimeAfter;
|
|
439
|
-
endTimeBefore;
|
|
440
|
-
endTimeAfter;
|
|
441
430
|
static fromAgFilterModel(tableFilters, ts) {
|
|
442
431
|
return this.convertFromAgFilterModel(new TaskFilter(), tableFilters, ts);
|
|
443
432
|
}
|
|
@@ -456,7 +445,7 @@ class TaskFilter extends BaseBpmFilter {
|
|
|
456
445
|
}
|
|
457
446
|
}
|
|
458
447
|
|
|
459
|
-
class
|
|
448
|
+
class YuvBpmManagementService {
|
|
460
449
|
static DEFAULT_PAGE_SIZE = 15;
|
|
461
450
|
bpmApiBase = '/bpm-engine/api';
|
|
462
451
|
#backendService = inject(BackendService);
|
|
@@ -465,11 +454,7 @@ class YuvBpmAdminService {
|
|
|
465
454
|
if (sort) {
|
|
466
455
|
filterParams = filterParams.set('sort', `${sort.by},${sort.order}`);
|
|
467
456
|
}
|
|
468
|
-
|
|
469
|
-
for (const key in filter) {
|
|
470
|
-
filterParams = filterParams.set(DeploymentFilter.bpmFilterToRestApiName[key], filter[key]['value']);
|
|
471
|
-
}
|
|
472
|
-
}
|
|
457
|
+
filterParams = applyBpmFilterParams(filterParams, filter, DeploymentFilter.bpmFilterToRestApiName);
|
|
473
458
|
return this.#backendService
|
|
474
459
|
.get(`${this.bpmApiBase}/deployments`, ApiBase.none, { params: filterParams });
|
|
475
460
|
}
|
|
@@ -487,11 +472,7 @@ class YuvBpmAdminService {
|
|
|
487
472
|
// Spring Pageable format: one parameter, "field,direction"
|
|
488
473
|
filterParams = filterParams.set('sort', `${sort.by},${sort.order}`);
|
|
489
474
|
}
|
|
490
|
-
|
|
491
|
-
for (const key in filter) {
|
|
492
|
-
filterParams = filterParams.set(ProcessDefinitionFilter.bpmFilterToRestApiName[key], filter[key]['value']);
|
|
493
|
-
}
|
|
494
|
-
}
|
|
475
|
+
filterParams = applyBpmFilterParams(filterParams, filter, ProcessDefinitionFilter.bpmFilterToRestApiName);
|
|
495
476
|
return this.#backendService
|
|
496
477
|
.get(`${this.bpmApiBase}/process-definitions`, ApiBase.none, { params: filterParams });
|
|
497
478
|
}
|
|
@@ -516,11 +497,7 @@ class YuvBpmAdminService {
|
|
|
516
497
|
if (sort) {
|
|
517
498
|
filterParams = filterParams.set('sort', `${sort.by},${sort.order}`);
|
|
518
499
|
}
|
|
519
|
-
|
|
520
|
-
for (const key in filter) {
|
|
521
|
-
filterParams = filterParams.set(ProcessFilter.bpmFilterToRestApiName[key], filter[key]['value']);
|
|
522
|
-
}
|
|
523
|
-
}
|
|
500
|
+
filterParams = applyBpmFilterParams(filterParams, filter, ProcessFilter.bpmFilterToRestApiName);
|
|
524
501
|
return this.#backendService.get(`${this.bpmApiBase}/processes`, ApiBase.none, { params: filterParams });
|
|
525
502
|
}
|
|
526
503
|
getProcess(processInstanceId) {
|
|
@@ -544,13 +521,9 @@ class YuvBpmAdminService {
|
|
|
544
521
|
if (sort) {
|
|
545
522
|
filterParams = filterParams.set('sort', `${sort.by},${sort.order}`);
|
|
546
523
|
}
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
if (key === 'assignee') {
|
|
551
|
-
filterParams = filterParams.set('isAssigned', 'true');
|
|
552
|
-
}
|
|
553
|
-
}
|
|
524
|
+
filterParams = applyBpmFilterParams(filterParams, filter, TaskFilter.bpmFilterToRestApiName);
|
|
525
|
+
if (filter?.assignee?.value != null) {
|
|
526
|
+
filterParams = filterParams.set('isAssigned', 'true');
|
|
554
527
|
}
|
|
555
528
|
return this.#backendService
|
|
556
529
|
.get(`${this.bpmApiBase}/tasks`, ApiBase.none, { params: filterParams });
|
|
@@ -569,10 +542,10 @@ class YuvBpmAdminService {
|
|
|
569
542
|
setTaskCandidates(taskId, body) {
|
|
570
543
|
return this.#backendService.post(`${this.bpmApiBase}/tasks/${taskId}/candidates`, body, ApiBase.none);
|
|
571
544
|
}
|
|
572
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type:
|
|
573
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type:
|
|
545
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: YuvBpmManagementService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
546
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: YuvBpmManagementService, providedIn: 'root' });
|
|
574
547
|
}
|
|
575
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type:
|
|
548
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: YuvBpmManagementService, decorators: [{
|
|
576
549
|
type: Injectable,
|
|
577
550
|
args: [{
|
|
578
551
|
providedIn: 'root',
|
|
@@ -2118,7 +2091,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImpo
|
|
|
2118
2091
|
*/
|
|
2119
2092
|
class DetailsComponent {
|
|
2120
2093
|
#dialog = inject(MatDialog);
|
|
2121
|
-
#service = inject(
|
|
2094
|
+
#service = inject(YuvBpmManagementService);
|
|
2122
2095
|
#translate = inject(TranslateService);
|
|
2123
2096
|
#notifications = inject(NotificationService);
|
|
2124
2097
|
#logger = inject(Logger);
|
|
@@ -2361,7 +2334,7 @@ class YuvBpmManagementComponent {
|
|
|
2361
2334
|
#titleService = inject(Title);
|
|
2362
2335
|
#route = inject(ActivatedRoute);
|
|
2363
2336
|
#router = inject(Router);
|
|
2364
|
-
#service = inject(
|
|
2337
|
+
#service = inject(YuvBpmManagementService);
|
|
2365
2338
|
#translate = inject(TranslateService);
|
|
2366
2339
|
#logger = inject(Logger);
|
|
2367
2340
|
#state = inject(BpmManagementStateService);
|
|
@@ -2756,19 +2729,19 @@ const QUICK_FILTERS = {
|
|
|
2756
2729
|
|
|
2757
2730
|
/**
|
|
2758
2731
|
* Deployments, process definitions, processes and tasks are rendered by the same master/details
|
|
2759
|
-
* container, the entity comes from the route data. Deployments and process definitions are optional.
|
|
2732
|
+
* container, the entity comes from the route data. Deployments and process definitions are optional. The empty path opens the first enabled entity.
|
|
2760
2733
|
*/
|
|
2761
2734
|
const YuvBpmManagementRoutes = [
|
|
2762
2735
|
{ path: 'deployments', component: YuvBpmManagementComponent, data: { entity: 'deployments' }, canActivate: [deploymentsGuard] },
|
|
2763
2736
|
{ path: 'definitions', component: YuvBpmManagementComponent, data: { entity: 'definitions' }, canActivate: [processDefinitionsGuard] },
|
|
2764
2737
|
{ path: 'processes', component: YuvBpmManagementComponent, data: { entity: 'processes' } },
|
|
2765
2738
|
{ path: 'tasks', component: YuvBpmManagementComponent, data: { entity: 'tasks' } },
|
|
2766
|
-
{ path: '',
|
|
2739
|
+
{ path: '', pathMatch: 'full', children: [], canActivate: [defaultEntityGuard] }
|
|
2767
2740
|
];
|
|
2768
2741
|
|
|
2769
2742
|
/**
|
|
2770
2743
|
* Generated bundle index. Do not edit.
|
|
2771
2744
|
*/
|
|
2772
2745
|
|
|
2773
|
-
export { APP_ICONS, APP_ID, BPM_ENTITIES, BPM_ENTITY_META, FILTER_OPERATORS, FILTER_TYPES, ProcessDefinitionScope, ProcessDefinitionStatus, ProcessStatus, TaskStatus,
|
|
2746
|
+
export { APP_ICONS, APP_ID, BPM_ENTITIES, BPM_ENTITY_META, FILTER_OPERATORS, FILTER_TYPES, ProcessDefinitionScope, ProcessDefinitionStatus, ProcessStatus, TaskStatus, YuvBpmManagementRoutes, YuvBpmManagementService, definitionIcon, definitionSeverity, definitionStatusLabel, formatDateTime, processSeverity, processStatusIcon, processStatusLabel, taskSeverity, taskStatusIcon, taskStatusLabel };
|
|
2774
2747
|
//# sourceMappingURL=yuuvis-bpm-management-app.mjs.map
|