@mediusinc/mng-commons-audit 5.0.0-rc.1 → 5.0.0-rc.3
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/lib/api/models/entityChange.mjs +2 -43
- package/esm2022/lib/api/models/guiEntityModel.mjs +2 -38
- package/esm2022/lib/api/models/guiPropertyModel.mjs +2 -68
- package/esm2022/lib/api/models/guiRelationModel.mjs +2 -32
- package/esm2022/lib/api/models/revEntityWithChangesDto.mjs +2 -38
- package/esm2022/lib/api/models/revEntityWithStateDto.mjs +2 -48
- package/esm2022/lib/api/services/audit-api.service.mjs +38 -0
- package/esm2022/lib/api/services/audit-revisions-api.service.mjs +28 -22
- package/esm2022/lib/api/services/audit.service.mjs +32 -20
- package/esm2022/lib/audit.routes.mjs +11 -11
- package/esm2022/lib/components/entity-changes-field/entity-changes-field.component.mjs +6 -7
- package/esm2022/lib/components/pages/audit/audit.page.component.mjs +3 -3
- package/esm2022/lib/components/pages/entity-revisions/audit-entity-revisions.page.component.mjs +17 -18
- package/esm2022/lib/components/pages/revisions/audit-revisions.page.component.mjs +19 -23
- package/esm2022/lib/models/entity-revision-change-state.model.mjs +2 -9
- package/esm2022/lib/models/entity-revision-changes.model.mjs +2 -9
- package/esm2022/lib/models/guiEntityModelWithI18n.model.mjs +2 -10
- package/esm2022/lib/models/rev-entity-detailed.model.mjs +2 -10
- package/esm2022/lib/models/rev-entity.model.mjs +2 -9
- package/esm2022/lib/models/revEntityWithId.model.mjs +2 -11
- package/esm2022/lib/utils/audit.util.mjs +24 -24
- package/fesm2022/mediusinc-mng-commons-audit.mjs +157 -218
- package/fesm2022/mediusinc-mng-commons-audit.mjs.map +1 -1
- package/i18n/en.json +7 -9
- package/i18n/sl.json +7 -9
- package/lib/api/models/entityChange.d.ts +1 -5
- package/lib/api/models/guiEntityModel.d.ts +1 -5
- package/lib/api/models/guiPropertyModel.d.ts +1 -5
- package/lib/api/models/guiRelationModel.d.ts +1 -5
- package/lib/api/models/revEntityWithChangesDto.d.ts +1 -5
- package/lib/api/models/revEntityWithStateDto.d.ts +1 -5
- package/lib/api/services/audit-api.service.d.ts +12 -0
- package/lib/api/services/audit-revisions-api.service.d.ts +3 -7
- package/lib/api/services/audit.service.d.ts +2 -6
- package/lib/components/pages/entity-revisions/audit-entity-revisions.page.component.d.ts +4 -3
- package/lib/components/pages/revisions/audit-revisions.page.component.d.ts +2 -2
- package/lib/models/entity-revision-change-state.model.d.ts +1 -1
- package/lib/models/entity-revision-changes.model.d.ts +1 -1
- package/lib/models/guiEntityModelWithI18n.model.d.ts +1 -1
- package/lib/models/rev-entity-detailed.model.d.ts +1 -1
- package/lib/models/rev-entity.model.d.ts +1 -1
- package/lib/models/revEntityWithId.model.d.ts +1 -1
- package/package.json +2 -3
- package/version-info.json +11 -0
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { TableviewComponent,
|
|
1
|
+
import { CommonsConfigurationService, TypeRegistry, dataListParamsToUrlQuery, CommonsInternalError, itemIdToDefined, createRoute, createRouteRedirect, createRoutes } from '@mediusinc/mng-commons/core';
|
|
2
|
+
import { TableviewComponent, createTableviewRoute } from '@mediusinc/mng-commons/tableview';
|
|
3
3
|
import * as i0 from '@angular/core';
|
|
4
4
|
import { InjectionToken, inject, Injectable, Component, ChangeDetectionStrategy, computed, signal, effect, DestroyRef, Input, Injector } from '@angular/core';
|
|
5
5
|
import { shareReplay, throwError, BehaviorSubject } from 'rxjs';
|
|
6
6
|
import { map } from 'rxjs/operators';
|
|
7
|
-
import {
|
|
8
|
-
import { __decorate } from 'tslib';
|
|
7
|
+
import { HttpHeaders, HttpClient, HttpParams } from '@angular/common/http';
|
|
9
8
|
import { RouterOutlet, Router, ActivatedRoute } from '@angular/router';
|
|
10
9
|
import { AsyncPipe, JsonPipe } from '@angular/common';
|
|
11
10
|
import { toSignal, takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
@@ -15,51 +14,53 @@ import { FormlyModule } from '@ngx-formly/core';
|
|
|
15
14
|
import * as i2 from '@ngx-translate/core';
|
|
16
15
|
import { TranslateService, TranslateModule } from '@ngx-translate/core';
|
|
17
16
|
import { DropdownComponent } from '@mediusinc/mng-commons/form';
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import { enumModel, enumModelGeneric, ModelDescriptor } from '@mediusinc/mng-commons/model';
|
|
17
|
+
import { lookupDataProvider, lookupDataProviderWithService } from '@mediusinc/mng-commons/form/api';
|
|
18
|
+
import { tableviewDescriptor, tableviewDataProviderWithService, actionEditorDetails, AFormlyCustomFieldComponent, editorDescriptor, TableviewEditorTypeEnum } from '@mediusinc/mng-commons/tableview/api';
|
|
19
|
+
import { enumModel, enumModelGeneric, model } from '@mediusinc/mng-commons/model';
|
|
22
20
|
import { TableComponent } from '@mediusinc/mng-commons/table';
|
|
23
|
-
import {
|
|
21
|
+
import { tableDescriptor, TablePaginationModeEnum } from '@mediusinc/mng-commons/table/api';
|
|
24
22
|
|
|
25
23
|
const COMMONS_AUDIT_MODULE_CONFIG_IT = new InjectionToken('CommonsAuditModuleConfig');
|
|
26
24
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
static { GuiEntityModelDto_1 = this; }
|
|
30
|
-
static { this.attributeTypeMap = [
|
|
31
|
-
{
|
|
32
|
-
name: 'entityName',
|
|
33
|
-
baseName: 'entityName',
|
|
34
|
-
type: 'string'
|
|
35
|
-
},
|
|
36
|
-
{
|
|
37
|
-
name: 'properties',
|
|
38
|
-
baseName: 'properties',
|
|
39
|
-
type: 'Array<GuiPropertyModel>'
|
|
40
|
-
}
|
|
41
|
-
]; }
|
|
42
|
-
static getAttributeTypeMap() {
|
|
43
|
-
return GuiEntityModelDto_1.attributeTypeMap;
|
|
44
|
-
}
|
|
45
|
-
};
|
|
46
|
-
GuiEntityModelDto = GuiEntityModelDto_1 = __decorate([
|
|
47
|
-
TypeName('MngGuiEntityModelDto')
|
|
48
|
-
], GuiEntityModelDto);
|
|
49
|
-
TypeRegistry.get().registerType(GuiEntityModelDto);
|
|
50
|
-
|
|
51
|
-
class AuditService extends ACommonsBaseV1ApiService {
|
|
25
|
+
/* eslint-disable */
|
|
26
|
+
class AuditApiService {
|
|
52
27
|
constructor() {
|
|
53
|
-
|
|
54
|
-
this.CACHE_SIZE = 1;
|
|
28
|
+
this.defaultHeaders = new HttpHeaders();
|
|
55
29
|
this.moduleConfig = inject(COMMONS_AUDIT_MODULE_CONFIG_IT);
|
|
30
|
+
this.http = inject(HttpClient);
|
|
56
31
|
this.configService = CommonsConfigurationService.get();
|
|
57
32
|
}
|
|
33
|
+
getBasePath() {
|
|
34
|
+
return `${this.configService.getConfigValue(this.moduleConfig.apiBasePathConfigKey)}`;
|
|
35
|
+
}
|
|
58
36
|
getServiceBasePath() {
|
|
59
37
|
return this.moduleConfig.apiServiceBasePath ?? '';
|
|
60
38
|
}
|
|
61
|
-
|
|
62
|
-
|
|
39
|
+
getUrl(...pathSegments) {
|
|
40
|
+
let baseUrl = this.getBasePath();
|
|
41
|
+
if (baseUrl.endsWith('/')) {
|
|
42
|
+
baseUrl = baseUrl.substring(0, baseUrl.length - 1);
|
|
43
|
+
}
|
|
44
|
+
const serviceBasePath = this.getServiceBasePath();
|
|
45
|
+
let path = [serviceBasePath, ...pathSegments].filter(s => s && s.length).join('/');
|
|
46
|
+
// omit first and last '/'
|
|
47
|
+
if (path.startsWith('/')) {
|
|
48
|
+
path = path.substring(1);
|
|
49
|
+
}
|
|
50
|
+
if (path.endsWith('/')) {
|
|
51
|
+
path = path.substring(0, path.length - 1);
|
|
52
|
+
}
|
|
53
|
+
// replace any double '//' from path that could come from joining paths
|
|
54
|
+
path = path.replace('//', '/');
|
|
55
|
+
return `${baseUrl}/${path}`;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/* eslint-disable @typescript-eslint/no-explicit-any, @typescript-eslint/ban-types */
|
|
60
|
+
class AuditService extends AuditApiService {
|
|
61
|
+
constructor() {
|
|
62
|
+
super();
|
|
63
|
+
this.CACHE_SIZE = 1;
|
|
63
64
|
}
|
|
64
65
|
get revModel$() {
|
|
65
66
|
if (!this.revModelObs) {
|
|
@@ -74,68 +75,49 @@ class AuditService extends ACommonsBaseV1ApiService {
|
|
|
74
75
|
return this.auditModelObs;
|
|
75
76
|
}
|
|
76
77
|
requestRevModel() {
|
|
77
|
-
|
|
78
|
+
let localVarHeaders = this.defaultHeaders;
|
|
79
|
+
localVarHeaders = localVarHeaders.set('Accept', 'application/json');
|
|
80
|
+
return this.http.get(this.getUrl(`/rev-model`), {
|
|
81
|
+
headers: localVarHeaders
|
|
82
|
+
});
|
|
78
83
|
}
|
|
79
84
|
requestAuditModel() {
|
|
80
|
-
|
|
85
|
+
let localVarHeaders = this.defaultHeaders;
|
|
86
|
+
localVarHeaders = localVarHeaders.set('Accept', 'application/json');
|
|
87
|
+
return this.http
|
|
88
|
+
.get(this.getUrl(`/audit-models`), {
|
|
89
|
+
headers: localVarHeaders
|
|
90
|
+
})
|
|
91
|
+
.pipe(map(response => {
|
|
92
|
+
if (Array.isArray(response)) {
|
|
93
|
+
return response.map(item => {
|
|
94
|
+
return {
|
|
95
|
+
entityName: item.entityName,
|
|
96
|
+
properties: item.properties
|
|
97
|
+
};
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
else {
|
|
101
|
+
return [];
|
|
102
|
+
}
|
|
103
|
+
}));
|
|
81
104
|
}
|
|
82
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.
|
|
83
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.
|
|
105
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: AuditService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
106
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: AuditService }); }
|
|
84
107
|
}
|
|
85
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.
|
|
108
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: AuditService, decorators: [{
|
|
86
109
|
type: Injectable
|
|
87
110
|
}], ctorParameters: () => [] });
|
|
88
111
|
|
|
89
112
|
class AuditPageComponent {
|
|
90
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.
|
|
91
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.
|
|
113
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: AuditPageComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
114
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.4", type: AuditPageComponent, isStandalone: true, selector: "mng-audit-page", ngImport: i0, template: "<router-outlet></router-outlet>\n", dependencies: [{ kind: "directive", type: RouterOutlet, selector: "router-outlet", inputs: ["name"], outputs: ["activate", "deactivate", "attach", "detach"], exportAs: ["outlet"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
92
115
|
}
|
|
93
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.
|
|
116
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: AuditPageComponent, decorators: [{
|
|
94
117
|
type: Component,
|
|
95
118
|
args: [{ standalone: true, selector: 'mng-audit-page', imports: [RouterOutlet], changeDetection: ChangeDetectionStrategy.OnPush, template: "<router-outlet></router-outlet>\n" }]
|
|
96
119
|
}] });
|
|
97
120
|
|
|
98
|
-
var RevEntityWithStateDto_1;
|
|
99
|
-
let RevEntityWithStateDto = class RevEntityWithStateDto {
|
|
100
|
-
static { RevEntityWithStateDto_1 = this; }
|
|
101
|
-
static { this.attributeTypeMap = [
|
|
102
|
-
{
|
|
103
|
-
name: 'revEntity',
|
|
104
|
-
baseName: 'revEntity',
|
|
105
|
-
type: '{ [key: string]: any; }'
|
|
106
|
-
},
|
|
107
|
-
{
|
|
108
|
-
name: 'revType',
|
|
109
|
-
baseName: 'revType',
|
|
110
|
-
type: 'RevisionType'
|
|
111
|
-
},
|
|
112
|
-
{
|
|
113
|
-
name: 'entityClassName',
|
|
114
|
-
baseName: 'entityClassName',
|
|
115
|
-
type: 'string'
|
|
116
|
-
},
|
|
117
|
-
{
|
|
118
|
-
name: 'entityState',
|
|
119
|
-
baseName: 'entityState',
|
|
120
|
-
type: '{ [key: string]: any; }'
|
|
121
|
-
}
|
|
122
|
-
]; }
|
|
123
|
-
static getAttributeTypeMap() {
|
|
124
|
-
return RevEntityWithStateDto_1.attributeTypeMap;
|
|
125
|
-
}
|
|
126
|
-
};
|
|
127
|
-
RevEntityWithStateDto = RevEntityWithStateDto_1 = __decorate([
|
|
128
|
-
TypeName('MngRevEntityWithStateDto')
|
|
129
|
-
], RevEntityWithStateDto);
|
|
130
|
-
TypeRegistry.get().registerType(RevEntityWithStateDto);
|
|
131
|
-
|
|
132
|
-
let RevEntityWithId = class RevEntityWithId extends RevEntityWithStateDto {
|
|
133
|
-
};
|
|
134
|
-
RevEntityWithId = __decorate([
|
|
135
|
-
TypeName('MngRevEntityWithId')
|
|
136
|
-
], RevEntityWithId);
|
|
137
|
-
TypeRegistry.get().registerType(RevEntityWithId);
|
|
138
|
-
|
|
139
121
|
/**
|
|
140
122
|
* Medius quarkus sampler
|
|
141
123
|
* Sampler OPENAPI definition
|
|
@@ -179,18 +161,6 @@ var RevisionTypeDto;
|
|
|
179
161
|
TypeRegistry.get().registerEnum(RevisionTypeDto, 'MngRevisionTypeDto');
|
|
180
162
|
const revisionTypeEnum = enumModel(RevisionTypeDto.Add, RevisionTypeDto, 'MngRevisionTypeDto');
|
|
181
163
|
|
|
182
|
-
let EntityRevisionChangeState = class EntityRevisionChangeState {
|
|
183
|
-
};
|
|
184
|
-
EntityRevisionChangeState = __decorate([
|
|
185
|
-
TypeName('MngEntityRevisionChangeState')
|
|
186
|
-
], EntityRevisionChangeState);
|
|
187
|
-
|
|
188
|
-
let EntityRevisionChanges = class EntityRevisionChanges {
|
|
189
|
-
};
|
|
190
|
-
EntityRevisionChanges = __decorate([
|
|
191
|
-
TypeName('MngEntityChanges')
|
|
192
|
-
], EntityRevisionChanges);
|
|
193
|
-
|
|
194
164
|
class AuditUtil {
|
|
195
165
|
static { this._dateRegex = /\d{4}-[01]\d-[0-3]\d/; }
|
|
196
166
|
static addColumnsFromModel(descriptor, properties, modelType = undefined, addFilters = true, addSorts = true) {
|
|
@@ -215,7 +185,7 @@ class AuditUtil {
|
|
|
215
185
|
else {
|
|
216
186
|
column = descriptor.addColumnUnsafe(property.resolvedPropertyName);
|
|
217
187
|
if (addFilters) {
|
|
218
|
-
descriptor.addFilterLookupUnsafe(column.property,
|
|
188
|
+
descriptor.addFilterLookupUnsafe(column.property, lookupDataProvider().withLookup(() => property.possibleEnumValues ?? []));
|
|
219
189
|
}
|
|
220
190
|
}
|
|
221
191
|
}
|
|
@@ -372,35 +342,37 @@ class AuditUtil {
|
|
|
372
342
|
static mapItemsToEntityChangesArray(fieldValue) {
|
|
373
343
|
const entityChanges = [];
|
|
374
344
|
for (const key of Object.keys(fieldValue)) {
|
|
375
|
-
const ec =
|
|
376
|
-
ec.entityType = key;
|
|
377
|
-
ec.items = [];
|
|
345
|
+
const ec = { entityType: key, items: [] };
|
|
378
346
|
for (const change of fieldValue[key]) {
|
|
379
347
|
if (change.revType === RevisionTypeDto.Add && change.entityNewState) {
|
|
380
|
-
const item =
|
|
381
|
-
|
|
382
|
-
|
|
348
|
+
const item = {
|
|
349
|
+
revType: change.revType,
|
|
350
|
+
color: 'green'
|
|
351
|
+
};
|
|
383
352
|
Object.entries(change.entityNewState).forEach(([key, value]) => (item[key] = value));
|
|
384
|
-
ec.items
|
|
353
|
+
ec.items?.push(item);
|
|
385
354
|
}
|
|
386
355
|
else if (change.revType === RevisionTypeDto.Del && change.entityOldState) {
|
|
387
|
-
const item =
|
|
388
|
-
|
|
389
|
-
|
|
356
|
+
const item = {
|
|
357
|
+
revType: change.revType,
|
|
358
|
+
color: 'red'
|
|
359
|
+
};
|
|
390
360
|
Object.entries(change.entityOldState).forEach(([key, value]) => (item[key] = value));
|
|
391
|
-
ec.items
|
|
361
|
+
ec.items?.push(item);
|
|
392
362
|
}
|
|
393
363
|
else if (change.revType === RevisionTypeDto.Mod && change.entityOldState && change.entityNewState) {
|
|
394
|
-
const itemOld =
|
|
395
|
-
|
|
396
|
-
|
|
364
|
+
const itemOld = {
|
|
365
|
+
revType: change.revType,
|
|
366
|
+
color: 'red'
|
|
367
|
+
};
|
|
397
368
|
Object.entries(change.entityOldState).forEach(([key, value]) => (itemOld[key] = value));
|
|
398
|
-
const itemNew =
|
|
399
|
-
|
|
400
|
-
|
|
369
|
+
const itemNew = {
|
|
370
|
+
revType: change.revType,
|
|
371
|
+
color: 'green'
|
|
372
|
+
};
|
|
401
373
|
Object.entries(change.entityNewState).forEach(([key, value]) => (itemNew[key] = value));
|
|
402
|
-
ec.items
|
|
403
|
-
ec.items
|
|
374
|
+
ec.items?.push(itemOld);
|
|
375
|
+
ec.items?.push(itemNew);
|
|
404
376
|
}
|
|
405
377
|
}
|
|
406
378
|
entityChanges.push(ec);
|
|
@@ -409,17 +381,10 @@ class AuditUtil {
|
|
|
409
381
|
}
|
|
410
382
|
}
|
|
411
383
|
|
|
412
|
-
|
|
384
|
+
/* eslint-disable @typescript-eslint/no-explicit-any, @typescript-eslint/ban-types */
|
|
385
|
+
class AuditRevisionsApiService extends AuditApiService {
|
|
413
386
|
constructor() {
|
|
414
387
|
super();
|
|
415
|
-
this.moduleConfig = inject(COMMONS_AUDIT_MODULE_CONFIG_IT);
|
|
416
|
-
this.configService = CommonsConfigurationService.get();
|
|
417
|
-
}
|
|
418
|
-
getServiceBasePath() {
|
|
419
|
-
return this.moduleConfig.apiServiceBasePath ?? '';
|
|
420
|
-
}
|
|
421
|
-
getBasePath() {
|
|
422
|
-
return `${this.configService.getConfigValue(this.moduleConfig.apiBasePathConfigKey)}`;
|
|
423
388
|
}
|
|
424
389
|
getRevisionList(params) {
|
|
425
390
|
return this.http.get(this.getUrl(''), {
|
|
@@ -430,19 +395,35 @@ class AuditRevisionsApiService extends ACommonsBaseV1ApiService {
|
|
|
430
395
|
return this.http.get(this.getUrl(`/changes/${revId}`));
|
|
431
396
|
}
|
|
432
397
|
listRevisionsWithStateForEntityType(params, entityType) {
|
|
398
|
+
let localVarHeaders = this.defaultHeaders;
|
|
399
|
+
localVarHeaders = localVarHeaders.set('Accept', 'application/json');
|
|
433
400
|
return this.http
|
|
434
401
|
.get(this.getUrl(`/states/${entityType}`), {
|
|
435
|
-
params: AuditUtil.paramsToHttpParams(params)
|
|
402
|
+
params: AuditUtil.paramsToHttpParams(params),
|
|
403
|
+
headers: localVarHeaders
|
|
436
404
|
})
|
|
437
405
|
.pipe(map(res => {
|
|
438
406
|
return {
|
|
439
|
-
data:
|
|
407
|
+
data: res.data.map(item => {
|
|
408
|
+
return {
|
|
409
|
+
revEntity: item.revEntity,
|
|
410
|
+
revType: item.revType,
|
|
411
|
+
entityClassName: item.entityClassName,
|
|
412
|
+
entityState: item.entityState
|
|
413
|
+
};
|
|
414
|
+
}),
|
|
440
415
|
totalCount: res.totalCount
|
|
441
416
|
};
|
|
442
417
|
}));
|
|
443
418
|
}
|
|
444
419
|
fetchRevisionsWithStateForEntityType(entityType, revId, itemId) {
|
|
445
|
-
|
|
420
|
+
let localVarHeaders = this.defaultHeaders;
|
|
421
|
+
localVarHeaders = localVarHeaders.set('Accept', 'application/json');
|
|
422
|
+
return this.http
|
|
423
|
+
.get(this.getUrl(`/states/${entityType}?rev=eq:${revId}&id=eq:${itemId}`), {
|
|
424
|
+
headers: localVarHeaders
|
|
425
|
+
})
|
|
426
|
+
.pipe(map(res => res.data.map(i => {
|
|
446
427
|
i.mergedId = i.revEntity?.['rev'] + '_' + i.entityState?.['id'];
|
|
447
428
|
return i;
|
|
448
429
|
})), map(items => {
|
|
@@ -452,19 +433,13 @@ class AuditRevisionsApiService extends ACommonsBaseV1ApiService {
|
|
|
452
433
|
throw new CommonsInternalError(`Entity revision ${revId} for ${entityType} with id ${itemId} was not found`);
|
|
453
434
|
}));
|
|
454
435
|
}
|
|
455
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.
|
|
456
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.
|
|
436
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: AuditRevisionsApiService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
437
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: AuditRevisionsApiService }); }
|
|
457
438
|
}
|
|
458
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.
|
|
439
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: AuditRevisionsApiService, decorators: [{
|
|
459
440
|
type: Injectable
|
|
460
441
|
}], ctorParameters: () => [] });
|
|
461
442
|
|
|
462
|
-
let GuiEntityModelWithI18n = class GuiEntityModelWithI18n extends GuiEntityModelDto {
|
|
463
|
-
};
|
|
464
|
-
GuiEntityModelWithI18n = __decorate([
|
|
465
|
-
TypeName('MngGuiEntityModelWithI18n')
|
|
466
|
-
], GuiEntityModelWithI18n);
|
|
467
|
-
|
|
468
443
|
class AuditEntityRevisionsPageComponent {
|
|
469
444
|
constructor() {
|
|
470
445
|
this.router = inject(Router);
|
|
@@ -492,7 +467,7 @@ class AuditEntityRevisionsPageComponent {
|
|
|
492
467
|
if (!revModel || !selectedRevisionEntity?.entityName) {
|
|
493
468
|
return undefined;
|
|
494
469
|
}
|
|
495
|
-
const desc =
|
|
470
|
+
const desc = tableviewDescriptor({ id: 'mergedId', i18nBase: selectedRevisionEntity.entityName });
|
|
496
471
|
AuditUtil.buildDescriptorForEntityRevision(desc, revModel, selectedRevisionEntity);
|
|
497
472
|
desc.table.withColumnsResizable();
|
|
498
473
|
desc.table.withCurrentColumnsReorderable();
|
|
@@ -507,16 +482,17 @@ class AuditEntityRevisionsPageComponent {
|
|
|
507
482
|
}
|
|
508
483
|
const entityName = selectedRevisionEntity.entityName;
|
|
509
484
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
510
|
-
return
|
|
485
|
+
return tableviewDataProviderWithService(AuditRevisionsApiService).withGetAll((params, service) => selectedRevisionEntity.entityName
|
|
511
486
|
? service.listRevisionsWithStateForEntityType(params, entityName).pipe(map(res => {
|
|
512
487
|
const revEntityWithStateAndIdList = [];
|
|
513
488
|
for (const revEntityWithState of res.data) {
|
|
514
|
-
const revEntityWithStateAndId =
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
489
|
+
const revEntityWithStateAndId = {
|
|
490
|
+
mergedId: revEntityWithState.revEntity?.['rev'] + '_' + revEntityWithState.entityState?.['id'],
|
|
491
|
+
revType: revEntityWithState.revType,
|
|
492
|
+
revEntity: revEntityWithState.revEntity,
|
|
493
|
+
entityState: revEntityWithState.entityState,
|
|
494
|
+
entityClassName: revEntityWithState.entityClassName
|
|
495
|
+
};
|
|
520
496
|
revEntityWithStateAndIdList.push(revEntityWithStateAndId);
|
|
521
497
|
}
|
|
522
498
|
return { data: revEntityWithStateAndIdList, totalCount: res.totalCount };
|
|
@@ -530,7 +506,7 @@ class AuditEntityRevisionsPageComponent {
|
|
|
530
506
|
return [];
|
|
531
507
|
}
|
|
532
508
|
const entityName = selectedRevisionEntity.entityName;
|
|
533
|
-
const detailsAction =
|
|
509
|
+
const detailsAction = actionEditorDetails(descriptor.detailsEditor, AuditRevisionsApiService)
|
|
534
510
|
.withFetchFunction(ctx => {
|
|
535
511
|
if (!entityName) {
|
|
536
512
|
return throwError(() => new CommonsInternalError('No revision entity is provided for details.'));
|
|
@@ -545,7 +521,7 @@ class AuditEntityRevisionsPageComponent {
|
|
|
545
521
|
.withEditorTitle('pages.entityRevisions.actions.details.editor.title');
|
|
546
522
|
return [detailsAction];
|
|
547
523
|
});
|
|
548
|
-
this.revisionEntitiesLookupProvider =
|
|
524
|
+
this.revisionEntitiesLookupProvider = lookupDataProviderWithService(AuditService).withLookup(() => this.auditService.auditModel$.pipe(map(model => {
|
|
549
525
|
const modelI18n = model;
|
|
550
526
|
modelI18n.sort((m1, m2) => {
|
|
551
527
|
if (m1.entityName && m2.entityName) {
|
|
@@ -583,50 +559,14 @@ class AuditEntityRevisionsPageComponent {
|
|
|
583
559
|
this.router.navigate(['/audit/entity-revisions/']);
|
|
584
560
|
}
|
|
585
561
|
}
|
|
586
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.
|
|
587
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "17.3.
|
|
562
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: AuditEntityRevisionsPageComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
563
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "17.3.4", type: AuditEntityRevisionsPageComponent, isStandalone: true, selector: "mng-audit-entity-revisions-page", providers: [AuditRevisionsApiService], ngImport: i0, template: "<div class=\"card\">\n <div class=\"field mb-0\">\n <mng-dropdown\n id=\"revisionEntityDropdown\"\n [placeholder]=\"'pages.entityRevisions.dropdown.placeholder' | translate\"\n optionsLabelProperty=\"entityNameI18n\"\n [ngModel]=\"selectedRevisionEntity()\"\n (valueChange)=\"onRevisionEntityChange($event)\"\n [dataProvider]=\"revisionEntitiesLookupProvider\"\n [showClear]=\"true\"></mng-dropdown>\n @if (!selectedRevisionEntity()) {\n <small class=\"block\">\n {{ 'pages.entityRevisions.dropdown.helpText' | translate }}\n </small>\n }\n </div>\n</div>\n@if (showTableview() && descriptor()) {\n <mng-tableview [descriptor]=\"descriptor()!\" [dataProvider]=\"dataProvider()\" [actions]=\"actions()\"></mng-tableview>\n}\n", dependencies: [{ kind: "component", type: DropdownComponent, selector: "mng-dropdown", inputs: ["dataProvider", "options", "optionsTrackProperty", "optionsLabelProperty", "optionsLabelTranslate", "optionsValueProperty", "optionsDisabledProperty", "multiselect", "placeholder", "showClear", "selectFirstItem", "className", "dropdownClassName", "changeValueOnBlur", "loading", "disabled"], outputs: ["valueChange", "blur"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: TranslateModule }, { kind: "pipe", type: i2.TranslatePipe, name: "translate" }, { kind: "ngmodule", type: FormlyModule }, { kind: "component", type: TableviewComponent, selector: "mng-tableview", inputs: ["descriptor", "dataProvider", "actions"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
588
564
|
}
|
|
589
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.
|
|
565
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: AuditEntityRevisionsPageComponent, decorators: [{
|
|
590
566
|
type: Component,
|
|
591
567
|
args: [{ standalone: true, selector: 'mng-audit-entity-revisions-page', imports: [DropdownComponent, FormsModule, AsyncPipe, TranslateModule, FormlyModule, TableviewComponent], providers: [AuditRevisionsApiService], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"card\">\n <div class=\"field mb-0\">\n <mng-dropdown\n id=\"revisionEntityDropdown\"\n [placeholder]=\"'pages.entityRevisions.dropdown.placeholder' | translate\"\n optionsLabelProperty=\"entityNameI18n\"\n [ngModel]=\"selectedRevisionEntity()\"\n (valueChange)=\"onRevisionEntityChange($event)\"\n [dataProvider]=\"revisionEntitiesLookupProvider\"\n [showClear]=\"true\"></mng-dropdown>\n @if (!selectedRevisionEntity()) {\n <small class=\"block\">\n {{ 'pages.entityRevisions.dropdown.helpText' | translate }}\n </small>\n }\n </div>\n</div>\n@if (showTableview() && descriptor()) {\n <mng-tableview [descriptor]=\"descriptor()!\" [dataProvider]=\"dataProvider()\" [actions]=\"actions()\"></mng-tableview>\n}\n" }]
|
|
592
568
|
}], ctorParameters: () => [] });
|
|
593
569
|
|
|
594
|
-
var RevEntityWithChangesDto_1;
|
|
595
|
-
let RevEntityWithChangesDto = class RevEntityWithChangesDto {
|
|
596
|
-
static { RevEntityWithChangesDto_1 = this; }
|
|
597
|
-
static { this.attributeTypeMap = [
|
|
598
|
-
{
|
|
599
|
-
name: 'revEntity',
|
|
600
|
-
baseName: 'revEntity',
|
|
601
|
-
type: '{ [key: string]: any; }'
|
|
602
|
-
},
|
|
603
|
-
{
|
|
604
|
-
name: 'entityNameChangesMap',
|
|
605
|
-
baseName: 'entityNameChangesMap',
|
|
606
|
-
type: '{ [key: string]: Array<EntityChange>; }'
|
|
607
|
-
}
|
|
608
|
-
]; }
|
|
609
|
-
static getAttributeTypeMap() {
|
|
610
|
-
return RevEntityWithChangesDto_1.attributeTypeMap;
|
|
611
|
-
}
|
|
612
|
-
};
|
|
613
|
-
RevEntityWithChangesDto = RevEntityWithChangesDto_1 = __decorate([
|
|
614
|
-
TypeName('MngRevEntityWithChangesDto')
|
|
615
|
-
], RevEntityWithChangesDto);
|
|
616
|
-
TypeRegistry.get().registerType(RevEntityWithChangesDto);
|
|
617
|
-
|
|
618
|
-
let RevEntity = class RevEntity {
|
|
619
|
-
};
|
|
620
|
-
RevEntity = __decorate([
|
|
621
|
-
TypeName('MngRevEntity')
|
|
622
|
-
], RevEntity);
|
|
623
|
-
|
|
624
|
-
let RevEntityDetailed = class RevEntityDetailed extends RevEntity {
|
|
625
|
-
};
|
|
626
|
-
RevEntityDetailed = __decorate([
|
|
627
|
-
TypeName('MngRevEntityDetailed')
|
|
628
|
-
], RevEntityDetailed);
|
|
629
|
-
|
|
630
570
|
class EntityChangesFieldComponent extends AFormlyCustomFieldComponent {
|
|
631
571
|
constructor() {
|
|
632
572
|
super(...arguments);
|
|
@@ -663,7 +603,7 @@ class EntityChangesFieldComponent extends AFormlyCustomFieldComponent {
|
|
|
663
603
|
}
|
|
664
604
|
}
|
|
665
605
|
const guiEntityModel = this.auditModel.filter(m => m.entityName === entityChanges.entityType)[0];
|
|
666
|
-
const desc =
|
|
606
|
+
const desc = tableDescriptor({ i18nBase: guiEntityModel.entityName }).withClassName('py-2');
|
|
667
607
|
if (guiEntityModel.entityName) {
|
|
668
608
|
desc.withTitle(guiEntityModel.entityName);
|
|
669
609
|
}
|
|
@@ -683,10 +623,10 @@ class EntityChangesFieldComponent extends AFormlyCustomFieldComponent {
|
|
|
683
623
|
desc.withTrackProperty(`EntityChangeField_${entityChanges.entityType ?? 'default'}`);
|
|
684
624
|
return desc;
|
|
685
625
|
}
|
|
686
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.
|
|
687
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "17.3.
|
|
626
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: EntityChangesFieldComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
627
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "17.3.4", type: EntityChangesFieldComponent, isStandalone: true, selector: "mng-entity-changes-field", inputs: { injector: "injector" }, usesInheritance: true, ngImport: i0, template: "@if (modelFetched | async) {\n <div>\n @for (ec of entityChanges; track ec) {\n <mng-table [items]=\"ec.items\" [descriptor]=\"createDescriptor(ec)\"></mng-table>\n }\n </div>\n} @else {\n <div class=\"text-center\">\n <i class=\"pi pi-spin pi-spinner\" style=\"font-size: 2rem\"></i>\n </div>\n}\n", styles: ["::ng-deep tr.audit-row-deleted{background:#ff3d331a!important}::ng-deep tr.audit-row-deleted .audit-cell{background:#f6544c4d!important}::ng-deep tr.audit-row-added{background-color:#1bc5621a!important}::ng-deep tr.audit-row-added .audit-cell{background:#1bc5624d!important}\n"], dependencies: [{ kind: "component", type: TableComponent, selector: "mng-table", inputs: ["descriptor", "items", "result", "loading", "dataProvider", "useQueryParams", "selectionMode", "selectionEnabled", "columnLastMinWidth", "captionComponent", "columnCustomLastComponent", "globalFilterFields"], outputs: ["tableLoad", "cellClick", "selectionChange", "captionComponentInstance", "columnCustomLastComponentInstance"] }, { kind: "pipe", type: AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
688
628
|
}
|
|
689
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.
|
|
629
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: EntityChangesFieldComponent, decorators: [{
|
|
690
630
|
type: Component,
|
|
691
631
|
args: [{ standalone: true, selector: 'mng-entity-changes-field', imports: [TableComponent, AsyncPipe], changeDetection: ChangeDetectionStrategy.OnPush, template: "@if (modelFetched | async) {\n <div>\n @for (ec of entityChanges; track ec) {\n <mng-table [items]=\"ec.items\" [descriptor]=\"createDescriptor(ec)\"></mng-table>\n }\n </div>\n} @else {\n <div class=\"text-center\">\n <i class=\"pi pi-spin pi-spinner\" style=\"font-size: 2rem\"></i>\n </div>\n}\n", styles: ["::ng-deep tr.audit-row-deleted{background:#ff3d331a!important}::ng-deep tr.audit-row-deleted .audit-cell{background:#f6544c4d!important}::ng-deep tr.audit-row-added{background-color:#1bc5621a!important}::ng-deep tr.audit-row-added .audit-cell{background:#1bc5624d!important}\n"] }]
|
|
692
632
|
}], propDecorators: { injector: [{
|
|
@@ -703,13 +643,13 @@ class AuditRevisionsPageComponent {
|
|
|
703
643
|
const revModel = this.revModel();
|
|
704
644
|
if (revModel) {
|
|
705
645
|
const idProperty = revModel.properties?.filter(prop => prop.isId).map(prop => prop.resolvedPropertyName)[0];
|
|
706
|
-
const
|
|
646
|
+
const revEntModel = model({ id: 'rev', title: 'rev', i18nBase: 'MngRevEntity' });
|
|
707
647
|
if (revModel.entityName)
|
|
708
|
-
|
|
648
|
+
revEntModel.withI18nBase(revModel.entityName);
|
|
709
649
|
if (idProperty)
|
|
710
|
-
|
|
711
|
-
const desc =
|
|
712
|
-
const detailsDescriptor =
|
|
650
|
+
revEntModel.withIdPropertyUnsafe(idProperty);
|
|
651
|
+
const desc = tableviewDescriptor(revEntModel);
|
|
652
|
+
const detailsDescriptor = editorDescriptor({ i18nBase: 'MngRevEntity', tableviewEditorType: TableviewEditorTypeEnum.Details });
|
|
713
653
|
detailsDescriptor.model.withIdPropertyUnsafe('revEntity.' + idProperty);
|
|
714
654
|
if (revModel.properties) {
|
|
715
655
|
AuditUtil.addColumnsFromModel(desc.table, revModel.properties);
|
|
@@ -725,28 +665,27 @@ class AuditRevisionsPageComponent {
|
|
|
725
665
|
desc.withDetailsDescriptor(detailsDescriptor); // MngRevEntity is extended by MngRevEntityWithChangesDto, so no real harm here
|
|
726
666
|
return desc;
|
|
727
667
|
}
|
|
728
|
-
return
|
|
668
|
+
return tableviewDescriptor();
|
|
729
669
|
});
|
|
730
|
-
this.dataProvider = signal(
|
|
670
|
+
this.dataProvider = signal(tableviewDataProviderWithService(AuditRevisionsApiService).withGetAll((params, service) => service.getRevisionList(params).pipe(map(res => ({ data: res.data, totalCount: res.totalCount })))));
|
|
731
671
|
this.actions = computed(() => {
|
|
732
|
-
|
|
733
|
-
const detailsAction = ActionEditorDetailsDescriptor.createWithProvider(this.descriptor().detailsEditor, AuditRevisionsApiService).withFetchFunction(ctx => {
|
|
734
|
-
console.log(ctx);
|
|
672
|
+
const detailsAction = actionEditorDetails(this.descriptor().detailsEditor, AuditRevisionsApiService).withFetchFunction(ctx => {
|
|
735
673
|
return ctx.serviceInstance.getAllChangesForRevision(itemIdToDefined(ctx.parameters.itemId)).pipe(map(item => {
|
|
736
|
-
const revEntityWithChanges =
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
674
|
+
const revEntityWithChanges = {
|
|
675
|
+
rev: ctx.parameters.itemId,
|
|
676
|
+
revEntity: item.revEntity,
|
|
677
|
+
entityNameChangesMap: item.entityNameChangesMap
|
|
678
|
+
};
|
|
740
679
|
return revEntityWithChanges;
|
|
741
680
|
}));
|
|
742
681
|
});
|
|
743
682
|
return [detailsAction];
|
|
744
683
|
});
|
|
745
684
|
}
|
|
746
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.
|
|
747
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "17.3.
|
|
685
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: AuditRevisionsPageComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
686
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "17.3.4", type: AuditRevisionsPageComponent, isStandalone: true, selector: "mng-audit-revisions-page", providers: [AuditRevisionsApiService], ngImport: i0, template: "@if (showTableview()) {\n <mng-tableview [descriptor]=\"descriptor()\" [dataProvider]=\"dataProvider()\" [actions]=\"actions()\"></mng-tableview>\n}\n", dependencies: [{ kind: "component", type: TableviewComponent, selector: "mng-tableview", inputs: ["descriptor", "dataProvider", "actions"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
748
687
|
}
|
|
749
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.
|
|
688
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: AuditRevisionsPageComponent, decorators: [{
|
|
750
689
|
type: Component,
|
|
751
690
|
args: [{ standalone: true, selector: 'mng-audit-revisions-page', imports: [TableviewComponent, AsyncPipe, RouterOutlet, JsonPipe], providers: [AuditRevisionsApiService], changeDetection: ChangeDetectionStrategy.OnPush, template: "@if (showTableview()) {\n <mng-tableview [descriptor]=\"descriptor()\" [dataProvider]=\"dataProvider()\" [actions]=\"actions()\"></mng-tableview>\n}\n" }]
|
|
752
691
|
}] });
|
|
@@ -757,30 +696,30 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.2", ngImpor
|
|
|
757
696
|
* @param routeConfig Optionally provide route configs.
|
|
758
697
|
*/
|
|
759
698
|
function provideAuditRoutes(config, routeConfig) {
|
|
760
|
-
const routeBuilder =
|
|
699
|
+
const routeBuilder = createRoute('', config.rootPageComponent ?? AuditPageComponent)
|
|
761
700
|
.withProvider(AuditService)
|
|
762
701
|
.withProvider({
|
|
763
702
|
provide: COMMONS_AUDIT_MODULE_CONFIG_IT,
|
|
764
703
|
useValue: config
|
|
765
704
|
})
|
|
766
|
-
.addChildBuilder(
|
|
705
|
+
.addChildBuilder(createRouteRedirect('', routeConfig?.defaultRedirect ?? 'revisions', 'full'));
|
|
767
706
|
if (routeConfig?.preRevisionRoutes?.length) {
|
|
768
707
|
routeConfig.preRevisionRoutes.forEach(r => routeBuilder.addChildBuilder(r));
|
|
769
708
|
}
|
|
770
|
-
const revisionsRouteBuilder =
|
|
709
|
+
const revisionsRouteBuilder = createTableviewRoute('revisions', config.revisionsPageComponent ?? AuditRevisionsPageComponent)
|
|
771
710
|
.withTitle('pages.revisions.title')
|
|
772
711
|
.withAdd(false)
|
|
773
712
|
.withDelete(false)
|
|
774
713
|
.withEdit(false);
|
|
775
714
|
if (routeConfig?.revisionsMenuItem) {
|
|
776
|
-
revisionsRouteBuilder.
|
|
715
|
+
revisionsRouteBuilder.withMenuItemOpts(routeConfig.revisionsMenuItem);
|
|
777
716
|
}
|
|
778
717
|
else {
|
|
779
718
|
revisionsRouteBuilder.withMenuItem('pi pi-book', 'pages.revisions.title');
|
|
780
719
|
}
|
|
781
|
-
const entityRevisionsRouteBuilder =
|
|
720
|
+
const entityRevisionsRouteBuilder = createRoute('entity-revisions', config.entityRevisionsPageComponent ?? AuditEntityRevisionsPageComponent).withTitle('pages.entityRevisions.title');
|
|
782
721
|
if (routeConfig?.entityRevisionsMenuItem) {
|
|
783
|
-
entityRevisionsRouteBuilder.
|
|
722
|
+
entityRevisionsRouteBuilder.withMenuItemOpts(routeConfig.entityRevisionsMenuItem);
|
|
784
723
|
}
|
|
785
724
|
else {
|
|
786
725
|
entityRevisionsRouteBuilder.withMenuItem('pi pi-building', 'pages.entityRevisions.title');
|
|
@@ -788,11 +727,11 @@ function provideAuditRoutes(config, routeConfig) {
|
|
|
788
727
|
routeBuilder
|
|
789
728
|
.addChildBuilder(revisionsRouteBuilder)
|
|
790
729
|
.addChildBuilder(entityRevisionsRouteBuilder)
|
|
791
|
-
.addChildBuilder(
|
|
730
|
+
.addChildBuilder(createTableviewRoute('entity-revisions/:entityClass', config.entityRevisionsPageComponent ?? AuditEntityRevisionsPageComponent).withTitle('pages.entityRevisions.title'));
|
|
792
731
|
if (routeConfig?.postRevisionRoutes?.length) {
|
|
793
732
|
routeConfig.postRevisionRoutes.forEach(r => routeBuilder.addChildBuilder(r));
|
|
794
733
|
}
|
|
795
|
-
return
|
|
734
|
+
return createRoutes().add(routeBuilder).build();
|
|
796
735
|
}
|
|
797
736
|
|
|
798
737
|
/**
|