@unifylib/ui-lib 1.0.3 → 1.1.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.
Files changed (155) hide show
  1. package/ng-package.json +7 -7
  2. package/package.json +14 -12
  3. package/src/lib/base-model/SearchStrConfig.ts +12 -12
  4. package/src/lib/base-model/api-response.ts +23 -23
  5. package/src/lib/base-model/audit-log-entry.ts +7 -7
  6. package/src/lib/base-model/button-action-settings.ts +29 -25
  7. package/src/lib/base-model/column-def.model.ts +34 -34
  8. package/src/lib/base-model/do-action-request.ts +11 -11
  9. package/src/lib/base-model/feature-item.ts +9 -0
  10. package/src/lib/base-model/field-action.ts +7 -7
  11. package/src/lib/base-model/field-filter.model.ts +7 -14
  12. package/src/lib/base-model/field-info.ts +102 -98
  13. package/src/lib/base-model/field-predicate.model.ts +7 -7
  14. package/src/lib/base-model/filter-request.ts +27 -27
  15. package/src/lib/base-model/filter.model.ts +49 -49
  16. package/src/lib/base-model/get-items-list.ts +24 -24
  17. package/src/lib/base-model/index.ts +11 -11
  18. package/src/lib/base-model/items-total.model.ts +12 -0
  19. package/src/lib/base-model/line-item.model.ts +18 -0
  20. package/src/lib/base-model/lookupItem.ts +21 -21
  21. package/src/lib/base-model/null-snackmessage.ts +9 -9
  22. package/src/lib/base-model/page-info.ts +54 -51
  23. package/src/lib/base-model/report-request.model.ts +33 -33
  24. package/src/lib/base-model/response-envelop.model.ts +15 -15
  25. package/src/lib/base-model/snack-message.model.ts +14 -14
  26. package/src/lib/base-model/snackmessage-interface.ts +7 -7
  27. package/src/lib/base-model/table-column.interface.ts +29 -29
  28. package/src/lib/base-model/table-page-user-action.interface.ts +33 -33
  29. package/src/lib/base-model/workflow/workflow-steps.model.ts +9 -9
  30. package/src/lib/base-model/workflow/workflow.model.ts +52 -52
  31. package/src/lib/components/action-comment/action-comment.component.css +52 -0
  32. package/src/lib/components/action-comment/action-comment.component.html +47 -0
  33. package/src/lib/components/{rejection-comment → action-comment}/action-comment.component.spec.ts +23 -23
  34. package/src/lib/components/{rejection-comment → action-comment}/action-comment.component.ts +102 -86
  35. package/src/lib/components/action-confirmation/action-confirmation.component.css +46 -34
  36. package/src/lib/components/action-confirmation/action-confirmation.component.html +32 -18
  37. package/src/lib/components/action-confirmation/action-confirmation.component.spec.ts +23 -23
  38. package/src/lib/components/action-confirmation/action-confirmation.component.ts +58 -58
  39. package/src/lib/components/activity-report-form/activity-report-form.component.html +110 -109
  40. package/src/lib/components/activity-report-form/activity-report-form.component.scss +69 -0
  41. package/src/lib/components/activity-report-form/activity-report-form.component.spec.ts +25 -25
  42. package/src/lib/components/activity-report-form/activity-report-form.component.ts +616 -605
  43. package/src/lib/components/advanced-filter/field-filter/field-filter.component.html +8 -0
  44. package/src/lib/components/advanced-filter/field-filter/field-filter.component.scss +0 -0
  45. package/src/lib/components/advanced-filter/field-filter/field-filter.component.spec.ts +25 -0
  46. package/src/lib/components/advanced-filter/field-filter/field-filter.component.ts +55 -0
  47. package/src/lib/components/advanced-filter/filter-builder/filter-builder.component.html +36 -0
  48. package/src/lib/components/advanced-filter/filter-builder/filter-builder.component.scss +130 -0
  49. package/src/lib/components/advanced-filter/filter-builder/filter-builder.component.spec.ts +25 -0
  50. package/src/lib/components/advanced-filter/filter-builder/filter-builder.component.ts +186 -0
  51. package/src/lib/components/audit-log-details-dialog/audit-log-details-dialog.component.css +51 -51
  52. package/src/lib/components/audit-log-details-dialog/audit-log-details-dialog.component.html +23 -23
  53. package/src/lib/components/audit-log-details-dialog/audit-log-details-dialog.component.spec.ts +23 -23
  54. package/src/lib/components/audit-log-details-dialog/audit-log-details-dialog.component.ts +69 -69
  55. package/src/lib/components/audit-log-list/audit-log.component.html +26 -23
  56. package/src/lib/components/audit-log-list/audit-log.component.scss +50 -0
  57. package/src/lib/components/audit-log-list/audit-log.component.spec.ts +25 -25
  58. package/src/lib/components/audit-log-list/audit-log.component.ts +114 -116
  59. package/src/lib/components/auto-complete/auto-complete.component.css +55 -14
  60. package/src/lib/components/auto-complete/auto-complete.component.html +45 -29
  61. package/src/lib/components/auto-complete/auto-complete.component.spec.ts +23 -23
  62. package/src/lib/components/auto-complete/auto-complete.component.ts +331 -330
  63. package/src/lib/components/base-form/base-form.component.html +59 -58
  64. package/src/lib/components/base-form/base-form.component.scss +68 -0
  65. package/src/lib/components/base-form/base-form.component.spec.ts +25 -25
  66. package/src/lib/components/base-form/base-form.component.ts +323 -305
  67. package/src/lib/components/base-form-canvas/base-form-canvas.component.css +196 -22
  68. package/src/lib/components/base-form-canvas/base-form-canvas.component.html +1095 -1006
  69. package/src/lib/components/base-form-canvas/base-form-canvas.component.spec.ts +23 -23
  70. package/src/lib/components/base-form-canvas/base-form-canvas.component.ts +680 -573
  71. package/src/lib/components/base-input-dialog/base-input-dialog.component.css +67 -0
  72. package/src/lib/components/base-input-dialog/base-input-dialog.component.html +47 -42
  73. package/src/lib/components/base-input-dialog/base-input-dialog.component.spec.ts +23 -23
  74. package/src/lib/components/base-input-dialog/base-input-dialog.component.ts +77 -78
  75. package/src/lib/components/base-table/base-table.component.html +268 -242
  76. package/src/lib/components/base-table/base-table.component.scss +140 -31
  77. package/src/lib/components/base-table/base-table.component.spec.ts +25 -25
  78. package/src/lib/components/base-table/base-table.component.ts +621 -568
  79. package/src/lib/components/button-actions/button-actions.component.html +27 -28
  80. package/src/lib/components/button-actions/button-actions.component.scss +101 -6
  81. package/src/lib/components/button-actions/button-actions.component.spec.ts +23 -23
  82. package/src/lib/components/button-actions/button-actions.component.ts +70 -72
  83. package/src/lib/components/editable-base-table/editable-base-table.component.html +337 -372
  84. package/src/lib/components/editable-base-table/editable-base-table.component.scss +126 -44
  85. package/src/lib/components/editable-base-table/editable-base-table.component.spec.ts +25 -25
  86. package/src/lib/components/editable-base-table/editable-base-table.component.ts +579 -570
  87. package/src/lib/components/equation-builder/equation-builder.component.css +39 -0
  88. package/src/lib/components/equation-builder/equation-builder.component.html +31 -31
  89. package/src/lib/components/equation-builder/equation-builder.component.spec.ts +23 -23
  90. package/src/lib/components/equation-builder/equation-builder.component.ts +119 -121
  91. package/src/lib/components/item-line-editor/item-line-editor.component.html +102 -0
  92. package/src/lib/components/item-line-editor/item-line-editor.component.scss +152 -0
  93. package/src/lib/components/item-line-editor/item-line-editor.component.spec.ts +23 -0
  94. package/src/lib/components/item-line-editor/item-line-editor.component.ts +306 -0
  95. package/src/lib/components/multi-auto-complete/multi-auto-complete.component.css +19 -11
  96. package/src/lib/components/multi-auto-complete/multi-auto-complete.component.html +38 -38
  97. package/src/lib/components/multi-auto-complete/multi-auto-complete.component.spec.ts +23 -23
  98. package/src/lib/components/multi-auto-complete/multi-auto-complete.component.ts +315 -317
  99. package/src/lib/components/paginator/paginator.component.css +65 -25
  100. package/src/lib/components/paginator/paginator.component.html +30 -34
  101. package/src/lib/components/paginator/paginator.component.ts +87 -94
  102. package/src/lib/components/report-details-dialog/report-details-dialog.component.css +17 -17
  103. package/src/lib/components/report-details-dialog/report-details-dialog.component.html +16 -16
  104. package/src/lib/components/report-details-dialog/report-details-dialog.component.spec.ts +23 -23
  105. package/src/lib/components/report-details-dialog/report-details-dialog.component.ts +111 -113
  106. package/src/lib/components/report-form/report-form.component.html +92 -94
  107. package/src/lib/components/report-form/report-form.component.scss +51 -0
  108. package/src/lib/components/report-form/report-form.component.spec.ts +25 -25
  109. package/src/lib/components/report-form/report-form.component.ts +599 -588
  110. package/src/lib/components/search-bar/search-bar.component.html +51 -62
  111. package/src/lib/components/search-bar/search-bar.component.scss +63 -8
  112. package/src/lib/components/search-bar/search-bar.component.spec.ts +25 -25
  113. package/src/lib/components/search-bar/search-bar.component.ts +68 -70
  114. package/src/lib/components/section-form-canvas/section-form-canvas.component.html +43 -0
  115. package/src/lib/components/section-form-canvas/section-form-canvas.component.scss +81 -0
  116. package/src/lib/components/section-form-canvas/section-form-canvas.component.spec.ts +23 -0
  117. package/src/lib/components/section-form-canvas/section-form-canvas.component.ts +67 -0
  118. package/src/lib/components/shared/action-button/action-button.component.html +12 -0
  119. package/src/lib/components/shared/action-button/action-button.component.scss +45 -0
  120. package/src/lib/components/shared/action-button/action-button.component.ts +51 -0
  121. package/src/lib/components/shared/action-card/action-card.component.html +78 -0
  122. package/src/lib/components/shared/action-card/action-card.component.scss +238 -0
  123. package/src/lib/components/shared/action-card/action-card.component.ts +56 -0
  124. package/src/lib/components/shared/attachment-uploader/attachment-uploader.component.css +135 -54
  125. package/src/lib/components/shared/attachment-uploader/attachment-uploader.component.html +36 -22
  126. package/src/lib/components/shared/attachment-uploader/attachment-uploader.component.spec.ts +23 -23
  127. package/src/lib/components/shared/attachment-uploader/attachment-uploader.component.ts +71 -45
  128. package/src/lib/components/shared-list/shared-list.component.html +17 -17
  129. package/src/lib/components/shared-list/shared-list.component.spec.ts +23 -23
  130. package/src/lib/components/shared-list/shared-list.component.ts +53 -53
  131. package/src/lib/components/snackbar-static/snackbar-static.component.html +20 -0
  132. package/src/lib/components/snackbar-static/snackbar-static.component.scss +135 -0
  133. package/src/lib/components/snackbar-static/snackbar-static.component.ts +26 -0
  134. package/src/lib/components/title-bar/title-bar.component.html +35 -31
  135. package/src/lib/components/title-bar/title-bar.component.scss +126 -23
  136. package/src/lib/components/title-bar/title-bar.component.spec.ts +23 -23
  137. package/src/lib/components/title-bar/title-bar.component.ts +126 -119
  138. package/src/lib/services/backend-service.ts +287 -286
  139. package/src/lib/services/index.ts +3 -3
  140. package/src/lib/services/top-panel.ts +17 -17
  141. package/src/lib/services/trigger-form.service.ts +11 -11
  142. package/src/lib/share-module/shared-module.ts +10 -10
  143. package/src/lib/utils/base-utils.ts +102 -102
  144. package/src/lib/validators/date-range-validator.ts +31 -31
  145. package/src/lib/validators/index.ts +3 -3
  146. package/src/lib/validators/match-list.validator.ts +10 -10
  147. package/src/lib/validators/multi-email-validator.ts +15 -15
  148. package/src/public-api.ts +29 -21
  149. package/tsconfig.lib.json +15 -15
  150. package/tsconfig.lib.prod.json +11 -11
  151. package/tsconfig.spec.json +15 -15
  152. package/src/lib/components/rejection-comment/action-comment.component.css +0 -33
  153. package/src/lib/components/rejection-comment/action-comment.component.html +0 -46
  154. package/src/lib/styles/invoiceq-theme.scss +0 -252
  155. package/src/lib/styles/styles.scss +0 -1723
