@unifylib/ui-lib 1.0.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/README.md +0 -0
- package/ng-package.json +7 -0
- package/package.json +12 -0
- package/src/lib/base-model/SearchStrConfig.ts +12 -0
- package/src/lib/base-model/api-response.ts +23 -0
- package/src/lib/base-model/audit-log-entry.ts +7 -0
- package/src/lib/base-model/button-action-settings.ts +25 -0
- package/src/lib/base-model/column-def.model.ts +34 -0
- package/src/lib/base-model/do-action-request.ts +11 -0
- package/src/lib/base-model/field-action.ts +7 -0
- package/src/lib/base-model/field-filter.model.ts +14 -0
- package/src/lib/base-model/field-info.ts +98 -0
- package/src/lib/base-model/field-predicate.model.ts +7 -0
- package/src/lib/base-model/filter-request.ts +27 -0
- package/src/lib/base-model/filter.model.ts +49 -0
- package/src/lib/base-model/get-items-list.ts +24 -0
- package/src/lib/base-model/index.ts +11 -0
- package/src/lib/base-model/lookupItem.ts +21 -0
- package/src/lib/base-model/null-snackmessage.ts +9 -0
- package/src/lib/base-model/page-info.ts +51 -0
- package/src/lib/base-model/report-request.model.ts +33 -0
- package/src/lib/base-model/response-envelop.model.ts +15 -0
- package/src/lib/base-model/snack-message.model.ts +14 -0
- package/src/lib/base-model/snackmessage-interface.ts +7 -0
- package/src/lib/base-model/table-column.interface.ts +29 -0
- package/src/lib/base-model/table-page-user-action.interface.ts +33 -0
- package/src/lib/base-model/workflow/workflow-steps.model.ts +9 -0
- package/src/lib/base-model/workflow/workflow.model.ts +52 -0
- package/src/lib/components/action-confirmation/action-confirmation.component.css +34 -0
- package/src/lib/components/action-confirmation/action-confirmation.component.html +18 -0
- package/src/lib/components/action-confirmation/action-confirmation.component.spec.ts +23 -0
- package/src/lib/components/action-confirmation/action-confirmation.component.ts +58 -0
- package/src/lib/components/activity-report-form/activity-report-form.component.html +109 -0
- package/src/lib/components/activity-report-form/activity-report-form.component.scss +0 -0
- package/src/lib/components/activity-report-form/activity-report-form.component.spec.ts +25 -0
- package/src/lib/components/activity-report-form/activity-report-form.component.ts +605 -0
- package/src/lib/components/audit-log-details-dialog/audit-log-details-dialog.component.css +51 -0
- package/src/lib/components/audit-log-details-dialog/audit-log-details-dialog.component.html +23 -0
- package/src/lib/components/audit-log-details-dialog/audit-log-details-dialog.component.spec.ts +23 -0
- package/src/lib/components/audit-log-details-dialog/audit-log-details-dialog.component.ts +69 -0
- package/src/lib/components/audit-log-list/audit-log.component.html +23 -0
- package/src/lib/components/audit-log-list/audit-log.component.scss +0 -0
- package/src/lib/components/audit-log-list/audit-log.component.spec.ts +25 -0
- package/src/lib/components/audit-log-list/audit-log.component.ts +116 -0
- package/src/lib/components/auto-complete/auto-complete.component.css +14 -0
- package/src/lib/components/auto-complete/auto-complete.component.html +29 -0
- package/src/lib/components/auto-complete/auto-complete.component.spec.ts +23 -0
- package/src/lib/components/auto-complete/auto-complete.component.ts +330 -0
- package/src/lib/components/base-form/base-form.component.html +58 -0
- package/src/lib/components/base-form/base-form.component.scss +0 -0
- package/src/lib/components/base-form/base-form.component.spec.ts +25 -0
- package/src/lib/components/base-form/base-form.component.ts +305 -0
- package/src/lib/components/base-form-canvas/base-form-canvas.component.css +22 -0
- package/src/lib/components/base-form-canvas/base-form-canvas.component.html +1006 -0
- package/src/lib/components/base-form-canvas/base-form-canvas.component.spec.ts +23 -0
- package/src/lib/components/base-form-canvas/base-form-canvas.component.ts +573 -0
- package/src/lib/components/base-input-dialog/base-input-dialog.component.css +0 -0
- package/src/lib/components/base-input-dialog/base-input-dialog.component.html +42 -0
- package/src/lib/components/base-input-dialog/base-input-dialog.component.spec.ts +23 -0
- package/src/lib/components/base-input-dialog/base-input-dialog.component.ts +78 -0
- package/src/lib/components/base-table/base-table.component.html +242 -0
- package/src/lib/components/base-table/base-table.component.scss +31 -0
- package/src/lib/components/base-table/base-table.component.spec.ts +25 -0
- package/src/lib/components/base-table/base-table.component.ts +568 -0
- package/src/lib/components/button-actions/button-actions.component.html +28 -0
- package/src/lib/components/button-actions/button-actions.component.scss +6 -0
- package/src/lib/components/button-actions/button-actions.component.spec.ts +23 -0
- package/src/lib/components/button-actions/button-actions.component.ts +72 -0
- package/src/lib/components/editable-base-table/editable-base-table.component.html +372 -0
- package/src/lib/components/editable-base-table/editable-base-table.component.scss +44 -0
- package/src/lib/components/editable-base-table/editable-base-table.component.spec.ts +25 -0
- package/src/lib/components/editable-base-table/editable-base-table.component.ts +570 -0
- package/src/lib/components/equation-builder/equation-builder.component.css +0 -0
- package/src/lib/components/equation-builder/equation-builder.component.html +31 -0
- package/src/lib/components/equation-builder/equation-builder.component.spec.ts +23 -0
- package/src/lib/components/equation-builder/equation-builder.component.ts +121 -0
- package/src/lib/components/multi-auto-complete/multi-auto-complete.component.css +11 -0
- package/src/lib/components/multi-auto-complete/multi-auto-complete.component.html +38 -0
- package/src/lib/components/multi-auto-complete/multi-auto-complete.component.spec.ts +23 -0
- package/src/lib/components/multi-auto-complete/multi-auto-complete.component.ts +317 -0
- package/src/lib/components/paginator/paginator.component.css +25 -0
- package/src/lib/components/paginator/paginator.component.html +34 -0
- package/src/lib/components/paginator/paginator.component.ts +94 -0
- package/src/lib/components/rejection-comment/action-comment.component.css +33 -0
- package/src/lib/components/rejection-comment/action-comment.component.html +46 -0
- package/src/lib/components/rejection-comment/action-comment.component.spec.ts +23 -0
- package/src/lib/components/rejection-comment/action-comment.component.ts +86 -0
- package/src/lib/components/report-details-dialog/report-details-dialog.component.css +17 -0
- package/src/lib/components/report-details-dialog/report-details-dialog.component.html +16 -0
- package/src/lib/components/report-details-dialog/report-details-dialog.component.spec.ts +23 -0
- package/src/lib/components/report-details-dialog/report-details-dialog.component.ts +113 -0
- package/src/lib/components/report-form/report-form.component.html +94 -0
- package/src/lib/components/report-form/report-form.component.scss +0 -0
- package/src/lib/components/report-form/report-form.component.spec.ts +25 -0
- package/src/lib/components/report-form/report-form.component.ts +588 -0
- package/src/lib/components/search-bar/search-bar.component.html +62 -0
- package/src/lib/components/search-bar/search-bar.component.scss +8 -0
- package/src/lib/components/search-bar/search-bar.component.spec.ts +25 -0
- package/src/lib/components/search-bar/search-bar.component.ts +70 -0
- package/src/lib/components/shared/attachment-uploader/attachment-uploader.component.css +54 -0
- package/src/lib/components/shared/attachment-uploader/attachment-uploader.component.html +22 -0
- package/src/lib/components/shared/attachment-uploader/attachment-uploader.component.spec.ts +23 -0
- package/src/lib/components/shared/attachment-uploader/attachment-uploader.component.ts +45 -0
- package/src/lib/components/shared-list/shared-list.component.css +0 -0
- package/src/lib/components/shared-list/shared-list.component.html +17 -0
- package/src/lib/components/shared-list/shared-list.component.spec.ts +23 -0
- package/src/lib/components/shared-list/shared-list.component.ts +53 -0
- package/src/lib/components/title-bar/title-bar.component.css +0 -0
- package/src/lib/components/title-bar/title-bar.component.css.map +1 -0
- package/src/lib/components/title-bar/title-bar.component.html +31 -0
- package/src/lib/components/title-bar/title-bar.component.scss +23 -0
- package/src/lib/components/title-bar/title-bar.component.spec.ts +23 -0
- package/src/lib/components/title-bar/title-bar.component.ts +119 -0
- package/src/lib/services/backend-service.ts +286 -0
- package/src/lib/services/index.ts +3 -0
- package/src/lib/services/top-panel.ts +17 -0
- package/src/lib/services/trigger-form.service.ts +11 -0
- package/src/lib/share-module/shared-module.ts +10 -0
- package/src/lib/styles/invoiceq-theme.scss +252 -0
- package/src/lib/styles/styles.scss +1723 -0
- package/src/lib/utils/base-utils.ts +102 -0
- package/src/lib/validators/date-range-validator.ts +31 -0
- package/src/lib/validators/index.ts +3 -0
- package/src/lib/validators/match-list.validator.ts +10 -0
- package/src/lib/validators/multi-email-validator.ts +15 -0
- package/src/public-api.ts +21 -0
- package/tsconfig.lib.json +15 -0
- package/tsconfig.lib.prod.json +11 -0
- package/tsconfig.spec.json +15 -0
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
<div *ngIf="signingRequired">
|
|
2
|
+
<p mat-dialog-title align="start" class="invoice-note-text invoice-section m-0">
|
|
3
|
+
{{ 'comment.OTP' | translate }}
|
|
4
|
+
<span *ngIf="isTermination" class="text-red">*</span>
|
|
5
|
+
</p>
|
|
6
|
+
<mat-dialog-content class="mat-typography">
|
|
7
|
+
<mat-form-field appearance="outline" class="w-100" [class.error-input]="isSubmitted && !otp">
|
|
8
|
+
<input cdkFocusInitial agAcceptOnlyNumeric [(ngModel)]="otp" matInput type="text" class="pad-top"/>
|
|
9
|
+
</mat-form-field>
|
|
10
|
+
</mat-dialog-content>
|
|
11
|
+
</div>
|
|
12
|
+
<div>
|
|
13
|
+
<div class="action-comment">
|
|
14
|
+
<p class="invoice-note-text invoice-section">
|
|
15
|
+
<span style="padding: 10px 15px">{{ actionLabel | translate }}</span>
|
|
16
|
+
<span *ngIf="isTermination" class="text-red">*</span>
|
|
17
|
+
</p>
|
|
18
|
+
<mat-icon (click)="cancel()">close</mat-icon>
|
|
19
|
+
<!-- <span class="material-icons" (click)="cancel()">close</span>-->
|
|
20
|
+
</div>
|
|
21
|
+
<mat-dialog-content class="mat-typography overflow-hidden">
|
|
22
|
+
<mat-form-field appearance="outline" class="w-100">
|
|
23
|
+
<textarea cdkFocusInitial [(ngModel)]="comment" matInput class="form-style"
|
|
24
|
+
[id]="isTermination ? 'warn' : 'primary'"
|
|
25
|
+
cdkTextareaAutosize
|
|
26
|
+
cdkAutosizeMinRows="4"
|
|
27
|
+
cdkAutosizeMaxRows="5"
|
|
28
|
+
placeholder="{{'PAYER.placeHolder' | translate}}">
|
|
29
|
+
</textarea>
|
|
30
|
+
</mat-form-field>
|
|
31
|
+
</mat-dialog-content>
|
|
32
|
+
|
|
33
|
+
<div style="margin-top: 10px">
|
|
34
|
+
<p *ngIf="warningMsg" mat-dialog-title align="start" class="invoice-section m-0 text-red">
|
|
35
|
+
{{ 'vendorWarning' | translate }}
|
|
36
|
+
</p>
|
|
37
|
+
</div>
|
|
38
|
+
|
|
39
|
+
<mat-dialog-actions align="end" class="modal-footer">
|
|
40
|
+
|
|
41
|
+
<button mat-stroked-button [color]="isTermination ? 'warn': 'primary'" [disabled]="isTermination && !comment"
|
|
42
|
+
(click)="commentAndClose()" id="actionLabel">
|
|
43
|
+
{{ 'Proceed' | translate }}
|
|
44
|
+
</button>
|
|
45
|
+
</mat-dialog-actions>
|
|
46
|
+
</div>
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
|
2
|
+
|
|
3
|
+
import { ActionCommentComponent } from './action-comment.component';
|
|
4
|
+
|
|
5
|
+
describe('ActionCommentComponent', () => {
|
|
6
|
+
let component: ActionCommentComponent;
|
|
7
|
+
let fixture: ComponentFixture<ActionCommentComponent>;
|
|
8
|
+
|
|
9
|
+
beforeEach(async () => {
|
|
10
|
+
await TestBed.configureTestingModule({
|
|
11
|
+
imports: [ActionCommentComponent]
|
|
12
|
+
})
|
|
13
|
+
.compileComponents();
|
|
14
|
+
|
|
15
|
+
fixture = TestBed.createComponent(ActionCommentComponent);
|
|
16
|
+
component = fixture.componentInstance;
|
|
17
|
+
fixture.detectChanges();
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
it('should create', () => {
|
|
21
|
+
expect(component).toBeTruthy();
|
|
22
|
+
});
|
|
23
|
+
});
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import {Component, HostListener, Inject, OnInit} from '@angular/core';
|
|
2
|
+
import {
|
|
3
|
+
MAT_DIALOG_DATA,
|
|
4
|
+
MatDialogActions,
|
|
5
|
+
MatDialogContent,
|
|
6
|
+
MatDialogRef,
|
|
7
|
+
MatDialogTitle
|
|
8
|
+
} from "@angular/material/dialog";
|
|
9
|
+
import {MatFormField} from "@angular/material/form-field";
|
|
10
|
+
import {FormsModule} from "@angular/forms";
|
|
11
|
+
import {CdkTextareaAutosize} from "@angular/cdk/text-field";
|
|
12
|
+
import {TranslateModule} from "@ngx-translate/core";
|
|
13
|
+
import {MatCheckbox} from "@angular/material/checkbox";
|
|
14
|
+
import {MatButton} from "@angular/material/button";
|
|
15
|
+
import {MatInput} from "@angular/material/input";
|
|
16
|
+
import {NgIf} from "@angular/common";
|
|
17
|
+
import {MatIcon} from "@angular/material/icon";
|
|
18
|
+
|
|
19
|
+
@Component({
|
|
20
|
+
selector: 'app-action-comment',
|
|
21
|
+
standalone: true,
|
|
22
|
+
imports: [
|
|
23
|
+
MatDialogTitle,
|
|
24
|
+
MatFormField,
|
|
25
|
+
MatDialogContent,
|
|
26
|
+
FormsModule,
|
|
27
|
+
CdkTextareaAutosize,
|
|
28
|
+
TranslateModule,
|
|
29
|
+
MatCheckbox,
|
|
30
|
+
MatDialogActions,
|
|
31
|
+
MatButton,
|
|
32
|
+
MatInput,
|
|
33
|
+
NgIf,
|
|
34
|
+
MatIcon
|
|
35
|
+
],
|
|
36
|
+
templateUrl: './action-comment.component.html',
|
|
37
|
+
styleUrl: './action-comment.component.css'
|
|
38
|
+
})
|
|
39
|
+
export class ActionCommentComponent implements OnInit {
|
|
40
|
+
actionLabel : string =''
|
|
41
|
+
isTermination : boolean=false;
|
|
42
|
+
comment: string = '';
|
|
43
|
+
external: boolean = false;
|
|
44
|
+
signingRequired: boolean = false;
|
|
45
|
+
tokenReference: string = "";
|
|
46
|
+
otp: string = "";
|
|
47
|
+
isSubmitted: boolean = false;
|
|
48
|
+
showExternalBox = true;
|
|
49
|
+
warningMsg = false;
|
|
50
|
+
constructor(public dialogRef: MatDialogRef<ActionCommentComponent>,
|
|
51
|
+
@Inject(MAT_DIALOG_DATA) public data: any) {
|
|
52
|
+
dialogRef.disableClose = true;
|
|
53
|
+
}
|
|
54
|
+
@HostListener('window:keyup.esc') onKeyUp() {
|
|
55
|
+
this.dialogRef.close();
|
|
56
|
+
}
|
|
57
|
+
ngOnInit(): void {
|
|
58
|
+
this.actionLabel = this.data.label;
|
|
59
|
+
this.isTermination = this.data.isTermination ;
|
|
60
|
+
this.signingRequired = this.data.signingRequired;
|
|
61
|
+
this.tokenReference = this.data.tokenReference;
|
|
62
|
+
this.warningMsg = this.data.warningMsg || false;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
commentAndClose() {
|
|
67
|
+
this.isSubmitted = true;
|
|
68
|
+
if (this.signingRequired && !this.otp) return false;//validation
|
|
69
|
+
let obj:{[key: string]:any} = {
|
|
70
|
+
comment: this.comment,
|
|
71
|
+
shareExternal : this.external
|
|
72
|
+
};
|
|
73
|
+
//
|
|
74
|
+
if(this.signingRequired) obj["token"] = this.otp;
|
|
75
|
+
if(this.signingRequired) obj["tokenReference"] = this.tokenReference;
|
|
76
|
+
//
|
|
77
|
+
this.dialogRef.close(obj);
|
|
78
|
+
|
|
79
|
+
return "";
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
cancel() {
|
|
83
|
+
this.dialogRef.close();
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
::ng-deep .mat-dialog-actions {
|
|
2
|
+
justify-content: flex-end !important;
|
|
3
|
+
}
|
|
4
|
+
.close-button {
|
|
5
|
+
position: absolute;
|
|
6
|
+
right: 8px;
|
|
7
|
+
top: 8px;
|
|
8
|
+
z-index: 10;
|
|
9
|
+
background-color: white;
|
|
10
|
+
border-radius: 50%;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
:host-context([dir="rtl"]) .close-button {
|
|
14
|
+
right: auto;
|
|
15
|
+
left: 8px;
|
|
16
|
+
}
|
|
17
|
+
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
<mat-dialog-content style="max-height: 70vh; overflow: auto; position: relative;">
|
|
2
|
+
<button mat-icon-button class="close-button" (click)="cancel()" [attr.dir]="dialogDirection">
|
|
3
|
+
<mat-icon>close</mat-icon>
|
|
4
|
+
</button>
|
|
5
|
+
|
|
6
|
+
<h1 mat-dialog-title [innerHTML]="getTitle()"></h1>
|
|
7
|
+
|
|
8
|
+
<app-base-table
|
|
9
|
+
[pageInfo]="pageInfo"
|
|
10
|
+
[columns]="columns"
|
|
11
|
+
id="junior"
|
|
12
|
+
[enforceRefresh]="true"
|
|
13
|
+
[reportRequest]="reportRequest">
|
|
14
|
+
</app-base-table>
|
|
15
|
+
</mat-dialog-content>
|
|
16
|
+
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
|
2
|
+
|
|
3
|
+
import { ReportDetailsDialogComponent } from './report-details-dialog.component';
|
|
4
|
+
|
|
5
|
+
describe('ActionCommentComponent', () => {
|
|
6
|
+
let component: ReportDetailsDialogComponent;
|
|
7
|
+
let fixture: ComponentFixture<ReportDetailsDialogComponent>;
|
|
8
|
+
|
|
9
|
+
beforeEach(async () => {
|
|
10
|
+
await TestBed.configureTestingModule({
|
|
11
|
+
imports: [ReportDetailsDialogComponent]
|
|
12
|
+
})
|
|
13
|
+
.compileComponents();
|
|
14
|
+
|
|
15
|
+
fixture = TestBed.createComponent(ReportDetailsDialogComponent);
|
|
16
|
+
component = fixture.componentInstance;
|
|
17
|
+
fixture.detectChanges();
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
it('should create', () => {
|
|
21
|
+
expect(component).toBeTruthy();
|
|
22
|
+
});
|
|
23
|
+
});
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import {AfterViewInit, Component, ElementRef, HostListener, Inject, OnInit} from '@angular/core';
|
|
2
|
+
import {
|
|
3
|
+
MAT_DIALOG_DATA, MatDialogActions, MatDialogContent,
|
|
4
|
+
MatDialogRef, MatDialogTitle,
|
|
5
|
+
} from "@angular/material/dialog";
|
|
6
|
+
import {FormsModule} from "@angular/forms";
|
|
7
|
+
import {TranslateModule, TranslateService} from "@ngx-translate/core";
|
|
8
|
+
import {FieldInfo, PageInfo, ReportRequest, TableColumn} from "../../base-model";
|
|
9
|
+
import {BaseTableComponent} from "../base-table/base-table.component";
|
|
10
|
+
import {FlexModule} from "@angular/flex-layout";
|
|
11
|
+
import {MatButton, MatIconButton} from "@angular/material/button";
|
|
12
|
+
import {BackendService} from "../../services";
|
|
13
|
+
import {MatIcon} from "@angular/material/icon";
|
|
14
|
+
|
|
15
|
+
@Component({
|
|
16
|
+
selector: 'app-audit-log-details-dialog',
|
|
17
|
+
standalone: true,
|
|
18
|
+
imports: [
|
|
19
|
+
FormsModule,
|
|
20
|
+
TranslateModule,
|
|
21
|
+
BaseTableComponent,
|
|
22
|
+
FlexModule,
|
|
23
|
+
MatDialogContent,
|
|
24
|
+
MatDialogTitle,
|
|
25
|
+
MatIconButton,
|
|
26
|
+
MatIcon
|
|
27
|
+
],
|
|
28
|
+
templateUrl: './report-details-dialog.component.html',
|
|
29
|
+
styleUrl: './report-details-dialog.component.css'
|
|
30
|
+
})
|
|
31
|
+
export class ReportDetailsDialogComponent implements OnInit , AfterViewInit{
|
|
32
|
+
dialogDirection: 'ltr' | 'rtl' = 'ltr';
|
|
33
|
+
|
|
34
|
+
pageInfo: PageInfo;
|
|
35
|
+
fields: FieldInfo[] = [];
|
|
36
|
+
|
|
37
|
+
isTermination : boolean=false;
|
|
38
|
+
comment: string = '';
|
|
39
|
+
external: boolean = false;
|
|
40
|
+
signingRequired: boolean = false;
|
|
41
|
+
tokenReference: string = "";
|
|
42
|
+
warningMsg = false;
|
|
43
|
+
item: any = {};
|
|
44
|
+
reportRequest: ReportRequest;
|
|
45
|
+
columns: TableColumn<any>[];
|
|
46
|
+
constructor(public dialogRef: MatDialogRef<ReportDetailsDialogComponent>,
|
|
47
|
+
@Inject(MAT_DIALOG_DATA) public data: any,
|
|
48
|
+
private translateService: TranslateService,
|
|
49
|
+
public backendService:BackendService,
|
|
50
|
+
private elRef: ElementRef) {
|
|
51
|
+
dialogRef.disableClose = true;
|
|
52
|
+
}
|
|
53
|
+
@HostListener('window:keyup.esc') onKeyUp() {
|
|
54
|
+
this.dialogRef.close();
|
|
55
|
+
}
|
|
56
|
+
ngOnInit(): void {
|
|
57
|
+
this.pageInfo = this.data.pageInfo;
|
|
58
|
+
this.pageInfo.hideTitle = true;
|
|
59
|
+
this.item = this.data.item;
|
|
60
|
+
this.pageInfo.hideExtractButton = false;
|
|
61
|
+
this.columns = this.data.columns;
|
|
62
|
+
this.reportRequest = this.data.request;
|
|
63
|
+
this.warningMsg = this.data.warningMsg || false;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
ngAfterViewInit(): void {
|
|
67
|
+
const container = this.elRef.nativeElement.closest('mat-dialog-container');
|
|
68
|
+
if (container && container.getAttribute('dir')) {
|
|
69
|
+
this.dialogDirection = container.getAttribute('dir') as 'ltr' | 'rtl';
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
cancel() {
|
|
74
|
+
this.reportRequest.filterRequest.filters = [];
|
|
75
|
+
this.backendService.isEmptyItems = false;
|
|
76
|
+
this.dialogRef.close();
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
@HostListener('document:click', ['$event'])
|
|
80
|
+
onBackdropClick(event: MouseEvent): void {
|
|
81
|
+
const target = event.target as HTMLElement;
|
|
82
|
+
if (target.classList.contains('cdk-overlay-backdrop')) {
|
|
83
|
+
this.reportRequest.filterRequest.filters = [];
|
|
84
|
+
this.backendService.isEmptyItems = false;
|
|
85
|
+
this.dialogRef.close();
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
getTitle() {
|
|
90
|
+
if (this.item?.isec_value_ar) {
|
|
91
|
+
const isecLabel = this.translateService.instant('ISEC');
|
|
92
|
+
return `<strong>${isecLabel} ${this.item.isec_value_ar}</strong>`;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
const sectorLabel = this.translateService.instant('SECTOR');
|
|
96
|
+
const periodLabel = this.translateService.instant('FOR_PERIOD');
|
|
97
|
+
const directorateLabel = this.translateService.instant('DIRECTORATE');
|
|
98
|
+
|
|
99
|
+
const sectorText = this.item.sector ? `${sectorLabel} ${this.item.sector}` : '';
|
|
100
|
+
const periodText = this.item.period ? ` ${periodLabel} ${this.item.period}` : '';
|
|
101
|
+
const yearText = this.item.year ? ` - ${this.item.year}` : '';
|
|
102
|
+
const directorateLine = this.item.directorate ? `<br><strong>${directorateLabel} - ${this.item.directorate}</strong>` : '';
|
|
103
|
+
|
|
104
|
+
const mainLine = (sectorText || periodText || yearText)
|
|
105
|
+
? `<strong>${[sectorText, periodText, yearText].filter(Boolean).join('')}</strong>`
|
|
106
|
+
: '';
|
|
107
|
+
|
|
108
|
+
return `${mainLine}${directorateLine}`;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
<div fxLayout="column" fxFlex="2" fxHide.lt-sm [ngStyle]="{'height':isMatchHeight() ? '30vh' : '88vh' }">
|
|
2
|
+
|
|
3
|
+
</div>
|
|
4
|
+
|
|
5
|
+
<div fxLayout="column" fxFlex="98">
|
|
6
|
+
|
|
7
|
+
<div fxLayout="row" fxLayoutAlign="start center" style="margin-bottom: 10px;">
|
|
8
|
+
<app-title-bar [pageTitle]="getTitle()" [newAction]="false"></app-title-bar>
|
|
9
|
+
|
|
10
|
+
<mat-icon
|
|
11
|
+
*ngIf="pageInfo?.hasHint"
|
|
12
|
+
[matTooltip]="pageInfo.labelsSection + '.hint' | translate"
|
|
13
|
+
matTooltipPosition="right"
|
|
14
|
+
color="primary"
|
|
15
|
+
style="cursor: pointer; margin-left: 10px;"
|
|
16
|
+
matTooltipClass="custom-tooltip">
|
|
17
|
+
help_outline
|
|
18
|
+
</mat-icon>
|
|
19
|
+
</div>
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
<app-base-form-canvas
|
|
23
|
+
[pageInfo]="pageInfo"
|
|
24
|
+
[fields]="fields"
|
|
25
|
+
[editable]="isEditable"
|
|
26
|
+
[errors]="errors"
|
|
27
|
+
[item]="this.reportForm?.value || {}"
|
|
28
|
+
(formUpdated)="updateForm($event)"
|
|
29
|
+
></app-base-form-canvas>
|
|
30
|
+
<br>
|
|
31
|
+
<br>
|
|
32
|
+
<div fxLayout="column">
|
|
33
|
+
<div fxLayout="row" fxLayout.lt-sm="column" fxLayoutAlign="start center" fxLayoutAlign.lt-lg="start strat" fxLayoutGap="10">
|
|
34
|
+
<button *ngIf="activeLevel === 1" color="primary" mat-flat-button (click)="doAction(x)" [disabled]="!isValidForm()">
|
|
35
|
+
{{ 'REPORTS.generate' | translate }}
|
|
36
|
+
</button>
|
|
37
|
+
|
|
38
|
+
<button mat-raised-button [matMenuTriggerFor]="menu" [disabled]="getIsEmptyList()" color="primary">
|
|
39
|
+
{{ 'extract' | translate }}
|
|
40
|
+
<mat-icon class="expand_more actionButton__expand">expand_more</mat-icon>
|
|
41
|
+
</button>
|
|
42
|
+
|
|
43
|
+
<button
|
|
44
|
+
mat-flat-button
|
|
45
|
+
(click)="clear()"
|
|
46
|
+
[disabled]="isFormEmpty() || activeLevel > 1">
|
|
47
|
+
{{ 'REPORTS.clear' | translate }}
|
|
48
|
+
</button>
|
|
49
|
+
|
|
50
|
+
<button *ngIf="activeLevel === 1 && drillDownEnabled()" color="warn" mat-flat-button (click)="drillDown()">
|
|
51
|
+
{{ drillDownLabel() | translate }}
|
|
52
|
+
</button>
|
|
53
|
+
|
|
54
|
+
<button *ngIf="activeLevel > 1 && backButtonEnabled" color="warn" mat-flat-button (click)="goUp()">
|
|
55
|
+
{{ 'REPORTS.up' | translate }}
|
|
56
|
+
</button>
|
|
57
|
+
</div>
|
|
58
|
+
</div>
|
|
59
|
+
|
|
60
|
+
<div *ngIf="activeLevel === 1" fxLayout="row" fxLayoutGap="10px" fxLayoutAlign="start start" fxLayoutAlign.lt-sm="center start"
|
|
61
|
+
class="main-form-canvas"
|
|
62
|
+
style="margin-top: 3vh; width: 100%">
|
|
63
|
+
<div fxLayout="column" fxFlex="100">
|
|
64
|
+
<app-base-table [pageInfo]="pageInfo" [columns]="columnsDefinition" [enforceRefresh]="reloadData" id="parent"
|
|
65
|
+
[reportRequest]="reportRequest" (userAction)="emitUserAction($event)" (hyperLinkAction)="emitHyperLinkAction($event)"></app-base-table>
|
|
66
|
+
</div>
|
|
67
|
+
</div>
|
|
68
|
+
<div *ngIf="activeLevel === 2" fxLayout="row" fxLayoutGap="10px" fxLayoutAlign="start start" fxLayoutAlign.lt-sm="center start"
|
|
69
|
+
class="main-form-canvas"
|
|
70
|
+
style="margin-top: 3vh; width: 100%">
|
|
71
|
+
<div fxLayout="column" fxFlex="100">
|
|
72
|
+
<app-base-table [pageInfo]="drillDownPageInfo" [columns]="drillDownColumns " id="child"
|
|
73
|
+
[reportRequest]="childReportRequest"
|
|
74
|
+
(userAction)="emitJuniorAction($event)" (hyperLinkAction)="emitHyperLinkAction($event)"></app-base-table>
|
|
75
|
+
</div>
|
|
76
|
+
</div>
|
|
77
|
+
<div *ngIf="activeLevel === 3" fxLayout="row" fxLayoutGap="10px" fxLayoutAlign="start start" fxLayoutAlign.lt-sm="center start"
|
|
78
|
+
class="main-form-canvas"
|
|
79
|
+
style="margin-top: 3vh; width: 100%">
|
|
80
|
+
<div fxLayout="column" fxFlex="100">
|
|
81
|
+
<app-base-table [pageInfo]="juniorPageInfo" [columns]="juniorColumns" id="junior"
|
|
82
|
+
[reportRequest]="juniorReportRequest"></app-base-table>
|
|
83
|
+
</div>
|
|
84
|
+
</div>
|
|
85
|
+
|
|
86
|
+
</div>
|
|
87
|
+
<mat-menu #menu="matMenu">
|
|
88
|
+
<button type="button"
|
|
89
|
+
mat-menu-item
|
|
90
|
+
*ngFor="let type of types"
|
|
91
|
+
(click)="extractReport(type)">
|
|
92
|
+
{{ type }}
|
|
93
|
+
</button>
|
|
94
|
+
</mat-menu>
|
|
File without changes
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import {ComponentFixture, TestBed} from '@angular/core/testing';
|
|
2
|
+
|
|
3
|
+
import {ReportFormComponent} from './report-form.component';
|
|
4
|
+
|
|
5
|
+
describe('BaseFormComponent', () => {
|
|
6
|
+
let component: ReportFormComponent;
|
|
7
|
+
let fixture: ComponentFixture<ReportFormComponent>;
|
|
8
|
+
|
|
9
|
+
beforeEach(async () => {
|
|
10
|
+
await TestBed.configureTestingModule({
|
|
11
|
+
declarations: [ ReportFormComponent ]
|
|
12
|
+
})
|
|
13
|
+
.compileComponents();
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
beforeEach(() => {
|
|
17
|
+
fixture = TestBed.createComponent(ReportFormComponent);
|
|
18
|
+
component = fixture.componentInstance;
|
|
19
|
+
fixture.detectChanges();
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
it('should create', () => {
|
|
23
|
+
expect(component).toBeTruthy();
|
|
24
|
+
});
|
|
25
|
+
});
|