@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.
- package/ng-package.json +7 -7
- package/package.json +14 -12
- package/src/lib/base-model/SearchStrConfig.ts +12 -12
- package/src/lib/base-model/api-response.ts +23 -23
- package/src/lib/base-model/audit-log-entry.ts +7 -7
- package/src/lib/base-model/button-action-settings.ts +29 -25
- package/src/lib/base-model/column-def.model.ts +34 -34
- package/src/lib/base-model/do-action-request.ts +11 -11
- package/src/lib/base-model/feature-item.ts +9 -0
- package/src/lib/base-model/field-action.ts +7 -7
- package/src/lib/base-model/field-filter.model.ts +7 -14
- package/src/lib/base-model/field-info.ts +102 -98
- package/src/lib/base-model/field-predicate.model.ts +7 -7
- package/src/lib/base-model/filter-request.ts +27 -27
- package/src/lib/base-model/filter.model.ts +49 -49
- package/src/lib/base-model/get-items-list.ts +24 -24
- package/src/lib/base-model/index.ts +11 -11
- package/src/lib/base-model/items-total.model.ts +12 -0
- package/src/lib/base-model/line-item.model.ts +18 -0
- package/src/lib/base-model/lookupItem.ts +21 -21
- package/src/lib/base-model/null-snackmessage.ts +9 -9
- package/src/lib/base-model/page-info.ts +54 -51
- package/src/lib/base-model/report-request.model.ts +33 -33
- package/src/lib/base-model/response-envelop.model.ts +15 -15
- package/src/lib/base-model/snack-message.model.ts +14 -14
- package/src/lib/base-model/snackmessage-interface.ts +7 -7
- package/src/lib/base-model/table-column.interface.ts +29 -29
- package/src/lib/base-model/table-page-user-action.interface.ts +33 -33
- package/src/lib/base-model/workflow/workflow-steps.model.ts +9 -9
- package/src/lib/base-model/workflow/workflow.model.ts +52 -52
- package/src/lib/components/action-comment/action-comment.component.css +52 -0
- package/src/lib/components/action-comment/action-comment.component.html +47 -0
- package/src/lib/components/{rejection-comment → action-comment}/action-comment.component.spec.ts +23 -23
- package/src/lib/components/{rejection-comment → action-comment}/action-comment.component.ts +102 -86
- package/src/lib/components/action-confirmation/action-confirmation.component.css +46 -34
- package/src/lib/components/action-confirmation/action-confirmation.component.html +32 -18
- package/src/lib/components/action-confirmation/action-confirmation.component.spec.ts +23 -23
- package/src/lib/components/action-confirmation/action-confirmation.component.ts +58 -58
- package/src/lib/components/activity-report-form/activity-report-form.component.html +110 -109
- package/src/lib/components/activity-report-form/activity-report-form.component.scss +69 -0
- package/src/lib/components/activity-report-form/activity-report-form.component.spec.ts +25 -25
- package/src/lib/components/activity-report-form/activity-report-form.component.ts +616 -605
- package/src/lib/components/advanced-filter/field-filter/field-filter.component.html +8 -0
- package/src/lib/components/advanced-filter/field-filter/field-filter.component.scss +0 -0
- package/src/lib/components/advanced-filter/field-filter/field-filter.component.spec.ts +25 -0
- package/src/lib/components/advanced-filter/field-filter/field-filter.component.ts +55 -0
- package/src/lib/components/advanced-filter/filter-builder/filter-builder.component.html +36 -0
- package/src/lib/components/advanced-filter/filter-builder/filter-builder.component.scss +130 -0
- package/src/lib/components/advanced-filter/filter-builder/filter-builder.component.spec.ts +25 -0
- package/src/lib/components/advanced-filter/filter-builder/filter-builder.component.ts +186 -0
- package/src/lib/components/audit-log-details-dialog/audit-log-details-dialog.component.css +51 -51
- package/src/lib/components/audit-log-details-dialog/audit-log-details-dialog.component.html +23 -23
- package/src/lib/components/audit-log-details-dialog/audit-log-details-dialog.component.spec.ts +23 -23
- package/src/lib/components/audit-log-details-dialog/audit-log-details-dialog.component.ts +69 -69
- package/src/lib/components/audit-log-list/audit-log.component.html +26 -23
- package/src/lib/components/audit-log-list/audit-log.component.scss +50 -0
- package/src/lib/components/audit-log-list/audit-log.component.spec.ts +25 -25
- package/src/lib/components/audit-log-list/audit-log.component.ts +114 -116
- package/src/lib/components/auto-complete/auto-complete.component.css +55 -14
- package/src/lib/components/auto-complete/auto-complete.component.html +45 -29
- package/src/lib/components/auto-complete/auto-complete.component.spec.ts +23 -23
- package/src/lib/components/auto-complete/auto-complete.component.ts +331 -330
- package/src/lib/components/base-form/base-form.component.html +59 -58
- package/src/lib/components/base-form/base-form.component.scss +68 -0
- package/src/lib/components/base-form/base-form.component.spec.ts +25 -25
- package/src/lib/components/base-form/base-form.component.ts +323 -305
- package/src/lib/components/base-form-canvas/base-form-canvas.component.css +196 -22
- package/src/lib/components/base-form-canvas/base-form-canvas.component.html +1095 -1006
- package/src/lib/components/base-form-canvas/base-form-canvas.component.spec.ts +23 -23
- package/src/lib/components/base-form-canvas/base-form-canvas.component.ts +680 -573
- package/src/lib/components/base-input-dialog/base-input-dialog.component.css +67 -0
- package/src/lib/components/base-input-dialog/base-input-dialog.component.html +47 -42
- package/src/lib/components/base-input-dialog/base-input-dialog.component.spec.ts +23 -23
- package/src/lib/components/base-input-dialog/base-input-dialog.component.ts +77 -78
- package/src/lib/components/base-table/base-table.component.html +268 -242
- package/src/lib/components/base-table/base-table.component.scss +140 -31
- package/src/lib/components/base-table/base-table.component.spec.ts +25 -25
- package/src/lib/components/base-table/base-table.component.ts +621 -568
- package/src/lib/components/button-actions/button-actions.component.html +27 -28
- package/src/lib/components/button-actions/button-actions.component.scss +101 -6
- package/src/lib/components/button-actions/button-actions.component.spec.ts +23 -23
- package/src/lib/components/button-actions/button-actions.component.ts +70 -72
- package/src/lib/components/editable-base-table/editable-base-table.component.html +337 -372
- package/src/lib/components/editable-base-table/editable-base-table.component.scss +126 -44
- package/src/lib/components/editable-base-table/editable-base-table.component.spec.ts +25 -25
- package/src/lib/components/editable-base-table/editable-base-table.component.ts +579 -570
- package/src/lib/components/equation-builder/equation-builder.component.css +39 -0
- package/src/lib/components/equation-builder/equation-builder.component.html +31 -31
- package/src/lib/components/equation-builder/equation-builder.component.spec.ts +23 -23
- package/src/lib/components/equation-builder/equation-builder.component.ts +119 -121
- package/src/lib/components/item-line-editor/item-line-editor.component.html +102 -0
- package/src/lib/components/item-line-editor/item-line-editor.component.scss +152 -0
- package/src/lib/components/item-line-editor/item-line-editor.component.spec.ts +23 -0
- package/src/lib/components/item-line-editor/item-line-editor.component.ts +306 -0
- package/src/lib/components/multi-auto-complete/multi-auto-complete.component.css +19 -11
- package/src/lib/components/multi-auto-complete/multi-auto-complete.component.html +38 -38
- package/src/lib/components/multi-auto-complete/multi-auto-complete.component.spec.ts +23 -23
- package/src/lib/components/multi-auto-complete/multi-auto-complete.component.ts +315 -317
- package/src/lib/components/paginator/paginator.component.css +65 -25
- package/src/lib/components/paginator/paginator.component.html +30 -34
- package/src/lib/components/paginator/paginator.component.ts +87 -94
- package/src/lib/components/report-details-dialog/report-details-dialog.component.css +17 -17
- package/src/lib/components/report-details-dialog/report-details-dialog.component.html +16 -16
- package/src/lib/components/report-details-dialog/report-details-dialog.component.spec.ts +23 -23
- package/src/lib/components/report-details-dialog/report-details-dialog.component.ts +111 -113
- package/src/lib/components/report-form/report-form.component.html +92 -94
- package/src/lib/components/report-form/report-form.component.scss +51 -0
- package/src/lib/components/report-form/report-form.component.spec.ts +25 -25
- package/src/lib/components/report-form/report-form.component.ts +599 -588
- package/src/lib/components/search-bar/search-bar.component.html +51 -62
- package/src/lib/components/search-bar/search-bar.component.scss +63 -8
- package/src/lib/components/search-bar/search-bar.component.spec.ts +25 -25
- package/src/lib/components/search-bar/search-bar.component.ts +68 -70
- package/src/lib/components/section-form-canvas/section-form-canvas.component.html +43 -0
- package/src/lib/components/section-form-canvas/section-form-canvas.component.scss +81 -0
- package/src/lib/components/section-form-canvas/section-form-canvas.component.spec.ts +23 -0
- package/src/lib/components/section-form-canvas/section-form-canvas.component.ts +67 -0
- package/src/lib/components/shared/action-button/action-button.component.html +12 -0
- package/src/lib/components/shared/action-button/action-button.component.scss +45 -0
- package/src/lib/components/shared/action-button/action-button.component.ts +51 -0
- package/src/lib/components/shared/action-card/action-card.component.html +78 -0
- package/src/lib/components/shared/action-card/action-card.component.scss +238 -0
- package/src/lib/components/shared/action-card/action-card.component.ts +56 -0
- package/src/lib/components/shared/attachment-uploader/attachment-uploader.component.css +135 -54
- package/src/lib/components/shared/attachment-uploader/attachment-uploader.component.html +36 -22
- package/src/lib/components/shared/attachment-uploader/attachment-uploader.component.spec.ts +23 -23
- package/src/lib/components/shared/attachment-uploader/attachment-uploader.component.ts +71 -45
- package/src/lib/components/shared-list/shared-list.component.html +17 -17
- package/src/lib/components/shared-list/shared-list.component.spec.ts +23 -23
- package/src/lib/components/shared-list/shared-list.component.ts +53 -53
- package/src/lib/components/snackbar-static/snackbar-static.component.html +20 -0
- package/src/lib/components/snackbar-static/snackbar-static.component.scss +135 -0
- package/src/lib/components/snackbar-static/snackbar-static.component.ts +26 -0
- package/src/lib/components/title-bar/title-bar.component.html +35 -31
- package/src/lib/components/title-bar/title-bar.component.scss +126 -23
- package/src/lib/components/title-bar/title-bar.component.spec.ts +23 -23
- package/src/lib/components/title-bar/title-bar.component.ts +126 -119
- package/src/lib/services/backend-service.ts +287 -286
- package/src/lib/services/index.ts +3 -3
- package/src/lib/services/top-panel.ts +17 -17
- package/src/lib/services/trigger-form.service.ts +11 -11
- package/src/lib/share-module/shared-module.ts +10 -10
- package/src/lib/utils/base-utils.ts +102 -102
- package/src/lib/validators/date-range-validator.ts +31 -31
- package/src/lib/validators/index.ts +3 -3
- package/src/lib/validators/match-list.validator.ts +10 -10
- package/src/lib/validators/multi-email-validator.ts +15 -15
- package/src/public-api.ts +29 -21
- package/tsconfig.lib.json +15 -15
- package/tsconfig.lib.prod.json +11 -11
- package/tsconfig.spec.json +15 -15
- package/src/lib/components/rejection-comment/action-comment.component.css +0 -33
- package/src/lib/components/rejection-comment/action-comment.component.html +0 -46
- package/src/lib/styles/invoiceq-theme.scss +0 -252
- package/src/lib/styles/styles.scss +0 -1723
|
File without changes
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
|
2
|
+
|
|
3
|
+
import { FieldFilterComponent } from './field-filter.component';
|
|
4
|
+
|
|
5
|
+
describe('FieldFilterComponent', () => {
|
|
6
|
+
let component: FieldFilterComponent;
|
|
7
|
+
let fixture: ComponentFixture<FieldFilterComponent>;
|
|
8
|
+
|
|
9
|
+
beforeEach(async(() => {
|
|
10
|
+
TestBed.configureTestingModule({
|
|
11
|
+
declarations: [ FieldFilterComponent ]
|
|
12
|
+
})
|
|
13
|
+
.compileComponents();
|
|
14
|
+
}));
|
|
15
|
+
|
|
16
|
+
beforeEach(() => {
|
|
17
|
+
fixture = TestBed.createComponent(FieldFilterComponent);
|
|
18
|
+
component = fixture.componentInstance;
|
|
19
|
+
fixture.detectChanges();
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
it('should create', () => {
|
|
23
|
+
expect(component).toBeTruthy();
|
|
24
|
+
});
|
|
25
|
+
});
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import {Component, EventEmitter, Input, OnChanges, OnInit, Output, SimpleChanges} from '@angular/core';
|
|
2
|
+
import {FormGroup} from "@angular/forms";
|
|
3
|
+
import {FieldFilter} from "../../../base-model/field-filter.model";
|
|
4
|
+
import {FieldInfo, PageInfo} from "../../../base-model";
|
|
5
|
+
import {BaseFormCanvasComponent} from "../../base-form-canvas/base-form-canvas.component";
|
|
6
|
+
|
|
7
|
+
@Component({
|
|
8
|
+
selector: 'app-field-filter',
|
|
9
|
+
templateUrl: './field-filter.component.html',
|
|
10
|
+
standalone: true,
|
|
11
|
+
imports: [
|
|
12
|
+
BaseFormCanvasComponent
|
|
13
|
+
],
|
|
14
|
+
styleUrls: ['./field-filter.component.scss']
|
|
15
|
+
})
|
|
16
|
+
|
|
17
|
+
export class FieldFilterComponent implements OnInit {
|
|
18
|
+
|
|
19
|
+
@Input()
|
|
20
|
+
filter: FieldFilter;
|
|
21
|
+
|
|
22
|
+
@Input()
|
|
23
|
+
pageInfo: PageInfo;
|
|
24
|
+
|
|
25
|
+
@Input()
|
|
26
|
+
filterFields: FieldInfo[];
|
|
27
|
+
|
|
28
|
+
filterForm: FormGroup;
|
|
29
|
+
|
|
30
|
+
@Input()
|
|
31
|
+
item: any;
|
|
32
|
+
|
|
33
|
+
@Input()
|
|
34
|
+
editable = false;
|
|
35
|
+
|
|
36
|
+
@Output()
|
|
37
|
+
selectedValue: EventEmitter<any> = new EventEmitter<any>();
|
|
38
|
+
|
|
39
|
+
@Output()
|
|
40
|
+
filterFieldInformation: EventEmitter<any> = new EventEmitter<any>();
|
|
41
|
+
|
|
42
|
+
constructor() { }
|
|
43
|
+
|
|
44
|
+
ngOnInit(): void {
|
|
45
|
+
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
formChanges($event: FormGroup) {
|
|
50
|
+
this.filterForm = $event;
|
|
51
|
+
this.filterForm.valueChanges.subscribe(v => {
|
|
52
|
+
this.filterFieldInformation.emit(this.filterForm.value);
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
<div class="main-filter-builder">
|
|
2
|
+
|
|
3
|
+
<div class="filterForm">
|
|
4
|
+
<div class="filterForm__row">
|
|
5
|
+
<div class="filterForm__col">
|
|
6
|
+
<app-field-filter
|
|
7
|
+
[editable]="isEditable()"
|
|
8
|
+
[filter]="filter"
|
|
9
|
+
[pageInfo]="pageInfo"
|
|
10
|
+
*ngIf="isEditable()"
|
|
11
|
+
[filterFields]="filterFields"
|
|
12
|
+
(filterFieldInformation)="formChanges($event)"
|
|
13
|
+
class="filterForm__filed-filter"
|
|
14
|
+
>
|
|
15
|
+
</app-field-filter>
|
|
16
|
+
</div>
|
|
17
|
+
</div>
|
|
18
|
+
</div>
|
|
19
|
+
|
|
20
|
+
<!-- <div *ngIf="checkIsEmpty()" class="line-top">-->
|
|
21
|
+
<!-- <mat-divider></mat-divider>-->
|
|
22
|
+
<!-- </div>-->
|
|
23
|
+
|
|
24
|
+
<!-- <div class="line-bottom">-->
|
|
25
|
+
<!-- <mat-divider></mat-divider>-->
|
|
26
|
+
<!-- </div>-->
|
|
27
|
+
|
|
28
|
+
<!-- <div class="action">-->
|
|
29
|
+
<!-- <button class="btn-none-background-primary action__clear" mat-button (click)="deleteAll()">-->
|
|
30
|
+
<!-- {{'FILTER-BUILDER.clearAllFilters' | translate}}-->
|
|
31
|
+
<!-- </button>-->
|
|
32
|
+
<!-- <button class="btn-background-primary" mat-button (click)="doSearch()">-->
|
|
33
|
+
<!-- {{'FILTER-BUILDER.search' | translate}}-->
|
|
34
|
+
<!-- </button>-->
|
|
35
|
+
<!-- </div>-->
|
|
36
|
+
</div>
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
.main-filter-builder {
|
|
2
|
+
|
|
3
|
+
.filterForm {
|
|
4
|
+
display: block;
|
|
5
|
+
|
|
6
|
+
&__row {
|
|
7
|
+
display: flex;
|
|
8
|
+
align-items: center;
|
|
9
|
+
gap: 12px;
|
|
10
|
+
margin: 6px 0;
|
|
11
|
+
flex-wrap: wrap;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
&__col {
|
|
15
|
+
flex: 1 1 auto;
|
|
16
|
+
min-width: 0;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
&__filed-filter {
|
|
20
|
+
margin: 5px 0 0 0 !important;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.action-filter {
|
|
24
|
+
flex: 0 0 auto;
|
|
25
|
+
.edit-design {
|
|
26
|
+
margin: auto;
|
|
27
|
+
|
|
28
|
+
&__add-button {
|
|
29
|
+
background: #FFFFFF !important;
|
|
30
|
+
color: var(--primary-color) !important;
|
|
31
|
+
height: 48px;
|
|
32
|
+
width: 48px;
|
|
33
|
+
border-radius: 5px;
|
|
34
|
+
border: #D9D9D9 solid 1px;
|
|
35
|
+
margin: 30px 0 0 0;
|
|
36
|
+
|
|
37
|
+
&__add-button-text {
|
|
38
|
+
margin: 0 5px
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.line-top {
|
|
46
|
+
mat-divider {
|
|
47
|
+
width: 98%;
|
|
48
|
+
margin: 0 auto 10px auto;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
.advanced-button {
|
|
54
|
+
display: flex;
|
|
55
|
+
flex-wrap: wrap;
|
|
56
|
+
gap: 8px;
|
|
57
|
+
.view {
|
|
58
|
+
background: #E3FBFF !important;
|
|
59
|
+
border: 1px solid #00ABC8 !important;
|
|
60
|
+
border-radius: 6px !important;
|
|
61
|
+
margin: 10px 0;
|
|
62
|
+
padding: 6px 8px;
|
|
63
|
+
height: 32px;
|
|
64
|
+
margin-top: 0 !important;
|
|
65
|
+
display: flex;
|
|
66
|
+
align-items: center;
|
|
67
|
+
gap: 6px;
|
|
68
|
+
|
|
69
|
+
&__filed {
|
|
70
|
+
margin-top: -3px;
|
|
71
|
+
display: inline-block;
|
|
72
|
+
color: #1C355E;
|
|
73
|
+
font-weight: 400;
|
|
74
|
+
font-size: 14px;
|
|
75
|
+
line-height: 16px;
|
|
76
|
+
font-style: normal;
|
|
77
|
+
text-align: center !important;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
&__close {
|
|
81
|
+
margin-left: 6px;
|
|
82
|
+
&__icon {
|
|
83
|
+
color: #1C355E;
|
|
84
|
+
font-size: 14px;
|
|
85
|
+
cursor: pointer;
|
|
86
|
+
display: inline-block;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
.line-bottom {
|
|
93
|
+
mat-divider {
|
|
94
|
+
width: 98%;
|
|
95
|
+
margin: 0 auto 10px auto;
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
.action {
|
|
100
|
+
justify-content: end;
|
|
101
|
+
padding: 5px 10px 10px 10px;
|
|
102
|
+
|
|
103
|
+
&__clear {
|
|
104
|
+
border: none !important;
|
|
105
|
+
margin: 0 5px
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
/* Responsive rules to replace fxLayout breakpoints */
|
|
110
|
+
@media (max-width: 599.98px) {
|
|
111
|
+
.filterForm {
|
|
112
|
+
&__row {
|
|
113
|
+
flex-wrap: wrap;
|
|
114
|
+
}
|
|
115
|
+
.action-filter .edit-design__add-button {
|
|
116
|
+
width: 100%;
|
|
117
|
+
height: 45px;
|
|
118
|
+
margin: 5px 5px 10px;
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
/* Hide add button text on screens larger than small (equivalent to fxHide.gt-xs) */
|
|
124
|
+
@media (min-width: 600px) {
|
|
125
|
+
.add-text-responsive {
|
|
126
|
+
display: none;
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
|
2
|
+
|
|
3
|
+
import { FilterBuilderComponent } from './filter-builder.component';
|
|
4
|
+
|
|
5
|
+
describe('FilterBuilderComponent', () => {
|
|
6
|
+
let component: FilterBuilderComponent;
|
|
7
|
+
let fixture: ComponentFixture<FilterBuilderComponent>;
|
|
8
|
+
|
|
9
|
+
beforeEach(async(() => {
|
|
10
|
+
TestBed.configureTestingModule({
|
|
11
|
+
declarations: [ FilterBuilderComponent ]
|
|
12
|
+
})
|
|
13
|
+
.compileComponents();
|
|
14
|
+
}));
|
|
15
|
+
|
|
16
|
+
beforeEach(() => {
|
|
17
|
+
fixture = TestBed.createComponent(FilterBuilderComponent);
|
|
18
|
+
component = fixture.componentInstance;
|
|
19
|
+
fixture.detectChanges();
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
it('should create', () => {
|
|
23
|
+
expect(component).toBeTruthy();
|
|
24
|
+
});
|
|
25
|
+
});
|
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
import {Component, EventEmitter, Input, OnDestroy, OnInit, Output} from '@angular/core';
|
|
2
|
+
import {CommonModule} from '@angular/common';
|
|
3
|
+
import {FieldInfo, PageInfo, TableColumn} from "../../../base-model";
|
|
4
|
+
import {FieldFilter} from "../../../base-model/field-filter.model";
|
|
5
|
+
import {FieldFilterComponent} from "../field-filter/field-filter.component";
|
|
6
|
+
import {TranslateModule} from "@ngx-translate/core";
|
|
7
|
+
|
|
8
|
+
@Component({
|
|
9
|
+
selector: 'app-filter-builder',
|
|
10
|
+
templateUrl: './filter-builder.component.html',
|
|
11
|
+
standalone: true,
|
|
12
|
+
imports: [
|
|
13
|
+
CommonModule,
|
|
14
|
+
FieldFilterComponent,
|
|
15
|
+
TranslateModule
|
|
16
|
+
],
|
|
17
|
+
styleUrls: ['./filter-builder.component.scss']
|
|
18
|
+
})
|
|
19
|
+
export class FilterBuilderComponent implements OnInit, OnDestroy {
|
|
20
|
+
|
|
21
|
+
@Input()
|
|
22
|
+
columns: TableColumn<any>[];
|
|
23
|
+
|
|
24
|
+
@Input()
|
|
25
|
+
isChecked: boolean;
|
|
26
|
+
@Input()
|
|
27
|
+
filterFields: FieldInfo[];
|
|
28
|
+
@Input()
|
|
29
|
+
pageInfo: PageInfo;
|
|
30
|
+
|
|
31
|
+
filter: FieldFilter;
|
|
32
|
+
filters: FieldFilter[] = [];
|
|
33
|
+
|
|
34
|
+
private searchTimeout: any;
|
|
35
|
+
|
|
36
|
+
@Output()
|
|
37
|
+
filterInformation: EventEmitter<FieldFilter[]> = new EventEmitter<FieldFilter[]>();
|
|
38
|
+
|
|
39
|
+
@Output()
|
|
40
|
+
isEmpty: EventEmitter<boolean> = new EventEmitter<boolean>();
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
constructor() {
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
ngOnInit(): void {
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
this.switchToAdvanced();
|
|
50
|
+
if (!this.filter) {
|
|
51
|
+
this.filter = this.createDefaultFieldFilter();
|
|
52
|
+
}
|
|
53
|
+
if (this.filterFields && this.filterFields.length) {
|
|
54
|
+
this.filters = this.filterFields.map(() => this.createDefaultFieldFilter());
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
ngOnDestroy(): void {
|
|
59
|
+
if (this.searchTimeout) {
|
|
60
|
+
clearTimeout(this.searchTimeout);
|
|
61
|
+
this.searchTimeout = null;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
doSearch() {
|
|
67
|
+
const filtersArray = (this.filters || [])
|
|
68
|
+
.filter(f => !!f && f.fieldName && f.valueObject !== undefined && f.valueObject !== null && f.valueObject !== '')
|
|
69
|
+
.map(f => ({...f}));
|
|
70
|
+
this.filterInformation.emit(filtersArray);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
private scheduleSearch(delayMs: number = 800) {
|
|
74
|
+
if (this.searchTimeout) {
|
|
75
|
+
clearTimeout(this.searchTimeout);
|
|
76
|
+
}
|
|
77
|
+
this.searchTimeout = setTimeout(() => {
|
|
78
|
+
this.doSearch();
|
|
79
|
+
}, delayMs);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
formChanges($event: any, index?: number, fieldInfo?: FieldInfo) {
|
|
83
|
+
if (index === undefined || !fieldInfo) {
|
|
84
|
+
if (!this.filterFields || !this.filterFields.length) {
|
|
85
|
+
this.filters = [];
|
|
86
|
+
this.doSearch();
|
|
87
|
+
return;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
this.filters = this.filterFields.map((fi) => {
|
|
91
|
+
const controlName = fi.property;
|
|
92
|
+
let value = $event ? $event[controlName] : undefined;
|
|
93
|
+
if (value === undefined || value === null || value === '') {
|
|
94
|
+
return this.createDefaultFieldFilter();
|
|
95
|
+
}
|
|
96
|
+
const fieldName = controlName === 'from' || controlName === 'to' ? fi.targetProperty : controlName;
|
|
97
|
+
|
|
98
|
+
return {
|
|
99
|
+
fieldName: fieldName,
|
|
100
|
+
operator: fi.filterOperator || 'EQUALS',
|
|
101
|
+
filterType: 'FILED_FILTER',
|
|
102
|
+
fieldType: this.typeMap(fi.type) as any,
|
|
103
|
+
valueObject: value as any
|
|
104
|
+
} as FieldFilter;
|
|
105
|
+
});
|
|
106
|
+
|
|
107
|
+
const hasTextField = (this.filterFields || []).some(fi => ((fi.type || '').toLowerCase() === 'text'));
|
|
108
|
+
if (hasTextField) {
|
|
109
|
+
this.scheduleSearch();
|
|
110
|
+
} else {
|
|
111
|
+
this.doSearch();
|
|
112
|
+
}
|
|
113
|
+
return;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
if (!this.filters) {
|
|
117
|
+
this.filters = [];
|
|
118
|
+
}
|
|
119
|
+
if (this.filters.length < index + 1) {
|
|
120
|
+
this.filters.length = index + 1;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
let controlName = fieldInfo.property;
|
|
124
|
+
let value = $event ? $event[controlName] : undefined;
|
|
125
|
+
if ($event && $event.filterField !== undefined && $event.fromValue !== undefined) {
|
|
126
|
+
controlName = $event.filterField || controlName;
|
|
127
|
+
value = $event.fromValue;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
if (value === undefined || value === null || value === '') {
|
|
131
|
+
this.filters[index] = this.createDefaultFieldFilter();
|
|
132
|
+
} else {
|
|
133
|
+
this.filters[index] = {
|
|
134
|
+
fieldName: controlName,
|
|
135
|
+
operator: fieldInfo.filterOperator || 'EQUALS',
|
|
136
|
+
filterType: 'FILED_FILTER',
|
|
137
|
+
fieldType: this.typeMap(fieldInfo.type) as any,
|
|
138
|
+
valueObject: value as any
|
|
139
|
+
} as FieldFilter;
|
|
140
|
+
}
|
|
141
|
+
const isTextField = ((fieldInfo.type || '').toLowerCase() === 'text');
|
|
142
|
+
if (isTextField) {
|
|
143
|
+
this.scheduleSearch();
|
|
144
|
+
} else {
|
|
145
|
+
this.doSearch();
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
typeMap(colType?: string): string {
|
|
149
|
+
const t = (colType || '').toLowerCase();
|
|
150
|
+
if (t.includes('number') || t.includes('int') || t === 'long') return 'Long';
|
|
151
|
+
if (t.includes('date') || t.includes('time')) return 'Date';
|
|
152
|
+
if (t.includes('bool')) return 'Boolean';
|
|
153
|
+
return 'String';
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
isEditable(_index?: number) {
|
|
157
|
+
return true;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
|
|
161
|
+
deleteAll() {
|
|
162
|
+
this.filter = this.createDefaultFieldFilter();
|
|
163
|
+
this.filters = this.filterFields ? this.filterFields.map(() => this.createDefaultFieldFilter()) : [];
|
|
164
|
+
this.isEmpty.emit(true);
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
|
|
168
|
+
switchToAdvanced() {
|
|
169
|
+
if (this.isChecked) {
|
|
170
|
+
if (!this.filter || Object.keys(this.filter).length === 0) {
|
|
171
|
+
this.filter = this.createDefaultFieldFilter();
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
|
|
177
|
+
private createDefaultFieldFilter(): FieldFilter {
|
|
178
|
+
return {
|
|
179
|
+
fieldName: '',
|
|
180
|
+
operator: '',
|
|
181
|
+
filterType: '',
|
|
182
|
+
fieldType: '',
|
|
183
|
+
valueObject: ''
|
|
184
|
+
} as FieldFilter;
|
|
185
|
+
}
|
|
186
|
+
}
|
|
@@ -1,51 +1,51 @@
|
|
|
1
|
-
.m-0{
|
|
2
|
-
margin: 0 !important;
|
|
3
|
-
}
|
|
4
|
-
.w-100{
|
|
5
|
-
width: 100%;
|
|
6
|
-
}
|
|
7
|
-
.form-style{
|
|
8
|
-
min-height: 12vh !important;
|
|
9
|
-
height: auto !important;
|
|
10
|
-
}
|
|
11
|
-
.text-red{
|
|
12
|
-
color: red !important;
|
|
13
|
-
}
|
|
14
|
-
.modal-footer{
|
|
15
|
-
margin-top: 5vh;
|
|
16
|
-
}
|
|
17
|
-
.overflow-hidden{
|
|
18
|
-
overflow: hidden;
|
|
19
|
-
}
|
|
20
|
-
.pad-top{
|
|
21
|
-
margin-top: -7px;
|
|
22
|
-
display: block;
|
|
23
|
-
}
|
|
24
|
-
.action-comment {
|
|
25
|
-
/*direction: rtl;*/
|
|
26
|
-
display: flex;
|
|
27
|
-
justify-content: space-between;
|
|
28
|
-
}
|
|
29
|
-
.material-icons {
|
|
30
|
-
color: #E22222;
|
|
31
|
-
}
|
|
32
|
-
textarea#warn::placeholder {
|
|
33
|
-
color: red;
|
|
34
|
-
}
|
|
35
|
-
.invoice-label {
|
|
36
|
-
color: var(--primary-color);
|
|
37
|
-
margin: 0px;
|
|
38
|
-
font-weight: bold;
|
|
39
|
-
padding-bottom: 10px !important;
|
|
40
|
-
padding-top: 6px !important;
|
|
41
|
-
border-bottom: none !important;
|
|
42
|
-
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
.invoice-label-text {
|
|
46
|
-
color: var(--accent-color);
|
|
47
|
-
font-weight: normal;
|
|
48
|
-
word-wrap: break-word;
|
|
49
|
-
white-space: pre-wrap;
|
|
50
|
-
width: 100%;
|
|
51
|
-
}
|
|
1
|
+
.m-0{
|
|
2
|
+
margin: 0 !important;
|
|
3
|
+
}
|
|
4
|
+
.w-100{
|
|
5
|
+
width: 100%;
|
|
6
|
+
}
|
|
7
|
+
.form-style{
|
|
8
|
+
min-height: 12vh !important;
|
|
9
|
+
height: auto !important;
|
|
10
|
+
}
|
|
11
|
+
.text-red{
|
|
12
|
+
color: red !important;
|
|
13
|
+
}
|
|
14
|
+
.modal-footer{
|
|
15
|
+
margin-top: 5vh;
|
|
16
|
+
}
|
|
17
|
+
.overflow-hidden{
|
|
18
|
+
overflow: hidden;
|
|
19
|
+
}
|
|
20
|
+
.pad-top{
|
|
21
|
+
margin-top: -7px;
|
|
22
|
+
display: block;
|
|
23
|
+
}
|
|
24
|
+
.action-comment {
|
|
25
|
+
/*direction: rtl;*/
|
|
26
|
+
display: flex;
|
|
27
|
+
justify-content: space-between;
|
|
28
|
+
}
|
|
29
|
+
.material-icons {
|
|
30
|
+
color: #E22222;
|
|
31
|
+
}
|
|
32
|
+
textarea#warn::placeholder {
|
|
33
|
+
color: red;
|
|
34
|
+
}
|
|
35
|
+
.invoice-label {
|
|
36
|
+
color: var(--primary-color);
|
|
37
|
+
margin: 0px;
|
|
38
|
+
font-weight: bold;
|
|
39
|
+
padding-bottom: 10px !important;
|
|
40
|
+
padding-top: 6px !important;
|
|
41
|
+
border-bottom: none !important;
|
|
42
|
+
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.invoice-label-text {
|
|
46
|
+
color: var(--accent-color);
|
|
47
|
+
font-weight: normal;
|
|
48
|
+
word-wrap: break-word;
|
|
49
|
+
white-space: pre-wrap;
|
|
50
|
+
width: 100%;
|
|
51
|
+
}
|
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
<mat-dialog-content class="mat-typography overflow-hidden">
|
|
2
|
-
<div style="'padding': '10px 30px 10px 0'">
|
|
3
|
-
<h2 mat-dialog-title>{{ getTitle()| translate }}</h2>
|
|
4
|
-
<app-base-form-canvas
|
|
5
|
-
[pageInfo]="pageInfo"
|
|
6
|
-
[fields]="fields"
|
|
7
|
-
[editable]="false"
|
|
8
|
-
[item]="item"
|
|
9
|
-
></app-base-form-canvas>
|
|
10
|
-
|
|
11
|
-
<p>
|
|
12
|
-
<span class="invoice-label">{{ 'audit-log.reason_dialog' | translate }} :</span>
|
|
13
|
-
<span class="invoice-label-text">{{ comment }}</span>
|
|
14
|
-
</p>
|
|
15
|
-
<mat-divider style="width: 97%"></mat-divider>
|
|
16
|
-
<br>
|
|
17
|
-
<button mat-stroked-button color='accent' style="margin: 5px"
|
|
18
|
-
(click)="cancel()" id="acceptActionLabel">
|
|
19
|
-
{{ 'audit-log.close' | translate }}
|
|
20
|
-
</button>
|
|
21
|
-
<br>
|
|
22
|
-
</div>
|
|
23
|
-
</mat-dialog-content>
|
|
1
|
+
<mat-dialog-content class="mat-typography overflow-hidden">
|
|
2
|
+
<div style="'padding': '10px 30px 10px 0'">
|
|
3
|
+
<h2 mat-dialog-title>{{ getTitle()| translate }}</h2>
|
|
4
|
+
<app-base-form-canvas
|
|
5
|
+
[pageInfo]="pageInfo"
|
|
6
|
+
[fields]="fields"
|
|
7
|
+
[editable]="false"
|
|
8
|
+
[item]="item"
|
|
9
|
+
></app-base-form-canvas>
|
|
10
|
+
|
|
11
|
+
<p>
|
|
12
|
+
<span class="invoice-label">{{ 'audit-log.reason_dialog' | translate }} :</span>
|
|
13
|
+
<span class="invoice-label-text">{{ comment }}</span>
|
|
14
|
+
</p>
|
|
15
|
+
<mat-divider style="width: 97%"></mat-divider>
|
|
16
|
+
<br>
|
|
17
|
+
<button mat-stroked-button color='accent' style="margin: 5px"
|
|
18
|
+
(click)="cancel()" id="acceptActionLabel">
|
|
19
|
+
{{ 'audit-log.close' | translate }}
|
|
20
|
+
</button>
|
|
21
|
+
<br>
|
|
22
|
+
</div>
|
|
23
|
+
</mat-dialog-content>
|
package/src/lib/components/audit-log-details-dialog/audit-log-details-dialog.component.spec.ts
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
|
2
|
-
|
|
3
|
-
import { AuditLogDetailsDialogComponent } from './audit-log-details-dialog.component';
|
|
4
|
-
|
|
5
|
-
describe('ActionCommentComponent', () => {
|
|
6
|
-
let component: AuditLogDetailsDialogComponent;
|
|
7
|
-
let fixture: ComponentFixture<AuditLogDetailsDialogComponent>;
|
|
8
|
-
|
|
9
|
-
beforeEach(async () => {
|
|
10
|
-
await TestBed.configureTestingModule({
|
|
11
|
-
imports: [AuditLogDetailsDialogComponent]
|
|
12
|
-
})
|
|
13
|
-
.compileComponents();
|
|
14
|
-
|
|
15
|
-
fixture = TestBed.createComponent(AuditLogDetailsDialogComponent);
|
|
16
|
-
component = fixture.componentInstance;
|
|
17
|
-
fixture.detectChanges();
|
|
18
|
-
});
|
|
19
|
-
|
|
20
|
-
it('should create', () => {
|
|
21
|
-
expect(component).toBeTruthy();
|
|
22
|
-
});
|
|
23
|
-
});
|
|
1
|
+
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
|
2
|
+
|
|
3
|
+
import { AuditLogDetailsDialogComponent } from './audit-log-details-dialog.component';
|
|
4
|
+
|
|
5
|
+
describe('ActionCommentComponent', () => {
|
|
6
|
+
let component: AuditLogDetailsDialogComponent;
|
|
7
|
+
let fixture: ComponentFixture<AuditLogDetailsDialogComponent>;
|
|
8
|
+
|
|
9
|
+
beforeEach(async () => {
|
|
10
|
+
await TestBed.configureTestingModule({
|
|
11
|
+
imports: [AuditLogDetailsDialogComponent]
|
|
12
|
+
})
|
|
13
|
+
.compileComponents();
|
|
14
|
+
|
|
15
|
+
fixture = TestBed.createComponent(AuditLogDetailsDialogComponent);
|
|
16
|
+
component = fixture.componentInstance;
|
|
17
|
+
fixture.detectChanges();
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
it('should create', () => {
|
|
21
|
+
expect(component).toBeTruthy();
|
|
22
|
+
});
|
|
23
|
+
});
|