@@ -1,69 +1,69 @@
1
- import {Component, HostListener, Inject, OnInit} from '@angular/core';
2
- import {MAT_DIALOG_DATA, MatDialogContent, MatDialogRef, MatDialogTitle} from "@angular/material/dialog";
3
- import {FormsModule} from "@angular/forms";
4
- import {TranslateModule} from "@ngx-translate/core";
5
- import {MatButton} from "@angular/material/button";
6
- import {FieldInfo, PageInfo} from "../../base-model";
7
- import {BaseFormCanvasComponent} from "../base-form-canvas/base-form-canvas.component";
8
- import {MatDivider} from "@angular/material/divider";
9
-
10
- @Component({
11
- selector: 'app-audit-log-details-dialog',
12
- standalone: true,
13
- imports: [
14
- MatDialogTitle,
15
- MatDialogContent,
16
- FormsModule,
17
- TranslateModule,
18
- MatButton,
19
- BaseFormCanvasComponent,
20
- MatDivider
21
- ],
22
- templateUrl: './audit-log-details-dialog.component.html',
23
- styleUrl: './audit-log-details-dialog.component.css'
24
- })
25
- export class AuditLogDetailsDialogComponent implements OnInit {
26
- pageInfo: PageInfo;
27
- fields: FieldInfo[] = [];
28
-
29
- actionLabel : string =''
30
- isTermination : boolean=false;
31
- comment: string = '';
32
- external: boolean = false;
33
- signingRequired: boolean = false;
34
- tokenReference: string = "";
35
- warningMsg = false;
36
- item: any = {};
37
- constructor(public dialogRef: MatDialogRef<AuditLogDetailsDialogComponent>,
38
- @Inject(MAT_DIALOG_DATA) public data: any) {
39
- dialogRef.disableClose = true;
40
- }
41
- @HostListener('window:keyup.esc') onKeyUp() {
42
- this.dialogRef.close();
43
- }
44
- ngOnInit(): void {
45
- this.pageInfo = this.data.pageInfo;
46
- this.fields = this.data.fields;
47
-
48
- this.fields = this.data.fields.map((f: any) => ({ ...f }));
49
-
50
- const showHiddenFields: string[] = this.data.showHiddenFields || [];
51
- this.fields.forEach(field => {
52
- if (showHiddenFields.includes(field.property)) {
53
- field.visible = true;
54
- }
55
- });
56
- this.item = this.data.item;
57
- this.comment = this.data.comment;
58
- this.warningMsg = this.data.warningMsg || false;
59
- }
60
-
61
- cancel() {
62
- this.dialogRef.close();
63
- }
64
-
65
-
66
- getTitle() {
67
- return `${this.pageInfo.labelsSection}.${this.pageInfo.id}`;
68
- }
69
- }
1
+ import {Component, HostListener, Inject, OnInit} from '@angular/core';
2
+ import {MAT_DIALOG_DATA, MatDialogContent, MatDialogRef, MatDialogTitle} from "@angular/material/dialog";
3
+ import {FormsModule} from "@angular/forms";
4
+ import {TranslateModule} from "@ngx-translate/core";
5
+ import {MatButton} from "@angular/material/button";
6
+ import {FieldInfo, PageInfo} from "../../base-model";
7
+ import {BaseFormCanvasComponent} from "../base-form-canvas/base-form-canvas.component";
8
+ import {MatDivider} from "@angular/material/divider";
9
+
10
+ @Component({
11
+ selector: 'app-audit-log-details-dialog',
12
+ standalone: true,
13
+ imports: [
14
+ MatDialogTitle,
15
+ MatDialogContent,
16
+ FormsModule,
17
+ TranslateModule,
18
+ MatButton,
19
+ BaseFormCanvasComponent,
20
+ MatDivider
21
+ ],
22
+ templateUrl: './audit-log-details-dialog.component.html',
23
+ styleUrl: './audit-log-details-dialog.component.css'
24
+ })
25
+ export class AuditLogDetailsDialogComponent implements OnInit {
26
+ pageInfo: PageInfo;
27
+ fields: FieldInfo[] = [];
28
+
29
+ actionLabel : string =''
30
+ isTermination : boolean=false;
31
+ comment: string = '';
32
+ external: boolean = false;
33
+ signingRequired: boolean = false;
34
+ tokenReference: string = "";
35
+ warningMsg = false;
36
+ item: any = {};
37
+ constructor(public dialogRef: MatDialogRef<AuditLogDetailsDialogComponent>,
38
+ @Inject(MAT_DIALOG_DATA) public data: any) {
39
+ dialogRef.disableClose = true;
40
+ }
41
+ @HostListener('window:keyup.esc') onKeyUp() {
42
+ this.dialogRef.close();
43
+ }
44
+ ngOnInit(): void {
45
+ this.pageInfo = this.data.pageInfo;
46
+ this.fields = this.data.fields;
47
+
48
+ this.fields = this.data.fields.map((f: any) => ({ ...f }));
49
+
50
+ const showHiddenFields: string[] = this.data.showHiddenFields || [];
51
+ this.fields.forEach(field => {
52
+ if (showHiddenFields.includes(field.property)) {
53
+ field.visible = true;
54
+ }
55
+ });
56
+ this.item = this.data.item;
57
+ this.comment = this.data.comment;
58
+ this.warningMsg = this.data.warningMsg || false;
59
+ }
60
+
61
+ cancel() {
62
+ this.dialogRef.close();
63
+ }
64
+
65
+
66
+ getTitle() {
67
+ return `${this.pageInfo.labelsSection}.${this.pageInfo.id}`;
68
+ }
69
+ }
@@ -1,23 +1,26 @@
1
- <h4><span style="font-weight: normal; color: #222222" >{{'audit-log.title' | translate}}</span></h4>
2
- <div class="hrdivider-mini" >
3
- <hr class="header-hr"/>
4
- </div>
5
-
6
- <div fxLayout="row" fxLayout.lt-md="row" fxLayoutGap="5px" fxLayoutAlign="start start" style="width: 100%;"
7
- *ngFor="let auditLog of auditLogEntries; let i=index">
8
- <div fxLayout="column" fxFlex="100" fxLayoutAlign="start start">
9
- <p *ngIf="i===0" style="margin-bottom: 15px; margin-top: 0"></p>
10
- <p style="margin-bottom: 0; margin-top: 0">
11
- {{getDescription(auditLog)}}
12
- <button mat-stroked-button color="secondary" (click)="viewObject(auditLog)">
13
- {{ 'audit-log.view_details' | translate }}
14
- </button>
15
-
16
- </p>
17
- <p class="invoice-label-text" style="margin: 0;word-wrap: break-word"></p>
18
- <div class="hrdivider-mini" >
19
- <hr class="header-hr"/>
20
- </div>
21
- </div>
22
-
23
- </div>
1
+ <h4>
2
+ <span class="audit-log-title">{{ 'audit-log.title' | translate }}</span>
3
+ </h4>
4
+
5
+ <div class="hrdivider-mini">
6
+ <hr class="header-hr" />
7
+ </div>
8
+
9
+ <div class="audit-log-container" *ngFor="let auditLog of auditLogEntries; let i = index">
10
+ <div class="audit-log-entry">
11
+ <p *ngIf="i === 0" class="audit-log-spacer"></p>
12
+
13
+ <p class="audit-log-text">
14
+ {{ getDescription(auditLog) }}
15
+ <button mat-stroked-button color="secondary" (click)="viewObject(auditLog)" [attr.id]="'audit-view-details-' + i">
16
+ {{ 'audit-log.view_details' | translate }}
17
+ </button>
18
+ </p>
19
+
20
+ <p class="invoice-label-text"></p>
21
+
22
+ <div class="hrdivider-mini">
23
+ <hr class="header-hr" />
24
+ </div>
25
+ </div>
26
+ </div>
@@ -0,0 +1,50 @@
1
+ .audit-log-title {
2
+ font-weight: normal;
3
+ color: #222222;
4
+ }
5
+
6
+ .hrdivider-mini {
7
+ width: 100%;
8
+ }
9
+
10
+ .header-hr {
11
+ height: 4px;
12
+ background-color: #339dff;
13
+ border: none;
14
+ margin: 5px 0;
15
+ }
16
+
17
+ .audit-log-container {
18
+ display: flex;
19
+ flex-direction: row;
20
+ gap: 5px;
21
+ justify-content: flex-start;
22
+ align-items: flex-start;
23
+ width: 100%;
24
+ flex-wrap: wrap;
25
+ }
26
+
27
+ .audit-log-entry {
28
+ display: flex;
29
+ flex-direction: column;
30
+ align-items: flex-start;
31
+ flex: 1 1 100%;
32
+ }
33
+
34
+ .audit-log-spacer {
35
+ margin-bottom: 15px;
36
+ margin-top: 0;
37
+ }
38
+
39
+ .audit-log-text {
40
+ margin: 0;
41
+ word-wrap: break-word;
42
+ }
43
+
44
+ /* --- Responsive --- */
45
+ @media (max-width: 960px) {
46
+ .audit-log-container {
47
+ flex-direction: column;
48
+ align-items: stretch;
49
+ }
50
+ }
@@ -1,25 +1,25 @@
1
- import {ComponentFixture, TestBed} from '@angular/core/testing';
2
-
3
- import {AuditLogComponent} from './audit-log.component';
4
-
5
- describe('BaseFormComponent', () => {
6
- let component: AuditLogComponent;
7
- let fixture: ComponentFixture<AuditLogComponent>;
8
-
9
- beforeEach(async () => {
10
- await TestBed.configureTestingModule({
11
- declarations: [ AuditLogComponent ]
12
- })
13
- .compileComponents();
14
- });
15
-
16
- beforeEach(() => {
17
- fixture = TestBed.createComponent(AuditLogComponent);
18
- component = fixture.componentInstance;
19
- fixture.detectChanges();
20
- });
21
-
22
- it('should create', () => {
23
- expect(component).toBeTruthy();
24
- });
25
- });
1
+ import {ComponentFixture, TestBed} from '@angular/core/testing';
2
+
3
+ import {AuditLogComponent} from './audit-log.component';
4
+
5
+ describe('BaseFormComponent', () => {
6
+ let component: AuditLogComponent;
7
+ let fixture: ComponentFixture<AuditLogComponent>;
8
+
9
+ beforeEach(async () => {
10
+ await TestBed.configureTestingModule({
11
+ declarations: [ AuditLogComponent ]
12
+ })
13
+ .compileComponents();
14
+ });
15
+
16
+ beforeEach(() => {
17
+ fixture = TestBed.createComponent(AuditLogComponent);
18
+ component = fixture.componentInstance;
19
+ fixture.detectChanges();
20
+ });
21
+
22
+ it('should create', () => {
23
+ expect(component).toBeTruthy();
24
+ });
25
+ });
@@ -1,116 +1,114 @@
1
- import {Component, Inject, Input, OnInit} from '@angular/core';
2
- import {FieldInfo, Filter, FilterRequest, PageInfo, TableColumn} from "../../base-model";
3
- import {TranslateModule, TranslateService} from "@ngx-translate/core";
4
- import {BackendService} from "../../services";
5
- import {DatePipe, NgForOf, NgIf} from "@angular/common";
6
- import {FlexLayoutModule} from "@angular/flex-layout";
7
- import {MatButton, MatButtonModule} from "@angular/material/button";
8
- import {MatIconModule} from "@angular/material/icon";
9
- import {MatDialog} from "@angular/material/dialog";
10
- import {ActivatedRoute, Router} from "@angular/router";
11
- import {AuditLogEntry} from "../../base-model/audit-log-entry";
12
- import {AuditLogDetailsDialogComponent} from "../audit-log-details-dialog/audit-log-details-dialog.component";
13
- import {Directionality} from "@angular/cdk/bidi";
14
-
15
- @Component({
16
- selector: 'app-audit-log',
17
- standalone: true,
18
- imports: [
19
- FlexLayoutModule,
20
- NgForOf,
21
- MatButtonModule,
22
- TranslateModule,
23
- NgIf,
24
- MatIconModule,
25
- MatButton
26
- ],
27
- providers: [DatePipe],
28
- templateUrl: './audit-log.component.html',
29
- styleUrl: './audit-log.component.scss'
30
- })
31
- export class AuditLogComponent implements OnInit {
32
- auditLogEntries: AuditLogEntry[] = [];
33
-
34
- @Input()
35
- pageInfo!: PageInfo;
36
-
37
- @Input()
38
- fields: FieldInfo[];
39
-
40
- @Input()
41
- showHiddenFields : string[];
42
-
43
-
44
- itemId: number;
45
-
46
- item : any = {};
47
- isLoaded : boolean = false;
48
- columnsDefinition: TableColumn<any>[];
49
-
50
- currentDirection: 'ltr' | 'rtl';
51
-
52
-
53
- constructor(public dialog: MatDialog,
54
- private activatedRoute: ActivatedRoute,
55
- private datePipe: DatePipe,
56
- private translateService:TranslateService,
57
- private router:Router,
58
- private directionality: Directionality,
59
- @Inject('securityManager') private securityManager: any,
60
- public backendService: BackendService) {
61
- }
62
-
63
- ngOnInit(): void {
64
- this.currentDirection = this.directionality.value;
65
- this.directionality.change.subscribe((value) => {
66
- this.currentDirection = value;
67
- })
68
-
69
- this.loadItem();
70
- }
71
-
72
-
73
- private loadItem() {
74
- if (this.activatedRoute.snapshot.queryParams['token']) {
75
- this.itemId = this.backendService.decrypt(this.activatedRoute.snapshot.queryParams['token']);
76
- }
77
- const filterRequest = new FilterRequest;
78
- if (this.itemId > 0) {
79
- filterRequest.filters = [];
80
- filterRequest.sortDirection = "DESC";
81
- // TODO
82
- // add pagination support here.
83
- filterRequest.pageSize = 1000;
84
- filterRequest.filters.push(new Filter({
85
- key: 0,
86
- fieldType: 'Long',
87
- fieldName: 'id',
88
- valueObject: this.itemId,
89
- filterType: 'FILED_FILTER',
90
- operator: 'EQUALS'
91
- }));
92
- }
93
- this.backendService.getItemAuditLog(filterRequest, this.pageInfo!.apiUri).subscribe(resp => {
94
- this.auditLogEntries = resp.body;
95
- });
96
- }
97
-
98
-
99
- viewObject(auditLog: AuditLogEntry) {
100
- const dialogRef = this.dialog.open(AuditLogDetailsDialogComponent, {
101
- data: {pageInfo: this.pageInfo, fields: this.fields, item:auditLog.subject, comment: auditLog.comment, showHiddenFields:this.showHiddenFields},
102
- width: '800px',
103
- height: 'auto',
104
- direction: this.currentDirection
105
- });
106
-
107
- }
108
-
109
- getDescription(auditLog: AuditLogEntry) {
110
- return `
111
- ${auditLog.createdBy || this.translateService.instant('system')}
112
- ${this.translateService.instant('on')}
113
- ${this.datePipe.transform(auditLog.createdOn, 'medium')}
114
- ${this.translateService.instant('audit-log.executed')} ${this.translateService.instant(auditLog.action.toString())}`
115
- }
116
- }
1
+ import {Component, Inject, Input, OnInit} from '@angular/core';
2
+ import {FieldInfo, Filter, FilterRequest, PageInfo, TableColumn} from "../../base-model";
3
+ import {TranslateModule, TranslateService} from "@ngx-translate/core";
4
+ import {BackendService} from "../../services";
5
+ import {DatePipe, NgForOf, NgIf} from "@angular/common";
6
+ import {MatButton, MatButtonModule} from "@angular/material/button";
7
+ import {MatIconModule} from "@angular/material/icon";
8
+ import {MatDialog} from "@angular/material/dialog";
9
+ import {ActivatedRoute, Router} from "@angular/router";
10
+ import {AuditLogEntry} from "../../base-model/audit-log-entry";
11
+ import {AuditLogDetailsDialogComponent} from "../audit-log-details-dialog/audit-log-details-dialog.component";
12
+ import {Directionality} from "@angular/cdk/bidi";
13
+
14
+ @Component({
15
+ selector: 'app-audit-log',
16
+ standalone: true,
17
+ imports: [
18
+ NgForOf,
19
+ MatButtonModule,
20
+ TranslateModule,
21
+ NgIf,
22
+ MatIconModule,
23
+ MatButton
24
+ ],
25
+ providers: [DatePipe],
26
+ templateUrl: './audit-log.component.html',
27
+ styleUrl: './audit-log.component.scss'
28
+ })
29
+ export class AuditLogComponent implements OnInit {
30
+ auditLogEntries: AuditLogEntry[] = [];
31
+
32
+ @Input()
33
+ pageInfo!: PageInfo;
34
+
35
+ @Input()
36
+ fields: FieldInfo[];
37
+
38
+ @Input()
39
+ showHiddenFields : string[];
40
+
41
+
42
+ itemId: number;
43
+
44
+ item : any = {};
45
+ isLoaded : boolean = false;
46
+ columnsDefinition: TableColumn<any>[];
47
+
48
+ currentDirection: 'ltr' | 'rtl';
49
+
50
+
51
+ constructor(public dialog: MatDialog,
52
+ private activatedRoute: ActivatedRoute,
53
+ private datePipe: DatePipe,
54
+ private translateService:TranslateService,
55
+ private router:Router,
56
+ private directionality: Directionality,
57
+ @Inject('securityManager') private securityManager: any,
58
+ public backendService: BackendService) {
59
+ }
60
+
61
+ ngOnInit(): void {
62
+ this.currentDirection = this.directionality.value;
63
+ this.directionality.change.subscribe((value) => {
64
+ this.currentDirection = value;
65
+ })
66
+
67
+ this.loadItem();
68
+ }
69
+
70
+
71
+ private loadItem() {
72
+ if (this.activatedRoute.snapshot.queryParams['token']) {
73
+ this.itemId = this.backendService.decrypt(this.activatedRoute.snapshot.queryParams['token']);
74
+ }
75
+ const filterRequest = new FilterRequest;
76
+ if (this.itemId > 0) {
77
+ filterRequest.filters = [];
78
+ filterRequest.sortDirection = "DESC";
79
+ // TODO
80
+ // add pagination support here.
81
+ filterRequest.pageSize = 1000;
82
+ filterRequest.filters.push(new Filter({
83
+ key: 0,
84
+ fieldType: 'Long',
85
+ fieldName: 'id',
86
+ valueObject: this.itemId,
87
+ filterType: 'FILED_FILTER',
88
+ operator: 'EQUALS'
89
+ }));
90
+ }
91
+ this.backendService.getItemAuditLog(filterRequest, this.pageInfo!.apiUri).subscribe(resp => {
92
+ this.auditLogEntries = resp.body;
93
+ });
94
+ }
95
+
96
+
97
+ viewObject(auditLog: AuditLogEntry) {
98
+ const dialogRef = this.dialog.open(AuditLogDetailsDialogComponent, {
99
+ data: {pageInfo: this.pageInfo, fields: this.fields, item:auditLog.subject, comment: auditLog.comment, showHiddenFields:this.showHiddenFields},
100
+ width: '800px',
101
+ height: 'auto',
102
+ direction: this.currentDirection
103
+ });
104
+
105
+ }
106
+
107
+ getDescription(auditLog: AuditLogEntry) {
108
+ return `
109
+ ${auditLog.createdBy || this.translateService.instant('system')}
110
+ ${this.translateService.instant('on')}
111
+ ${this.datePipe.transform(auditLog.createdOn, 'medium')}
112
+ ${this.translateService.instant('audit-log.executed')} ${this.translateService.instant(auditLog.action.toString())}`
113
+ }
114
+ }
@@ -1,14 +1,55 @@
1
- ::ng-deep .main-auto-complete {
2
-
3
- .matField {
4
- margin-bottom: 24px !important;
5
- .mat-form-field-wrapper {
6
- padding: 0 !important;
7
- margin-bottom: 0 !important;
8
- }
9
- }
10
-
11
-
12
- }
13
-
14
-
1
+
2
+ .main-auto-complete {
3
+ display: flex;
4
+ flex-direction: column;
5
+ width: 100%;
6
+ }
7
+
8
+ .mat-field-wrapper {
9
+ display: flex;
10
+ flex-direction: column;
11
+ width: 100%;
12
+ }
13
+
14
+ .label-and-asterisk-container {
15
+ display: flex;
16
+ align-items: center;
17
+ gap: 4px;
18
+ margin-bottom: 4px;
19
+ }
20
+
21
+ .custom-label {
22
+ font-weight: 500;
23
+ }
24
+
25
+ .required-asterisk {
26
+ color: red;
27
+ }
28
+
29
+
30
+ .autocomplete-field {
31
+ width: 100%;
32
+ display: flex;
33
+ /*flex-direction: row;*/
34
+ align-items: center;
35
+ }
36
+
37
+
38
+ .autocomplete-button {
39
+ margin-left: 4px;
40
+ }
41
+
42
+
43
+ @media (max-width: 600px) {
44
+ .main-auto-complete,
45
+ .mat-field-wrapper,
46
+ .autocomplete-field {
47
+ flex-direction: column;
48
+ width: 100%;
49
+ }
50
+
51
+ .autocomplete-button {
52
+ margin-left: 0;
53
+ margin-top: 4px;
54
+ }
55
+ }